content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
class Template: def __init__(self, bot, channel): self.bot = bot self.channel = channel channel.set_command("!command", self.on_command, "!command description") def on_command(self, message): pass # runs when a personal message is received # message is a dictionary containing the username, channel and message # channel parameter in message dictionary is the bot username def on_personal_message(self, message): pass # runs when a message is received in the channel # message is a dictionary containing the username, channel and message def on_message(self, message): pass # runs when a user joins the channel # slot is an integer of the slot number joined # username is a string of the user's username who joined def on_join(self, username, slot): pass # runs when a user leaves the channel # slot is an integer of the slot number joined # username is a string of the user's username who joined def on_part(self, username, slot): pass # runs when the match is started def on_match_start(self): pass # runs when the match finishes normally def on_match_finish(self): pass # runs when a match is aborted with either a command or the method channel.abort_match() def on_match_abort(self): pass # runs when the host is changed # old_host is the username of the user who had host before the change # new_host is the username of the user who has just received host def on_host_change(self, old_host, new_host): pass # runs when a user changes team # username is the username of the user who changed team # team is the colour of the team joined def on_team_change(self, username, team): pass # runs when a user is added to a team # username is the username of the user who changed team # team is the colour of the team joined def on_team_addition(self, username, team): pass # runs when a user changes slot # slot is an integer of the slot number joined # username is a string of the user's username who joined def on_slot_change(self, username, slot): pass # runs when all players in the room have readied up def on_all_players_ready(self): pass # runs when the beatmap is changed # old beatmap is the previous beatmap before the change # new_beatmap is the beatmap which hasw just been changed to def on_beatmap_change(self, old_beatmap, new_beatmap): pass # runs when host enters map select def on_changing_beatmap(self): pass # runs when a game room is closed def on_room_close(self): pass # runs when the host is cleared # old_host is the host prior to clearing the room def on_clear_host(self, old_host): pass # runs when an enforced attribute is violated # error contains: # type - the type of on_rule_violation # message - a message to explain what is going on def on_rule_violation(self, error): pass
class Template: def __init__(self, bot, channel): self.bot = bot self.channel = channel channel.set_command('!command', self.on_command, '!command description') def on_command(self, message): pass def on_personal_message(self, message): pass def on_message(self, message): pass def on_join(self, username, slot): pass def on_part(self, username, slot): pass def on_match_start(self): pass def on_match_finish(self): pass def on_match_abort(self): pass def on_host_change(self, old_host, new_host): pass def on_team_change(self, username, team): pass def on_team_addition(self, username, team): pass def on_slot_change(self, username, slot): pass def on_all_players_ready(self): pass def on_beatmap_change(self, old_beatmap, new_beatmap): pass def on_changing_beatmap(self): pass def on_room_close(self): pass def on_clear_host(self, old_host): pass def on_rule_violation(self, error): pass
def setup(app): """Additions and customizations to Sphinx that are useful for documenting the Salt project. """ app.add_crossref_type(directivename="conf_master", rolename="conf_master", indextemplate="pair: %s; conf/master") app.add_crossref_type(directivename="conf_minion", rolename="conf_minion", indextemplate="pair: %s; conf/minion") app.add_crossref_type(directivename="conf-log", rolename="conf-log", indextemplate="pair: %s; conf/logging")
def setup(app): """Additions and customizations to Sphinx that are useful for documenting the Salt project. """ app.add_crossref_type(directivename='conf_master', rolename='conf_master', indextemplate='pair: %s; conf/master') app.add_crossref_type(directivename='conf_minion', rolename='conf_minion', indextemplate='pair: %s; conf/minion') app.add_crossref_type(directivename='conf-log', rolename='conf-log', indextemplate='pair: %s; conf/logging')
# -*- coding: utf-8 -*- DEBUG = True TESTING = True SECRET_KEY = 'SECRET_KEY' DATABASE_URI = 'mysql+pymysql://root:root@127.0.0.1/git_webhook' CELERY_BROKER_URL = 'redis://:@127.0.0.1:6379/0' CELERY_RESULT_BACKEND = 'redis://:@127.0.0.1:6379/0' SOCKET_MESSAGE_QUEUE = 'redis://:@127.0.0.1:6379/0' GITHUB_CLIENT_ID = '123' GITHUB_CLIENT_SECRET = 'SECRET'
debug = True testing = True secret_key = 'SECRET_KEY' database_uri = 'mysql+pymysql://root:root@127.0.0.1/git_webhook' celery_broker_url = 'redis://:@127.0.0.1:6379/0' celery_result_backend = 'redis://:@127.0.0.1:6379/0' socket_message_queue = 'redis://:@127.0.0.1:6379/0' github_client_id = '123' github_client_secret = 'SECRET'
__title__ = 'django-activeurl' __package_name__ = 'django_activeurl' __version__ = '0.1.12' __description__ = 'Easy-to-use active URL highlighting for Django' __email__ = 'hellysmile@gmail.com' __author__ = 'hellysmile' __license__ = 'Apache 2.0' __copyright__ = 'Copyright (c) hellysmile@gmail.com'
__title__ = 'django-activeurl' __package_name__ = 'django_activeurl' __version__ = '0.1.12' __description__ = 'Easy-to-use active URL highlighting for Django' __email__ = 'hellysmile@gmail.com' __author__ = 'hellysmile' __license__ = 'Apache 2.0' __copyright__ = 'Copyright (c) hellysmile@gmail.com'
# Copyright 2018 The Bazel Authors. All rights reserved. # # 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. """Implementation of compilation logic for Swift.""" load(":actions.bzl", "run_toolchain_action") load(":deps.bzl", "collect_link_libraries") load(":derived_files.bzl", "derived_files") load( ":providers.bzl", "SwiftClangModuleInfo", "SwiftInfo", "SwiftToolchainInfo", ) load(":utils.bzl", "collect_transitive") load("@bazel_skylib//lib:collections.bzl", "collections") load("@bazel_skylib//lib:paths.bzl", "paths") # Swift compiler options that cause the code to be compiled using whole-module optimization. _WMO_COPTS = ("-force-single-frontend-invocation", "-whole-module-optimization", "-wmo") def collect_transitive_compile_inputs(args, deps, direct_defines = []): """Collect transitive inputs and flags from Swift providers. Args: args: An `Args` object to which deps: The dependencies for which the inputs should be gathered. direct_defines: The list of defines for the target being built, which are merged with the transitive defines before they are added to `args` in order to prevent duplication. Returns: A list of `depset`s representing files that must be passed as inputs to the Swift compilation action. """ input_depsets = [] # Collect all the search paths, module maps, flags, and so forth from transitive dependencies. transitive_swiftmodules = collect_transitive( deps, SwiftInfo, "transitive_swiftmodules", ) args.add_all(transitive_swiftmodules, format_each = "-I%s", map_each = _dirname_map_fn) input_depsets.append(transitive_swiftmodules) transitive_defines = collect_transitive( deps, SwiftInfo, "transitive_defines", direct = direct_defines, ) args.add_all(transitive_defines, format_each = "-D%s") transitive_modulemaps = collect_transitive( deps, SwiftClangModuleInfo, "transitive_modulemaps", ) input_depsets.append(transitive_modulemaps) args.add_all( transitive_modulemaps, before_each = "-Xcc", format_each = "-fmodule-map-file=%s", ) transitive_cc_headers = collect_transitive( deps, SwiftClangModuleInfo, "transitive_headers", ) input_depsets.append(transitive_cc_headers) transitive_cc_compile_flags = collect_transitive( deps, SwiftClangModuleInfo, "transitive_compile_flags", ) # Handle possible spaces in these arguments correctly (for example, # `-isystem foo`) by prepending `-Xcc` to each one. for arg in transitive_cc_compile_flags.to_list(): args.add_all(arg.split(" "), before_each = "-Xcc") transitive_cc_defines = collect_transitive( deps, SwiftClangModuleInfo, "transitive_defines", ) args.add_all(transitive_cc_defines, before_each = "-Xcc", format_each = "-D%s") return input_depsets def declare_compile_outputs( actions, copts, srcs, target_name, index_while_building = False): """Declares output files (and optional output file map) for a compile action. Args: actions: The object used to register actions. copts: The flags that will be passed to the compile action, which are scanned to determine whether a single frontend invocation will be used or not. srcs: The list of source files that will be compiled. target_name: The name (excluding package path) of the target being built. index_while_building: If `True`, a tree artifact will be declared to hold Clang index store data and the relevant option will be added during compilation to generate the indexes. Returns: A `struct` containing the following fields: * `args`: A list of values that should be added to the `Args` of the compile action. * `compile_inputs`: Additional input files that should be passed to the compile action. * `other_outputs`: Additional output files that should be declared by the compile action, but which are not processed further. * `output_groups`: A dictionary of additional output groups that should be propagated by the calling rule using the `OutputGroupInfo` provider. * `output_objects`: A list of object (.o) files that will be the result of the compile action and which should be archived afterward. """ output_nature = _emitted_output_nature(copts) if not output_nature.emits_multiple_objects: # If we're emitting a single object, we don't use an object map; we just declare the output # file that the compiler will generate and there are no other partial outputs. out_obj = derived_files.whole_module_object_file(actions, target_name = target_name) return struct( args = ["-o", out_obj], compile_inputs = [], other_outputs = [], output_groups = {}, output_objects = [out_obj], ) # Otherwise, we need to create an output map that lists the individual object files so that we # can pass them all to the archive action. output_map_file = derived_files.swiftc_output_file_map(actions, target_name = target_name) # The output map data, which is keyed by source path and will be written to `output_map_file`. output_map = {} # Object files that will be used to build the archive. output_objs = [] # Additional files, such as partial Swift modules, that must be declared as action outputs # although they are not processed further. other_outputs = [] for src in srcs: src_output_map = {} # Declare the object file (there is one per source file). obj = derived_files.intermediate_object_file(actions, target_name = target_name, src = src) output_objs.append(obj) src_output_map["object"] = obj.path # Multi-threaded WMO compiles still produce a single .swiftmodule file, despite producing # multiple object files, so we have to check explicitly for that case. if output_nature.emits_partial_modules: partial_module = derived_files.partial_swiftmodule( actions, target_name = target_name, src = src, ) other_outputs.append(partial_module) src_output_map["swiftmodule"] = partial_module.path output_map[src.path] = struct(**src_output_map) actions.write( content = struct(**output_map).to_json(), output = output_map_file, ) args = ["-output-file-map", output_map_file] output_groups = {} # Configure index-while-building if requested. IDEs and other indexing tools can enable this # feature on the command line during a build and then access the index store artifacts that are # produced. if index_while_building: index_store_dir = derived_files.indexstore_directory(actions, target_name = target_name) other_outputs.append(index_store_dir) args.extend(["-index-store-path", index_store_dir.path]) output_groups["swift_index_store"] = depset(direct = [index_store_dir]) return struct( args = args, compile_inputs = [output_map_file], other_outputs = other_outputs, output_groups = output_groups, output_objects = output_objs, ) def find_swift_version_copt_value(copts): """Returns the value of the `-swift-version` argument, if found. Args: copts: The list of copts to be scanned. Returns: The value of the `-swift-version` argument, or None if it was not found in the copt list. """ # Note that the argument can occur multiple times, and the last one wins. last_swift_version = None count = len(copts) for i in range(count): copt = copts[i] if copt == "-swift-version" and i + 1 < count: last_swift_version = copts[i + 1] return last_swift_version def new_objc_provider( deps, include_path, link_inputs, linkopts, module_map, static_archive, swiftmodule, objc_header = None): """Creates an `apple_common.Objc` provider for a Swift target. Args: deps: The dependencies of the target being built, whose `Objc` providers will be passed to the new one in order to propagate the correct transitive fields. include_path: A header search path that should be propagated to dependents. link_inputs: Additional linker input files that should be propagated to dependents. linkopts: Linker options that should be propagated to dependents. module_map: The module map generated for the Swift target's Objective-C header, if any. static_archive: The static archive (`.a` file) containing the target's compiled code. swiftmodule: The `.swiftmodule` file for the compiled target. objc_header: The generated Objective-C header for the Swift target. If `None`, no headers will be propagated. This header is only needed for Swift code that defines classes that should be exposed to Objective-C. Returns: An `apple_common.Objc` provider that should be returned by the calling rule. """ objc_providers = [dep[apple_common.Objc] for dep in deps if apple_common.Objc in dep] objc_provider_args = { "include": depset(direct = [include_path]), "library": depset(direct = [static_archive]), "link_inputs": depset(direct = [swiftmodule] + link_inputs), "providers": objc_providers, "uses_swift": True, } if objc_header: objc_provider_args["header"] = depset(direct = [objc_header]) if linkopts: objc_provider_args["linkopt"] = depset(direct = linkopts) # In addition to the generated header's module map, we must re-propagate the direct deps' # Objective-C module maps to dependents, because those Swift modules still need to see them. We # need to construct a new transitive objc provider to get the correct strict propagation # behavior. transitive_objc_provider_args = {"providers": objc_providers} if module_map: transitive_objc_provider_args["module_map"] = depset(direct = [module_map]) transitive_objc = apple_common.new_objc_provider(**transitive_objc_provider_args) objc_provider_args["module_map"] = transitive_objc.module_map return apple_common.new_objc_provider(**objc_provider_args) def objc_compile_requirements(args, deps, objc_fragment): """Collects compilation requirements for Objective-C dependencies. Args: args: An `Args` object to which compile options will be added. deps: The `deps` of the target being built. objc_fragment: The `objc` configuration fragment. Returns: A `depset` of files that should be included among the inputs of the compile action. """ defines = [] includes = [] inputs = [] module_maps = [] static_frameworks = [] all_frameworks = [] objc_providers = [dep[apple_common.Objc] for dep in deps if apple_common.Objc in dep] for objc in objc_providers: inputs.append(objc.header) inputs.append(objc.umbrella_header) inputs.append(objc.static_framework_file) inputs.append(objc.dynamic_framework_file) defines.append(objc.define) includes.append(objc.include) static_frameworks.append(objc.framework_dir) all_frameworks.append(objc.framework_dir) all_frameworks.append(objc.dynamic_framework_dir) # Collect module maps for dependencies. These must be pulled from a combined transitive # provider to get the correct strict propagation behavior that we use to workaround command-line # length issues until Swift 4.2 is available. transitive_objc_provider = apple_common.new_objc_provider(providers = objc_providers) module_maps = transitive_objc_provider.module_map inputs.append(module_maps) # Add the objc dependencies' header search paths so that imported modules can find their # headers. args.add_all(depset(transitive = includes), format_each = "-I%s") # Add framework search paths for any Objective-C frameworks propagated through static/dynamic # framework provider keys. args.add_all( depset(transitive = all_frameworks), format_each = "-F%s", map_each = paths.dirname, ) # Disable the `LC_LINKER_OPTION` load commands for static framework automatic linking. This is # needed to correctly deduplicate static frameworks from also being linked into test binaries # where it is also linked into the app binary. TODO(allevato): Update this to not expand the # depset once `Args.add` supports returning multiple elements from a `map_fn`. for framework in depset(transitive = static_frameworks).to_list(): args.add_all(collections.before_each( "-Xfrontend", [ "-disable-autolink-framework", _objc_provider_framework_name(framework), ], )) # Swift's ClangImporter does not include the current directory by default in its search paths, # so we must add it to find workspace-relative imports in headers imported by module maps. args.add_all(["-Xcc", "-iquote."]) # Ensure that headers imported by Swift modules have the correct defines propagated from # dependencies. args.add_all(depset(transitive = defines), before_each = "-Xcc", format_each = "-D%s") # Load module maps explicitly instead of letting Clang discover them in the search paths. This # is needed to avoid a case where Clang may load the same header in modular and non-modular # contexts, leading to duplicate definitions in the same file. # <https://llvm.org/bugs/show_bug.cgi?id=19501> args.add_all(module_maps, before_each = "-Xcc", format_each = "-fmodule-map-file=%s") # Add any copts required by the `objc` configuration fragment. args.add_all(_clang_copts(objc_fragment), before_each = "-Xcc") return depset(transitive = inputs) def register_autolink_extract_action( actions, objects, output, toolchain): """Extracts autolink information from Swift `.o` files. For some platforms (such as Linux), autolinking of imported frameworks is achieved by extracting the information about which libraries are needed from the `.o` files and producing a text file with the necessary linker flags. That file can then be passed to the linker as a response file (i.e., `@flags.txt`). Args: actions: The object used to register actions. objects: The list of object files whose autolink information will be extracted. output: A `File` into which the autolink information will be written. toolchain: The `SwiftToolchainInfo` provider of the toolchain. """ tool_args = actions.args() tool_args.add_all(objects) tool_args.add("-o", output) run_toolchain_action( actions = actions, toolchain = toolchain, arguments = [tool_args], executable = "swift-autolink-extract", inputs = objects, mnemonic = "SwiftAutolinkExtract", outputs = [output], ) def swift_library_output_map(name, module_link_name): """Returns the dictionary of implicit outputs for a `swift_library`. This function is used to specify the `outputs` of the `swift_library` rule; as such, its arguments must be named exactly the same as the attributes to which they refer. Args: name: The name of the target being built. module_link_name: The module link name of the target being built. Returns: The implicit outputs dictionary for a `swift_library`. """ lib_name = module_link_name if module_link_name else name return { "archive": "lib{}.a".format(lib_name), } def write_objc_header_module_map( actions, module_name, objc_header, output): """Writes a module map for a generated Swift header to a file. Args: actions: The context's actions object. module_name: The name of the Swift module. objc_header: The `File` representing the generated header. output: The `File` to which the module map should be written. """ actions.write( content = ('module "{module_name}" {{\n' + ' header "../{header_name}"\n' + "}}\n").format( header_name = objc_header.basename, module_name = module_name, ), output = output, ) def _clang_copts(objc_fragment): """Returns copts that should be passed to `clang` from the `objc` fragment. Args: objc_fragment: The `objc` configuration fragment. Returns: A list of `clang` copts. """ # In general, every compilation mode flag from native `objc_*` rules should be passed, but `-g` # seems to break Clang module compilation. Since this flag does not make much sense for module # compilation and only touches headers, it's ok to omit. clang_copts = objc_fragment.copts + objc_fragment.copts_for_current_compilation_mode return [copt for copt in clang_copts if copt != "-g"] def _dirname_map_fn(f): """Returns the dir name of a file. This function is intended to be used as a mapping function for file passed into `Args.add`. Args: f: The file. Returns: The dirname of the file. """ return f.dirname def _emitted_output_nature(copts): """Returns a `struct` with information about the nature of emitted outputs for the given flags. The compiler emits a single object if it is invoked with whole-module optimization enabled and is single-threaded (`-num-threads` is not present or is equal to 1); otherwise, it emits one object file per source file. It also emits a single `.swiftmodule` file for WMO builds, _regardless of thread count,_ so we have to treat that case separately. Args: copts: The options passed into the compile action. Returns: A struct containing the following fields: * `emits_multiple_objects`: `True` if the Swift frontend emits an object file per source file, instead of a single object file for the whole module, in a compilation action with the given flags. * `emits_partial_modules`: `True` if the Swift frontend emits partial `.swiftmodule` files for the individual source files in a compilation action with the given flags. """ is_wmo = False saw_space_separated_num_threads = False num_threads = 1 for copt in copts: if copt in _WMO_COPTS: is_wmo = True elif saw_space_separated_num_threads: saw_space_separated_num_threads = False num_threads = _safe_int(copt) elif copt == "-num-threads": saw_space_separated_num_threads = True elif copt.startswith("-num-threads="): num_threads = _safe_int(copt.split("=")[1]) if not num_threads: fail("The value of '-num-threads' must be a positive integer.") return struct( emits_multiple_objects = not (is_wmo and num_threads == 1), emits_partial_modules = not is_wmo, ) def _safe_int(s): """Returns the integer value of `s` when interpreted as base 10, or `None` if it is invalid. This function is needed because `int()` fails the build when passed a string that isn't a valid integer, with no way to recover (https://github.com/bazelbuild/bazel/issues/5940). Args: s: The string to be converted to an integer. Returns: The integer value of `s`, or `None` if was not a valid base 10 integer. """ for i in range(len(s)): if s[i] < "0" or s[i] > "9": return None return int(s) def _objc_provider_framework_name(path): """Returns the name of the framework from an `objc` provider path. Args: path: A path that came from an `objc` provider. Returns: A string containing the name of the framework (e.g., `Foo` for `Foo.framework`). """ return path.rpartition("/")[2].partition(".")[0]
"""Implementation of compilation logic for Swift.""" load(':actions.bzl', 'run_toolchain_action') load(':deps.bzl', 'collect_link_libraries') load(':derived_files.bzl', 'derived_files') load(':providers.bzl', 'SwiftClangModuleInfo', 'SwiftInfo', 'SwiftToolchainInfo') load(':utils.bzl', 'collect_transitive') load('@bazel_skylib//lib:collections.bzl', 'collections') load('@bazel_skylib//lib:paths.bzl', 'paths') _wmo_copts = ('-force-single-frontend-invocation', '-whole-module-optimization', '-wmo') def collect_transitive_compile_inputs(args, deps, direct_defines=[]): """Collect transitive inputs and flags from Swift providers. Args: args: An `Args` object to which deps: The dependencies for which the inputs should be gathered. direct_defines: The list of defines for the target being built, which are merged with the transitive defines before they are added to `args` in order to prevent duplication. Returns: A list of `depset`s representing files that must be passed as inputs to the Swift compilation action. """ input_depsets = [] transitive_swiftmodules = collect_transitive(deps, SwiftInfo, 'transitive_swiftmodules') args.add_all(transitive_swiftmodules, format_each='-I%s', map_each=_dirname_map_fn) input_depsets.append(transitive_swiftmodules) transitive_defines = collect_transitive(deps, SwiftInfo, 'transitive_defines', direct=direct_defines) args.add_all(transitive_defines, format_each='-D%s') transitive_modulemaps = collect_transitive(deps, SwiftClangModuleInfo, 'transitive_modulemaps') input_depsets.append(transitive_modulemaps) args.add_all(transitive_modulemaps, before_each='-Xcc', format_each='-fmodule-map-file=%s') transitive_cc_headers = collect_transitive(deps, SwiftClangModuleInfo, 'transitive_headers') input_depsets.append(transitive_cc_headers) transitive_cc_compile_flags = collect_transitive(deps, SwiftClangModuleInfo, 'transitive_compile_flags') for arg in transitive_cc_compile_flags.to_list(): args.add_all(arg.split(' '), before_each='-Xcc') transitive_cc_defines = collect_transitive(deps, SwiftClangModuleInfo, 'transitive_defines') args.add_all(transitive_cc_defines, before_each='-Xcc', format_each='-D%s') return input_depsets def declare_compile_outputs(actions, copts, srcs, target_name, index_while_building=False): """Declares output files (and optional output file map) for a compile action. Args: actions: The object used to register actions. copts: The flags that will be passed to the compile action, which are scanned to determine whether a single frontend invocation will be used or not. srcs: The list of source files that will be compiled. target_name: The name (excluding package path) of the target being built. index_while_building: If `True`, a tree artifact will be declared to hold Clang index store data and the relevant option will be added during compilation to generate the indexes. Returns: A `struct` containing the following fields: * `args`: A list of values that should be added to the `Args` of the compile action. * `compile_inputs`: Additional input files that should be passed to the compile action. * `other_outputs`: Additional output files that should be declared by the compile action, but which are not processed further. * `output_groups`: A dictionary of additional output groups that should be propagated by the calling rule using the `OutputGroupInfo` provider. * `output_objects`: A list of object (.o) files that will be the result of the compile action and which should be archived afterward. """ output_nature = _emitted_output_nature(copts) if not output_nature.emits_multiple_objects: out_obj = derived_files.whole_module_object_file(actions, target_name=target_name) return struct(args=['-o', out_obj], compile_inputs=[], other_outputs=[], output_groups={}, output_objects=[out_obj]) output_map_file = derived_files.swiftc_output_file_map(actions, target_name=target_name) output_map = {} output_objs = [] other_outputs = [] for src in srcs: src_output_map = {} obj = derived_files.intermediate_object_file(actions, target_name=target_name, src=src) output_objs.append(obj) src_output_map['object'] = obj.path if output_nature.emits_partial_modules: partial_module = derived_files.partial_swiftmodule(actions, target_name=target_name, src=src) other_outputs.append(partial_module) src_output_map['swiftmodule'] = partial_module.path output_map[src.path] = struct(**src_output_map) actions.write(content=struct(**output_map).to_json(), output=output_map_file) args = ['-output-file-map', output_map_file] output_groups = {} if index_while_building: index_store_dir = derived_files.indexstore_directory(actions, target_name=target_name) other_outputs.append(index_store_dir) args.extend(['-index-store-path', index_store_dir.path]) output_groups['swift_index_store'] = depset(direct=[index_store_dir]) return struct(args=args, compile_inputs=[output_map_file], other_outputs=other_outputs, output_groups=output_groups, output_objects=output_objs) def find_swift_version_copt_value(copts): """Returns the value of the `-swift-version` argument, if found. Args: copts: The list of copts to be scanned. Returns: The value of the `-swift-version` argument, or None if it was not found in the copt list. """ last_swift_version = None count = len(copts) for i in range(count): copt = copts[i] if copt == '-swift-version' and i + 1 < count: last_swift_version = copts[i + 1] return last_swift_version def new_objc_provider(deps, include_path, link_inputs, linkopts, module_map, static_archive, swiftmodule, objc_header=None): """Creates an `apple_common.Objc` provider for a Swift target. Args: deps: The dependencies of the target being built, whose `Objc` providers will be passed to the new one in order to propagate the correct transitive fields. include_path: A header search path that should be propagated to dependents. link_inputs: Additional linker input files that should be propagated to dependents. linkopts: Linker options that should be propagated to dependents. module_map: The module map generated for the Swift target's Objective-C header, if any. static_archive: The static archive (`.a` file) containing the target's compiled code. swiftmodule: The `.swiftmodule` file for the compiled target. objc_header: The generated Objective-C header for the Swift target. If `None`, no headers will be propagated. This header is only needed for Swift code that defines classes that should be exposed to Objective-C. Returns: An `apple_common.Objc` provider that should be returned by the calling rule. """ objc_providers = [dep[apple_common.Objc] for dep in deps if apple_common.Objc in dep] objc_provider_args = {'include': depset(direct=[include_path]), 'library': depset(direct=[static_archive]), 'link_inputs': depset(direct=[swiftmodule] + link_inputs), 'providers': objc_providers, 'uses_swift': True} if objc_header: objc_provider_args['header'] = depset(direct=[objc_header]) if linkopts: objc_provider_args['linkopt'] = depset(direct=linkopts) transitive_objc_provider_args = {'providers': objc_providers} if module_map: transitive_objc_provider_args['module_map'] = depset(direct=[module_map]) transitive_objc = apple_common.new_objc_provider(**transitive_objc_provider_args) objc_provider_args['module_map'] = transitive_objc.module_map return apple_common.new_objc_provider(**objc_provider_args) def objc_compile_requirements(args, deps, objc_fragment): """Collects compilation requirements for Objective-C dependencies. Args: args: An `Args` object to which compile options will be added. deps: The `deps` of the target being built. objc_fragment: The `objc` configuration fragment. Returns: A `depset` of files that should be included among the inputs of the compile action. """ defines = [] includes = [] inputs = [] module_maps = [] static_frameworks = [] all_frameworks = [] objc_providers = [dep[apple_common.Objc] for dep in deps if apple_common.Objc in dep] for objc in objc_providers: inputs.append(objc.header) inputs.append(objc.umbrella_header) inputs.append(objc.static_framework_file) inputs.append(objc.dynamic_framework_file) defines.append(objc.define) includes.append(objc.include) static_frameworks.append(objc.framework_dir) all_frameworks.append(objc.framework_dir) all_frameworks.append(objc.dynamic_framework_dir) transitive_objc_provider = apple_common.new_objc_provider(providers=objc_providers) module_maps = transitive_objc_provider.module_map inputs.append(module_maps) args.add_all(depset(transitive=includes), format_each='-I%s') args.add_all(depset(transitive=all_frameworks), format_each='-F%s', map_each=paths.dirname) for framework in depset(transitive=static_frameworks).to_list(): args.add_all(collections.before_each('-Xfrontend', ['-disable-autolink-framework', _objc_provider_framework_name(framework)])) args.add_all(['-Xcc', '-iquote.']) args.add_all(depset(transitive=defines), before_each='-Xcc', format_each='-D%s') args.add_all(module_maps, before_each='-Xcc', format_each='-fmodule-map-file=%s') args.add_all(_clang_copts(objc_fragment), before_each='-Xcc') return depset(transitive=inputs) def register_autolink_extract_action(actions, objects, output, toolchain): """Extracts autolink information from Swift `.o` files. For some platforms (such as Linux), autolinking of imported frameworks is achieved by extracting the information about which libraries are needed from the `.o` files and producing a text file with the necessary linker flags. That file can then be passed to the linker as a response file (i.e., `@flags.txt`). Args: actions: The object used to register actions. objects: The list of object files whose autolink information will be extracted. output: A `File` into which the autolink information will be written. toolchain: The `SwiftToolchainInfo` provider of the toolchain. """ tool_args = actions.args() tool_args.add_all(objects) tool_args.add('-o', output) run_toolchain_action(actions=actions, toolchain=toolchain, arguments=[tool_args], executable='swift-autolink-extract', inputs=objects, mnemonic='SwiftAutolinkExtract', outputs=[output]) def swift_library_output_map(name, module_link_name): """Returns the dictionary of implicit outputs for a `swift_library`. This function is used to specify the `outputs` of the `swift_library` rule; as such, its arguments must be named exactly the same as the attributes to which they refer. Args: name: The name of the target being built. module_link_name: The module link name of the target being built. Returns: The implicit outputs dictionary for a `swift_library`. """ lib_name = module_link_name if module_link_name else name return {'archive': 'lib{}.a'.format(lib_name)} def write_objc_header_module_map(actions, module_name, objc_header, output): """Writes a module map for a generated Swift header to a file. Args: actions: The context's actions object. module_name: The name of the Swift module. objc_header: The `File` representing the generated header. output: The `File` to which the module map should be written. """ actions.write(content=('module "{module_name}" {{\n' + ' header "../{header_name}"\n' + '}}\n').format(header_name=objc_header.basename, module_name=module_name), output=output) def _clang_copts(objc_fragment): """Returns copts that should be passed to `clang` from the `objc` fragment. Args: objc_fragment: The `objc` configuration fragment. Returns: A list of `clang` copts. """ clang_copts = objc_fragment.copts + objc_fragment.copts_for_current_compilation_mode return [copt for copt in clang_copts if copt != '-g'] def _dirname_map_fn(f): """Returns the dir name of a file. This function is intended to be used as a mapping function for file passed into `Args.add`. Args: f: The file. Returns: The dirname of the file. """ return f.dirname def _emitted_output_nature(copts): """Returns a `struct` with information about the nature of emitted outputs for the given flags. The compiler emits a single object if it is invoked with whole-module optimization enabled and is single-threaded (`-num-threads` is not present or is equal to 1); otherwise, it emits one object file per source file. It also emits a single `.swiftmodule` file for WMO builds, _regardless of thread count,_ so we have to treat that case separately. Args: copts: The options passed into the compile action. Returns: A struct containing the following fields: * `emits_multiple_objects`: `True` if the Swift frontend emits an object file per source file, instead of a single object file for the whole module, in a compilation action with the given flags. * `emits_partial_modules`: `True` if the Swift frontend emits partial `.swiftmodule` files for the individual source files in a compilation action with the given flags. """ is_wmo = False saw_space_separated_num_threads = False num_threads = 1 for copt in copts: if copt in _WMO_COPTS: is_wmo = True elif saw_space_separated_num_threads: saw_space_separated_num_threads = False num_threads = _safe_int(copt) elif copt == '-num-threads': saw_space_separated_num_threads = True elif copt.startswith('-num-threads='): num_threads = _safe_int(copt.split('=')[1]) if not num_threads: fail("The value of '-num-threads' must be a positive integer.") return struct(emits_multiple_objects=not (is_wmo and num_threads == 1), emits_partial_modules=not is_wmo) def _safe_int(s): """Returns the integer value of `s` when interpreted as base 10, or `None` if it is invalid. This function is needed because `int()` fails the build when passed a string that isn't a valid integer, with no way to recover (https://github.com/bazelbuild/bazel/issues/5940). Args: s: The string to be converted to an integer. Returns: The integer value of `s`, or `None` if was not a valid base 10 integer. """ for i in range(len(s)): if s[i] < '0' or s[i] > '9': return None return int(s) def _objc_provider_framework_name(path): """Returns the name of the framework from an `objc` provider path. Args: path: A path that came from an `objc` provider. Returns: A string containing the name of the framework (e.g., `Foo` for `Foo.framework`). """ return path.rpartition('/')[2].partition('.')[0]
"""Sample Configuration The bot doesn't actually read sample-config.py; it reads config.py instead. So you need to copy this file to config.py then make your local changes there. (The reason for this extra step is to make it harder for me to accidentally check in private information like server names or passwords.) """ # The bot's IRC nick nickname = "blahblahblahbot" # Hostname of the IRC server. For now, only one. serverhost = "irc.example.com" # Port of the IRC server. For now, only one. serverport = 6667 # List of IRC channels to watch channels = ["#bottest"] # List of bot admins. For now, admins are global not per-channel. admins = ["dripton"] # SQLite 3 database path. sqlite_path = "/var/tmp/blahblahblahbot.db"
"""Sample Configuration The bot doesn't actually read sample-config.py; it reads config.py instead. So you need to copy this file to config.py then make your local changes there. (The reason for this extra step is to make it harder for me to accidentally check in private information like server names or passwords.) """ nickname = 'blahblahblahbot' serverhost = 'irc.example.com' serverport = 6667 channels = ['#bottest'] admins = ['dripton'] sqlite_path = '/var/tmp/blahblahblahbot.db'
# # PySNMP MIB module AT-ISDN-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/AT-ISDN-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:14: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, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsIntersection", "ValueSizeConstraint") modules, DisplayStringUnsized = mibBuilder.importSymbols("AT-SMI-MIB", "modules", "DisplayStringUnsized") ifIndex, InterfaceIndexOrZero = mibBuilder.importSymbols("IF-MIB", "ifIndex", "InterfaceIndexOrZero") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") Counter32, ObjectIdentity, IpAddress, Gauge32, Integer32, MibIdentifier, ModuleIdentity, iso, Unsigned32, TimeTicks, Bits, NotificationType, Counter64, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "ObjectIdentity", "IpAddress", "Gauge32", "Integer32", "MibIdentifier", "ModuleIdentity", "iso", "Unsigned32", "TimeTicks", "Bits", "NotificationType", "Counter64", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn") TruthValue, TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TruthValue", "TextualConvention", "DisplayString") cc = ModuleIdentity((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37)) cc.setRevisions(('2006-06-28 12:22',)) if mibBuilder.loadTexts: cc.setLastUpdated('200606281222Z') if mibBuilder.loadTexts: cc.setOrganization('Allied Telesis, Inc') ccDetailsTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1), ) if mibBuilder.loadTexts: ccDetailsTable.setStatus('current') ccDetailsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1), ).setIndexNames((0, "AT-ISDN-MIB", "ccDetailsIndex")) if mibBuilder.loadTexts: ccDetailsEntry.setStatus('current') ccDetailsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 128))).setMaxAccess("readonly") if mibBuilder.loadTexts: ccDetailsIndex.setStatus('current') ccDetailsName = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 2), DisplayStringUnsized().subtype(subtypeSpec=ValueSizeConstraint(0, 15))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsName.setStatus('current') ccDetailsRemoteName = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 3), DisplayStringUnsized().subtype(subtypeSpec=ValueSizeConstraint(0, 15))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsRemoteName.setStatus('current') ccDetailsCalledNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 4), DisplayStringUnsized().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsCalledNumber.setStatus('current') ccDetailsCallingNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 5), DisplayStringUnsized().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsCallingNumber.setStatus('current') ccDetailsAlternateNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 6), DisplayStringUnsized().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsAlternateNumber.setStatus('current') ccDetailsEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('enabled')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsEnabled.setStatus('current') ccDetailsDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("inOnly", 1), ("outOnly", 2), ("both", 3))).clone('both')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsDirection.setStatus('current') ccDetailsPrecedence = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("in", 1), ("out", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsPrecedence.setStatus('current') ccDetailsHoldupTime = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7200))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsHoldupTime.setStatus('current') ccDetailsPreferredIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 11), InterfaceIndexOrZero()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsPreferredIfIndex.setStatus('current') ccDetailsRequiredIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 12), InterfaceIndexOrZero()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsRequiredIfIndex.setStatus('current') ccDetailsPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 99)).clone(50)).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsPriority.setStatus('current') ccDetailsRetryT1 = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(5, 120)).clone(30)).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsRetryT1.setStatus('current') ccDetailsRetryN1 = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 10))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsRetryN1.setStatus('current') ccDetailsRetryT2 = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(300, 1200)).clone(600)).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsRetryT2.setStatus('current') ccDetailsRetryN2 = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 17), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 5))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsRetryN2.setStatus('current') ccDetailsKeepup = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2))).clone('no')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsKeepup.setStatus('current') ccDetailsOutSetupCli = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("off", 1), ("calling", 2), ("interface", 3), ("nonumber", 4))).clone('off')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsOutSetupCli.setStatus('current') ccDetailsOutSetupUser = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("off", 1), ("local", 2), ("remote", 3))).clone('off')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsOutSetupUser.setStatus('current') ccDetailsOutSetupCalledSub = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("off", 1), ("local", 2), ("remote", 3))).clone('off')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsOutSetupCalledSub.setStatus('current') ccDetailsOutSubaddress = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 22), DisplayStringUnsized().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsOutSubaddress.setStatus('current') ccDetailsCallback = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2))).clone('no')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsCallback.setStatus('current') ccDetailsCallbackDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 24), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100)).clone(41)).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsCallbackDelay.setStatus('current') ccDetailsInSetupCalledSubSearch = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("off", 1), ("local", 2), ("remote", 3))).clone('off')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsInSetupCalledSubSearch.setStatus('current') ccDetailsInSetupUserSearch = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 26), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("off", 1), ("local", 2), ("remote", 3))).clone('off')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsInSetupUserSearch.setStatus('current') ccDetailsInSetupCliSearch = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 27), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("off", 1), ("on", 2), ("list", 3))).clone('off')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsInSetupCliSearch.setStatus('current') ccDetailsInSetupCliSearchList = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 28), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsInSetupCliSearchList.setStatus('current') ccDetailsInAnyFlag = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 29), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2))).clone('no')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsInAnyFlag.setStatus('current') ccDetailsInSetupCalledSubCheck = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 30), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("off", 1), ("local", 2), ("remote", 3))).clone('off')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsInSetupCalledSubCheck.setStatus('current') ccDetailsInSetupUserCheck = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 31), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("off", 1), ("local", 2), ("remote", 3))).clone('off')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsInSetupUserCheck.setStatus('current') ccDetailsInSetupCliCheck = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("off", 1), ("present", 2), ("required", 3))).clone('off')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsInSetupCliCheck.setStatus('current') ccDetailsInSetupCliCheckList = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 33), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsInSetupCliCheckList.setStatus('current') ccDetailsUserType = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 34), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("attach", 1), ("ppp", 2))).clone('attach')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsUserType.setStatus('current') ccDetailsLoginType = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 35), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("none", 1), ("userdb", 2), ("radius", 3), ("papTacacs", 4), ("chap", 5), ("papRadius", 6), ("tacacs", 7), ("all", 8))).clone('none')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsLoginType.setStatus('current') ccDetailsUsername = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 36), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("none", 1), ("cli", 2), ("calledsub", 3), ("useruser", 4), ("callname", 5))).clone('none')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsUsername.setStatus('current') ccDetailsPassword = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 37), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("none", 1), ("cli", 2), ("calledsub", 3), ("useruser", 4), ("callname", 5))).clone('none')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsPassword.setStatus('current') ccDetailsBumpDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 38), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100)).clone(5)).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsBumpDelay.setStatus('current') ccDetailsDataRate = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 39), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("rate-64k", 1), ("rate-56k", 2))).clone('rate-64k')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsDataRate.setStatus('current') ccDetailsPppTemplate = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 40), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 33)).clone(33)).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccDetailsPppTemplate.setStatus('current') ccDetailsUserModule = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 41), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ccDetailsUserModule.setStatus('current') ccDetailsNumberAttachments = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 42), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ccDetailsNumberAttachments.setStatus('current') ccCliListTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 2), ) if mibBuilder.loadTexts: ccCliListTable.setStatus('current') ccCliListEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 2, 1), ).setIndexNames((0, "AT-ISDN-MIB", "ccCliListListIndex"), (0, "AT-ISDN-MIB", "ccCliListEntryIndex")) if mibBuilder.loadTexts: ccCliListEntry.setStatus('current') ccCliListListIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: ccCliListListIndex.setStatus('current') ccCliListEntryIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 2, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ccCliListEntryIndex.setStatus('current') ccCliListNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 2, 1, 3), DisplayStringUnsized().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccCliListNumber.setStatus('current') ccActiveCallTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3), ) if mibBuilder.loadTexts: ccActiveCallTable.setStatus('current') ccActiveCallEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1), ).setIndexNames((0, "AT-ISDN-MIB", "ccActiveCallIndex")) if mibBuilder.loadTexts: ccActiveCallEntry.setStatus('current') ccActiveCallIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 128))).setMaxAccess("readonly") if mibBuilder.loadTexts: ccActiveCallIndex.setStatus('current') ccActiveCallDetailsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 128))).setMaxAccess("readonly") if mibBuilder.loadTexts: ccActiveCallDetailsIndex.setStatus('current') ccActiveCallIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 3), InterfaceIndexOrZero()).setMaxAccess("readonly") if mibBuilder.loadTexts: ccActiveCallIfIndex.setStatus('current') ccActiveCallDataRate = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("rate-64k", 1), ("rate-56k", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ccActiveCallDataRate.setStatus('current') ccActiveCallState = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("null", 1), ("off", 2), ("try", 3), ("on", 4), ("wait", 5), ("await1", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ccActiveCallState.setStatus('current') ccActiveCallDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("in", 1), ("out", 2), ("undefined", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ccActiveCallDirection.setStatus('current') ccActiveCallUserModule = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ccActiveCallUserModule.setStatus('current') ccActiveCallUserInstance = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ccActiveCallUserInstance.setStatus('current') ccActiveCallBchannelIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 31))).setMaxAccess("readonly") if mibBuilder.loadTexts: ccActiveCallBchannelIndex.setStatus('current') ccCallLogTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4), ) if mibBuilder.loadTexts: ccCallLogTable.setStatus('current') ccCallLogEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1), ).setIndexNames((0, "AT-ISDN-MIB", "ccCallLogIndex")) if mibBuilder.loadTexts: ccCallLogEntry.setStatus('current') ccCallLogIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ccCallLogIndex.setStatus('current') ccCallLogName = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ccCallLogName.setStatus('current') ccCallLogState = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("initial", 1), ("active", 2), ("disconnected", 3), ("cleared", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ccCallLogState.setStatus('current') ccCallLogTimeStarted = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ccCallLogTimeStarted.setStatus('current') ccCallLogDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("in", 1), ("out", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ccCallLogDirection.setStatus('current') ccCallLogDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ccCallLogDuration.setStatus('current') ccCallLogRemoteNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ccCallLogRemoteNumber.setStatus('current') ccAttachmentTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 5), ) if mibBuilder.loadTexts: ccAttachmentTable.setStatus('current') ccAttachmentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 5, 1), ).setIndexNames((0, "AT-ISDN-MIB", "ccAttachmentDetailsIndex"), (0, "AT-ISDN-MIB", "ccAttachmentEntryIndex")) if mibBuilder.loadTexts: ccAttachmentEntry.setStatus('current') ccAttachmentDetailsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 128))).setMaxAccess("readonly") if mibBuilder.loadTexts: ccAttachmentDetailsIndex.setStatus('current') ccAttachmentEntryIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 5, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ccAttachmentEntryIndex.setStatus('current') ccAttachmentActiveCallIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 5, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 128))).setMaxAccess("readonly") if mibBuilder.loadTexts: ccAttachmentActiveCallIndex.setStatus('current') ccAttachmentUserInstance = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 5, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ccAttachmentUserInstance.setStatus('current') ccBchannelTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6), ) if mibBuilder.loadTexts: ccBchannelTable.setStatus('current') ccBchannelEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1), ).setIndexNames((0, "AT-ISDN-MIB", "ccBchannelIfIndex"), (0, "AT-ISDN-MIB", "ccBchannelChannelIndex")) if mibBuilder.loadTexts: ccBchannelEntry.setStatus('current') ccBchannelIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ccBchannelIfIndex.setStatus('current') ccBchannelChannelIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 31))).setMaxAccess("readonly") if mibBuilder.loadTexts: ccBchannelChannelIndex.setStatus('current') ccBchannelAllocated = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ccBchannelAllocated.setStatus('current') ccBchannelCallType = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("undefined", 1), ("data", 2), ("voice", 3), ("x25", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ccBchannelCallType.setStatus('current') ccBchannelActiveCallIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 128))).setMaxAccess("readonly") if mibBuilder.loadTexts: ccBchannelActiveCallIndex.setStatus('current') ccBchannelPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ccBchannelPriority.setStatus('current') ccBchannelDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("in", 1), ("out", 2), ("unallocated", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ccBchannelDirection.setStatus('current') mibBuilder.exportSymbols("AT-ISDN-MIB", ccActiveCallDirection=ccActiveCallDirection, ccBchannelIfIndex=ccBchannelIfIndex, ccDetailsInAnyFlag=ccDetailsInAnyFlag, ccDetailsCalledNumber=ccDetailsCalledNumber, ccCliListTable=ccCliListTable, ccDetailsPriority=ccDetailsPriority, ccActiveCallDataRate=ccActiveCallDataRate, ccDetailsPreferredIfIndex=ccDetailsPreferredIfIndex, ccActiveCallUserInstance=ccActiveCallUserInstance, ccDetailsEnabled=ccDetailsEnabled, ccCallLogIndex=ccCallLogIndex, ccDetailsEntry=ccDetailsEntry, ccDetailsRequiredIfIndex=ccDetailsRequiredIfIndex, ccCallLogDirection=ccCallLogDirection, ccCliListEntryIndex=ccCliListEntryIndex, ccDetailsTable=ccDetailsTable, ccDetailsOutSetupCli=ccDetailsOutSetupCli, ccCallLogTable=ccCallLogTable, ccDetailsPassword=ccDetailsPassword, ccCallLogDuration=ccCallLogDuration, ccBchannelChannelIndex=ccBchannelChannelIndex, ccActiveCallUserModule=ccActiveCallUserModule, ccAttachmentTable=ccAttachmentTable, ccBchannelPriority=ccBchannelPriority, ccAttachmentEntry=ccAttachmentEntry, ccAttachmentEntryIndex=ccAttachmentEntryIndex, ccBchannelCallType=ccBchannelCallType, ccDetailsCallback=ccDetailsCallback, ccAttachmentActiveCallIndex=ccAttachmentActiveCallIndex, ccDetailsInSetupCliCheck=ccDetailsInSetupCliCheck, ccCallLogName=ccCallLogName, ccCliListEntry=ccCliListEntry, ccDetailsCallingNumber=ccDetailsCallingNumber, ccAttachmentDetailsIndex=ccAttachmentDetailsIndex, ccDetailsName=ccDetailsName, ccActiveCallEntry=ccActiveCallEntry, ccDetailsOutSubaddress=ccDetailsOutSubaddress, ccCliListNumber=ccCliListNumber, ccDetailsRetryN1=ccDetailsRetryN1, ccCallLogRemoteNumber=ccCallLogRemoteNumber, ccBchannelActiveCallIndex=ccBchannelActiveCallIndex, ccDetailsOutSetupCalledSub=ccDetailsOutSetupCalledSub, ccActiveCallState=ccActiveCallState, ccDetailsUserType=ccDetailsUserType, ccDetailsRetryN2=ccDetailsRetryN2, ccDetailsKeepup=ccDetailsKeepup, ccDetailsDataRate=ccDetailsDataRate, ccDetailsAlternateNumber=ccDetailsAlternateNumber, ccDetailsRetryT2=ccDetailsRetryT2, ccDetailsRetryT1=ccDetailsRetryT1, ccDetailsInSetupUserCheck=ccDetailsInSetupUserCheck, ccActiveCallBchannelIndex=ccActiveCallBchannelIndex, ccActiveCallIfIndex=ccActiveCallIfIndex, ccDetailsInSetupCliSearchList=ccDetailsInSetupCliSearchList, ccDetailsRemoteName=ccDetailsRemoteName, ccCallLogState=ccCallLogState, ccDetailsOutSetupUser=ccDetailsOutSetupUser, ccBchannelEntry=ccBchannelEntry, ccDetailsLoginType=ccDetailsLoginType, ccDetailsPrecedence=ccDetailsPrecedence, ccActiveCallDetailsIndex=ccActiveCallDetailsIndex, ccDetailsCallbackDelay=ccDetailsCallbackDelay, ccActiveCallIndex=ccActiveCallIndex, ccBchannelTable=ccBchannelTable, ccDetailsInSetupCliCheckList=ccDetailsInSetupCliCheckList, ccDetailsInSetupCalledSubSearch=ccDetailsInSetupCalledSubSearch, ccDetailsInSetupCliSearch=ccDetailsInSetupCliSearch, ccBchannelDirection=ccBchannelDirection, ccBchannelAllocated=ccBchannelAllocated, ccAttachmentUserInstance=ccAttachmentUserInstance, ccDetailsUsername=ccDetailsUsername, ccDetailsHoldupTime=ccDetailsHoldupTime, ccDetailsBumpDelay=ccDetailsBumpDelay, ccCallLogEntry=ccCallLogEntry, ccDetailsNumberAttachments=ccDetailsNumberAttachments, ccDetailsInSetupCalledSubCheck=ccDetailsInSetupCalledSubCheck, ccCliListListIndex=ccCliListListIndex, ccDetailsUserModule=ccDetailsUserModule, ccActiveCallTable=ccActiveCallTable, ccCallLogTimeStarted=ccCallLogTimeStarted, PYSNMP_MODULE_ID=cc, ccDetailsIndex=ccDetailsIndex, ccDetailsDirection=ccDetailsDirection, ccDetailsInSetupUserSearch=ccDetailsInSetupUserSearch, ccDetailsPppTemplate=ccDetailsPppTemplate, cc=cc)
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, single_value_constraint, value_range_constraint, constraints_intersection, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsIntersection', 'ValueSizeConstraint') (modules, display_string_unsized) = mibBuilder.importSymbols('AT-SMI-MIB', 'modules', 'DisplayStringUnsized') (if_index, interface_index_or_zero) = mibBuilder.importSymbols('IF-MIB', 'ifIndex', 'InterfaceIndexOrZero') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (counter32, object_identity, ip_address, gauge32, integer32, mib_identifier, module_identity, iso, unsigned32, time_ticks, bits, notification_type, counter64, mib_scalar, mib_table, mib_table_row, mib_table_column) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter32', 'ObjectIdentity', 'IpAddress', 'Gauge32', 'Integer32', 'MibIdentifier', 'ModuleIdentity', 'iso', 'Unsigned32', 'TimeTicks', 'Bits', 'NotificationType', 'Counter64', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn') (truth_value, textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TruthValue', 'TextualConvention', 'DisplayString') cc = module_identity((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37)) cc.setRevisions(('2006-06-28 12:22',)) if mibBuilder.loadTexts: cc.setLastUpdated('200606281222Z') if mibBuilder.loadTexts: cc.setOrganization('Allied Telesis, Inc') cc_details_table = mib_table((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1)) if mibBuilder.loadTexts: ccDetailsTable.setStatus('current') cc_details_entry = mib_table_row((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1)).setIndexNames((0, 'AT-ISDN-MIB', 'ccDetailsIndex')) if mibBuilder.loadTexts: ccDetailsEntry.setStatus('current') cc_details_index = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 128))).setMaxAccess('readonly') if mibBuilder.loadTexts: ccDetailsIndex.setStatus('current') cc_details_name = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 2), display_string_unsized().subtype(subtypeSpec=value_size_constraint(0, 15))).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsName.setStatus('current') cc_details_remote_name = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 3), display_string_unsized().subtype(subtypeSpec=value_size_constraint(0, 15))).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsRemoteName.setStatus('current') cc_details_called_number = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 4), display_string_unsized().subtype(subtypeSpec=value_size_constraint(0, 31))).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsCalledNumber.setStatus('current') cc_details_calling_number = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 5), display_string_unsized().subtype(subtypeSpec=value_size_constraint(0, 31))).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsCallingNumber.setStatus('current') cc_details_alternate_number = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 6), display_string_unsized().subtype(subtypeSpec=value_size_constraint(0, 31))).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsAlternateNumber.setStatus('current') cc_details_enabled = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('disabled', 1), ('enabled', 2))).clone('enabled')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsEnabled.setStatus('current') cc_details_direction = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('inOnly', 1), ('outOnly', 2), ('both', 3))).clone('both')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsDirection.setStatus('current') cc_details_precedence = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('in', 1), ('out', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsPrecedence.setStatus('current') cc_details_holdup_time = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 7200))).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsHoldupTime.setStatus('current') cc_details_preferred_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 11), interface_index_or_zero()).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsPreferredIfIndex.setStatus('current') cc_details_required_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 12), interface_index_or_zero()).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsRequiredIfIndex.setStatus('current') cc_details_priority = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(0, 99)).clone(50)).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsPriority.setStatus('current') cc_details_retry_t1 = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 14), integer32().subtype(subtypeSpec=value_range_constraint(5, 120)).clone(30)).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsRetryT1.setStatus('current') cc_details_retry_n1 = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 15), integer32().subtype(subtypeSpec=value_range_constraint(0, 10))).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsRetryN1.setStatus('current') cc_details_retry_t2 = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 16), integer32().subtype(subtypeSpec=value_range_constraint(300, 1200)).clone(600)).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsRetryT2.setStatus('current') cc_details_retry_n2 = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 17), integer32().subtype(subtypeSpec=value_range_constraint(0, 5))).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsRetryN2.setStatus('current') cc_details_keepup = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 18), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no', 1), ('yes', 2))).clone('no')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsKeepup.setStatus('current') cc_details_out_setup_cli = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 19), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('off', 1), ('calling', 2), ('interface', 3), ('nonumber', 4))).clone('off')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsOutSetupCli.setStatus('current') cc_details_out_setup_user = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 20), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('off', 1), ('local', 2), ('remote', 3))).clone('off')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsOutSetupUser.setStatus('current') cc_details_out_setup_called_sub = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 21), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('off', 1), ('local', 2), ('remote', 3))).clone('off')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsOutSetupCalledSub.setStatus('current') cc_details_out_subaddress = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 22), display_string_unsized().subtype(subtypeSpec=value_size_constraint(0, 31))).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsOutSubaddress.setStatus('current') cc_details_callback = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 23), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no', 1), ('yes', 2))).clone('no')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsCallback.setStatus('current') cc_details_callback_delay = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 24), integer32().subtype(subtypeSpec=value_range_constraint(0, 100)).clone(41)).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsCallbackDelay.setStatus('current') cc_details_in_setup_called_sub_search = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 25), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('off', 1), ('local', 2), ('remote', 3))).clone('off')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsInSetupCalledSubSearch.setStatus('current') cc_details_in_setup_user_search = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 26), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('off', 1), ('local', 2), ('remote', 3))).clone('off')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsInSetupUserSearch.setStatus('current') cc_details_in_setup_cli_search = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 27), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('off', 1), ('on', 2), ('list', 3))).clone('off')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsInSetupCliSearch.setStatus('current') cc_details_in_setup_cli_search_list = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 28), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsInSetupCliSearchList.setStatus('current') cc_details_in_any_flag = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 29), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no', 1), ('yes', 2))).clone('no')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsInAnyFlag.setStatus('current') cc_details_in_setup_called_sub_check = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 30), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('off', 1), ('local', 2), ('remote', 3))).clone('off')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsInSetupCalledSubCheck.setStatus('current') cc_details_in_setup_user_check = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 31), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('off', 1), ('local', 2), ('remote', 3))).clone('off')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsInSetupUserCheck.setStatus('current') cc_details_in_setup_cli_check = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 32), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('off', 1), ('present', 2), ('required', 3))).clone('off')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsInSetupCliCheck.setStatus('current') cc_details_in_setup_cli_check_list = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 33), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsInSetupCliCheckList.setStatus('current') cc_details_user_type = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 34), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('attach', 1), ('ppp', 2))).clone('attach')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsUserType.setStatus('current') cc_details_login_type = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 35), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('none', 1), ('userdb', 2), ('radius', 3), ('papTacacs', 4), ('chap', 5), ('papRadius', 6), ('tacacs', 7), ('all', 8))).clone('none')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsLoginType.setStatus('current') cc_details_username = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 36), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('none', 1), ('cli', 2), ('calledsub', 3), ('useruser', 4), ('callname', 5))).clone('none')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsUsername.setStatus('current') cc_details_password = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 37), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('none', 1), ('cli', 2), ('calledsub', 3), ('useruser', 4), ('callname', 5))).clone('none')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsPassword.setStatus('current') cc_details_bump_delay = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 38), integer32().subtype(subtypeSpec=value_range_constraint(0, 100)).clone(5)).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsBumpDelay.setStatus('current') cc_details_data_rate = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 39), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('rate-64k', 1), ('rate-56k', 2))).clone('rate-64k')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsDataRate.setStatus('current') cc_details_ppp_template = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 40), integer32().subtype(subtypeSpec=value_range_constraint(1, 33)).clone(33)).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccDetailsPppTemplate.setStatus('current') cc_details_user_module = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 41), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ccDetailsUserModule.setStatus('current') cc_details_number_attachments = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 1, 1, 42), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ccDetailsNumberAttachments.setStatus('current') cc_cli_list_table = mib_table((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 2)) if mibBuilder.loadTexts: ccCliListTable.setStatus('current') cc_cli_list_entry = mib_table_row((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 2, 1)).setIndexNames((0, 'AT-ISDN-MIB', 'ccCliListListIndex'), (0, 'AT-ISDN-MIB', 'ccCliListEntryIndex')) if mibBuilder.loadTexts: ccCliListEntry.setStatus('current') cc_cli_list_list_index = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 100))).setMaxAccess('readonly') if mibBuilder.loadTexts: ccCliListListIndex.setStatus('current') cc_cli_list_entry_index = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 2, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ccCliListEntryIndex.setStatus('current') cc_cli_list_number = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 2, 1, 3), display_string_unsized().subtype(subtypeSpec=value_size_constraint(0, 31))).setMaxAccess('readwrite') if mibBuilder.loadTexts: ccCliListNumber.setStatus('current') cc_active_call_table = mib_table((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3)) if mibBuilder.loadTexts: ccActiveCallTable.setStatus('current') cc_active_call_entry = mib_table_row((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1)).setIndexNames((0, 'AT-ISDN-MIB', 'ccActiveCallIndex')) if mibBuilder.loadTexts: ccActiveCallEntry.setStatus('current') cc_active_call_index = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 128))).setMaxAccess('readonly') if mibBuilder.loadTexts: ccActiveCallIndex.setStatus('current') cc_active_call_details_index = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 128))).setMaxAccess('readonly') if mibBuilder.loadTexts: ccActiveCallDetailsIndex.setStatus('current') cc_active_call_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 3), interface_index_or_zero()).setMaxAccess('readonly') if mibBuilder.loadTexts: ccActiveCallIfIndex.setStatus('current') cc_active_call_data_rate = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('rate-64k', 1), ('rate-56k', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: ccActiveCallDataRate.setStatus('current') cc_active_call_state = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('null', 1), ('off', 2), ('try', 3), ('on', 4), ('wait', 5), ('await1', 6)))).setMaxAccess('readonly') if mibBuilder.loadTexts: ccActiveCallState.setStatus('current') cc_active_call_direction = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('in', 1), ('out', 2), ('undefined', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: ccActiveCallDirection.setStatus('current') cc_active_call_user_module = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 7), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ccActiveCallUserModule.setStatus('current') cc_active_call_user_instance = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 8), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ccActiveCallUserInstance.setStatus('current') cc_active_call_bchannel_index = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 3, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 31))).setMaxAccess('readonly') if mibBuilder.loadTexts: ccActiveCallBchannelIndex.setStatus('current') cc_call_log_table = mib_table((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4)) if mibBuilder.loadTexts: ccCallLogTable.setStatus('current') cc_call_log_entry = mib_table_row((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1)).setIndexNames((0, 'AT-ISDN-MIB', 'ccCallLogIndex')) if mibBuilder.loadTexts: ccCallLogEntry.setStatus('current') cc_call_log_index = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ccCallLogIndex.setStatus('current') cc_call_log_name = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 2), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: ccCallLogName.setStatus('current') cc_call_log_state = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('initial', 1), ('active', 2), ('disconnected', 3), ('cleared', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: ccCallLogState.setStatus('current') cc_call_log_time_started = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 4), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: ccCallLogTimeStarted.setStatus('current') cc_call_log_direction = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('in', 1), ('out', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: ccCallLogDirection.setStatus('current') cc_call_log_duration = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ccCallLogDuration.setStatus('current') cc_call_log_remote_number = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 4, 1, 7), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: ccCallLogRemoteNumber.setStatus('current') cc_attachment_table = mib_table((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 5)) if mibBuilder.loadTexts: ccAttachmentTable.setStatus('current') cc_attachment_entry = mib_table_row((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 5, 1)).setIndexNames((0, 'AT-ISDN-MIB', 'ccAttachmentDetailsIndex'), (0, 'AT-ISDN-MIB', 'ccAttachmentEntryIndex')) if mibBuilder.loadTexts: ccAttachmentEntry.setStatus('current') cc_attachment_details_index = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 5, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 128))).setMaxAccess('readonly') if mibBuilder.loadTexts: ccAttachmentDetailsIndex.setStatus('current') cc_attachment_entry_index = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 5, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ccAttachmentEntryIndex.setStatus('current') cc_attachment_active_call_index = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 5, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 128))).setMaxAccess('readonly') if mibBuilder.loadTexts: ccAttachmentActiveCallIndex.setStatus('current') cc_attachment_user_instance = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 5, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ccAttachmentUserInstance.setStatus('current') cc_bchannel_table = mib_table((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6)) if mibBuilder.loadTexts: ccBchannelTable.setStatus('current') cc_bchannel_entry = mib_table_row((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1)).setIndexNames((0, 'AT-ISDN-MIB', 'ccBchannelIfIndex'), (0, 'AT-ISDN-MIB', 'ccBchannelChannelIndex')) if mibBuilder.loadTexts: ccBchannelEntry.setStatus('current') cc_bchannel_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ccBchannelIfIndex.setStatus('current') cc_bchannel_channel_index = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 31))).setMaxAccess('readonly') if mibBuilder.loadTexts: ccBchannelChannelIndex.setStatus('current') cc_bchannel_allocated = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no', 1), ('yes', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: ccBchannelAllocated.setStatus('current') cc_bchannel_call_type = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('undefined', 1), ('data', 2), ('voice', 3), ('x25', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: ccBchannelCallType.setStatus('current') cc_bchannel_active_call_index = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 128))).setMaxAccess('readonly') if mibBuilder.loadTexts: ccBchannelActiveCallIndex.setStatus('current') cc_bchannel_priority = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ccBchannelPriority.setStatus('current') cc_bchannel_direction = mib_table_column((1, 3, 6, 1, 4, 1, 207, 8, 4, 4, 4, 37, 6, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('in', 1), ('out', 2), ('unallocated', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: ccBchannelDirection.setStatus('current') mibBuilder.exportSymbols('AT-ISDN-MIB', ccActiveCallDirection=ccActiveCallDirection, ccBchannelIfIndex=ccBchannelIfIndex, ccDetailsInAnyFlag=ccDetailsInAnyFlag, ccDetailsCalledNumber=ccDetailsCalledNumber, ccCliListTable=ccCliListTable, ccDetailsPriority=ccDetailsPriority, ccActiveCallDataRate=ccActiveCallDataRate, ccDetailsPreferredIfIndex=ccDetailsPreferredIfIndex, ccActiveCallUserInstance=ccActiveCallUserInstance, ccDetailsEnabled=ccDetailsEnabled, ccCallLogIndex=ccCallLogIndex, ccDetailsEntry=ccDetailsEntry, ccDetailsRequiredIfIndex=ccDetailsRequiredIfIndex, ccCallLogDirection=ccCallLogDirection, ccCliListEntryIndex=ccCliListEntryIndex, ccDetailsTable=ccDetailsTable, ccDetailsOutSetupCli=ccDetailsOutSetupCli, ccCallLogTable=ccCallLogTable, ccDetailsPassword=ccDetailsPassword, ccCallLogDuration=ccCallLogDuration, ccBchannelChannelIndex=ccBchannelChannelIndex, ccActiveCallUserModule=ccActiveCallUserModule, ccAttachmentTable=ccAttachmentTable, ccBchannelPriority=ccBchannelPriority, ccAttachmentEntry=ccAttachmentEntry, ccAttachmentEntryIndex=ccAttachmentEntryIndex, ccBchannelCallType=ccBchannelCallType, ccDetailsCallback=ccDetailsCallback, ccAttachmentActiveCallIndex=ccAttachmentActiveCallIndex, ccDetailsInSetupCliCheck=ccDetailsInSetupCliCheck, ccCallLogName=ccCallLogName, ccCliListEntry=ccCliListEntry, ccDetailsCallingNumber=ccDetailsCallingNumber, ccAttachmentDetailsIndex=ccAttachmentDetailsIndex, ccDetailsName=ccDetailsName, ccActiveCallEntry=ccActiveCallEntry, ccDetailsOutSubaddress=ccDetailsOutSubaddress, ccCliListNumber=ccCliListNumber, ccDetailsRetryN1=ccDetailsRetryN1, ccCallLogRemoteNumber=ccCallLogRemoteNumber, ccBchannelActiveCallIndex=ccBchannelActiveCallIndex, ccDetailsOutSetupCalledSub=ccDetailsOutSetupCalledSub, ccActiveCallState=ccActiveCallState, ccDetailsUserType=ccDetailsUserType, ccDetailsRetryN2=ccDetailsRetryN2, ccDetailsKeepup=ccDetailsKeepup, ccDetailsDataRate=ccDetailsDataRate, ccDetailsAlternateNumber=ccDetailsAlternateNumber, ccDetailsRetryT2=ccDetailsRetryT2, ccDetailsRetryT1=ccDetailsRetryT1, ccDetailsInSetupUserCheck=ccDetailsInSetupUserCheck, ccActiveCallBchannelIndex=ccActiveCallBchannelIndex, ccActiveCallIfIndex=ccActiveCallIfIndex, ccDetailsInSetupCliSearchList=ccDetailsInSetupCliSearchList, ccDetailsRemoteName=ccDetailsRemoteName, ccCallLogState=ccCallLogState, ccDetailsOutSetupUser=ccDetailsOutSetupUser, ccBchannelEntry=ccBchannelEntry, ccDetailsLoginType=ccDetailsLoginType, ccDetailsPrecedence=ccDetailsPrecedence, ccActiveCallDetailsIndex=ccActiveCallDetailsIndex, ccDetailsCallbackDelay=ccDetailsCallbackDelay, ccActiveCallIndex=ccActiveCallIndex, ccBchannelTable=ccBchannelTable, ccDetailsInSetupCliCheckList=ccDetailsInSetupCliCheckList, ccDetailsInSetupCalledSubSearch=ccDetailsInSetupCalledSubSearch, ccDetailsInSetupCliSearch=ccDetailsInSetupCliSearch, ccBchannelDirection=ccBchannelDirection, ccBchannelAllocated=ccBchannelAllocated, ccAttachmentUserInstance=ccAttachmentUserInstance, ccDetailsUsername=ccDetailsUsername, ccDetailsHoldupTime=ccDetailsHoldupTime, ccDetailsBumpDelay=ccDetailsBumpDelay, ccCallLogEntry=ccCallLogEntry, ccDetailsNumberAttachments=ccDetailsNumberAttachments, ccDetailsInSetupCalledSubCheck=ccDetailsInSetupCalledSubCheck, ccCliListListIndex=ccCliListListIndex, ccDetailsUserModule=ccDetailsUserModule, ccActiveCallTable=ccActiveCallTable, ccCallLogTimeStarted=ccCallLogTimeStarted, PYSNMP_MODULE_ID=cc, ccDetailsIndex=ccDetailsIndex, ccDetailsDirection=ccDetailsDirection, ccDetailsInSetupUserSearch=ccDetailsInSetupUserSearch, ccDetailsPppTemplate=ccDetailsPppTemplate, cc=cc)
# Compound Interest P = float(input('Enter principal amount: $')) r = float(input('Enter annual interest rate %')) n = float(input('Enter number of times per year interest has compounded: ')) t = float( input('Enter number of years account will be left to earn interest: ')) r /= 100 # 50% = .50 A = P * ((1 + (r / n)) ** (n * t)) print('After ', t, ' years, $', format(A, ',.2f'), ' will be in the account. ', sep='')
p = float(input('Enter principal amount: $')) r = float(input('Enter annual interest rate %')) n = float(input('Enter number of times per year interest has compounded: ')) t = float(input('Enter number of years account will be left to earn interest: ')) r /= 100 a = P * (1 + r / n) ** (n * t) print('After ', t, ' years, $', format(A, ',.2f'), ' will be in the account. ', sep='')
#coding: utf-8 # Copyright 2005-2010 Wesabe, Inc. # # 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. # # ofx.validators - Classes to validate certain financial data types. # class RoutingNumber: def __init__(self, number): self.number = number # FIXME: need to make sure we're really getting a number and not any non-number characters. try: self.digits = [int(digit) for digit in str(self.number).strip()] self.region_code = int(str(self.digits[0]) + str(self.digits[1])) self.converted = True except ValueError: # Not a number, failed to convert self.digits = None self.region_code = None self.converted = False def is_valid(self): if self.converted is False or len(self.digits) != 9: return False checksum = ((self.digits[0] * 3) + (self.digits[1] * 7) + self.digits[2] + (self.digits[3] * 3) + (self.digits[4] * 7) + self.digits[5] + (self.digits[6] * 3) + (self.digits[7] * 7) + self.digits[8] ) return (checksum % 10 == 0) def get_type(self): # Remember that range() stops one short of the second argument. # In other words, "x in range(1, 13)" means "x >= 1 and x < 13". if self.region_code == 0: return "United States Government" elif self.region_code in range(1, 13): return "Primary" elif self.region_code in range(21, 33): return "Thrift" elif self.region_code in range(61, 73): return "Electronic" elif self.region_code == 80: return "Traveller's Cheque" else: return None def get_region(self): if self.region_code == 0: return "United States Government" elif self.region_code in [1, 21, 61]: return "Boston" elif self.region_code in [2, 22, 62]: return "New York" elif self.region_code in [3, 23, 63]: return "Philadelphia" elif self.region_code in [4, 24, 64]: return "Cleveland" elif self.region_code in [5, 25, 65]: return "Richmond" elif self.region_code in [6, 26, 66]: return "Atlanta" elif self.region_code in [7, 27, 67]: return "Chicago" elif self.region_code in [8, 28, 68]: return "St. Louis" elif self.region_code in [9, 29, 69]: return "Minneapolis" elif self.region_code in [10, 30, 70]: return "Kansas City" elif self.region_code in [11, 31, 71]: return "Dallas" elif self.region_code in [12, 32, 72]: return "San Francisco" elif self.region_code == 80: return "Traveller's Cheque" else: return None def to_s(self): return str(self.number) + " (valid: %s; type: %s; region: %s)" % \ (self.is_valid(), self.get_type(), self.get_region()) def __repr__(self): return self.to_s()
class Routingnumber: def __init__(self, number): self.number = number try: self.digits = [int(digit) for digit in str(self.number).strip()] self.region_code = int(str(self.digits[0]) + str(self.digits[1])) self.converted = True except ValueError: self.digits = None self.region_code = None self.converted = False def is_valid(self): if self.converted is False or len(self.digits) != 9: return False checksum = self.digits[0] * 3 + self.digits[1] * 7 + self.digits[2] + self.digits[3] * 3 + self.digits[4] * 7 + self.digits[5] + self.digits[6] * 3 + self.digits[7] * 7 + self.digits[8] return checksum % 10 == 0 def get_type(self): if self.region_code == 0: return 'United States Government' elif self.region_code in range(1, 13): return 'Primary' elif self.region_code in range(21, 33): return 'Thrift' elif self.region_code in range(61, 73): return 'Electronic' elif self.region_code == 80: return "Traveller's Cheque" else: return None def get_region(self): if self.region_code == 0: return 'United States Government' elif self.region_code in [1, 21, 61]: return 'Boston' elif self.region_code in [2, 22, 62]: return 'New York' elif self.region_code in [3, 23, 63]: return 'Philadelphia' elif self.region_code in [4, 24, 64]: return 'Cleveland' elif self.region_code in [5, 25, 65]: return 'Richmond' elif self.region_code in [6, 26, 66]: return 'Atlanta' elif self.region_code in [7, 27, 67]: return 'Chicago' elif self.region_code in [8, 28, 68]: return 'St. Louis' elif self.region_code in [9, 29, 69]: return 'Minneapolis' elif self.region_code in [10, 30, 70]: return 'Kansas City' elif self.region_code in [11, 31, 71]: return 'Dallas' elif self.region_code in [12, 32, 72]: return 'San Francisco' elif self.region_code == 80: return "Traveller's Cheque" else: return None def to_s(self): return str(self.number) + ' (valid: %s; type: %s; region: %s)' % (self.is_valid(), self.get_type(), self.get_region()) def __repr__(self): return self.to_s()
def pytest_addoption(parser): parser.addoption("--project", action="store", default='None') def pytest_generate_tests(metafunc): # This is called for every test. Only get/set command line arguments # if the argument is specified in the list of test "fixturenames". option_value = metafunc.config.option.project if 'project' in metafunc.fixturenames and option_value is not None: metafunc.parametrize("project", [option_value])
def pytest_addoption(parser): parser.addoption('--project', action='store', default='None') def pytest_generate_tests(metafunc): option_value = metafunc.config.option.project if 'project' in metafunc.fixturenames and option_value is not None: metafunc.parametrize('project', [option_value])
def endswith(x, lst): """ Select longest suffix that matches x from provided list(lst) :param x: input string :param lst: suffixes to compare with :return: longest suffix that matches input string if available otherwise None """ longest_suffix = None for suffix in lst: if x.endswith(suffix): if longest_suffix is None or len(longest_suffix) < len(suffix): longest_suffix = suffix return longest_suffix def startswith(x, lst): """ Select longest prefix that matches x from provided list(lst) :param x: input string :param lst: prefixes to compare with :return: longest prefix that matches input string if available otherwise None """ longest_prefix = None for prefix in lst: if x.startswith(prefix): if longest_prefix is None or len(longest_prefix) < len(prefix): longest_prefix = prefix return longest_prefix def combine(cs, vs): """ Returns all possible combinations preserving the order :param cs: list of first strings :param vs: list of second strings :return: list of combined strings """ return [ci + vi for ci in cs for vi in vs] def harmonic_mean(*a): return len(a) / sum([1 / k for k in a])
def endswith(x, lst): """ Select longest suffix that matches x from provided list(lst) :param x: input string :param lst: suffixes to compare with :return: longest suffix that matches input string if available otherwise None """ longest_suffix = None for suffix in lst: if x.endswith(suffix): if longest_suffix is None or len(longest_suffix) < len(suffix): longest_suffix = suffix return longest_suffix def startswith(x, lst): """ Select longest prefix that matches x from provided list(lst) :param x: input string :param lst: prefixes to compare with :return: longest prefix that matches input string if available otherwise None """ longest_prefix = None for prefix in lst: if x.startswith(prefix): if longest_prefix is None or len(longest_prefix) < len(prefix): longest_prefix = prefix return longest_prefix def combine(cs, vs): """ Returns all possible combinations preserving the order :param cs: list of first strings :param vs: list of second strings :return: list of combined strings """ return [ci + vi for ci in cs for vi in vs] def harmonic_mean(*a): return len(a) / sum([1 / k for k in a])
#!/usr/bin/env python3 class Solution: def findCircleNum(self, M): sz, num = len(M), 0 marked = [False] * sz def dfs(p): marked[p] = True for q in range(sz): if M[p][q] and (not marked[q]): dfs(q) for p in range(sz): if not marked[p]: num += 1 dfs(p) return num sol = Solution() M = [[1,1,0], [1,1,0], [0,0,1]] M = [[1,1,0], [1,1,1], [0,1,1]] M = [[1]] print(sol.findCircleNum(M))
class Solution: def find_circle_num(self, M): (sz, num) = (len(M), 0) marked = [False] * sz def dfs(p): marked[p] = True for q in range(sz): if M[p][q] and (not marked[q]): dfs(q) for p in range(sz): if not marked[p]: num += 1 dfs(p) return num sol = solution() m = [[1, 1, 0], [1, 1, 0], [0, 0, 1]] m = [[1, 1, 0], [1, 1, 1], [0, 1, 1]] m = [[1]] print(sol.findCircleNum(M))
#prints all TRs in a table table = soup.findAll('table')[3] for row in table.findAll('tr'): print(row) #prints each TR and each child tag in TR table = soup.findAll('table')[3] for row in table.findAll('tr'): for line in row.findAll(): print(line)
table = soup.findAll('table')[3] for row in table.findAll('tr'): print(row) table = soup.findAll('table')[3] for row in table.findAll('tr'): for line in row.findAll(): print(line)
#1. Idea here is we want to return a list of strings which contains all of the root to leaf paths in the binary tree. #2. So initialize a list (path_list) then we are going to make a recursive call function. In the function we will pass the root of the binary tree and a empty string which we will modify and add node values as we recurse. #3. If the root is NOT none, we want to add that node value to our string, this will always begin from the ROOT of the binary tree. This will build our string of paths. #4. Once we come accross a leaf our second condition will be met thus we know that if we hit a leaf we have reached the END of the path, so we have our root to leaf path, hence we should add that path to our path_list, not path_list will be global for inner function. #5. Otherwise if we are not at a leaf, we still want to build our list and add the node value BUT we want to keep recursing down the tree until we hit the leaves, so we simply recurse left and right respectivley. #6. Rememeber to pass the path + -> as this will build the string according to the desired output. Done! def binaryTreePaths(self, root): path_list = [] def recurse(root, path): if root: path += str(root.val) if not root.left and not root.right: path_list.append(path) else: recurse(root.left, path + "->") recurse(root.right, path + "->") recurse(root, "") return path_list
def binary_tree_paths(self, root): path_list = [] def recurse(root, path): if root: path += str(root.val) if not root.left and (not root.right): path_list.append(path) else: recurse(root.left, path + '->') recurse(root.right, path + '->') recurse(root, '') return path_list
class NfDictionaryTryGetResults: def __init__( self): self.__key_exists = \ False self.__value = \ None def __get_key_exists( self) \ -> bool: key_exists = \ self.__key_exists return \ key_exists def __set_key_exists( self, key_exists: bool): self.__key_exists = \ key_exists def __get_value( self): value = \ self.__value return \ value def __set_value( self, value): self.__value = \ value key_exists = \ property( fget=__get_key_exists, fset=__set_key_exists) value = \ property( fget=__get_value, fset=__set_value)
class Nfdictionarytrygetresults: def __init__(self): self.__key_exists = False self.__value = None def __get_key_exists(self) -> bool: key_exists = self.__key_exists return key_exists def __set_key_exists(self, key_exists: bool): self.__key_exists = key_exists def __get_value(self): value = self.__value return value def __set_value(self, value): self.__value = value key_exists = property(fget=__get_key_exists, fset=__set_key_exists) value = property(fget=__get_value, fset=__set_value)
class Solution: """ @param nums: An integer array sorted in ascending order @param target: An integer @return: An integer """ def findPosition(self, nums, target): low = 0 high = len(nums) - 1 while low<=high : mid = (low+high) >> 1 if nums[mid]>target : high = mid-1 elif nums[mid]<target : low = mid+1 else : return mid return -1
class Solution: """ @param nums: An integer array sorted in ascending order @param target: An integer @return: An integer """ def find_position(self, nums, target): low = 0 high = len(nums) - 1 while low <= high: mid = low + high >> 1 if nums[mid] > target: high = mid - 1 elif nums[mid] < target: low = mid + 1 else: return mid return -1
# pylint: disable=missing-function-docstring, missing-module-docstring/ # coding: utf-8 x = 1 e1 = x + a e3 = f(x) + 1 # TODO e4 not working yet. we must get 2 errors #e4 = f(x,y) + 1
x = 1 e1 = x + a e3 = f(x) + 1
# -*- coding: utf-8 -*- """A Collection of Financial Calculators. This script contains a variety of financial calculator functions needed to determine loan qualifications. """ """Credit Score Filter. This script filters a bank list by the user's minimum credit score. """ def filter_credit_score(credit_score, bank_list): """Filters the bank list by the mininim allowed credit score set by the bank. Args: credit_score (int): The applicant's credit score. bank_list (list of lists): The available bank loans. Returns: A list of qualifying bank loans. """ credit_score_approval_list = [] for bank in bank_list: if credit_score >= int(bank[4]): credit_score_approval_list.append(bank) return credit_score_approval_list """Debt to Income Filter. This script filters the bank list by the applicant's maximum debt-to-income ratio. """ def filter_debt_to_income(monthly_debt_ratio, bank_list): """Filters the bank list by the maximum debt-to-income ratio allowed by the bank. Args: monthly_debt_ratio (float): The applicant's monthly debt ratio. bank_list (list of lists): The available bank loans. Returns: A list of qualifying bank loans. """ debt_to_income_approval_list = [] for bank in bank_list: if monthly_debt_ratio <= float(bank[3]): debt_to_income_approval_list.append(bank) return debt_to_income_approval_list """Loan to Value Filter. This script filters the bank list by the applicant's maximum home loan to home value ratio. """ def filter_loan_to_value(loan_to_value_ratio, bank_list): """Filters the bank list by the maximum loan to value ratio. Args: loan_to_value_ratio (float): The applicant's loan to value ratio. bank_list (list of lists): The available bank loans. Returns: A list of qualifying bank loans. """ loan_to_value_approval_list = [] for bank in bank_list: if loan_to_value_ratio <= float(bank[2]): loan_to_value_approval_list.append(bank) return loan_to_value_approval_list """Max Loan Size Filter. This script filters the bank list by comparing the user's loan value against the bank's maximum loan size. """ def filter_max_loan_size(loan_amount, bank_list): """Filters the bank list by the maximum allowed loan amount. Args: loan_amount (int): The requested loan amount. bank_list (list of lists): The available bank loans. Returns: A list of qualifying bank loans. """ loan_size_approval_list = [] for bank in bank_list: if loan_amount <= int(bank[1]): loan_size_approval_list.append(bank) return loan_size_approval_list
"""A Collection of Financial Calculators. This script contains a variety of financial calculator functions needed to determine loan qualifications. """ "Credit Score Filter.\n\nThis script filters a bank list by the user's minimum credit score.\n\n" def filter_credit_score(credit_score, bank_list): """Filters the bank list by the mininim allowed credit score set by the bank. Args: credit_score (int): The applicant's credit score. bank_list (list of lists): The available bank loans. Returns: A list of qualifying bank loans. """ credit_score_approval_list = [] for bank in bank_list: if credit_score >= int(bank[4]): credit_score_approval_list.append(bank) return credit_score_approval_list "Debt to Income Filter.\n\nThis script filters the bank list by the applicant's\nmaximum debt-to-income ratio.\n\n" def filter_debt_to_income(monthly_debt_ratio, bank_list): """Filters the bank list by the maximum debt-to-income ratio allowed by the bank. Args: monthly_debt_ratio (float): The applicant's monthly debt ratio. bank_list (list of lists): The available bank loans. Returns: A list of qualifying bank loans. """ debt_to_income_approval_list = [] for bank in bank_list: if monthly_debt_ratio <= float(bank[3]): debt_to_income_approval_list.append(bank) return debt_to_income_approval_list "Loan to Value Filter.\n\nThis script filters the bank list by the applicant's maximum home loan\nto home value ratio.\n\n" def filter_loan_to_value(loan_to_value_ratio, bank_list): """Filters the bank list by the maximum loan to value ratio. Args: loan_to_value_ratio (float): The applicant's loan to value ratio. bank_list (list of lists): The available bank loans. Returns: A list of qualifying bank loans. """ loan_to_value_approval_list = [] for bank in bank_list: if loan_to_value_ratio <= float(bank[2]): loan_to_value_approval_list.append(bank) return loan_to_value_approval_list "Max Loan Size Filter.\n\nThis script filters the bank list by comparing the user's loan value\nagainst the bank's maximum loan size.\n\n" def filter_max_loan_size(loan_amount, bank_list): """Filters the bank list by the maximum allowed loan amount. Args: loan_amount (int): The requested loan amount. bank_list (list of lists): The available bank loans. Returns: A list of qualifying bank loans. """ loan_size_approval_list = [] for bank in bank_list: if loan_amount <= int(bank[1]): loan_size_approval_list.append(bank) return loan_size_approval_list
# -*- coding: utf-8 -*- def command(): return "edit-instance-vmware" def init_argument(parser): parser.add_argument("--instance-no", required=True) parser.add_argument("--instance-type", required=True) parser.add_argument("--key-name", required=True) parser.add_argument("--compute-resource", required=True) parser.add_argument("--is-static-ip", required=True) parser.add_argument("--ip-address", required=False) parser.add_argument("--subnet-mask", required=False) parser.add_argument("--default-gateway", required=False) parser.add_argument("--comment", required=False) parser.add_argument("--root-size", required=False) def execute(requester, args): instance_no = args.instance_no instance_type = args.instance_type key_name = args.key_name compute_resource = args.compute_resource is_static_ip = args.is_static_ip ip_address = args.ip_address subnet_mask = args.subnet_mask default_gateway = args.default_gateway comment = args.comment root_size = args.root_size parameters = {} parameters["InstanceNo"] = instance_no parameters["InstanceType"] = instance_type parameters["KeyName"] = key_name parameters["ComputeResource"] = compute_resource parameters["IsStaticIp"] = is_static_ip if (ip_address != None): parameters["IpAddress"] = ip_address if (subnet_mask != None): parameters["SubnetMask"] = subnet_mask if (default_gateway != None): parameters["DefaultGateway"] = default_gateway if (comment != None): parameters["Comment"] = comment if (root_size != None): parameters["RootSize"] = root_size return requester.execute("/EditInstanceVmware", parameters)
def command(): return 'edit-instance-vmware' def init_argument(parser): parser.add_argument('--instance-no', required=True) parser.add_argument('--instance-type', required=True) parser.add_argument('--key-name', required=True) parser.add_argument('--compute-resource', required=True) parser.add_argument('--is-static-ip', required=True) parser.add_argument('--ip-address', required=False) parser.add_argument('--subnet-mask', required=False) parser.add_argument('--default-gateway', required=False) parser.add_argument('--comment', required=False) parser.add_argument('--root-size', required=False) def execute(requester, args): instance_no = args.instance_no instance_type = args.instance_type key_name = args.key_name compute_resource = args.compute_resource is_static_ip = args.is_static_ip ip_address = args.ip_address subnet_mask = args.subnet_mask default_gateway = args.default_gateway comment = args.comment root_size = args.root_size parameters = {} parameters['InstanceNo'] = instance_no parameters['InstanceType'] = instance_type parameters['KeyName'] = key_name parameters['ComputeResource'] = compute_resource parameters['IsStaticIp'] = is_static_ip if ip_address != None: parameters['IpAddress'] = ip_address if subnet_mask != None: parameters['SubnetMask'] = subnet_mask if default_gateway != None: parameters['DefaultGateway'] = default_gateway if comment != None: parameters['Comment'] = comment if root_size != None: parameters['RootSize'] = root_size return requester.execute('/EditInstanceVmware', parameters)
############################################################################## # Documentation/conf.py # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The # ASF licenses this file to you 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. # ############################################################################## # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # # import os # import sys # sys.path.insert(0, os.path.abspath('.')) # -- Project information ----------------------------------------------------- project = 'NuttX' copyright = '2020, The Apache Software Foundation' author = 'NuttX community' version = release = 'latest' # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ "sphinx_rtd_theme", "m2r2", 'sphinx.ext.autosectionlabel', 'sphinx.ext.todo', 'sphinx_tabs.tabs' ] source_suffix = [ '.rst', '.md' ] todo_include_todos = True autosectionlabel_prefix_document = True # do not set Python as primary domain for code blocks highlight_language = "none" primary_domain = None # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # list of documentation versions to offer (besides latest) html_context = dict() html_context['nuttx_versions'] = ['latest'] # TODO: append other options using releases detected from git (or maybe just # a few hand-selected ones, or maybe just a "stable" option) # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'sphinx_rtd_theme' html_show_sphinx = False html_theme_options = { 'prev_next_buttons_location': None } # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] html_css_files = [ 'custom.css' ] html_show_license = True html_logo = '_static/NuttX.png' html_favicon = '_static/favicon.ico' today_fmt = '%d %B %y at %H:%M' c_id_attributes = [ 'FAR', 'CODE', 'noreturn_function' ]
project = 'NuttX' copyright = '2020, The Apache Software Foundation' author = 'NuttX community' version = release = 'latest' extensions = ['sphinx_rtd_theme', 'm2r2', 'sphinx.ext.autosectionlabel', 'sphinx.ext.todo', 'sphinx_tabs.tabs'] source_suffix = ['.rst', '.md'] todo_include_todos = True autosectionlabel_prefix_document = True highlight_language = 'none' primary_domain = None templates_path = ['_templates'] exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] html_context = dict() html_context['nuttx_versions'] = ['latest'] html_theme = 'sphinx_rtd_theme' html_show_sphinx = False html_theme_options = {'prev_next_buttons_location': None} html_static_path = ['_static'] html_css_files = ['custom.css'] html_show_license = True html_logo = '_static/NuttX.png' html_favicon = '_static/favicon.ico' today_fmt = '%d %B %y at %H:%M' c_id_attributes = ['FAR', 'CODE', 'noreturn_function']
config = { 'Department_level_configs': { 'Department_Name': 'Data Analisys Department', 'Department_Short_Name': 'DATA' } }
config = {'Department_level_configs': {'Department_Name': 'Data Analisys Department', 'Department_Short_Name': 'DATA'}}
""" At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you, and order one at a time (in the order specified by bills). Each customer will only buy one lemonade and pay with either a $5, $10, or $20 bill. You must provide the correct change to each customer, so that the net transaction is that the customer pays $5. Note that you don't have any change in hand at first. Return true if and only if you can provide every customer with correct change. Example 1: Input: [5,5,5,10,20] Output: true Explanation: From the first 3 customers, we collect three $5 bills in order. From the fourth customer, we collect a $10 bill and give back a $5. From the fifth customer, we give a $10 bill and a $5 bill. Since all customers got correct change, we output true. Example 2: Input: [5,5,10] Output: true Example 3: Input: [10,10] Output: false Example 4: Input: [5,5,10,10,20] Output: false Explanation: From the first two customers in order, we collect two $5 bills. For the next two customers in order, we collect a $10 bill and give back a $5 bill. For the last customer, we can't give change of $15 back because we only have two $10 bills. Since not every customer received correct change, the answer is false. Note: 0 <= bills.length <= 10000 bills[i] will be either 5, 10, or 20. """ class Solution(object): def lemonadeChange(self, bills): """ :type bills: List[int] :rtype: bool """ """ Method 1: * Given: Lemonade Cost = $5 Every customer only buys 1 lemonade Customers pay $5, $10 or $20 We must give back the correct change We initially start with zero change * Initialize three counters, 5 10 and 20 * IF the customer pays 5, then no sweat! Increment the counter * IF the customer pays 10, then we must give back a 5 * IF the customer pays 20, then we must give back a 5 and a 10 Your runtime beats 79.46 % of python submissions. """ count_5 = 0 count_10 = 0 count_20 = 0 for ele in bills: if ele == 5: count_5 += 1 if ele == 10: if count_5: count_5 -= 1 count_10 += 1 else: return False if ele == 20: if count_5 and count_10: count_5 -= 1 count_10 -= 1 count_20 += 1 elif count_5 > 3: count_5 -= 3 count_20 += 1 else: return False return True
""" At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you, and order one at a time (in the order specified by bills). Each customer will only buy one lemonade and pay with either a $5, $10, or $20 bill. You must provide the correct change to each customer, so that the net transaction is that the customer pays $5. Note that you don't have any change in hand at first. Return true if and only if you can provide every customer with correct change. Example 1: Input: [5,5,5,10,20] Output: true Explanation: From the first 3 customers, we collect three $5 bills in order. From the fourth customer, we collect a $10 bill and give back a $5. From the fifth customer, we give a $10 bill and a $5 bill. Since all customers got correct change, we output true. Example 2: Input: [5,5,10] Output: true Example 3: Input: [10,10] Output: false Example 4: Input: [5,5,10,10,20] Output: false Explanation: From the first two customers in order, we collect two $5 bills. For the next two customers in order, we collect a $10 bill and give back a $5 bill. For the last customer, we can't give change of $15 back because we only have two $10 bills. Since not every customer received correct change, the answer is false. Note: 0 <= bills.length <= 10000 bills[i] will be either 5, 10, or 20. """ class Solution(object): def lemonade_change(self, bills): """ :type bills: List[int] :rtype: bool """ '\n Method 1:\n\n * Given:\n Lemonade Cost = $5\n Every customer only buys 1 lemonade\n Customers pay $5, $10 or $20\n We must give back the correct change\n We initially start with zero change\n\n * Initialize three counters, 5 10 and 20\n\n * IF the customer pays 5, then no sweat!\n Increment the counter\n\n * IF the customer pays 10, then we must\n give back a 5\n\n * IF the customer pays 20, then we must\n give back a 5 and a 10\n\n Your runtime beats 79.46 % of python submissions.\n ' count_5 = 0 count_10 = 0 count_20 = 0 for ele in bills: if ele == 5: count_5 += 1 if ele == 10: if count_5: count_5 -= 1 count_10 += 1 else: return False if ele == 20: if count_5 and count_10: count_5 -= 1 count_10 -= 1 count_20 += 1 elif count_5 > 3: count_5 -= 3 count_20 += 1 else: return False return True
# coding: utf-8 class UtgError(Exception): MSG = None def __init__(self, **kwargs): super(UtgError, self).__init__(self.MSG % kwargs) self.arguments = kwargs class WordsError(UtgError): pass class WrongFormsNumberError(WordsError): MSG = 'constuctor of word receive wrong number of forms (%(wrong_number)s intead of %(expected_number)s), forms are: %(forms)s' class DuplicateWordError(WordsError): MSG = 'duplicate word in dictionary, type: %(type)s, normal form: %(normal_form)s' class UnknownVerboseIdError(WordsError): MSG = 'Unknown verbose id: %(verbose_id)s' class ExternalDependecyNotFoundError(WordsError): MSG = 'External dependency not found: %(dependency)s' class WrongDependencyFormatError(WordsError): MSG = 'wrong dependency format: %(dependency)s' class NoWordsFoundError(WordsError): MSG = 'no words found for text="%(text)s"' class MoreThenOneWordFoundError(WordsError): MSG = 'more then one word found for text="%(text)s" and type=%(type)s' class LexiconError(UtgError): pass class UnknownLexiconKeyError(LexiconError): MSG = 'unknown lexicon key: %(key)s' class NoTemplatesWithSpecifiedRestrictions(LexiconError): MSG = 'no templates with specified key: %(key)s and restrictions: %(restrictions)r' class TransformatorsError(UtgError): pass class UnknownIntegerFormError(TransformatorsError): MSG = 'unknown integer form: %(form)s'
class Utgerror(Exception): msg = None def __init__(self, **kwargs): super(UtgError, self).__init__(self.MSG % kwargs) self.arguments = kwargs class Wordserror(UtgError): pass class Wrongformsnumbererror(WordsError): msg = 'constuctor of word receive wrong number of forms (%(wrong_number)s intead of %(expected_number)s), forms are: %(forms)s' class Duplicateworderror(WordsError): msg = 'duplicate word in dictionary, type: %(type)s, normal form: %(normal_form)s' class Unknownverboseiderror(WordsError): msg = 'Unknown verbose id: %(verbose_id)s' class Externaldependecynotfounderror(WordsError): msg = 'External dependency not found: %(dependency)s' class Wrongdependencyformaterror(WordsError): msg = 'wrong dependency format: %(dependency)s' class Nowordsfounderror(WordsError): msg = 'no words found for text="%(text)s"' class Morethenonewordfounderror(WordsError): msg = 'more then one word found for text="%(text)s" and type=%(type)s' class Lexiconerror(UtgError): pass class Unknownlexiconkeyerror(LexiconError): msg = 'unknown lexicon key: %(key)s' class Notemplateswithspecifiedrestrictions(LexiconError): msg = 'no templates with specified key: %(key)s and restrictions: %(restrictions)r' class Transformatorserror(UtgError): pass class Unknownintegerformerror(TransformatorsError): msg = 'unknown integer form: %(form)s'
''' Abstract class of healthcheck. There is only one method to implement, that determines state of Vm or its underlying services. Initialization - consider following config: :: healthcheck: driver: SomeHC param1: AAAA param2: BBBB some_x: CCC All params will be passed as config dict to the driver init: ''' class AbstractHealthcheck: def __init__(self, config): pass async def is_healthy(self, vm): ''' Checks that is a given vm is healthy :arg vmshepherd.iaas.Vm vm: Vm object Returns boolean - True means is healthy, False means unhealthy. ''' raise NotImplementedError
""" Abstract class of healthcheck. There is only one method to implement, that determines state of Vm or its underlying services. Initialization - consider following config: :: healthcheck: driver: SomeHC param1: AAAA param2: BBBB some_x: CCC All params will be passed as config dict to the driver init: """ class Abstracthealthcheck: def __init__(self, config): pass async def is_healthy(self, vm): """ Checks that is a given vm is healthy :arg vmshepherd.iaas.Vm vm: Vm object Returns boolean - True means is healthy, False means unhealthy. """ raise NotImplementedError
# Solution #----------------------------------------------------# def prepend(self, value): """ Prepend a node to the beginning of the list """ if self.head is None: self.head = Node(value) return new_head = Node(value) new_head.next = self.head self.head = new_head #----------------------------------------------------# def append(self, value): """ Append a node to the end of the list """ # Here I'm not keeping track of the tail. It's possible to store the tail # as well as the head, which makes appending like this an O(1) operation. # Otherwise, it's an O(N) operation as you have to iterate through the # entire list to add a new tail. if self.head is None: self.head = Node(value) return node = self.head while node.next: node = node.next node.next = Node(value) #----------------------------------------------------# def search(self, value): """ Search the linked list for a node with the requested value and return the node. """ if self.head is None: return None node = self.head while node: if node.value == value: return node node = node.next raise ValueError("Value not found in the list.") #----------------------------------------------------# def remove(self, value): """ Delete the first node with the desired data. """ if self.head is None: return if self.head.value == value: self.head = self.head.next return node = self.head while node.next: if node.next.value == value: node.next = node.next.next return node = node.next raise ValueError("Value not found in the list.") #----------------------------------------------------# def pop(self): """ Return the first node's value and remove it from the list. """ if self.head is None: return None node = self.head self.head = self.head.next return node.value #----------------------------------------------------# def insert(self, value, pos): """ Insert value at pos position in the list. If pos is larger than the length of the list, append to the end of the list. """ # If the list is empty if self.head is None: self.head = Node(value) return if pos == 0: self.prepend(value) return index = 0 node = self.head while node.next and index <= pos: if (pos - 1) == index: new_node = Node(value) new_node.next = node.next node.next = new_node return index += 1 node = node.next else: self.append(value) #----------------------------------------------------# def size(self): """ Return the size or length of the linked list. """ size = 0 node = self.head while node: size += 1 node = node.next return size #----------------------------------------------------# def to_list(self): out = [] node = self.head while node: out.append(node.value) node = node.next return out
def prepend(self, value): """ Prepend a node to the beginning of the list """ if self.head is None: self.head = node(value) return new_head = node(value) new_head.next = self.head self.head = new_head def append(self, value): """ Append a node to the end of the list """ if self.head is None: self.head = node(value) return node = self.head while node.next: node = node.next node.next = node(value) def search(self, value): """ Search the linked list for a node with the requested value and return the node. """ if self.head is None: return None node = self.head while node: if node.value == value: return node node = node.next raise value_error('Value not found in the list.') def remove(self, value): """ Delete the first node with the desired data. """ if self.head is None: return if self.head.value == value: self.head = self.head.next return node = self.head while node.next: if node.next.value == value: node.next = node.next.next return node = node.next raise value_error('Value not found in the list.') def pop(self): """ Return the first node's value and remove it from the list. """ if self.head is None: return None node = self.head self.head = self.head.next return node.value def insert(self, value, pos): """ Insert value at pos position in the list. If pos is larger than the length of the list, append to the end of the list. """ if self.head is None: self.head = node(value) return if pos == 0: self.prepend(value) return index = 0 node = self.head while node.next and index <= pos: if pos - 1 == index: new_node = node(value) new_node.next = node.next node.next = new_node return index += 1 node = node.next else: self.append(value) def size(self): """ Return the size or length of the linked list. """ size = 0 node = self.head while node: size += 1 node = node.next return size def to_list(self): out = [] node = self.head while node: out.append(node.value) node = node.next return out
class State(object): def __init__(self): print("Processing current state: ", str(self)) def on_event(self, event): """ Handle events that are delegated to this State. """ pass def __repr__(self): """ Leverages the __str__ method to describe the State. """ return self.__str__() def __str__(self): """ Returns the name of the State. """ return self.__class__.__name___
class State(object): def __init__(self): print('Processing current state: ', str(self)) def on_event(self, event): """ Handle events that are delegated to this State. """ pass def __repr__(self): """ Leverages the __str__ method to describe the State. """ return self.__str__() def __str__(self): """ Returns the name of the State. """ return self.__class__.__name___
lines = int(input("Please enter number of lines : \n")) ln = 1 while ln <= lines: col = 1 while col <= lines: if ln == 1 or col == 1 or col == lines or ln == lines: print('*', end='') else: print(' ', end = '') col += 1 print() ln += 1
lines = int(input('Please enter number of lines : \n')) ln = 1 while ln <= lines: col = 1 while col <= lines: if ln == 1 or col == 1 or col == lines or (ln == lines): print('*', end='') else: print(' ', end='') col += 1 print() ln += 1
# Valid API version in URL path: YYYY-MM or unstable VERSION_PATTERN = r"([0-9]{4}-[0-9]{2})|unstable" # /oauth/authorize, /oauth/access_token do not require authentication NOT_AUTHABLE_PATTERN = r"\/oauth\/(authorize|access_token)" # /oauth/access_scopes does not require versioned API path NOT_VERSIONABLE_PATTERN = r"\/(oauth\/access_scopes)" # For extracting next/prev link header on REST API calls LINK_PATTERN = r"<.*?page_info=([a-zA-Z0-9\-_]+).*?>; rel=\"(next|previous)\"" # Header supplied by Shopify when rate limit is hit RETRY_HEADER = "retry-after" # Header supplied by Shopify for REST API calls, used by LINK_PATTERN LINK_HEADER = "link" # Header to send for public API calls ACCESS_TOKEN_HEADER = "x-shopify-access-token" # Default API version DEFAULT_VERSION = "2020-04" # Default API mode DEFAULT_MODE = "public" # Alternate API mode ALT_MODE = "private" # One second in milliseconds ONE_SECOND = 1000 # REST API type REST = "rest" # GraphQL API type GRAPHQL = "graphql"
version_pattern = '([0-9]{4}-[0-9]{2})|unstable' not_authable_pattern = '\\/oauth\\/(authorize|access_token)' not_versionable_pattern = '\\/(oauth\\/access_scopes)' link_pattern = '<.*?page_info=([a-zA-Z0-9\\-_]+).*?>; rel=\\"(next|previous)\\"' retry_header = 'retry-after' link_header = 'link' access_token_header = 'x-shopify-access-token' default_version = '2020-04' default_mode = 'public' alt_mode = 'private' one_second = 1000 rest = 'rest' graphql = 'graphql'
def iterate(pop): p = pop.copy() for i in range(8): p[i] = pop[i + 1] p[8] = pop[0] p[6] += pop[0] return p pop = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0} population = [int(n) for n in open('input.txt', 'r').readline().split(',')] for fish in population: pop[fish] += 1 for i in range(256): pop = iterate(pop) print(sum(pop.values()))
def iterate(pop): p = pop.copy() for i in range(8): p[i] = pop[i + 1] p[8] = pop[0] p[6] += pop[0] return p pop = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0} population = [int(n) for n in open('input.txt', 'r').readline().split(',')] for fish in population: pop[fish] += 1 for i in range(256): pop = iterate(pop) print(sum(pop.values()))
for c in range(6, 0,-1): print(c) n1 = int(input('Inicio: ')) n2 = int(input('Fim: ')) n3 = int(input('Passo: ')) for c in range(n1, n2 + 1, n3): print(c)
for c in range(6, 0, -1): print(c) n1 = int(input('Inicio: ')) n2 = int(input('Fim: ')) n3 = int(input('Passo: ')) for c in range(n1, n2 + 1, n3): print(c)
# # PySNMP MIB module SLAPM-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SLAPM-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:06:04 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, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, SingleValueConstraint, ValueSizeConstraint, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "SingleValueConstraint", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsIntersection") SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup") TimeTicks, MibIdentifier, Unsigned32, IpAddress, Gauge32, experimental, iso, NotificationType, Counter32, Bits, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter64, ObjectIdentity, Integer32, ModuleIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "MibIdentifier", "Unsigned32", "IpAddress", "Gauge32", "experimental", "iso", "NotificationType", "Counter32", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter64", "ObjectIdentity", "Integer32", "ModuleIdentity") TextualConvention, TestAndIncr, DateAndTime, DisplayString, RowStatus = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "TestAndIncr", "DateAndTime", "DisplayString", "RowStatus") slapmMIB = ModuleIdentity((1, 3, 6, 1, 3, 88)) slapmMIB.setRevisions(('2000-01-24 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: slapmMIB.setRevisionsDescriptions(('This version published as RFC 2758.',)) if mibBuilder.loadTexts: slapmMIB.setLastUpdated('200001240000Z') if mibBuilder.loadTexts: slapmMIB.setOrganization('International Business Machines Corp.') if mibBuilder.loadTexts: slapmMIB.setContactInfo('Kenneth White International Business Machines Corporation Network Computing Software Division Research Triangle Park, NC, USA E-mail: wkenneth@us.ibm.com') if mibBuilder.loadTexts: slapmMIB.setDescription('The Service Level Agreement Performance Monitoring MIB (SLAPM-MIB) provides data collection and monitoring capabilities for Service Level Agreements (SLAs) policy definitions.') class SlapmNameType(SnmpAdminString): description = 'The textual convention for naming entities within this MIB. The actual contents of an object defined using this textual convention should consist of the distinguished name portion of an name. This is usually the right-most portion of the name. This convention is necessary, since names within this MIB can be used as index items and an instance identifier is limited to 128 subidentifiers. This textual convention has been deprecated. All of the tables defined within this MIB that use this textual convention have been deprecated as well since the method of using a portion of the name (either of a policy definition or of a traffic profile) has been replaced by using an Unsigned32 index. The new slapmPolicyNameTable would then map the Unsigned32 index to a real name.' status = 'deprecated' subtypeSpec = SnmpAdminString.subtypeSpec + ValueSizeConstraint(0, 32) class SlapmStatus(TextualConvention, Bits): description = 'The textual convention for defining the various slapmPRMonTable (or old slapmPolicyMonitorTable) and the slapmSubcomponentTable states for actual policy rule traffic monitoring.' status = 'current' namedValues = NamedValues(("slaMinInRateNotAchieved", 0), ("slaMaxInRateExceeded", 1), ("slaMaxDelayExceeded", 2), ("slaMinOutRateNotAchieved", 3), ("slaMaxOutRateExceeded", 4), ("monitorMinInRateNotAchieved", 5), ("monitorMaxInRateExceeded", 6), ("monitorMaxDelayExceeded", 7), ("monitorMinOutRateNotAchieved", 8), ("monitorMaxOutRateExceeded", 9)) class SlapmPolicyRuleName(TextualConvention, OctetString): description = 'To facilitate internationalization, this TC represents information taken from the ISO/IEC IS 10646-1 character set, encoded as an octet string using the UTF-8 character encoding scheme described in RFC 2044. For strings in 7-bit US-ASCII, there is no impact since the UTF-8 representation is identical to the US-ASCII encoding.' status = 'current' displayHint = '1024t' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(0, 1024) slapmNotifications = MibIdentifier((1, 3, 6, 1, 3, 88, 0)) slapmObjects = MibIdentifier((1, 3, 6, 1, 3, 88, 1)) slapmConformance = MibIdentifier((1, 3, 6, 1, 3, 88, 2)) slapmBaseObjects = MibIdentifier((1, 3, 6, 1, 3, 88, 1, 1)) slapmSpinLock = MibScalar((1, 3, 6, 1, 3, 88, 1, 1, 1), TestAndIncr()).setMaxAccess("readwrite") if mibBuilder.loadTexts: slapmSpinLock.setStatus('current') if mibBuilder.loadTexts: slapmSpinLock.setDescription('An advisory lock used to allow cooperating applications to coordinate their use of the contents of this MIB. This typically occurs when an application seeks to create an new entry or alter an existing entry in slapmPRMonTable (or old slapmPolicyMonitorTable). A management implementation MAY utilize the slapmSpinLock to serialize its changes or additions. This usage is not required. However, slapmSpinLock MUST be supported by agent implementations.') slapmPolicyCountQueries = MibScalar((1, 3, 6, 1, 3, 88, 1, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyCountQueries.setStatus('current') if mibBuilder.loadTexts: slapmPolicyCountQueries.setDescription('The total number of times that a policy lookup occurred with respect to a policy agent. This is the number of times that a reference was made to a policy definition at a system and includes the number of times that a policy repository was accessed, slapmPolicyCountAccesses. The object slapmPolicyCountAccesses should be less than slapmPolicyCountQueries when policy definitions are cached at a system.') slapmPolicyCountAccesses = MibScalar((1, 3, 6, 1, 3, 88, 1, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyCountAccesses.setStatus('current') if mibBuilder.loadTexts: slapmPolicyCountAccesses.setDescription('Total number of times that a policy repository was accessed with respect to a policy agent. The value of this object should be less than slapmPolicyCountQueries, since typically policy entries are cached to minimize repository accesses.') slapmPolicyCountSuccessAccesses = MibScalar((1, 3, 6, 1, 3, 88, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyCountSuccessAccesses.setStatus('current') if mibBuilder.loadTexts: slapmPolicyCountSuccessAccesses.setDescription('Total number of successful policy repository accesses with respect to a policy agent.') slapmPolicyCountNotFounds = MibScalar((1, 3, 6, 1, 3, 88, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyCountNotFounds.setStatus('current') if mibBuilder.loadTexts: slapmPolicyCountNotFounds.setDescription('Total number of policy repository accesses, with respect to a policy agent, that resulted in an entry not being located.') slapmPolicyPurgeTime = MibScalar((1, 3, 6, 1, 3, 88, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3600)).clone(900)).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: slapmPolicyPurgeTime.setStatus('current') if mibBuilder.loadTexts: slapmPolicyPurgeTime.setDescription('The purpose of this object is to define the amount of time (in seconds) to wait before removing an slapmPolicyRuleStatsEntry (or old slapmPolicyStatsEntry) when a system detects that the associated policy definition has been deleted. This gives any polling management applications time to complete their last poll before an entry is removed. An slapmPolicyRuleStatsEntry (or old slapmPolicyStatsEntry) enters the deleteNeeded(3) state via slapmPolicyRuleStatsOperStatus (or old slapmPolicyStatsOperStatus) when a system first detects that the entry needs to be removed. Once slapmPolicyPurgeTime has expired for an entry in deleteNeeded(3) state it is removed a long with any dependent slapmPRMonTable (or slapmPolicyMonitorTable) entries. A value of 0 for this option disables this function and results in the automatic purging of slapmPRMonTable (or slapmPolicyTable) entries upon transition into deleteNeeded(3) state. A slapmPolicyRuleDeleted (or slapmPolicyProfileDeleted) notification is sent when an slapmPolicyRuleStatsEntry (or slapmPolicyStatsEntry) is removed. Dependent slapmPRMonTable (or slapmPolicyMonitorTable) deletion results in a slapmPolicyRuleMonDeleted (or slapmPolicyMonitorDeleted) notification being sent. These notifications are suppressed if the value of slapmPolicyTrapEnable is disabled(2).') slapmPolicyTrapEnable = MibScalar((1, 3, 6, 1, 3, 88, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite") if mibBuilder.loadTexts: slapmPolicyTrapEnable.setStatus('current') if mibBuilder.loadTexts: slapmPolicyTrapEnable.setDescription('Indicates whether slapmPolicyRuleDeleted and slapmPolicyRuleMonDeleted (or slapmPolicyProfileDeleted and slapmPolicyMonitorDeleted) notifications should be generated by this system.') slapmPolicyTrapFilter = MibScalar((1, 3, 6, 1, 3, 88, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 64)).clone(3)).setUnits('intervals').setMaxAccess("readwrite") if mibBuilder.loadTexts: slapmPolicyTrapFilter.setStatus('current') if mibBuilder.loadTexts: slapmPolicyTrapFilter.setDescription('The purpose of this object is to suppress unnecessary slapmSubcMonitorNotOkay (or slapmSubcomponentMonitoredEventNotAchieved), for example, notifications. Basically, a monitored event has to not meet its SLA requirement for the number of consecutive intervals indicated by the value of this object.') slapmTableObjects = MibIdentifier((1, 3, 6, 1, 3, 88, 1, 2)) slapmPolicyStatsTable = MibTable((1, 3, 6, 1, 3, 88, 1, 2, 1), ) if mibBuilder.loadTexts: slapmPolicyStatsTable.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsTable.setDescription('Provides statistics on all policies known at a system. This table has been deprecated and replaced with the slapmPolicyRuleStatsTable. Older implementations of this MIB are expected to continue their support of this table.') slapmPolicyStatsEntry = MibTableRow((1, 3, 6, 1, 3, 88, 1, 2, 1, 1), ).setIndexNames((0, "SLAPM-MIB", "slapmPolicyStatsSystemAddress"), (0, "SLAPM-MIB", "slapmPolicyStatsPolicyName"), (0, "SLAPM-MIB", "slapmPolicyStatsTrafficProfileName")) if mibBuilder.loadTexts: slapmPolicyStatsEntry.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsEntry.setDescription('Defines an entry in the slapmPolicyStatsTable. This table defines a set of statistics that is kept on a per system, policy and traffic profile basis. A policy can be defined to contain multiple traffic profiles that map to a single action. Entries in this table are not created or deleted via SNMP but reflect the set of policy definitions known at a system.') slapmPolicyStatsSystemAddress = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 1), OctetString().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), ))) if mibBuilder.loadTexts: slapmPolicyStatsSystemAddress.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsSystemAddress.setDescription('Address of a system that an Policy definition relates to. A zero length octet string must be used to indicate that only a single system is being represented. Otherwise, the length of the octet string must be 4 for an ipv4 address or 16 for an ipv6 address.') slapmPolicyStatsPolicyName = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 2), SlapmNameType()) if mibBuilder.loadTexts: slapmPolicyStatsPolicyName.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsPolicyName.setDescription('Policy name that this entry relates to.') slapmPolicyStatsTrafficProfileName = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 3), SlapmNameType()) if mibBuilder.loadTexts: slapmPolicyStatsTrafficProfileName.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsTrafficProfileName.setDescription('The name of a traffic profile that is associated with a policy.') slapmPolicyStatsOperStatus = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("inactive", 1), ("active", 2), ("deleteNeeded", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyStatsOperStatus.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsOperStatus.setDescription('The state of a policy entry: inactive(1) - An policy entry was either defined by local system definition or discovered via a directory search but has not been activated (not currently being used). active(2) - Policy entry is being used to affect traffic flows. deleteNeeded(3) - Either though local implementation dependent methods or by discovering that the directory entry corresponding to this table entry no longer exists and slapmPolicyPurgeTime needs to expire before attempting to remove the corresponding slapmPolicyStatsEntry and any dependent slapmPolicyMonitor table entries. Note: a policy traffic profile in a state other than active(1) is not being used to affect traffic flows.') slapmPolicyStatsActiveConns = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 5), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyStatsActiveConns.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsActiveConns.setDescription('The number of active TCP connections that are affected by the corresponding policy entry.') slapmPolicyStatsTotalConns = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyStatsTotalConns.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsTotalConns.setDescription('The number of total TCP connections that are affected by the corresponding policy entry.') slapmPolicyStatsFirstActivated = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 7), DateAndTime().clone(hexValue="0000000000000000")).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyStatsFirstActivated.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsFirstActivated.setDescription('The timestamp for when the corresponding policy entry is activated. The value of this object serves as the discontinuity event indicator when polling entries in this table. The value of this object is updated on transition of slapmPolicyStatsOperStatus into the active(2) state.') slapmPolicyStatsLastMapping = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 8), DateAndTime().clone(hexValue="0000000000000000")).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyStatsLastMapping.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsLastMapping.setDescription('The timestamp for when the last time that the associated policy entry was used.') slapmPolicyStatsInOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyStatsInOctets.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsInOctets.setDescription('The number of octets that was received by IP for an entity that map to this entry.') slapmPolicyStatsOutOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyStatsOutOctets.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsOutOctets.setDescription('The number of octets that was transmitted by IP for an entity that map to this entry.') slapmPolicyStatsConnectionLimit = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyStatsConnectionLimit.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsConnectionLimit.setDescription('The limit for the number of active TCP connections that are allowed for this policy definition. A value of zero for this object implies that a connection limit has not been specified.') slapmPolicyStatsCountAccepts = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyStatsCountAccepts.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsCountAccepts.setDescription("This counter is incremented when a policy action's Permission value is set to Accept and a session (TCP connection) is accepted.") slapmPolicyStatsCountDenies = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyStatsCountDenies.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsCountDenies.setDescription("This counter is incremented when a policy action's Permission value is set to Deny and a session is denied, or when a session (TCP connection) is rejected due to a policy's connection limit (slapmPolicyStatsConnectLimit) being reached.") slapmPolicyStatsInDiscards = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyStatsInDiscards.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsInDiscards.setDescription('This counter counts the number of in octets discarded. This occurs when an error is detected. Examples of this are buffer overflow, checksum error, or bad packet format.') slapmPolicyStatsOutDiscards = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyStatsOutDiscards.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsOutDiscards.setDescription('This counter counts the number of out octets discarded. Examples of this are buffer overflow, checksum error, or bad packet format.') slapmPolicyStatsInPackets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyStatsInPackets.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsInPackets.setDescription('This counter counts the number of in packets received that relate to this policy entry from IP.') slapmPolicyStatsOutPackets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyStatsOutPackets.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsOutPackets.setDescription('This counter counts the number of out packets sent by IP that relate to this policy entry.') slapmPolicyStatsInProfileOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyStatsInProfileOctets.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsInProfileOctets.setDescription('This counter counts the number of in octets that are determined to be within profile.') slapmPolicyStatsOutProfileOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyStatsOutProfileOctets.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsOutProfileOctets.setDescription('This counter counts the number of out octets that are determined to be within profile.') slapmPolicyStatsMinRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 20), Integer32()).setUnits('Kilobits per second').setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyStatsMinRate.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsMinRate.setDescription('The minimum transfer rate defined for this entry.') slapmPolicyStatsMaxRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 21), Integer32()).setUnits('Kilobits per second').setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyStatsMaxRate.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsMaxRate.setDescription('The maximum transfer rate defined for this entry.') slapmPolicyStatsMaxDelay = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 22), Integer32()).setUnits('milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyStatsMaxDelay.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsMaxDelay.setDescription('The maximum delay defined for this entry.') slapmPolicyMonitorTable = MibTable((1, 3, 6, 1, 3, 88, 1, 2, 2), ) if mibBuilder.loadTexts: slapmPolicyMonitorTable.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorTable.setDescription('Provides a method of monitoring policies and their effect at a system. This table has been deprecated and replaced with the slapmPRMonTable. Older implementations of this MIB are expected to continue their support of this table.') slapmPolicyMonitorEntry = MibTableRow((1, 3, 6, 1, 3, 88, 1, 2, 2, 1), ).setIndexNames((0, "SLAPM-MIB", "slapmPolicyMonitorOwnerIndex"), (0, "SLAPM-MIB", "slapmPolicyMonitorSystemAddress"), (0, "SLAPM-MIB", "slapmPolicyMonitorPolicyName"), (0, "SLAPM-MIB", "slapmPolicyMonitorTrafficProfileName")) if mibBuilder.loadTexts: slapmPolicyMonitorEntry.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorEntry.setDescription('Defines an entry in the slapmPolicyMonitorTable. This table defines which policies should be monitored on a per policy traffic profile basis.') slapmPolicyMonitorOwnerIndex = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))) if mibBuilder.loadTexts: slapmPolicyMonitorOwnerIndex.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorOwnerIndex.setDescription("To facilitate the provisioning of access control by a security administrator using the View-Based Access Control Model (RFC 2575, VACM) for tables in which multiple users may need to independently create or modify entries, the initial index is used as an 'owner index'. Such an initial index has a syntax of SnmpAdminString, and can thus be trivially mapped to a securityName or groupName as defined in VACM, in accordance with a security policy. All entries in that table belonging to a particular user will have the same value for this initial index. For a given user's entries in a particular table, the object identifiers for the information in these entries will have the same subidentifiers (except for the 'column' subidentifier) up to the end of the encoded owner index. To configure VACM to permit access to this portion of the table, one would create vacmViewTreeFamilyTable entries with the value of vacmViewTreeFamilySubtree including the owner index portion, and vacmViewTreeFamilyMask 'wildcarding' the column subidentifier. More elaborate configurations are possible.") slapmPolicyMonitorSystemAddress = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 2), OctetString().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), ))) if mibBuilder.loadTexts: slapmPolicyMonitorSystemAddress.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorSystemAddress.setDescription('Address of a system that an Policy definition relates to. A zero length octet string can be used to indicate that only a single system is being represented. Otherwise, the length of the octet string should be 4 for an ipv4 address and 16 for an ipv6 address.') slapmPolicyMonitorPolicyName = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 3), SlapmNameType()) if mibBuilder.loadTexts: slapmPolicyMonitorPolicyName.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorPolicyName.setDescription('Policy name that this entry relates to.') slapmPolicyMonitorTrafficProfileName = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 4), SlapmNameType()) if mibBuilder.loadTexts: slapmPolicyMonitorTrafficProfileName.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorTrafficProfileName.setDescription('The corresponding Traffic Profile name.') slapmPolicyMonitorControl = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 5), Bits().clone(namedValues=NamedValues(("monitorMinRate", 0), ("monitorMaxRate", 1), ("monitorMaxDelay", 2), ("enableAggregateTraps", 3), ("enableSubcomponentTraps", 4), ("monitorSubcomponents", 5))).clone(namedValues=NamedValues(("monitorMinRate", 0), ("monitorMaxRate", 1), ("monitorMaxDelay", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: slapmPolicyMonitorControl.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorControl.setDescription("The value of this object determines the type and level of monitoring that is applied to a policy/profile. The value of this object can't be changed once the table entry that it is a part of is activated via a slapmPolicyMonitorRowStatus transition to active state. monitorMinRate(0) - Monitor minimum transfer rate. monitorMaxRate(1) - Monitor maximum transfer rate. monitorMaxDelay(2) - Monitor maximum delay. enableAggregateTraps(3) - The enableAggregateTraps(3) BITS setting enables notification generation when monitoring a policy traffic profile as an aggregate using the values in the corresponding slapmPolicyStatsEntry. By default this function is not enabled. enableSubcomponentTraps(4) - This BITS setting enables notification generation when monitoring all subcomponents that are mapped to an corresponding slapmPolicyStatsEntry. By default this function is not enabled. monitorSubcomponents(5) - This BITS setting enables monitoring of each subcomponent (typically a TCP connection or UDP listener) individually.") slapmPolicyMonitorStatus = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 6), SlapmStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyMonitorStatus.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorStatus.setDescription("The value of this object indicates when a monitored value has not meet a threshold or isn't meeting the defined service level. The SlapmStatus TEXTUAL-CONVENTION defines two levels of not meeting a threshold. The first set: slaMinInRateNotAchieved(0), slaMaxInRateExceeded(1), slaMaxDelayExceeded(2), slaMinOutRateNotAchieved(3), slaMaxOutRateExceeded(4) are used to indicate when the SLA as an aggregate is not meeting a threshold while the second set: monitorMinInRateNotAchieved(5), monitorMaxInRateExceeded(6), monitorMaxDelayExceeded(7), monitorMinOutRateNotAchieved(8), monitorMaxOutRateExceeded(9) indicate that at least one subcomponent is not meeting a threshold.") slapmPolicyMonitorInterval = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(15, 86400)).clone(20)).setUnits('seconds').setMaxAccess("readcreate") if mibBuilder.loadTexts: slapmPolicyMonitorInterval.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorInterval.setDescription('The number of seconds that defines the sample period.') slapmPolicyMonitorIntTime = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 8), DateAndTime().clone(hexValue="0000000000000000")).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyMonitorIntTime.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorIntTime.setDescription('The timestamp for when the last interval ended.') slapmPolicyMonitorCurrentInRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 9), Gauge32()).setUnits('kilobits per second').setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyMonitorCurrentInRate.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorCurrentInRate.setDescription('Using the value of the corresponding slapmPolicyMonitorInterval, slapmPolicyStatsInOctets is sampled and then divided by slapmPolicyMonitorInterval to determine the current in transfer rate.') slapmPolicyMonitorCurrentOutRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 10), Gauge32()).setUnits('kilobits per second').setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyMonitorCurrentOutRate.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorCurrentOutRate.setDescription('Using the value of the corresponding slapmPolicyMonitorInterval, slapmPolicyStatsOutOctets is sampled and then divided by slapmPolicyMonitorInterval to determine the current out transfer rate.') slapmPolicyMonitorMinRateLow = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 11), Integer32()).setUnits('kilobits per second').setMaxAccess("readcreate") if mibBuilder.loadTexts: slapmPolicyMonitorMinRateLow.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMinRateLow.setDescription("The threshold for generating a slapmMonitoredEventNotAchieved notification, signalling that a monitored minimum transfer rate has not been meet. A slapmMonitoredEventNotAchieved notification is not generated again for an slapmPolicyMonitorEntry until the minimum transfer rate exceeds slapmPolicyMonitorMinRateHigh (a slapmMonitoredEventOkay notification is then transmitted) and then fails below slapmPolicyMonitorMinRateLow. This behavior reduces the slapmMonitoredEventNotAchieved notifications that are transmitted. A value of zero for this object is returned when the slapmPolicyMonitorControl monitorMinRate(0) is not enabled. When enabled the default value for this object is the min rate value specified in the associated action definition minus 10%. If the action definition doesn't have a min rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMinRate(0) is selected. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapmPolicyMonitorMinRateHigh = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 12), Integer32()).setUnits('kilobits per second').setMaxAccess("readcreate") if mibBuilder.loadTexts: slapmPolicyMonitorMinRateHigh.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMinRateHigh.setDescription("The threshold for generating a slapmMonitoredEventOkay notification, signalling that a monitored minimum transfer rate has increased to an acceptable level. A value of zero for this object is returned when the slapmPolicyMonitorControl monitorMinRate(0) is not enabled. When enabled the default value for this object is the min rate value specified in the associated action definition plus 10%. If the action definition doesn't have a min rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMinRate(0) is selected. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapmPolicyMonitorMaxRateHigh = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 13), Integer32()).setUnits('kilobits per second').setMaxAccess("readcreate") if mibBuilder.loadTexts: slapmPolicyMonitorMaxRateHigh.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMaxRateHigh.setDescription("The threshold for generating a slapmMonitoredEventNotAchieved notification, signalling that a monitored maximum transfer rate has been exceeded. A slapmMonitoredEventNotAchieved notification is not generated again for an slapmPolicyMonitorEntry until the maximum transfer rate fails below slapmPolicyMonitorMaxRateLow (a slapmMonitoredEventOkay notification is then transmitted) and then raises above slapmPolicyMonitorMaxRateHigh. This behavior reduces the slapmMonitoredEventNotAchieved notifications that are transmitted. A value of zero for this object is returned when the slapmPolicyMonitorControl monitorMaxRate(1) is not enabled. When enabled the default value for this object is the max rate value specified in the associated action definition plus 10%. If the action definition doesn't have a max rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxRate(1) is selected. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapmPolicyMonitorMaxRateLow = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 14), Integer32()).setUnits('kilobits per second').setMaxAccess("readcreate") if mibBuilder.loadTexts: slapmPolicyMonitorMaxRateLow.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMaxRateLow.setDescription("The threshold for generating a slapmMonitoredEventOkay notification, signalling that a monitored maximum transfer rate has fallen to an acceptable level. A value of zero for this object is returned when the slapmPolicyMonitorControl monitorMaxRate(1) is not enabled. When enabled the default value for this object is the max rate value specified in the associated action definition minus 10%. If the action definition doesn't have a max rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxRate(1) is selected. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapmPolicyMonitorMaxDelayHigh = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 15), Integer32()).setUnits('milliseconds').setMaxAccess("readcreate") if mibBuilder.loadTexts: slapmPolicyMonitorMaxDelayHigh.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMaxDelayHigh.setDescription("The threshold for generating a slapmMonitoredEventNotAchieved notification, signalling that a monitored maximum delay rate has been exceeded. A slapmMonitoredEventNotAchieved notification is not generated again for an slapmPolicyMonitorEntry until the maximum delay rate falls below slapmPolicyMonitorMaxDelayLow (a slapmMonitoredEventOkay notification is then transmitted) and raises above slapmPolicyMonitorMaxDelayHigh. This behavior reduces the slapmMonitoredEventNotAchieved notifications that are transmitted. A value of zero for this object is returned when the slapmPolicyMonitorControl monitorMaxDelay(4) is not enabled. When enabled the default value for this object is the max delay value specified in the associated action definition plus 10%. If the action definition doesn't have a max delay defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxDelay(4) is selected. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapmPolicyMonitorMaxDelayLow = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 16), Integer32()).setUnits('milliseconds').setMaxAccess("readcreate") if mibBuilder.loadTexts: slapmPolicyMonitorMaxDelayLow.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMaxDelayLow.setDescription("The threshold for generating a slapmMonitoredEventOkay notification, signalling that a monitored maximum delay rate has fallen to an acceptable level. A value of zero for this object is returned when the slapmPolicyMonitorControl monitorMaxDelay(4) is not enabled. When enabled the default value for this object is the max delay value specified in the associated action definition minus 10%. If the action definition doesn't have a max delay defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxDelay(4) is selected. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapmPolicyMonitorMinInRateNotAchieves = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyMonitorMinInRateNotAchieves.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMinInRateNotAchieves.setDescription('The number of times that a minimum transfer in rate was not achieved.') slapmPolicyMonitorMaxInRateExceeds = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyMonitorMaxInRateExceeds.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMaxInRateExceeds.setDescription('The number of times that a maximum transfer in rate was exceeded.') slapmPolicyMonitorMaxDelayExceeds = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyMonitorMaxDelayExceeds.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMaxDelayExceeds.setDescription('The number of times that a maximum delay in rate was exceeded.') slapmPolicyMonitorMinOutRateNotAchieves = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyMonitorMinOutRateNotAchieves.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMinOutRateNotAchieves.setDescription('The number of times that a minimum transfer out rate was not achieved.') slapmPolicyMonitorMaxOutRateExceeds = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyMonitorMaxOutRateExceeds.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMaxOutRateExceeds.setDescription('The number of times that a maximum transfer out rate was exceeded.') slapmPolicyMonitorCurrentDelayRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 22), Gauge32()).setUnits('milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyMonitorCurrentDelayRate.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorCurrentDelayRate.setDescription('The current delay rate for this entry. This is calculated by taking the average of the TCP round trip times for all associating slapmSubcomponentTable entries within a interval.') slapmPolicyMonitorRowStatus = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 23), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: slapmPolicyMonitorRowStatus.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorRowStatus.setDescription('This object allows entries to be created and deleted in the slapmPolicyMonitorTable. An entry in this table is deleted by setting this object to destroy(6). Removal of a corresponding (same policy and traffic profile names) slapmPolicyStatsEntry has the side effect of the automatic deletion an entry in this table.') slapmSubcomponentTable = MibTable((1, 3, 6, 1, 3, 88, 1, 2, 3), ) if mibBuilder.loadTexts: slapmSubcomponentTable.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentTable.setDescription('Defines a table to provide information on the individually components that are mapped to a policy rule (or old traffic profile). The indexing for this table is designed to support the use of an SNMP GET-NEXT operation using only the remote address and remote port as a way for a management station to retrieve the table entries relating to a particular client.') slapmSubcomponentEntry = MibTableRow((1, 3, 6, 1, 3, 88, 1, 2, 3, 1), ).setIndexNames((0, "SLAPM-MIB", "slapmSubcomponentRemAddress"), (0, "SLAPM-MIB", "slapmSubcomponentRemPort"), (0, "SLAPM-MIB", "slapmSubcomponentLocalAddress"), (0, "SLAPM-MIB", "slapmSubcomponentLocalPort")) if mibBuilder.loadTexts: slapmSubcomponentEntry.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentEntry.setDescription("Describes a particular subcomponent entry. This table does not have an OwnerIndex as part of its indexing since this table's contents is intended to span multiple users.") slapmSubcomponentRemAddress = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 1), OctetString().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), ))) if mibBuilder.loadTexts: slapmSubcomponentRemAddress.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentRemAddress.setDescription('Indicate the remote address of a subcomponent. A remote address can be either an ipv4 address in which case 4 octets are required or as an ipv6 address that requires 16 octets. The value of this subidentifier is a zero length octet string when this entry relates to a UDP listener.') slapmSubcomponentRemPort = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))) if mibBuilder.loadTexts: slapmSubcomponentRemPort.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentRemPort.setDescription('Indicate the remote port of a subcomponent. The value of this subidentifier is 0 when this entry relates to a UDP listener.') slapmSubcomponentLocalAddress = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 3), OctetString().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), ))) if mibBuilder.loadTexts: slapmSubcomponentLocalAddress.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentLocalAddress.setDescription('Indicate the local address of a subcomponent. A local address can be either an ipv4 address in which case 4 octets are required or as an ipv6 address that requires 16 octets.') slapmSubcomponentLocalPort = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))) if mibBuilder.loadTexts: slapmSubcomponentLocalPort.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentLocalPort.setDescription('Indicate the local port of a subcomponent.') slapmSubcomponentProtocol = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("udpListener", 1), ("tcpConnection", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmSubcomponentProtocol.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentProtocol.setDescription('Indicate the protocol in use that identifies the type of subcomponent.') slapmSubcomponentSystemAddress = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 6), OctetString().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmSubcomponentSystemAddress.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentSystemAddress.setDescription('Address of a system that an Policy definition relates to. A zero length octet string can be used to indicate that only a single system is being represented. Otherwise, the length of the octet string should be 4 for an ipv4 address and 16 for an ipv6 address.') slapmSubcomponentPolicyName = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 7), SlapmNameType()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmSubcomponentPolicyName.setStatus('deprecated') if mibBuilder.loadTexts: slapmSubcomponentPolicyName.setDescription('Policy name that this entry relates to. This object, along with slapmSubcomponentTrafficProfileName, have been replaced with the use of an unsigned integer index that is mapped to an slapmPolicyNameEntry to actually identify policy naming.') slapmSubcomponentTrafficProfileName = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 8), SlapmNameType()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmSubcomponentTrafficProfileName.setStatus('deprecated') if mibBuilder.loadTexts: slapmSubcomponentTrafficProfileName.setDescription('The corresponding traffic profile name. This object, along with slapmSubcomponentProfileName, have been replaced with the use of an unsigned integer index that is mapped to an slapmPolicyNameEntry to actually identify policy naming.') slapmSubcomponentLastActivity = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 9), DateAndTime().clone(hexValue="0000000000000000")).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmSubcomponentLastActivity.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentLastActivity.setDescription('The date and timestamp of when this entry was last used.') slapmSubcomponentInOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmSubcomponentInOctets.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentInOctets.setDescription('The number of octets received from IP for this connection.') slapmSubcomponentOutOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmSubcomponentOutOctets.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentOutOctets.setDescription('The number of octets sent to IP for this connection.') slapmSubcomponentTcpOutBufferedOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmSubcomponentTcpOutBufferedOctets.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentTcpOutBufferedOctets.setDescription('Number of outgoing octets buffered. The value of this object is zero when the entry is not for a TCP connection.') slapmSubcomponentTcpInBufferedOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmSubcomponentTcpInBufferedOctets.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentTcpInBufferedOctets.setDescription('Number of incoming octets buffered. The value of this object is zero when the entry is not for a TCP connection.') slapmSubcomponentTcpReXmts = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmSubcomponentTcpReXmts.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentTcpReXmts.setDescription('Number of retransmissions. The value of this object is zero when the entry is not for a TCP connection.') slapmSubcomponentTcpRoundTripTime = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 15), Integer32()).setUnits('milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: slapmSubcomponentTcpRoundTripTime.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentTcpRoundTripTime.setDescription('The amount of time that has elapsed, measured in milliseconds, from when the last TCP segment was transmitted by the TCP Stack until the ACK was received. The value of this object is zero when the entry is not for a TCP connection.') slapmSubcomponentTcpRoundTripVariance = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 16), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmSubcomponentTcpRoundTripVariance.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentTcpRoundTripVariance.setDescription('Round trip time variance. The value of this object is zero when the entry is not for a TCP connection.') slapmSubcomponentInPdus = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmSubcomponentInPdus.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentInPdus.setDescription('The number of protocol related data units transferred inbound: slapmSubcomponentProtocol PDU Type udpListener(1) UDP datagrams tcpConnection(2) TCP segments') slapmSubcomponentOutPdus = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmSubcomponentOutPdus.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentOutPdus.setDescription('The number of protocol related data units transferred outbound: slapmSubcomponentProtocol PDU Type udpListener(1) UDP datagrams tcpConnection(2) TCP segments') slapmSubcomponentApplName = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 19), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmSubcomponentApplName.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentApplName.setDescription('The application name associated with this entry if known, otherwise a zero-length octet string is returned as the value of this object.') slapmSubcomponentMonitorStatus = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 20), SlapmStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmSubcomponentMonitorStatus.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentMonitorStatus.setDescription("The value of this object indicates when a monitored value has exceeded a threshold or isn't meeting the defined service level. Only the following SlapmStatus BITS setting can be reported here: monitorMinInRateNotAchieved(5), monitorMaxInRateExceeded(6), monitorMaxDelayExceeded(7), monitorMinOutRateNotAchieved(8), monitorMaxOutRateExceeded(9) This object only has meaning when an corresponding slapmPolicyMonitorEntry exists with the slapmPolicyMonitorControl BITS setting monitorSubcomponents(5) enabled.") slapmSubcomponentMonitorIntTime = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 21), DateAndTime().clone(hexValue="0000000000000000")).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmSubcomponentMonitorIntTime.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentMonitorIntTime.setDescription('The timestamp for when the last interval ended. This object only has meaning when an corresponding slapmPRMonEntry (or old slapmPolicyMonitorEntry) exists with the slapmPRMonControl (or slapmPolicyMonitorControl) BITS setting monitorSubcomponents(5) enabled. All of the octets returned when monitoring is not in effect must be zero.') slapmSubcomponentMonitorCurrentInRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 22), Gauge32()).setUnits('kilobits per second').setMaxAccess("readonly") if mibBuilder.loadTexts: slapmSubcomponentMonitorCurrentInRate.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentMonitorCurrentInRate.setDescription('Using the value of the corresponding slapmPRMonInterval (or slapmPolicyMonitorInterval), slapmSubcomponentStatsInOctets is divided by slapmSubcomponentMonitorInterval to determine the current in transfer rate. This object only has meaning when an corresponding slapmPRMonEntry (or slapmPolicyMonitorEntry) exists with the slapmPRMonControl (or slapmPolicyMonitorControl) BITS setting monitorSubcomponents(5) enabled. The value of this object is zero when monitoring is not in effect.') slapmSubcomponentMonitorCurrentOutRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 23), Gauge32()).setUnits('kilobits per second').setMaxAccess("readonly") if mibBuilder.loadTexts: slapmSubcomponentMonitorCurrentOutRate.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentMonitorCurrentOutRate.setDescription('Using the value of the corresponding slapmPRMonInterval (or slapmPolicyMonitorInterva)l, slapmSubcomponentStatsOutOctets is divided by slapmPRMonInterval (or slapmPolicyMonitorInterval) to determine the current out transfer rate. This object only has meaning when an corresponding slapmPRMonEntry (or slapmPolicyMonitorEntry) exists with the slapmPRMonControl (or slapmPolicyMonitorControl) BITS setting monitorSubcomponents(5) enabled. The value of this object is zero when monitoring is not in effect.') slapmSubcomponentPolicyRuleIndex = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 24), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmSubcomponentPolicyRuleIndex.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentPolicyRuleIndex.setDescription('Points to an slapmPolicyNameEntry when combined with slapmSubcomponentSystemAddress to indicate the policy naming that relates to this entry. A value of 0 for this object MUST be returned when the corresponding slapmSubcomponentEntry has no policy rule associated with it.') slapmPolicyNameTable = MibTable((1, 3, 6, 1, 3, 88, 1, 2, 4), ) if mibBuilder.loadTexts: slapmPolicyNameTable.setStatus('current') if mibBuilder.loadTexts: slapmPolicyNameTable.setDescription('Provides the mapping between a policy index as a unsigned 32 bit integer and the unique name associated with a policy rule.') slapmPolicyNameEntry = MibTableRow((1, 3, 6, 1, 3, 88, 1, 2, 4, 1), ).setIndexNames((0, "SLAPM-MIB", "slapmPolicyNameSystemAddress"), (0, "SLAPM-MIB", "slapmPolicyNameIndex")) if mibBuilder.loadTexts: slapmPolicyNameEntry.setStatus('current') if mibBuilder.loadTexts: slapmPolicyNameEntry.setDescription('Defines an entry in the slapmPolicyNameTable.') slapmPolicyNameSystemAddress = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 4, 1, 1), OctetString().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), ))) if mibBuilder.loadTexts: slapmPolicyNameSystemAddress.setStatus('current') if mibBuilder.loadTexts: slapmPolicyNameSystemAddress.setDescription('Address of a system that an Policy rule definition relates to. A zero length octet string must be used to indicate that only a single system is being represented. Otherwise, the length of the octet string must be 4 for an ipv4 address or 16 for an ipv6 address.') slapmPolicyNameIndex = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 4, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))) if mibBuilder.loadTexts: slapmPolicyNameIndex.setStatus('current') if mibBuilder.loadTexts: slapmPolicyNameIndex.setDescription('A locally arbitrary, but unique identifier associated with this table entry. This value is not expected to remain constant across reIPLs.') slapmPolicyNameOfRule = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 4, 1, 3), SlapmPolicyRuleName()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyNameOfRule.setStatus('current') if mibBuilder.loadTexts: slapmPolicyNameOfRule.setDescription('The unique name that identifies a policy rule definition.') slapmPolicyRuleStatsTable = MibTable((1, 3, 6, 1, 3, 88, 1, 2, 5), ) if mibBuilder.loadTexts: slapmPolicyRuleStatsTable.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsTable.setDescription('Provides statistics on a per system and a per policy rule basis.') slapmPolicyRuleStatsEntry = MibTableRow((1, 3, 6, 1, 3, 88, 1, 2, 5, 1), ).setIndexNames((0, "SLAPM-MIB", "slapmPolicyNameSystemAddress"), (0, "SLAPM-MIB", "slapmPolicyNameIndex")) if mibBuilder.loadTexts: slapmPolicyRuleStatsEntry.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsEntry.setDescription('Defines an entry in the slapmPolicyRuleStatsTable. This table defines a set of statistics that is kept on a per system and per policy rule basis. Entries in this table are not created or deleted via SNMP but reflect the set of policy rule definitions known at a system.') slapmPolicyRuleStatsOperStatus = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("inactive", 1), ("active", 2), ("deleteNeeded", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsOperStatus.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsOperStatus.setDescription('The state of a policy entry: inactive(1) - An policy entry was either defined by local system definition or discovered via a directory search but has not been activated (not currently being used). active(2) - Policy entry is being used to affect traffic flows. deleteNeeded(3) - Either though local implementation dependent methods or by discovering that the directory entry corresponding to this table entry no longer exists and slapmPolicyPurgeTime needs to expire before attempting to remove the corresponding slapmPolicyStatsEntry and any dependent slapmPolicyMonitor table entries. Note: a policy rule in a state other than active(2) is not being used to affect traffic flows.') slapmPolicyRuleStatsActiveConns = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsActiveConns.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsActiveConns.setDescription('The number of active TCP connections that are affected by the corresponding policy entry.') slapmPolicyRuleStatsTotalConns = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsTotalConns.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsTotalConns.setDescription('The number of total TCP connections that are affected by the corresponding policy entry.') slapmPolicyRuleStatsLActivated = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 4), DateAndTime().clone(hexValue="0000000000000000")).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsLActivated.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsLActivated.setDescription('The timestamp for when the corresponding policy entry was last activated. The value of this object serves as the discontinuity event indicator when polling entries in this table. The value of this object is updated on transition of slapmPolicyRuleStatsOperStatus into the active(2) state.') slapmPolicyRuleStatsLastMapping = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 5), DateAndTime().clone(hexValue="0000000000000000")).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsLastMapping.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsLastMapping.setDescription('The timestamp for when the last time that the associated policy entry was used.') slapmPolicyRuleStatsInOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsInOctets.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsInOctets.setDescription('The number of octets that was received by IP for an entity that map to this entry.') slapmPolicyRuleStatsOutOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsOutOctets.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsOutOctets.setDescription('The number of octets that was transmitted by IP for an entity that map to this entry.') slapmPolicyRuleStatsConnLimit = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 8), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsConnLimit.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsConnLimit.setDescription('The limit for the number of active TCP connections that are allowed for this policy definition. A value of zero for this object implies that a connection limit has not been specified.') slapmPolicyRuleStatsCountAccepts = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsCountAccepts.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsCountAccepts.setDescription("This counter is incremented when a policy action's Permission value is set to Accept and a session (TCP connection) is accepted.") slapmPolicyRuleStatsCountDenies = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsCountDenies.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsCountDenies.setDescription("This counter is incremented when a policy action's Permission value is set to Deny and a session is denied, or when a session (TCP connection) is rejected due to a policy's connection limit (slapmPolicyRuleStatsConnectLimit) being reached.") slapmPolicyRuleStatsInDiscards = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsInDiscards.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsInDiscards.setDescription('This counter counts the number of in octets discarded. This occurs when an error is detected. Examples of this are buffer overflow, checksum error, or bad packet format.') slapmPolicyRuleStatsOutDiscards = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsOutDiscards.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsOutDiscards.setDescription('This counter counts the number of out octets discarded. Examples of this are buffer overflow, checksum error, or bad packet format.') slapmPolicyRuleStatsInPackets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsInPackets.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsInPackets.setDescription('This counter counts the number of in packets received that relate to this policy entry from IP.') slapmPolicyRuleStatsOutPackets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsOutPackets.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsOutPackets.setDescription('This counter counts the number of out packets sent by IP that relate to this policy entry.') slapmPolicyRuleStatsInProOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsInProOctets.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsInProOctets.setDescription('This counter counts the number of in octets that are determined to be within profile.') slapmPolicyRuleStatsOutProOctets = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsOutProOctets.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsOutProOctets.setDescription('This counter counts the number of out octets that are determined to be within profile.') slapmPolicyRuleStatsMinRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 17), Unsigned32()).setUnits('Kilobits per second').setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsMinRate.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsMinRate.setDescription('The minimum transfer rate defined for this entry.') slapmPolicyRuleStatsMaxRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 18), Unsigned32()).setUnits('Kilobits per second').setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsMaxRate.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsMaxRate.setDescription('The maximum transfer rate defined for this entry.') slapmPolicyRuleStatsMaxDelay = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 19), Unsigned32()).setUnits('milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsMaxDelay.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsMaxDelay.setDescription('The maximum delay defined for this entry.') slapmPolicyRuleStatsTotalRsvpFlows = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsTotalRsvpFlows.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsTotalRsvpFlows.setDescription('Total number of RSVP flows that have be activated.') slapmPolicyRuleStatsActRsvpFlows = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 21), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPolicyRuleStatsActRsvpFlows.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsActRsvpFlows.setDescription('Current number of active RSVP flows.') slapmPRMonTable = MibTable((1, 3, 6, 1, 3, 88, 1, 2, 6), ) if mibBuilder.loadTexts: slapmPRMonTable.setStatus('current') if mibBuilder.loadTexts: slapmPRMonTable.setDescription('Provides a method of monitoring policies and their effect at a system.') slapmPRMonEntry = MibTableRow((1, 3, 6, 1, 3, 88, 1, 2, 6, 1), ).setIndexNames((0, "SLAPM-MIB", "slapmPRMonOwnerIndex"), (0, "SLAPM-MIB", "slapmPRMonSystemAddress"), (0, "SLAPM-MIB", "slapmPRMonIndex")) if mibBuilder.loadTexts: slapmPRMonEntry.setStatus('current') if mibBuilder.loadTexts: slapmPRMonEntry.setDescription('Defines an entry in the slapmPRMonTable. This table defines which policies should be monitored on a per policy rule basis. An attempt to set any read-create object defined within an slapmPRMonEntry while the value of slapmPRMonRowStatus is active(1) will result in an inconsistentValue error.') slapmPRMonOwnerIndex = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))) if mibBuilder.loadTexts: slapmPRMonOwnerIndex.setStatus('current') if mibBuilder.loadTexts: slapmPRMonOwnerIndex.setDescription("To facilitate the provisioning of access control by a security administrator using the View-Based Access Control Model (RFC 2575, VACM) for tables in which multiple users may need to independently create or modify entries, the initial index is used as an 'owner index'. Such an initial index has a syntax of SnmpAdminString, and can thus be trivially mapped to a securityName or groupName as defined in VACM, in accordance with a security policy. All entries in that table belonging to a particular user will have the same value for this initial index. For a given user's entries in a particular table, the object identifiers for the information in these entries will have the same subidentifiers (except for the 'column' subidentifier) up to the end of the encoded owner index. To configure VACM to permit access to this portion of the table, one would create vacmViewTreeFamilyTable entries with the value of vacmViewTreeFamilySubtree including the owner index portion, and vacmViewTreeFamilyMask 'wildcarding' the column subidentifier. More elaborate configurations are possible.") slapmPRMonSystemAddress = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 2), OctetString().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), ))) if mibBuilder.loadTexts: slapmPRMonSystemAddress.setStatus('current') if mibBuilder.loadTexts: slapmPRMonSystemAddress.setDescription('Address of a system that an Policy definition relates to. A zero length octet string can be used to indicate that only a single system is being represented. Otherwise, the length of the octet string should be 4 for an ipv4 address and 16 for an ipv6 address.') slapmPRMonIndex = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 3), Unsigned32()) if mibBuilder.loadTexts: slapmPRMonIndex.setStatus('current') if mibBuilder.loadTexts: slapmPRMonIndex.setDescription('An slapmPolicyNameTable index, slapmPolicyNameIndex, that points to the unique name associated with a policy rule definition.') slapmPRMonControl = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 4), Bits().clone(namedValues=NamedValues(("monitorMinRate", 0), ("monitorMaxRate", 1), ("monitorMaxDelay", 2), ("enableAggregateTraps", 3), ("enableSubcomponentTraps", 4), ("monitorSubcomponents", 5))).clone(namedValues=NamedValues(("monitorMinRate", 0), ("monitorMaxRate", 1), ("monitorMaxDelay", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: slapmPRMonControl.setStatus('current') if mibBuilder.loadTexts: slapmPRMonControl.setDescription("The value of this object determines the type and level of monitoring that is applied to a policy rule. The value of this object can't be changed once the table entry that it is a part of is activated via a slapmPRMonRowStatus transition to active state. monitorMinRate(0) - Monitor minimum transfer rate. monitorMaxRate(1) - Monitor maximum transfer rate. monitorMaxDelay(2) - Monitor maximum delay. enableAggregateTraps(3) - The enableAggregateTraps(3) BITS setting enables notification generation when monitoring a policy rule as an aggregate using the values in the corresponding slapmPRMonStatsEntry. By default this function is not enabled. enableSubcomponentTraps(4) - This BITS setting enables notification generation when monitoring all subcomponents that are mapped to an corresponding slapmPRMonStatsEntry. By default this function is not enabled. monitorSubcomponents(5) - This BITS setting enables monitoring of each subcomponent (typically a TCP connection or UDP listener) individually.") slapmPRMonStatus = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 5), SlapmStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPRMonStatus.setStatus('current') if mibBuilder.loadTexts: slapmPRMonStatus.setDescription("The value of this object indicates when a monitored value has not meet a threshold or isn't meeting the defined service level. The SlapmStatus TEXTUAL-CONVENTION defines two levels of not meeting a threshold. The first set: slaMinInRateNotAchieved(0), slaMaxInRateExceeded(1), slaMaxDelayExceeded(2), slaMinOutRateNotAchieved(3), slaMaxOutRateExceeded(4) are used to indicate when the SLA as an aggregate is not meeting a threshold while the second set: monitorMinInRateNotAchieved(5), monitorMaxInRateExceeded(6), monitorMaxDelayExceeded(7), monitorMinOutRateNotAchieved(8), monitorMaxOutRateExceeded(9) indicate that at least one subcomponent is not meeting a threshold.") slapmPRMonInterval = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(15, 86400)).clone(20)).setUnits('seconds').setMaxAccess("readcreate") if mibBuilder.loadTexts: slapmPRMonInterval.setStatus('current') if mibBuilder.loadTexts: slapmPRMonInterval.setDescription('The number of seconds that defines the sample period.') slapmPRMonIntTime = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 7), DateAndTime().clone(hexValue="0000000000000000")).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPRMonIntTime.setStatus('current') if mibBuilder.loadTexts: slapmPRMonIntTime.setDescription('The timestamp for when the last interval ended.') slapmPRMonCurrentInRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 8), Gauge32()).setUnits('kilobits per second').setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPRMonCurrentInRate.setStatus('current') if mibBuilder.loadTexts: slapmPRMonCurrentInRate.setDescription('Using the value of the corresponding slapmPRMonInterval, slapmPolicyRuleStatsInOctets is sampled and then divided by slapmPRMonInterval to determine the current in transfer rate.') slapmPRMonCurrentOutRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 9), Gauge32()).setUnits('kilobits per second').setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPRMonCurrentOutRate.setStatus('current') if mibBuilder.loadTexts: slapmPRMonCurrentOutRate.setDescription('Using the value of the corresponding slapmPolicyMonInterval, slapmPolicyRuleStatsOutOctets is sampled and then divided by slapmPRMonInterval to determine the current out transfer rate.') slapmPRMonMinRateLow = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 10), Unsigned32()).setUnits('kilobits per second').setMaxAccess("readcreate") if mibBuilder.loadTexts: slapmPRMonMinRateLow.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMinRateLow.setDescription("The threshold for generating a slapmPolicyRuleMonNotOkay notification, signalling that a monitored minimum transfer rate has not been meet. A slapmPolicyRuleMonNotOkay notification is not generated again for an slapmPRMonEntry until the minimum transfer rate exceeds slapmPRMonMinRateHigh (a slapmPolicyRuleMonOkay notification is then transmitted) and then fails below slapmPRMonMinRateLow. This behavior reduces the slapmPolicyRuleMonNotOkay notifications that are transmitted. A value of zero for this object is returned when the slapmPRMonControl monitorMinRate(0) is not enabled. When enabled the default value for this object is the min rate value specified in the associated action definition minus 10%. If the action definition doesn't have a min rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMinRate(0) is selected. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapmPRMonMinRateHigh = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 11), Unsigned32()).setUnits('kilobits per second').setMaxAccess("readcreate") if mibBuilder.loadTexts: slapmPRMonMinRateHigh.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMinRateHigh.setDescription("The threshold for generating a slapmPolicyRuleMonOkay notification, signalling that a monitored minimum transfer rate has increased to an acceptable level. A value of zero for this object is returned when the slapmPRMonControl monitorMinRate(0) is not enabled. When enabled the default value for this object is the min rate value specified in the associated action definition plus 10%. If the action definition doesn't have a min rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMinRate(0) is selected. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapmPRMonMaxRateHigh = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 12), Unsigned32()).setUnits('kilobits per second').setMaxAccess("readcreate") if mibBuilder.loadTexts: slapmPRMonMaxRateHigh.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMaxRateHigh.setDescription("The threshold for generating a slapmPolicyRuleMonNotOkay notification, signalling that a monitored maximum transfer rate has been exceeded. A slapmPolicyRuleNotOkay notification is not generated again for an slapmPRMonEntry until the maximum transfer rate fails below slapmPRMonMaxRateLow (a slapmPolicyRuleMonOkay notification is then transmitted) and then raises above slapmPRMonMaxRateHigh. This behavior reduces the slapmPolicyRuleMonNotOkay notifications that are transmitted. A value of zero for this object is returned when the slapmPRMonControl monitorMaxRate(1) is not enabled. When enabled the default value for this object is the max rate value specified in the associated action definition plus 10%. If the action definition doesn't have a max rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxRate(1) is selected. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapmPRMonMaxRateLow = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 13), Unsigned32()).setUnits('kilobits per second').setMaxAccess("readcreate") if mibBuilder.loadTexts: slapmPRMonMaxRateLow.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMaxRateLow.setDescription("The threshold for generating a slapmPolicyRuleMonOkay notification, signalling that a monitored maximum transfer rate has fallen to an acceptable level. A value of zero for this object is returned when the slapmPRMonControl monitorMaxRate(1) is not enabled. When enabled the default value for this object is the max rate value specified in the associated action definition minus 10%. If the action definition doesn't have a max rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxRate(1) is selected. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapmPRMonMaxDelayHigh = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 14), Unsigned32()).setUnits('milliseconds').setMaxAccess("readcreate") if mibBuilder.loadTexts: slapmPRMonMaxDelayHigh.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMaxDelayHigh.setDescription("The threshold for generating a slapmPolicyRuleMonNotOkay notification, signalling that a monitored maximum delay rate has been exceeded. A slapmPolicyRuleMonNotOkay notification is not generated again for an slapmPRMonEntry until the maximum delay rate falls below slapmPRMonMaxDelayLow (a slapmPolicyRuleMonOkay notification is then transmitted) and raises above slapmPRMonMaxDelayHigh. This behavior reduces the slapmPolicyRuleMonNotOkay notifications that are transmitted. A value of zero for this object is returned when the slapmPRMonControl monitorMaxDelay(4) is not enabled. When enabled the default value for this object is the max delay value specified in the associated action definition plus 10%. If the action definition doesn't have a max delay defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxDelay(4) is selected. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapmPRMonMaxDelayLow = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 15), Unsigned32()).setUnits('milliseconds').setMaxAccess("readcreate") if mibBuilder.loadTexts: slapmPRMonMaxDelayLow.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMaxDelayLow.setDescription("The threshold for generating a slapmPolicyRuleMonOkay notification, signalling that a monitored maximum delay rate has fallen to an acceptable level. A value of zero for this object is returned when the slapmPRMonControl monitorMaxDelay(4) is not enabled. When enabled the default value for this object is the max delay value specified in the associated action definition minus 10%. If the action definition doesn't have a max delay defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxDelay(4) is selected. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapmPRMonMinInRateNotAchieves = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPRMonMinInRateNotAchieves.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMinInRateNotAchieves.setDescription('The number of times that a minimum transfer in rate was not achieved.') slapmPRMonMaxInRateExceeds = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPRMonMaxInRateExceeds.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMaxInRateExceeds.setDescription('The number of times that a maximum transfer in rate was exceeded.') slapmPRMonMaxDelayExceeds = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPRMonMaxDelayExceeds.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMaxDelayExceeds.setDescription('The number of times that a maximum delay in rate was exceeded.') slapmPRMonMinOutRateNotAchieves = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPRMonMinOutRateNotAchieves.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMinOutRateNotAchieves.setDescription('The number of times that a minimum transfer out rate was not achieved.') slapmPRMonMaxOutRateExceeds = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPRMonMaxOutRateExceeds.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMaxOutRateExceeds.setDescription('The number of times that a maximum transfer out rate was exceeded.') slapmPRMonCurrentDelayRate = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 21), Gauge32()).setUnits('milliseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: slapmPRMonCurrentDelayRate.setStatus('current') if mibBuilder.loadTexts: slapmPRMonCurrentDelayRate.setDescription('The current delay rate for this entry. This is calculated by taking the average of the TCP round trip times for all associating slapmSubcomponentTable entries within a interval.') slapmPRMonRowStatus = MibTableColumn((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 22), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: slapmPRMonRowStatus.setStatus('current') if mibBuilder.loadTexts: slapmPRMonRowStatus.setDescription('This object allows entries to be created and deleted in the slapmPRMonTable. An entry in this table is deleted by setting this object to destroy(6). Removal of an corresponding (same policy index) slapmPolicyRuleStatsEntry has the side effect of the automatic deletion an entry in this table. Note that an attempt to set any read-create object defined within an slapmPRMonEntry while the value of slapmPRMonRowStatus is active(1) will result in an inconsistentValue error.') slapmMonitoredEventNotAchieved = NotificationType((1, 3, 6, 1, 3, 88, 0, 1)).setObjects(("SLAPM-MIB", "slapmPolicyMonitorIntTime"), ("SLAPM-MIB", "slapmPolicyMonitorControl"), ("SLAPM-MIB", "slapmPolicyMonitorStatus"), ("SLAPM-MIB", "slapmPolicyMonitorStatus"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentInRate"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentOutRate"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentDelayRate")) if mibBuilder.loadTexts: slapmMonitoredEventNotAchieved.setStatus('deprecated') if mibBuilder.loadTexts: slapmMonitoredEventNotAchieved.setDescription('This notification is generated when an monitored event is not achieved with respect to threshold. This applies only towards monitoring a policy traffic profile as an aggregate via an associating slapmPolicyStatsEntry. The value of slapmPolicyMonitorControl can be examined to determine what is being monitored. The first slapmPolicyMonitorStatus value supplies the current monitor status while the 2nd value supplies the previous status. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for this notification to potentially be generated.') slapmMonitoredEventOkay = NotificationType((1, 3, 6, 1, 3, 88, 0, 2)).setObjects(("SLAPM-MIB", "slapmPolicyMonitorIntTime"), ("SLAPM-MIB", "slapmPolicyMonitorControl"), ("SLAPM-MIB", "slapmPolicyMonitorStatus"), ("SLAPM-MIB", "slapmPolicyMonitorStatus"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentInRate"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentOutRate"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentDelayRate")) if mibBuilder.loadTexts: slapmMonitoredEventOkay.setStatus('deprecated') if mibBuilder.loadTexts: slapmMonitoredEventOkay.setDescription('This notification is generated when a monitored event has improved to an acceptable level. This applies only towards monitoring a policy traffic profile as an aggregate via an associating slapmPolicyStatsEntry. The value of slapmPolicyMonitorControl can be examined to determine what is being monitored. The first slapmPolicyMonitorStatus value supplies the current monitor status while the 2nd value supplies the previous status. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for this notification to potentially be generated.') slapmPolicyProfileDeleted = NotificationType((1, 3, 6, 1, 3, 88, 0, 3)).setObjects(("SLAPM-MIB", "slapmPolicyStatsActiveConns"), ("SLAPM-MIB", "slapmPolicyStatsTotalConns"), ("SLAPM-MIB", "slapmPolicyStatsFirstActivated"), ("SLAPM-MIB", "slapmPolicyStatsLastMapping"), ("SLAPM-MIB", "slapmPolicyStatsInOctets"), ("SLAPM-MIB", "slapmPolicyStatsOutOctets"), ("SLAPM-MIB", "slapmPolicyStatsConnectionLimit"), ("SLAPM-MIB", "slapmPolicyStatsCountAccepts"), ("SLAPM-MIB", "slapmPolicyStatsCountDenies"), ("SLAPM-MIB", "slapmPolicyStatsInDiscards"), ("SLAPM-MIB", "slapmPolicyStatsOutDiscards"), ("SLAPM-MIB", "slapmPolicyStatsInPackets"), ("SLAPM-MIB", "slapmPolicyStatsOutPackets"), ("SLAPM-MIB", "slapmPolicyStatsInProfileOctets"), ("SLAPM-MIB", "slapmPolicyStatsOutProfileOctets"), ("SLAPM-MIB", "slapmPolicyStatsMinRate"), ("SLAPM-MIB", "slapmPolicyStatsMaxRate"), ("SLAPM-MIB", "slapmPolicyStatsMaxDelay")) if mibBuilder.loadTexts: slapmPolicyProfileDeleted.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyProfileDeleted.setDescription('A slapmPolicyDeleted notification is sent when a slapmPolicyStatsEntry is deleted if the value of slapmPolicyTrapEnable is enabled(1).') slapmPolicyMonitorDeleted = NotificationType((1, 3, 6, 1, 3, 88, 0, 4)).setObjects(("SLAPM-MIB", "slapmPolicyMonitorStatus"), ("SLAPM-MIB", "slapmPolicyMonitorInterval"), ("SLAPM-MIB", "slapmPolicyMonitorIntTime"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentInRate"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentOutRate"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentDelayRate"), ("SLAPM-MIB", "slapmPolicyMonitorMinRateLow"), ("SLAPM-MIB", "slapmPolicyMonitorMinRateHigh"), ("SLAPM-MIB", "slapmPolicyMonitorMaxRateHigh"), ("SLAPM-MIB", "slapmPolicyMonitorMaxRateLow"), ("SLAPM-MIB", "slapmPolicyMonitorMaxDelayHigh"), ("SLAPM-MIB", "slapmPolicyMonitorMaxDelayLow"), ("SLAPM-MIB", "slapmPolicyMonitorMinInRateNotAchieves"), ("SLAPM-MIB", "slapmPolicyMonitorMaxInRateExceeds"), ("SLAPM-MIB", "slapmPolicyMonitorMaxDelayExceeds"), ("SLAPM-MIB", "slapmPolicyMonitorMinOutRateNotAchieves"), ("SLAPM-MIB", "slapmPolicyMonitorMaxOutRateExceeds")) if mibBuilder.loadTexts: slapmPolicyMonitorDeleted.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorDeleted.setDescription('A slapmPolicyMonitorDeleted notification is sent when a slapmPolicyMonitorEntry is deleted if the value of slapmPolicyTrapEnable is enabled(1).') slapmSubcomponentMonitoredEventNotAchieved = NotificationType((1, 3, 6, 1, 3, 88, 0, 5)).setObjects(("SLAPM-MIB", "slapmSubcomponentSystemAddress"), ("SLAPM-MIB", "slapmSubcomponentPolicyName"), ("SLAPM-MIB", "slapmSubcomponentTrafficProfileName"), ("SLAPM-MIB", "slapmSubcomponentMonitorStatus"), ("SLAPM-MIB", "slapmSubcomponentMonitorStatus"), ("SLAPM-MIB", "slapmSubcomponentMonitorIntTime"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentInRate"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentOutRate"), ("SLAPM-MIB", "slapmSubcomponentTcpRoundTripTime")) if mibBuilder.loadTexts: slapmSubcomponentMonitoredEventNotAchieved.setStatus('deprecated') if mibBuilder.loadTexts: slapmSubcomponentMonitoredEventNotAchieved.setDescription('This notification is generated when a monitored value does not achieved a threshold specification. This applies only towards monitoring the individual components of a policy traffic profile. The value of the corresponding slapmPolicyMonitorControl can be examined to determine what is being monitored. The first slapmSubcomponentMonitorStatus value supplies the current monitor status while the 2nd value supplies the previous status. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableSubcomponentTraps(4), MUST be selected in order for this notification to potentially be generated.') slapmSubcomponentMonitoredEventOkay = NotificationType((1, 3, 6, 1, 3, 88, 0, 6)).setObjects(("SLAPM-MIB", "slapmSubcomponentSystemAddress"), ("SLAPM-MIB", "slapmSubcomponentPolicyName"), ("SLAPM-MIB", "slapmSubcomponentTrafficProfileName"), ("SLAPM-MIB", "slapmSubcomponentMonitorStatus"), ("SLAPM-MIB", "slapmSubcomponentMonitorStatus"), ("SLAPM-MIB", "slapmSubcomponentMonitorIntTime"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentInRate"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentOutRate"), ("SLAPM-MIB", "slapmSubcomponentTcpRoundTripTime")) if mibBuilder.loadTexts: slapmSubcomponentMonitoredEventOkay.setStatus('deprecated') if mibBuilder.loadTexts: slapmSubcomponentMonitoredEventOkay.setDescription('This notification is generated when a monitored value has reached an acceptable level. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableSubcomponentTraps(3), MUST be selected in order for this notification to potentially be generated.') slapmPolicyRuleMonNotOkay = NotificationType((1, 3, 6, 1, 3, 88, 0, 7)).setObjects(("SLAPM-MIB", "slapmPRMonIntTime"), ("SLAPM-MIB", "slapmPRMonControl"), ("SLAPM-MIB", "slapmPRMonStatus"), ("SLAPM-MIB", "slapmPRMonStatus"), ("SLAPM-MIB", "slapmPRMonCurrentInRate"), ("SLAPM-MIB", "slapmPRMonCurrentOutRate"), ("SLAPM-MIB", "slapmPRMonCurrentDelayRate")) if mibBuilder.loadTexts: slapmPolicyRuleMonNotOkay.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleMonNotOkay.setDescription('This notification is generated when an monitored event is not achieved with respect to a threshold. This applies only towards monitoring a policy rule as an aggregate via an associating slapmPolicyRuleStatsEntry. The value of slapmPRMonControl can be examined to determine what is being monitored. The first slapmPRMonStatus value supplies the current monitor status while the 2nd value supplies the previous status. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for this notification to potentially be generated.') slapmPolicyRuleMonOkay = NotificationType((1, 3, 6, 1, 3, 88, 0, 8)).setObjects(("SLAPM-MIB", "slapmPRMonIntTime"), ("SLAPM-MIB", "slapmPRMonControl"), ("SLAPM-MIB", "slapmPRMonStatus"), ("SLAPM-MIB", "slapmPRMonStatus"), ("SLAPM-MIB", "slapmPRMonCurrentInRate"), ("SLAPM-MIB", "slapmPRMonCurrentOutRate"), ("SLAPM-MIB", "slapmPRMonCurrentDelayRate")) if mibBuilder.loadTexts: slapmPolicyRuleMonOkay.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleMonOkay.setDescription('This notification is generated when a monitored event has improved to an acceptable level. This applies only towards monitoring a policy rule as an aggregate via an associating slapmPolicyRuleStatsEntry. The value of slapmPRMonControl can be examined to determine what is being monitored. The first slapmPRMonStatus value supplies the current monitor status while the 2nd value supplies the previous status. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for this notification to potentially be generated.') slapmPolicyRuleDeleted = NotificationType((1, 3, 6, 1, 3, 88, 0, 9)).setObjects(("SLAPM-MIB", "slapmPolicyRuleStatsActiveConns"), ("SLAPM-MIB", "slapmPolicyRuleStatsTotalConns"), ("SLAPM-MIB", "slapmPolicyRuleStatsLActivated"), ("SLAPM-MIB", "slapmPolicyRuleStatsLastMapping"), ("SLAPM-MIB", "slapmPolicyRuleStatsInOctets"), ("SLAPM-MIB", "slapmPolicyRuleStatsOutOctets"), ("SLAPM-MIB", "slapmPolicyRuleStatsConnLimit"), ("SLAPM-MIB", "slapmPolicyRuleStatsCountAccepts"), ("SLAPM-MIB", "slapmPolicyRuleStatsCountDenies"), ("SLAPM-MIB", "slapmPolicyRuleStatsInDiscards"), ("SLAPM-MIB", "slapmPolicyRuleStatsOutDiscards"), ("SLAPM-MIB", "slapmPolicyRuleStatsInPackets"), ("SLAPM-MIB", "slapmPolicyRuleStatsOutPackets"), ("SLAPM-MIB", "slapmPolicyRuleStatsInProOctets"), ("SLAPM-MIB", "slapmPolicyRuleStatsOutProOctets"), ("SLAPM-MIB", "slapmPolicyRuleStatsMinRate"), ("SLAPM-MIB", "slapmPolicyRuleStatsMaxRate"), ("SLAPM-MIB", "slapmPolicyRuleStatsMaxDelay"), ("SLAPM-MIB", "slapmPolicyRuleStatsTotalRsvpFlows"), ("SLAPM-MIB", "slapmPolicyRuleStatsActRsvpFlows")) if mibBuilder.loadTexts: slapmPolicyRuleDeleted.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleDeleted.setDescription('A slapmPolicyRuleDeleted notification is sent when a slapmPolicyRuleStatsEntry is deleted if the value of slapmPolicyTrapEnable is enabled(1).') slapmPolicyRuleMonDeleted = NotificationType((1, 3, 6, 1, 3, 88, 0, 10)).setObjects(("SLAPM-MIB", "slapmPRMonControl"), ("SLAPM-MIB", "slapmPRMonStatus"), ("SLAPM-MIB", "slapmPRMonInterval"), ("SLAPM-MIB", "slapmPRMonIntTime"), ("SLAPM-MIB", "slapmPRMonCurrentInRate"), ("SLAPM-MIB", "slapmPRMonCurrentOutRate"), ("SLAPM-MIB", "slapmPRMonCurrentDelayRate"), ("SLAPM-MIB", "slapmPRMonMinRateLow"), ("SLAPM-MIB", "slapmPRMonMinRateHigh"), ("SLAPM-MIB", "slapmPRMonMaxRateHigh"), ("SLAPM-MIB", "slapmPRMonMaxRateLow"), ("SLAPM-MIB", "slapmPRMonMaxDelayHigh"), ("SLAPM-MIB", "slapmPRMonMaxDelayLow"), ("SLAPM-MIB", "slapmPRMonMinInRateNotAchieves"), ("SLAPM-MIB", "slapmPRMonMaxInRateExceeds"), ("SLAPM-MIB", "slapmPRMonMaxDelayExceeds"), ("SLAPM-MIB", "slapmPRMonMinOutRateNotAchieves"), ("SLAPM-MIB", "slapmPRMonMaxOutRateExceeds")) if mibBuilder.loadTexts: slapmPolicyRuleMonDeleted.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleMonDeleted.setDescription('A slapmPolicyRuleMonDeleted notification is sent when a slapmPRMonEntry is deleted if the value of slapmPolicyTrapEnable is enabled(1).') slapmSubcMonitorNotOkay = NotificationType((1, 3, 6, 1, 3, 88, 0, 11)).setObjects(("SLAPM-MIB", "slapmSubcomponentSystemAddress"), ("SLAPM-MIB", "slapmSubcomponentPolicyRuleIndex"), ("SLAPM-MIB", "slapmPRMonControl"), ("SLAPM-MIB", "slapmSubcomponentMonitorStatus"), ("SLAPM-MIB", "slapmSubcomponentMonitorStatus"), ("SLAPM-MIB", "slapmSubcomponentMonitorIntTime"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentInRate"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentOutRate"), ("SLAPM-MIB", "slapmSubcomponentTcpRoundTripTime")) if mibBuilder.loadTexts: slapmSubcMonitorNotOkay.setStatus('current') if mibBuilder.loadTexts: slapmSubcMonitorNotOkay.setDescription('This notification is generated when a monitored value does not achieved a threshold specification. This applies only towards monitoring the individual components of a policy rule. The value of the corresponding slapmPRMonControl can be examined to determine what is being monitored. The first slapmSubcomponentMonitorStatus value supplies the current monitor status while the 2nd value supplies the previous status. Note: The corresponding slapmPRMonControl BITS setting, enableSubcomponentTraps(4), MUST be selected in order for this notification to potentially be generated.') slapmSubcMonitorOkay = NotificationType((1, 3, 6, 1, 3, 88, 0, 12)).setObjects(("SLAPM-MIB", "slapmSubcomponentSystemAddress"), ("SLAPM-MIB", "slapmSubcomponentPolicyRuleIndex"), ("SLAPM-MIB", "slapmPRMonControl"), ("SLAPM-MIB", "slapmSubcomponentMonitorStatus"), ("SLAPM-MIB", "slapmSubcomponentMonitorStatus"), ("SLAPM-MIB", "slapmSubcomponentMonitorIntTime"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentInRate"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentOutRate"), ("SLAPM-MIB", "slapmSubcomponentTcpRoundTripTime")) if mibBuilder.loadTexts: slapmSubcMonitorOkay.setStatus('current') if mibBuilder.loadTexts: slapmSubcMonitorOkay.setDescription('This notification is generated when a monitored value has reached an acceptable level. Note: The corresponding slapmPRMonControl BITS setting, enableSubcomponentTraps(3), MUST be selected in order for this notification to potentially be generated.') slapmCompliances = MibIdentifier((1, 3, 6, 1, 3, 88, 2, 1)) slapmGroups = MibIdentifier((1, 3, 6, 1, 3, 88, 2, 2)) slapmCompliance = ModuleCompliance((1, 3, 6, 1, 3, 88, 2, 1, 1)).setObjects(("SLAPM-MIB", "slapmBaseGroup2"), ("SLAPM-MIB", "slapmNotGroup2"), ("SLAPM-MIB", "slapmEndSystemGroup2"), ("SLAPM-MIB", "slapmEndSystemNotGroup2"), ("SLAPM-MIB", "slapmBaseGroup"), ("SLAPM-MIB", "slapmNotGroup"), ("SLAPM-MIB", "slapmOptionalGroup"), ("SLAPM-MIB", "slapmEndSystemGroup"), ("SLAPM-MIB", "slapmEndSystemNotGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): slapmCompliance = slapmCompliance.setStatus('current') if mibBuilder.loadTexts: slapmCompliance.setDescription('The compliance statement for the SLAPM-MIB.') slapmBaseGroup = ObjectGroup((1, 3, 6, 1, 3, 88, 2, 2, 1)).setObjects(("SLAPM-MIB", "slapmSpinLock"), ("SLAPM-MIB", "slapmPolicyCountQueries"), ("SLAPM-MIB", "slapmPolicyCountAccesses"), ("SLAPM-MIB", "slapmPolicyCountSuccessAccesses"), ("SLAPM-MIB", "slapmPolicyCountNotFounds"), ("SLAPM-MIB", "slapmPolicyPurgeTime"), ("SLAPM-MIB", "slapmPolicyTrapEnable"), ("SLAPM-MIB", "slapmPolicyStatsOperStatus"), ("SLAPM-MIB", "slapmPolicyStatsActiveConns"), ("SLAPM-MIB", "slapmPolicyStatsFirstActivated"), ("SLAPM-MIB", "slapmPolicyStatsLastMapping"), ("SLAPM-MIB", "slapmPolicyStatsInOctets"), ("SLAPM-MIB", "slapmPolicyStatsOutOctets"), ("SLAPM-MIB", "slapmPolicyStatsConnectionLimit"), ("SLAPM-MIB", "slapmPolicyStatsTotalConns"), ("SLAPM-MIB", "slapmPolicyStatsCountAccepts"), ("SLAPM-MIB", "slapmPolicyStatsCountDenies"), ("SLAPM-MIB", "slapmPolicyStatsInDiscards"), ("SLAPM-MIB", "slapmPolicyStatsOutDiscards"), ("SLAPM-MIB", "slapmPolicyStatsInPackets"), ("SLAPM-MIB", "slapmPolicyStatsOutPackets"), ("SLAPM-MIB", "slapmPolicyStatsMinRate"), ("SLAPM-MIB", "slapmPolicyStatsMaxRate"), ("SLAPM-MIB", "slapmPolicyStatsMaxDelay"), ("SLAPM-MIB", "slapmPolicyMonitorControl"), ("SLAPM-MIB", "slapmPolicyMonitorStatus"), ("SLAPM-MIB", "slapmPolicyMonitorInterval"), ("SLAPM-MIB", "slapmPolicyMonitorIntTime"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentInRate"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentOutRate"), ("SLAPM-MIB", "slapmPolicyMonitorMinRateLow"), ("SLAPM-MIB", "slapmPolicyMonitorMinRateHigh"), ("SLAPM-MIB", "slapmPolicyMonitorMaxRateHigh"), ("SLAPM-MIB", "slapmPolicyMonitorMaxRateLow"), ("SLAPM-MIB", "slapmPolicyMonitorMaxDelayHigh"), ("SLAPM-MIB", "slapmPolicyMonitorMaxDelayLow"), ("SLAPM-MIB", "slapmPolicyMonitorMinInRateNotAchieves"), ("SLAPM-MIB", "slapmPolicyMonitorMaxInRateExceeds"), ("SLAPM-MIB", "slapmPolicyMonitorMaxDelayExceeds"), ("SLAPM-MIB", "slapmPolicyMonitorMinOutRateNotAchieves"), ("SLAPM-MIB", "slapmPolicyMonitorMaxOutRateExceeds"), ("SLAPM-MIB", "slapmPolicyMonitorCurrentDelayRate"), ("SLAPM-MIB", "slapmPolicyMonitorRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): slapmBaseGroup = slapmBaseGroup.setStatus('deprecated') if mibBuilder.loadTexts: slapmBaseGroup.setDescription('The group of objects defined by this MIB that are required for all implementations to be compliant.') slapmOptionalGroup = ObjectGroup((1, 3, 6, 1, 3, 88, 2, 2, 2)).setObjects(("SLAPM-MIB", "slapmPolicyStatsInProfileOctets"), ("SLAPM-MIB", "slapmPolicyStatsOutProfileOctets")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): slapmOptionalGroup = slapmOptionalGroup.setStatus('deprecated') if mibBuilder.loadTexts: slapmOptionalGroup.setDescription('The group of objects defined by this MIB that are optional.') slapmEndSystemGroup = ObjectGroup((1, 3, 6, 1, 3, 88, 2, 2, 3)).setObjects(("SLAPM-MIB", "slapmPolicyTrapFilter"), ("SLAPM-MIB", "slapmSubcomponentProtocol"), ("SLAPM-MIB", "slapmSubcomponentSystemAddress"), ("SLAPM-MIB", "slapmSubcomponentPolicyName"), ("SLAPM-MIB", "slapmSubcomponentTrafficProfileName"), ("SLAPM-MIB", "slapmSubcomponentLastActivity"), ("SLAPM-MIB", "slapmSubcomponentInOctets"), ("SLAPM-MIB", "slapmSubcomponentOutOctets"), ("SLAPM-MIB", "slapmSubcomponentTcpOutBufferedOctets"), ("SLAPM-MIB", "slapmSubcomponentTcpInBufferedOctets"), ("SLAPM-MIB", "slapmSubcomponentTcpReXmts"), ("SLAPM-MIB", "slapmSubcomponentTcpRoundTripTime"), ("SLAPM-MIB", "slapmSubcomponentTcpRoundTripVariance"), ("SLAPM-MIB", "slapmSubcomponentInPdus"), ("SLAPM-MIB", "slapmSubcomponentOutPdus"), ("SLAPM-MIB", "slapmSubcomponentApplName"), ("SLAPM-MIB", "slapmSubcomponentMonitorStatus"), ("SLAPM-MIB", "slapmSubcomponentMonitorIntTime"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentOutRate"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentInRate")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): slapmEndSystemGroup = slapmEndSystemGroup.setStatus('deprecated') if mibBuilder.loadTexts: slapmEndSystemGroup.setDescription('The group of objects defined by this MIB that are required for end system implementations.') slapmNotGroup = NotificationGroup((1, 3, 6, 1, 3, 88, 2, 2, 4)).setObjects(("SLAPM-MIB", "slapmMonitoredEventNotAchieved"), ("SLAPM-MIB", "slapmMonitoredEventOkay"), ("SLAPM-MIB", "slapmPolicyProfileDeleted"), ("SLAPM-MIB", "slapmPolicyMonitorDeleted")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): slapmNotGroup = slapmNotGroup.setStatus('deprecated') if mibBuilder.loadTexts: slapmNotGroup.setDescription('The group of notifications defined by this MIB that MUST be implemented.') slapmEndSystemNotGroup = NotificationGroup((1, 3, 6, 1, 3, 88, 2, 2, 5)).setObjects(("SLAPM-MIB", "slapmSubcomponentMonitoredEventNotAchieved"), ("SLAPM-MIB", "slapmSubcomponentMonitoredEventOkay")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): slapmEndSystemNotGroup = slapmEndSystemNotGroup.setStatus('deprecated') if mibBuilder.loadTexts: slapmEndSystemNotGroup.setDescription('The group of objects defined by this MIB that are required for end system implementations.') slapmBaseGroup2 = ObjectGroup((1, 3, 6, 1, 3, 88, 2, 2, 6)).setObjects(("SLAPM-MIB", "slapmSpinLock"), ("SLAPM-MIB", "slapmPolicyCountQueries"), ("SLAPM-MIB", "slapmPolicyCountAccesses"), ("SLAPM-MIB", "slapmPolicyCountSuccessAccesses"), ("SLAPM-MIB", "slapmPolicyCountNotFounds"), ("SLAPM-MIB", "slapmPolicyPurgeTime"), ("SLAPM-MIB", "slapmPolicyTrapEnable"), ("SLAPM-MIB", "slapmPolicyNameOfRule"), ("SLAPM-MIB", "slapmPolicyRuleStatsOperStatus"), ("SLAPM-MIB", "slapmPolicyRuleStatsActiveConns"), ("SLAPM-MIB", "slapmPolicyRuleStatsTotalConns"), ("SLAPM-MIB", "slapmPolicyRuleStatsLActivated"), ("SLAPM-MIB", "slapmPolicyRuleStatsLastMapping"), ("SLAPM-MIB", "slapmPolicyRuleStatsInOctets"), ("SLAPM-MIB", "slapmPolicyRuleStatsOutOctets"), ("SLAPM-MIB", "slapmPolicyRuleStatsConnLimit"), ("SLAPM-MIB", "slapmPolicyRuleStatsCountAccepts"), ("SLAPM-MIB", "slapmPolicyRuleStatsCountDenies"), ("SLAPM-MIB", "slapmPolicyRuleStatsInDiscards"), ("SLAPM-MIB", "slapmPolicyRuleStatsOutDiscards"), ("SLAPM-MIB", "slapmPolicyRuleStatsInPackets"), ("SLAPM-MIB", "slapmPolicyRuleStatsOutPackets"), ("SLAPM-MIB", "slapmPolicyRuleStatsInProOctets"), ("SLAPM-MIB", "slapmPolicyRuleStatsOutProOctets"), ("SLAPM-MIB", "slapmPolicyRuleStatsMinRate"), ("SLAPM-MIB", "slapmPolicyRuleStatsMaxRate"), ("SLAPM-MIB", "slapmPolicyRuleStatsMaxDelay"), ("SLAPM-MIB", "slapmPolicyRuleStatsTotalRsvpFlows"), ("SLAPM-MIB", "slapmPolicyRuleStatsActRsvpFlows"), ("SLAPM-MIB", "slapmPRMonControl"), ("SLAPM-MIB", "slapmPRMonStatus"), ("SLAPM-MIB", "slapmPRMonInterval"), ("SLAPM-MIB", "slapmPRMonIntTime"), ("SLAPM-MIB", "slapmPRMonCurrentInRate"), ("SLAPM-MIB", "slapmPRMonCurrentOutRate"), ("SLAPM-MIB", "slapmPRMonMinRateLow"), ("SLAPM-MIB", "slapmPRMonMinRateHigh"), ("SLAPM-MIB", "slapmPRMonMaxRateHigh"), ("SLAPM-MIB", "slapmPRMonMaxRateLow"), ("SLAPM-MIB", "slapmPRMonMaxDelayHigh"), ("SLAPM-MIB", "slapmPRMonMaxDelayLow"), ("SLAPM-MIB", "slapmPRMonMinInRateNotAchieves"), ("SLAPM-MIB", "slapmPRMonMaxInRateExceeds"), ("SLAPM-MIB", "slapmPRMonMaxDelayExceeds"), ("SLAPM-MIB", "slapmPRMonMinOutRateNotAchieves"), ("SLAPM-MIB", "slapmPRMonMaxOutRateExceeds"), ("SLAPM-MIB", "slapmPRMonCurrentDelayRate"), ("SLAPM-MIB", "slapmPRMonRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): slapmBaseGroup2 = slapmBaseGroup2.setStatus('current') if mibBuilder.loadTexts: slapmBaseGroup2.setDescription('The group of objects defined by this MIB that are required for all implementations to be compliant.') slapmEndSystemGroup2 = ObjectGroup((1, 3, 6, 1, 3, 88, 2, 2, 7)).setObjects(("SLAPM-MIB", "slapmPolicyTrapFilter"), ("SLAPM-MIB", "slapmSubcomponentProtocol"), ("SLAPM-MIB", "slapmSubcomponentSystemAddress"), ("SLAPM-MIB", "slapmSubcomponentLastActivity"), ("SLAPM-MIB", "slapmSubcomponentInOctets"), ("SLAPM-MIB", "slapmSubcomponentOutOctets"), ("SLAPM-MIB", "slapmSubcomponentTcpOutBufferedOctets"), ("SLAPM-MIB", "slapmSubcomponentTcpInBufferedOctets"), ("SLAPM-MIB", "slapmSubcomponentTcpReXmts"), ("SLAPM-MIB", "slapmSubcomponentTcpRoundTripTime"), ("SLAPM-MIB", "slapmSubcomponentTcpRoundTripVariance"), ("SLAPM-MIB", "slapmSubcomponentInPdus"), ("SLAPM-MIB", "slapmSubcomponentOutPdus"), ("SLAPM-MIB", "slapmSubcomponentApplName"), ("SLAPM-MIB", "slapmSubcomponentMonitorStatus"), ("SLAPM-MIB", "slapmSubcomponentMonitorIntTime"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentOutRate"), ("SLAPM-MIB", "slapmSubcomponentMonitorCurrentInRate"), ("SLAPM-MIB", "slapmSubcomponentPolicyRuleIndex")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): slapmEndSystemGroup2 = slapmEndSystemGroup2.setStatus('current') if mibBuilder.loadTexts: slapmEndSystemGroup2.setDescription('The group of objects defined by this MIB that are required for end system implementations.') slapmNotGroup2 = NotificationGroup((1, 3, 6, 1, 3, 88, 2, 2, 8)).setObjects(("SLAPM-MIB", "slapmPolicyRuleMonNotOkay"), ("SLAPM-MIB", "slapmPolicyRuleMonOkay"), ("SLAPM-MIB", "slapmPolicyRuleDeleted"), ("SLAPM-MIB", "slapmPolicyRuleMonDeleted")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): slapmNotGroup2 = slapmNotGroup2.setStatus('current') if mibBuilder.loadTexts: slapmNotGroup2.setDescription('The group of notifications defined by this MIB that MUST be implemented.') slapmEndSystemNotGroup2 = NotificationGroup((1, 3, 6, 1, 3, 88, 2, 2, 9)).setObjects(("SLAPM-MIB", "slapmSubcMonitorNotOkay"), ("SLAPM-MIB", "slapmSubcMonitorOkay")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): slapmEndSystemNotGroup2 = slapmEndSystemNotGroup2.setStatus('current') if mibBuilder.loadTexts: slapmEndSystemNotGroup2.setDescription('The group of objects defined by this MIB that are required for end system implementations.') mibBuilder.exportSymbols("SLAPM-MIB", slapmPRMonCurrentOutRate=slapmPRMonCurrentOutRate, slapmPRMonMaxRateLow=slapmPRMonMaxRateLow, slapmPolicyRuleDeleted=slapmPolicyRuleDeleted, slapmPolicyStatsLastMapping=slapmPolicyStatsLastMapping, slapmPolicyMonitorMaxDelayExceeds=slapmPolicyMonitorMaxDelayExceeds, slapmPolicyStatsOutOctets=slapmPolicyStatsOutOctets, slapmPolicyMonitorIntTime=slapmPolicyMonitorIntTime, slapmPolicyRuleStatsCountDenies=slapmPolicyRuleStatsCountDenies, slapmSubcomponentTrafficProfileName=slapmSubcomponentTrafficProfileName, slapmPolicyRuleStatsTotalRsvpFlows=slapmPolicyRuleStatsTotalRsvpFlows, slapmPolicyRuleStatsInPackets=slapmPolicyRuleStatsInPackets, slapmPolicyMonitorMinRateLow=slapmPolicyMonitorMinRateLow, slapmPolicyMonitorCurrentDelayRate=slapmPolicyMonitorCurrentDelayRate, slapmSubcomponentInPdus=slapmSubcomponentInPdus, slapmSubcomponentOutOctets=slapmSubcomponentOutOctets, slapmPolicyStatsInOctets=slapmPolicyStatsInOctets, slapmPolicyMonitorMaxInRateExceeds=slapmPolicyMonitorMaxInRateExceeds, slapmPolicyCountAccesses=slapmPolicyCountAccesses, slapmPolicyStatsPolicyName=slapmPolicyStatsPolicyName, slapmSubcomponentRemPort=slapmSubcomponentRemPort, slapmPolicyMonitorTrafficProfileName=slapmPolicyMonitorTrafficProfileName, slapmPolicyMonitorMaxRateHigh=slapmPolicyMonitorMaxRateHigh, slapmMonitoredEventOkay=slapmMonitoredEventOkay, slapmOptionalGroup=slapmOptionalGroup, slapmPolicyRuleStatsCountAccepts=slapmPolicyRuleStatsCountAccepts, slapmPRMonTable=slapmPRMonTable, slapmPolicyStatsInDiscards=slapmPolicyStatsInDiscards, slapmSubcomponentPolicyName=slapmSubcomponentPolicyName, slapmPRMonMinOutRateNotAchieves=slapmPRMonMinOutRateNotAchieves, slapmSubcomponentOutPdus=slapmSubcomponentOutPdus, slapmPolicyMonitorControl=slapmPolicyMonitorControl, slapmSubcomponentMonitorCurrentInRate=slapmSubcomponentMonitorCurrentInRate, slapmPolicyRuleStatsTable=slapmPolicyRuleStatsTable, slapmPolicyRuleStatsOperStatus=slapmPolicyRuleStatsOperStatus, slapmSubcomponentTcpRoundTripVariance=slapmSubcomponentTcpRoundTripVariance, slapmMIB=slapmMIB, slapmPolicyRuleMonNotOkay=slapmPolicyRuleMonNotOkay, slapmPolicyStatsTrafficProfileName=slapmPolicyStatsTrafficProfileName, slapmPolicyRuleStatsInDiscards=slapmPolicyRuleStatsInDiscards, slapmPolicyStatsTable=slapmPolicyStatsTable, slapmSubcomponentMonitoredEventOkay=slapmSubcomponentMonitoredEventOkay, slapmPolicyNameTable=slapmPolicyNameTable, slapmPolicyStatsCountAccepts=slapmPolicyStatsCountAccepts, slapmPolicyStatsOutDiscards=slapmPolicyStatsOutDiscards, slapmBaseGroup2=slapmBaseGroup2, slapmObjects=slapmObjects, slapmPolicyMonitorCurrentInRate=slapmPolicyMonitorCurrentInRate, slapmPRMonMaxDelayLow=slapmPRMonMaxDelayLow, slapmPolicyStatsFirstActivated=slapmPolicyStatsFirstActivated, slapmPRMonIntTime=slapmPRMonIntTime, slapmPolicyRuleStatsTotalConns=slapmPolicyRuleStatsTotalConns, slapmPRMonRowStatus=slapmPRMonRowStatus, slapmPolicyStatsActiveConns=slapmPolicyStatsActiveConns, slapmPolicyMonitorMinInRateNotAchieves=slapmPolicyMonitorMinInRateNotAchieves, slapmSubcomponentApplName=slapmSubcomponentApplName, slapmEndSystemGroup2=slapmEndSystemGroup2, slapmEndSystemNotGroup2=slapmEndSystemNotGroup2, slapmSubcomponentLocalPort=slapmSubcomponentLocalPort, slapmPolicyStatsOutProfileOctets=slapmPolicyStatsOutProfileOctets, slapmPRMonCurrentInRate=slapmPRMonCurrentInRate, slapmPolicyRuleStatsActiveConns=slapmPolicyRuleStatsActiveConns, slapmEndSystemNotGroup=slapmEndSystemNotGroup, slapmPolicyMonitorMaxOutRateExceeds=slapmPolicyMonitorMaxOutRateExceeds, slapmPolicyRuleStatsOutProOctets=slapmPolicyRuleStatsOutProOctets, slapmPolicyStatsOutPackets=slapmPolicyStatsOutPackets, slapmPolicyStatsMinRate=slapmPolicyStatsMinRate, slapmPolicyMonitorMaxRateLow=slapmPolicyMonitorMaxRateLow, slapmSubcomponentTcpInBufferedOctets=slapmSubcomponentTcpInBufferedOctets, slapmPolicyStatsOperStatus=slapmPolicyStatsOperStatus, slapmPRMonMaxOutRateExceeds=slapmPRMonMaxOutRateExceeds, slapmPRMonMinRateLow=slapmPRMonMinRateLow, slapmSubcomponentRemAddress=slapmSubcomponentRemAddress, slapmBaseObjects=slapmBaseObjects, slapmPolicyMonitorMaxDelayHigh=slapmPolicyMonitorMaxDelayHigh, slapmSubcomponentLocalAddress=slapmSubcomponentLocalAddress, slapmPRMonIndex=slapmPRMonIndex, slapmBaseGroup=slapmBaseGroup, slapmPolicyCountQueries=slapmPolicyCountQueries, slapmPolicyRuleStatsConnLimit=slapmPolicyRuleStatsConnLimit, slapmCompliance=slapmCompliance, slapmPolicyMonitorRowStatus=slapmPolicyMonitorRowStatus, slapmConformance=slapmConformance, slapmPolicyRuleStatsActRsvpFlows=slapmPolicyRuleStatsActRsvpFlows, slapmPolicyRuleMonDeleted=slapmPolicyRuleMonDeleted, slapmPolicyMonitorPolicyName=slapmPolicyMonitorPolicyName, slapmPolicyMonitorTable=slapmPolicyMonitorTable, slapmPRMonMinRateHigh=slapmPRMonMinRateHigh, slapmCompliances=slapmCompliances, slapmPolicyMonitorMinRateHigh=slapmPolicyMonitorMinRateHigh, slapmPolicyPurgeTime=slapmPolicyPurgeTime, slapmPRMonMaxRateHigh=slapmPRMonMaxRateHigh, slapmPRMonMaxDelayExceeds=slapmPRMonMaxDelayExceeds, slapmPolicyNameIndex=slapmPolicyNameIndex, slapmPolicyRuleStatsMinRate=slapmPolicyRuleStatsMinRate, slapmEndSystemGroup=slapmEndSystemGroup, slapmPRMonMaxDelayHigh=slapmPRMonMaxDelayHigh, slapmNotifications=slapmNotifications, slapmPolicyStatsCountDenies=slapmPolicyStatsCountDenies, slapmPolicyRuleStatsLActivated=slapmPolicyRuleStatsLActivated, slapmSubcMonitorNotOkay=slapmSubcMonitorNotOkay, slapmPolicyRuleStatsLastMapping=slapmPolicyRuleStatsLastMapping, slapmPRMonMinInRateNotAchieves=slapmPRMonMinInRateNotAchieves, slapmPolicyTrapFilter=slapmPolicyTrapFilter, slapmSubcomponentMonitorStatus=slapmSubcomponentMonitorStatus, slapmPolicyCountNotFounds=slapmPolicyCountNotFounds, slapmSubcomponentLastActivity=slapmSubcomponentLastActivity, slapmPolicyRuleStatsInOctets=slapmPolicyRuleStatsInOctets, slapmPolicyMonitorOwnerIndex=slapmPolicyMonitorOwnerIndex, slapmPRMonCurrentDelayRate=slapmPRMonCurrentDelayRate, slapmSubcomponentMonitorIntTime=slapmSubcomponentMonitorIntTime, slapmSubcomponentSystemAddress=slapmSubcomponentSystemAddress, slapmPolicyMonitorEntry=slapmPolicyMonitorEntry, slapmPolicyRuleMonOkay=slapmPolicyRuleMonOkay, slapmPolicyRuleStatsMaxDelay=slapmPolicyRuleStatsMaxDelay, slapmSubcomponentTable=slapmSubcomponentTable, slapmPRMonInterval=slapmPRMonInterval, SlapmStatus=SlapmStatus, PYSNMP_MODULE_ID=slapmMIB, slapmPolicyMonitorStatus=slapmPolicyMonitorStatus, slapmSubcomponentProtocol=slapmSubcomponentProtocol, slapmSubcomponentTcpOutBufferedOctets=slapmSubcomponentTcpOutBufferedOctets, slapmPRMonOwnerIndex=slapmPRMonOwnerIndex, slapmSubcomponentInOctets=slapmSubcomponentInOctets, slapmSpinLock=slapmSpinLock, slapmPolicyMonitorMinOutRateNotAchieves=slapmPolicyMonitorMinOutRateNotAchieves, slapmPolicyStatsSystemAddress=slapmPolicyStatsSystemAddress, slapmPolicyMonitorDeleted=slapmPolicyMonitorDeleted, slapmPolicyStatsInPackets=slapmPolicyStatsInPackets, slapmPolicyStatsInProfileOctets=slapmPolicyStatsInProfileOctets, slapmSubcomponentTcpRoundTripTime=slapmSubcomponentTcpRoundTripTime, slapmNotGroup=slapmNotGroup, slapmPolicyRuleStatsOutOctets=slapmPolicyRuleStatsOutOctets, slapmSubcomponentPolicyRuleIndex=slapmSubcomponentPolicyRuleIndex, slapmPRMonControl=slapmPRMonControl, slapmPolicyNameEntry=slapmPolicyNameEntry, slapmPRMonSystemAddress=slapmPRMonSystemAddress, slapmPolicyStatsEntry=slapmPolicyStatsEntry, SlapmNameType=SlapmNameType, slapmPolicyMonitorCurrentOutRate=slapmPolicyMonitorCurrentOutRate, slapmPolicyStatsTotalConns=slapmPolicyStatsTotalConns, slapmPolicyTrapEnable=slapmPolicyTrapEnable, SlapmPolicyRuleName=SlapmPolicyRuleName, slapmSubcomponentTcpReXmts=slapmSubcomponentTcpReXmts, slapmPolicyRuleStatsEntry=slapmPolicyRuleStatsEntry, slapmPolicyStatsConnectionLimit=slapmPolicyStatsConnectionLimit, slapmPRMonStatus=slapmPRMonStatus, slapmPolicyNameOfRule=slapmPolicyNameOfRule, slapmPolicyMonitorSystemAddress=slapmPolicyMonitorSystemAddress, slapmTableObjects=slapmTableObjects, slapmGroups=slapmGroups, slapmPolicyStatsMaxRate=slapmPolicyStatsMaxRate, slapmPolicyRuleStatsOutPackets=slapmPolicyRuleStatsOutPackets, slapmMonitoredEventNotAchieved=slapmMonitoredEventNotAchieved, slapmPolicyNameSystemAddress=slapmPolicyNameSystemAddress, slapmSubcMonitorOkay=slapmSubcMonitorOkay, slapmPolicyRuleStatsInProOctets=slapmPolicyRuleStatsInProOctets, slapmPolicyMonitorInterval=slapmPolicyMonitorInterval, slapmPolicyProfileDeleted=slapmPolicyProfileDeleted, slapmSubcomponentMonitoredEventNotAchieved=slapmSubcomponentMonitoredEventNotAchieved, slapmSubcomponentEntry=slapmSubcomponentEntry, slapmPolicyRuleStatsMaxRate=slapmPolicyRuleStatsMaxRate, slapmPolicyCountSuccessAccesses=slapmPolicyCountSuccessAccesses, slapmPRMonEntry=slapmPRMonEntry, slapmPolicyStatsMaxDelay=slapmPolicyStatsMaxDelay, slapmSubcomponentMonitorCurrentOutRate=slapmSubcomponentMonitorCurrentOutRate, slapmPRMonMaxInRateExceeds=slapmPRMonMaxInRateExceeds, slapmPolicyRuleStatsOutDiscards=slapmPolicyRuleStatsOutDiscards, slapmPolicyMonitorMaxDelayLow=slapmPolicyMonitorMaxDelayLow, slapmNotGroup2=slapmNotGroup2)
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, single_value_constraint, value_size_constraint, value_range_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'SingleValueConstraint', 'ValueSizeConstraint', 'ValueRangeConstraint', 'ConstraintsIntersection') (snmp_admin_string,) = mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString') (module_compliance, object_group, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'ObjectGroup', 'NotificationGroup') (time_ticks, mib_identifier, unsigned32, ip_address, gauge32, experimental, iso, notification_type, counter32, bits, mib_scalar, mib_table, mib_table_row, mib_table_column, counter64, object_identity, integer32, module_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'TimeTicks', 'MibIdentifier', 'Unsigned32', 'IpAddress', 'Gauge32', 'experimental', 'iso', 'NotificationType', 'Counter32', 'Bits', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Counter64', 'ObjectIdentity', 'Integer32', 'ModuleIdentity') (textual_convention, test_and_incr, date_and_time, display_string, row_status) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'TestAndIncr', 'DateAndTime', 'DisplayString', 'RowStatus') slapm_mib = module_identity((1, 3, 6, 1, 3, 88)) slapmMIB.setRevisions(('2000-01-24 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: slapmMIB.setRevisionsDescriptions(('This version published as RFC 2758.',)) if mibBuilder.loadTexts: slapmMIB.setLastUpdated('200001240000Z') if mibBuilder.loadTexts: slapmMIB.setOrganization('International Business Machines Corp.') if mibBuilder.loadTexts: slapmMIB.setContactInfo('Kenneth White International Business Machines Corporation Network Computing Software Division Research Triangle Park, NC, USA E-mail: wkenneth@us.ibm.com') if mibBuilder.loadTexts: slapmMIB.setDescription('The Service Level Agreement Performance Monitoring MIB (SLAPM-MIB) provides data collection and monitoring capabilities for Service Level Agreements (SLAs) policy definitions.') class Slapmnametype(SnmpAdminString): description = 'The textual convention for naming entities within this MIB. The actual contents of an object defined using this textual convention should consist of the distinguished name portion of an name. This is usually the right-most portion of the name. This convention is necessary, since names within this MIB can be used as index items and an instance identifier is limited to 128 subidentifiers. This textual convention has been deprecated. All of the tables defined within this MIB that use this textual convention have been deprecated as well since the method of using a portion of the name (either of a policy definition or of a traffic profile) has been replaced by using an Unsigned32 index. The new slapmPolicyNameTable would then map the Unsigned32 index to a real name.' status = 'deprecated' subtype_spec = SnmpAdminString.subtypeSpec + value_size_constraint(0, 32) class Slapmstatus(TextualConvention, Bits): description = 'The textual convention for defining the various slapmPRMonTable (or old slapmPolicyMonitorTable) and the slapmSubcomponentTable states for actual policy rule traffic monitoring.' status = 'current' named_values = named_values(('slaMinInRateNotAchieved', 0), ('slaMaxInRateExceeded', 1), ('slaMaxDelayExceeded', 2), ('slaMinOutRateNotAchieved', 3), ('slaMaxOutRateExceeded', 4), ('monitorMinInRateNotAchieved', 5), ('monitorMaxInRateExceeded', 6), ('monitorMaxDelayExceeded', 7), ('monitorMinOutRateNotAchieved', 8), ('monitorMaxOutRateExceeded', 9)) class Slapmpolicyrulename(TextualConvention, OctetString): description = 'To facilitate internationalization, this TC represents information taken from the ISO/IEC IS 10646-1 character set, encoded as an octet string using the UTF-8 character encoding scheme described in RFC 2044. For strings in 7-bit US-ASCII, there is no impact since the UTF-8 representation is identical to the US-ASCII encoding.' status = 'current' display_hint = '1024t' subtype_spec = OctetString.subtypeSpec + value_size_constraint(0, 1024) slapm_notifications = mib_identifier((1, 3, 6, 1, 3, 88, 0)) slapm_objects = mib_identifier((1, 3, 6, 1, 3, 88, 1)) slapm_conformance = mib_identifier((1, 3, 6, 1, 3, 88, 2)) slapm_base_objects = mib_identifier((1, 3, 6, 1, 3, 88, 1, 1)) slapm_spin_lock = mib_scalar((1, 3, 6, 1, 3, 88, 1, 1, 1), test_and_incr()).setMaxAccess('readwrite') if mibBuilder.loadTexts: slapmSpinLock.setStatus('current') if mibBuilder.loadTexts: slapmSpinLock.setDescription('An advisory lock used to allow cooperating applications to coordinate their use of the contents of this MIB. This typically occurs when an application seeks to create an new entry or alter an existing entry in slapmPRMonTable (or old slapmPolicyMonitorTable). A management implementation MAY utilize the slapmSpinLock to serialize its changes or additions. This usage is not required. However, slapmSpinLock MUST be supported by agent implementations.') slapm_policy_count_queries = mib_scalar((1, 3, 6, 1, 3, 88, 1, 1, 2), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyCountQueries.setStatus('current') if mibBuilder.loadTexts: slapmPolicyCountQueries.setDescription('The total number of times that a policy lookup occurred with respect to a policy agent. This is the number of times that a reference was made to a policy definition at a system and includes the number of times that a policy repository was accessed, slapmPolicyCountAccesses. The object slapmPolicyCountAccesses should be less than slapmPolicyCountQueries when policy definitions are cached at a system.') slapm_policy_count_accesses = mib_scalar((1, 3, 6, 1, 3, 88, 1, 1, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyCountAccesses.setStatus('current') if mibBuilder.loadTexts: slapmPolicyCountAccesses.setDescription('Total number of times that a policy repository was accessed with respect to a policy agent. The value of this object should be less than slapmPolicyCountQueries, since typically policy entries are cached to minimize repository accesses.') slapm_policy_count_success_accesses = mib_scalar((1, 3, 6, 1, 3, 88, 1, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyCountSuccessAccesses.setStatus('current') if mibBuilder.loadTexts: slapmPolicyCountSuccessAccesses.setDescription('Total number of successful policy repository accesses with respect to a policy agent.') slapm_policy_count_not_founds = mib_scalar((1, 3, 6, 1, 3, 88, 1, 1, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyCountNotFounds.setStatus('current') if mibBuilder.loadTexts: slapmPolicyCountNotFounds.setDescription('Total number of policy repository accesses, with respect to a policy agent, that resulted in an entry not being located.') slapm_policy_purge_time = mib_scalar((1, 3, 6, 1, 3, 88, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 3600)).clone(900)).setUnits('seconds').setMaxAccess('readwrite') if mibBuilder.loadTexts: slapmPolicyPurgeTime.setStatus('current') if mibBuilder.loadTexts: slapmPolicyPurgeTime.setDescription('The purpose of this object is to define the amount of time (in seconds) to wait before removing an slapmPolicyRuleStatsEntry (or old slapmPolicyStatsEntry) when a system detects that the associated policy definition has been deleted. This gives any polling management applications time to complete their last poll before an entry is removed. An slapmPolicyRuleStatsEntry (or old slapmPolicyStatsEntry) enters the deleteNeeded(3) state via slapmPolicyRuleStatsOperStatus (or old slapmPolicyStatsOperStatus) when a system first detects that the entry needs to be removed. Once slapmPolicyPurgeTime has expired for an entry in deleteNeeded(3) state it is removed a long with any dependent slapmPRMonTable (or slapmPolicyMonitorTable) entries. A value of 0 for this option disables this function and results in the automatic purging of slapmPRMonTable (or slapmPolicyTable) entries upon transition into deleteNeeded(3) state. A slapmPolicyRuleDeleted (or slapmPolicyProfileDeleted) notification is sent when an slapmPolicyRuleStatsEntry (or slapmPolicyStatsEntry) is removed. Dependent slapmPRMonTable (or slapmPolicyMonitorTable) deletion results in a slapmPolicyRuleMonDeleted (or slapmPolicyMonitorDeleted) notification being sent. These notifications are suppressed if the value of slapmPolicyTrapEnable is disabled(2).') slapm_policy_trap_enable = mib_scalar((1, 3, 6, 1, 3, 88, 1, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2))).clone('disabled')).setMaxAccess('readwrite') if mibBuilder.loadTexts: slapmPolicyTrapEnable.setStatus('current') if mibBuilder.loadTexts: slapmPolicyTrapEnable.setDescription('Indicates whether slapmPolicyRuleDeleted and slapmPolicyRuleMonDeleted (or slapmPolicyProfileDeleted and slapmPolicyMonitorDeleted) notifications should be generated by this system.') slapm_policy_trap_filter = mib_scalar((1, 3, 6, 1, 3, 88, 1, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 64)).clone(3)).setUnits('intervals').setMaxAccess('readwrite') if mibBuilder.loadTexts: slapmPolicyTrapFilter.setStatus('current') if mibBuilder.loadTexts: slapmPolicyTrapFilter.setDescription('The purpose of this object is to suppress unnecessary slapmSubcMonitorNotOkay (or slapmSubcomponentMonitoredEventNotAchieved), for example, notifications. Basically, a monitored event has to not meet its SLA requirement for the number of consecutive intervals indicated by the value of this object.') slapm_table_objects = mib_identifier((1, 3, 6, 1, 3, 88, 1, 2)) slapm_policy_stats_table = mib_table((1, 3, 6, 1, 3, 88, 1, 2, 1)) if mibBuilder.loadTexts: slapmPolicyStatsTable.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsTable.setDescription('Provides statistics on all policies known at a system. This table has been deprecated and replaced with the slapmPolicyRuleStatsTable. Older implementations of this MIB are expected to continue their support of this table.') slapm_policy_stats_entry = mib_table_row((1, 3, 6, 1, 3, 88, 1, 2, 1, 1)).setIndexNames((0, 'SLAPM-MIB', 'slapmPolicyStatsSystemAddress'), (0, 'SLAPM-MIB', 'slapmPolicyStatsPolicyName'), (0, 'SLAPM-MIB', 'slapmPolicyStatsTrafficProfileName')) if mibBuilder.loadTexts: slapmPolicyStatsEntry.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsEntry.setDescription('Defines an entry in the slapmPolicyStatsTable. This table defines a set of statistics that is kept on a per system, policy and traffic profile basis. A policy can be defined to contain multiple traffic profiles that map to a single action. Entries in this table are not created or deleted via SNMP but reflect the set of policy definitions known at a system.') slapm_policy_stats_system_address = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 1), octet_string().subtype(subtypeSpec=constraints_union(value_size_constraint(0, 0), value_size_constraint(4, 4), value_size_constraint(16, 16)))) if mibBuilder.loadTexts: slapmPolicyStatsSystemAddress.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsSystemAddress.setDescription('Address of a system that an Policy definition relates to. A zero length octet string must be used to indicate that only a single system is being represented. Otherwise, the length of the octet string must be 4 for an ipv4 address or 16 for an ipv6 address.') slapm_policy_stats_policy_name = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 2), slapm_name_type()) if mibBuilder.loadTexts: slapmPolicyStatsPolicyName.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsPolicyName.setDescription('Policy name that this entry relates to.') slapm_policy_stats_traffic_profile_name = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 3), slapm_name_type()) if mibBuilder.loadTexts: slapmPolicyStatsTrafficProfileName.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsTrafficProfileName.setDescription('The name of a traffic profile that is associated with a policy.') slapm_policy_stats_oper_status = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('inactive', 1), ('active', 2), ('deleteNeeded', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyStatsOperStatus.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsOperStatus.setDescription('The state of a policy entry: inactive(1) - An policy entry was either defined by local system definition or discovered via a directory search but has not been activated (not currently being used). active(2) - Policy entry is being used to affect traffic flows. deleteNeeded(3) - Either though local implementation dependent methods or by discovering that the directory entry corresponding to this table entry no longer exists and slapmPolicyPurgeTime needs to expire before attempting to remove the corresponding slapmPolicyStatsEntry and any dependent slapmPolicyMonitor table entries. Note: a policy traffic profile in a state other than active(1) is not being used to affect traffic flows.') slapm_policy_stats_active_conns = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 5), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyStatsActiveConns.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsActiveConns.setDescription('The number of active TCP connections that are affected by the corresponding policy entry.') slapm_policy_stats_total_conns = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyStatsTotalConns.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsTotalConns.setDescription('The number of total TCP connections that are affected by the corresponding policy entry.') slapm_policy_stats_first_activated = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 7), date_and_time().clone(hexValue='0000000000000000')).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyStatsFirstActivated.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsFirstActivated.setDescription('The timestamp for when the corresponding policy entry is activated. The value of this object serves as the discontinuity event indicator when polling entries in this table. The value of this object is updated on transition of slapmPolicyStatsOperStatus into the active(2) state.') slapm_policy_stats_last_mapping = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 8), date_and_time().clone(hexValue='0000000000000000')).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyStatsLastMapping.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsLastMapping.setDescription('The timestamp for when the last time that the associated policy entry was used.') slapm_policy_stats_in_octets = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyStatsInOctets.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsInOctets.setDescription('The number of octets that was received by IP for an entity that map to this entry.') slapm_policy_stats_out_octets = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyStatsOutOctets.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsOutOctets.setDescription('The number of octets that was transmitted by IP for an entity that map to this entry.') slapm_policy_stats_connection_limit = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 11), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyStatsConnectionLimit.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsConnectionLimit.setDescription('The limit for the number of active TCP connections that are allowed for this policy definition. A value of zero for this object implies that a connection limit has not been specified.') slapm_policy_stats_count_accepts = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 12), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyStatsCountAccepts.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsCountAccepts.setDescription("This counter is incremented when a policy action's Permission value is set to Accept and a session (TCP connection) is accepted.") slapm_policy_stats_count_denies = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 13), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyStatsCountDenies.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsCountDenies.setDescription("This counter is incremented when a policy action's Permission value is set to Deny and a session is denied, or when a session (TCP connection) is rejected due to a policy's connection limit (slapmPolicyStatsConnectLimit) being reached.") slapm_policy_stats_in_discards = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 14), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyStatsInDiscards.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsInDiscards.setDescription('This counter counts the number of in octets discarded. This occurs when an error is detected. Examples of this are buffer overflow, checksum error, or bad packet format.') slapm_policy_stats_out_discards = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 15), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyStatsOutDiscards.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsOutDiscards.setDescription('This counter counts the number of out octets discarded. Examples of this are buffer overflow, checksum error, or bad packet format.') slapm_policy_stats_in_packets = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 16), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyStatsInPackets.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsInPackets.setDescription('This counter counts the number of in packets received that relate to this policy entry from IP.') slapm_policy_stats_out_packets = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 17), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyStatsOutPackets.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsOutPackets.setDescription('This counter counts the number of out packets sent by IP that relate to this policy entry.') slapm_policy_stats_in_profile_octets = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 18), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyStatsInProfileOctets.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsInProfileOctets.setDescription('This counter counts the number of in octets that are determined to be within profile.') slapm_policy_stats_out_profile_octets = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 19), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyStatsOutProfileOctets.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsOutProfileOctets.setDescription('This counter counts the number of out octets that are determined to be within profile.') slapm_policy_stats_min_rate = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 20), integer32()).setUnits('Kilobits per second').setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyStatsMinRate.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsMinRate.setDescription('The minimum transfer rate defined for this entry.') slapm_policy_stats_max_rate = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 21), integer32()).setUnits('Kilobits per second').setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyStatsMaxRate.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsMaxRate.setDescription('The maximum transfer rate defined for this entry.') slapm_policy_stats_max_delay = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 1, 1, 22), integer32()).setUnits('milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyStatsMaxDelay.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyStatsMaxDelay.setDescription('The maximum delay defined for this entry.') slapm_policy_monitor_table = mib_table((1, 3, 6, 1, 3, 88, 1, 2, 2)) if mibBuilder.loadTexts: slapmPolicyMonitorTable.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorTable.setDescription('Provides a method of monitoring policies and their effect at a system. This table has been deprecated and replaced with the slapmPRMonTable. Older implementations of this MIB are expected to continue their support of this table.') slapm_policy_monitor_entry = mib_table_row((1, 3, 6, 1, 3, 88, 1, 2, 2, 1)).setIndexNames((0, 'SLAPM-MIB', 'slapmPolicyMonitorOwnerIndex'), (0, 'SLAPM-MIB', 'slapmPolicyMonitorSystemAddress'), (0, 'SLAPM-MIB', 'slapmPolicyMonitorPolicyName'), (0, 'SLAPM-MIB', 'slapmPolicyMonitorTrafficProfileName')) if mibBuilder.loadTexts: slapmPolicyMonitorEntry.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorEntry.setDescription('Defines an entry in the slapmPolicyMonitorTable. This table defines which policies should be monitored on a per policy traffic profile basis.') slapm_policy_monitor_owner_index = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 1), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(0, 16))) if mibBuilder.loadTexts: slapmPolicyMonitorOwnerIndex.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorOwnerIndex.setDescription("To facilitate the provisioning of access control by a security administrator using the View-Based Access Control Model (RFC 2575, VACM) for tables in which multiple users may need to independently create or modify entries, the initial index is used as an 'owner index'. Such an initial index has a syntax of SnmpAdminString, and can thus be trivially mapped to a securityName or groupName as defined in VACM, in accordance with a security policy. All entries in that table belonging to a particular user will have the same value for this initial index. For a given user's entries in a particular table, the object identifiers for the information in these entries will have the same subidentifiers (except for the 'column' subidentifier) up to the end of the encoded owner index. To configure VACM to permit access to this portion of the table, one would create vacmViewTreeFamilyTable entries with the value of vacmViewTreeFamilySubtree including the owner index portion, and vacmViewTreeFamilyMask 'wildcarding' the column subidentifier. More elaborate configurations are possible.") slapm_policy_monitor_system_address = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 2), octet_string().subtype(subtypeSpec=constraints_union(value_size_constraint(0, 0), value_size_constraint(4, 4), value_size_constraint(16, 16)))) if mibBuilder.loadTexts: slapmPolicyMonitorSystemAddress.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorSystemAddress.setDescription('Address of a system that an Policy definition relates to. A zero length octet string can be used to indicate that only a single system is being represented. Otherwise, the length of the octet string should be 4 for an ipv4 address and 16 for an ipv6 address.') slapm_policy_monitor_policy_name = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 3), slapm_name_type()) if mibBuilder.loadTexts: slapmPolicyMonitorPolicyName.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorPolicyName.setDescription('Policy name that this entry relates to.') slapm_policy_monitor_traffic_profile_name = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 4), slapm_name_type()) if mibBuilder.loadTexts: slapmPolicyMonitorTrafficProfileName.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorTrafficProfileName.setDescription('The corresponding Traffic Profile name.') slapm_policy_monitor_control = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 5), bits().clone(namedValues=named_values(('monitorMinRate', 0), ('monitorMaxRate', 1), ('monitorMaxDelay', 2), ('enableAggregateTraps', 3), ('enableSubcomponentTraps', 4), ('monitorSubcomponents', 5))).clone(namedValues=named_values(('monitorMinRate', 0), ('monitorMaxRate', 1), ('monitorMaxDelay', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: slapmPolicyMonitorControl.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorControl.setDescription("The value of this object determines the type and level of monitoring that is applied to a policy/profile. The value of this object can't be changed once the table entry that it is a part of is activated via a slapmPolicyMonitorRowStatus transition to active state. monitorMinRate(0) - Monitor minimum transfer rate. monitorMaxRate(1) - Monitor maximum transfer rate. monitorMaxDelay(2) - Monitor maximum delay. enableAggregateTraps(3) - The enableAggregateTraps(3) BITS setting enables notification generation when monitoring a policy traffic profile as an aggregate using the values in the corresponding slapmPolicyStatsEntry. By default this function is not enabled. enableSubcomponentTraps(4) - This BITS setting enables notification generation when monitoring all subcomponents that are mapped to an corresponding slapmPolicyStatsEntry. By default this function is not enabled. monitorSubcomponents(5) - This BITS setting enables monitoring of each subcomponent (typically a TCP connection or UDP listener) individually.") slapm_policy_monitor_status = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 6), slapm_status()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyMonitorStatus.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorStatus.setDescription("The value of this object indicates when a monitored value has not meet a threshold or isn't meeting the defined service level. The SlapmStatus TEXTUAL-CONVENTION defines two levels of not meeting a threshold. The first set: slaMinInRateNotAchieved(0), slaMaxInRateExceeded(1), slaMaxDelayExceeded(2), slaMinOutRateNotAchieved(3), slaMaxOutRateExceeded(4) are used to indicate when the SLA as an aggregate is not meeting a threshold while the second set: monitorMinInRateNotAchieved(5), monitorMaxInRateExceeded(6), monitorMaxDelayExceeded(7), monitorMinOutRateNotAchieved(8), monitorMaxOutRateExceeded(9) indicate that at least one subcomponent is not meeting a threshold.") slapm_policy_monitor_interval = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(15, 86400)).clone(20)).setUnits('seconds').setMaxAccess('readcreate') if mibBuilder.loadTexts: slapmPolicyMonitorInterval.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorInterval.setDescription('The number of seconds that defines the sample period.') slapm_policy_monitor_int_time = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 8), date_and_time().clone(hexValue='0000000000000000')).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyMonitorIntTime.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorIntTime.setDescription('The timestamp for when the last interval ended.') slapm_policy_monitor_current_in_rate = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 9), gauge32()).setUnits('kilobits per second').setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyMonitorCurrentInRate.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorCurrentInRate.setDescription('Using the value of the corresponding slapmPolicyMonitorInterval, slapmPolicyStatsInOctets is sampled and then divided by slapmPolicyMonitorInterval to determine the current in transfer rate.') slapm_policy_monitor_current_out_rate = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 10), gauge32()).setUnits('kilobits per second').setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyMonitorCurrentOutRate.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorCurrentOutRate.setDescription('Using the value of the corresponding slapmPolicyMonitorInterval, slapmPolicyStatsOutOctets is sampled and then divided by slapmPolicyMonitorInterval to determine the current out transfer rate.') slapm_policy_monitor_min_rate_low = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 11), integer32()).setUnits('kilobits per second').setMaxAccess('readcreate') if mibBuilder.loadTexts: slapmPolicyMonitorMinRateLow.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMinRateLow.setDescription("The threshold for generating a slapmMonitoredEventNotAchieved notification, signalling that a monitored minimum transfer rate has not been meet. A slapmMonitoredEventNotAchieved notification is not generated again for an slapmPolicyMonitorEntry until the minimum transfer rate exceeds slapmPolicyMonitorMinRateHigh (a slapmMonitoredEventOkay notification is then transmitted) and then fails below slapmPolicyMonitorMinRateLow. This behavior reduces the slapmMonitoredEventNotAchieved notifications that are transmitted. A value of zero for this object is returned when the slapmPolicyMonitorControl monitorMinRate(0) is not enabled. When enabled the default value for this object is the min rate value specified in the associated action definition minus 10%. If the action definition doesn't have a min rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMinRate(0) is selected. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapm_policy_monitor_min_rate_high = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 12), integer32()).setUnits('kilobits per second').setMaxAccess('readcreate') if mibBuilder.loadTexts: slapmPolicyMonitorMinRateHigh.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMinRateHigh.setDescription("The threshold for generating a slapmMonitoredEventOkay notification, signalling that a monitored minimum transfer rate has increased to an acceptable level. A value of zero for this object is returned when the slapmPolicyMonitorControl monitorMinRate(0) is not enabled. When enabled the default value for this object is the min rate value specified in the associated action definition plus 10%. If the action definition doesn't have a min rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMinRate(0) is selected. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapm_policy_monitor_max_rate_high = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 13), integer32()).setUnits('kilobits per second').setMaxAccess('readcreate') if mibBuilder.loadTexts: slapmPolicyMonitorMaxRateHigh.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMaxRateHigh.setDescription("The threshold for generating a slapmMonitoredEventNotAchieved notification, signalling that a monitored maximum transfer rate has been exceeded. A slapmMonitoredEventNotAchieved notification is not generated again for an slapmPolicyMonitorEntry until the maximum transfer rate fails below slapmPolicyMonitorMaxRateLow (a slapmMonitoredEventOkay notification is then transmitted) and then raises above slapmPolicyMonitorMaxRateHigh. This behavior reduces the slapmMonitoredEventNotAchieved notifications that are transmitted. A value of zero for this object is returned when the slapmPolicyMonitorControl monitorMaxRate(1) is not enabled. When enabled the default value for this object is the max rate value specified in the associated action definition plus 10%. If the action definition doesn't have a max rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxRate(1) is selected. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapm_policy_monitor_max_rate_low = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 14), integer32()).setUnits('kilobits per second').setMaxAccess('readcreate') if mibBuilder.loadTexts: slapmPolicyMonitorMaxRateLow.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMaxRateLow.setDescription("The threshold for generating a slapmMonitoredEventOkay notification, signalling that a monitored maximum transfer rate has fallen to an acceptable level. A value of zero for this object is returned when the slapmPolicyMonitorControl monitorMaxRate(1) is not enabled. When enabled the default value for this object is the max rate value specified in the associated action definition minus 10%. If the action definition doesn't have a max rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxRate(1) is selected. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapm_policy_monitor_max_delay_high = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 15), integer32()).setUnits('milliseconds').setMaxAccess('readcreate') if mibBuilder.loadTexts: slapmPolicyMonitorMaxDelayHigh.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMaxDelayHigh.setDescription("The threshold for generating a slapmMonitoredEventNotAchieved notification, signalling that a monitored maximum delay rate has been exceeded. A slapmMonitoredEventNotAchieved notification is not generated again for an slapmPolicyMonitorEntry until the maximum delay rate falls below slapmPolicyMonitorMaxDelayLow (a slapmMonitoredEventOkay notification is then transmitted) and raises above slapmPolicyMonitorMaxDelayHigh. This behavior reduces the slapmMonitoredEventNotAchieved notifications that are transmitted. A value of zero for this object is returned when the slapmPolicyMonitorControl monitorMaxDelay(4) is not enabled. When enabled the default value for this object is the max delay value specified in the associated action definition plus 10%. If the action definition doesn't have a max delay defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxDelay(4) is selected. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapm_policy_monitor_max_delay_low = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 16), integer32()).setUnits('milliseconds').setMaxAccess('readcreate') if mibBuilder.loadTexts: slapmPolicyMonitorMaxDelayLow.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMaxDelayLow.setDescription("The threshold for generating a slapmMonitoredEventOkay notification, signalling that a monitored maximum delay rate has fallen to an acceptable level. A value of zero for this object is returned when the slapmPolicyMonitorControl monitorMaxDelay(4) is not enabled. When enabled the default value for this object is the max delay value specified in the associated action definition minus 10%. If the action definition doesn't have a max delay defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxDelay(4) is selected. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapm_policy_monitor_min_in_rate_not_achieves = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 17), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyMonitorMinInRateNotAchieves.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMinInRateNotAchieves.setDescription('The number of times that a minimum transfer in rate was not achieved.') slapm_policy_monitor_max_in_rate_exceeds = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 18), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyMonitorMaxInRateExceeds.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMaxInRateExceeds.setDescription('The number of times that a maximum transfer in rate was exceeded.') slapm_policy_monitor_max_delay_exceeds = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 19), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyMonitorMaxDelayExceeds.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMaxDelayExceeds.setDescription('The number of times that a maximum delay in rate was exceeded.') slapm_policy_monitor_min_out_rate_not_achieves = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 20), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyMonitorMinOutRateNotAchieves.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMinOutRateNotAchieves.setDescription('The number of times that a minimum transfer out rate was not achieved.') slapm_policy_monitor_max_out_rate_exceeds = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 21), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyMonitorMaxOutRateExceeds.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorMaxOutRateExceeds.setDescription('The number of times that a maximum transfer out rate was exceeded.') slapm_policy_monitor_current_delay_rate = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 22), gauge32()).setUnits('milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyMonitorCurrentDelayRate.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorCurrentDelayRate.setDescription('The current delay rate for this entry. This is calculated by taking the average of the TCP round trip times for all associating slapmSubcomponentTable entries within a interval.') slapm_policy_monitor_row_status = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 2, 1, 23), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: slapmPolicyMonitorRowStatus.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorRowStatus.setDescription('This object allows entries to be created and deleted in the slapmPolicyMonitorTable. An entry in this table is deleted by setting this object to destroy(6). Removal of a corresponding (same policy and traffic profile names) slapmPolicyStatsEntry has the side effect of the automatic deletion an entry in this table.') slapm_subcomponent_table = mib_table((1, 3, 6, 1, 3, 88, 1, 2, 3)) if mibBuilder.loadTexts: slapmSubcomponentTable.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentTable.setDescription('Defines a table to provide information on the individually components that are mapped to a policy rule (or old traffic profile). The indexing for this table is designed to support the use of an SNMP GET-NEXT operation using only the remote address and remote port as a way for a management station to retrieve the table entries relating to a particular client.') slapm_subcomponent_entry = mib_table_row((1, 3, 6, 1, 3, 88, 1, 2, 3, 1)).setIndexNames((0, 'SLAPM-MIB', 'slapmSubcomponentRemAddress'), (0, 'SLAPM-MIB', 'slapmSubcomponentRemPort'), (0, 'SLAPM-MIB', 'slapmSubcomponentLocalAddress'), (0, 'SLAPM-MIB', 'slapmSubcomponentLocalPort')) if mibBuilder.loadTexts: slapmSubcomponentEntry.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentEntry.setDescription("Describes a particular subcomponent entry. This table does not have an OwnerIndex as part of its indexing since this table's contents is intended to span multiple users.") slapm_subcomponent_rem_address = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 1), octet_string().subtype(subtypeSpec=constraints_union(value_size_constraint(0, 0), value_size_constraint(4, 4), value_size_constraint(16, 16)))) if mibBuilder.loadTexts: slapmSubcomponentRemAddress.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentRemAddress.setDescription('Indicate the remote address of a subcomponent. A remote address can be either an ipv4 address in which case 4 octets are required or as an ipv6 address that requires 16 octets. The value of this subidentifier is a zero length octet string when this entry relates to a UDP listener.') slapm_subcomponent_rem_port = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))) if mibBuilder.loadTexts: slapmSubcomponentRemPort.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentRemPort.setDescription('Indicate the remote port of a subcomponent. The value of this subidentifier is 0 when this entry relates to a UDP listener.') slapm_subcomponent_local_address = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 3), octet_string().subtype(subtypeSpec=constraints_union(value_size_constraint(4, 4), value_size_constraint(16, 16)))) if mibBuilder.loadTexts: slapmSubcomponentLocalAddress.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentLocalAddress.setDescription('Indicate the local address of a subcomponent. A local address can be either an ipv4 address in which case 4 octets are required or as an ipv6 address that requires 16 octets.') slapm_subcomponent_local_port = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))) if mibBuilder.loadTexts: slapmSubcomponentLocalPort.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentLocalPort.setDescription('Indicate the local port of a subcomponent.') slapm_subcomponent_protocol = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('udpListener', 1), ('tcpConnection', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmSubcomponentProtocol.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentProtocol.setDescription('Indicate the protocol in use that identifies the type of subcomponent.') slapm_subcomponent_system_address = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 6), octet_string().subtype(subtypeSpec=constraints_union(value_size_constraint(0, 0), value_size_constraint(4, 4), value_size_constraint(16, 16)))).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmSubcomponentSystemAddress.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentSystemAddress.setDescription('Address of a system that an Policy definition relates to. A zero length octet string can be used to indicate that only a single system is being represented. Otherwise, the length of the octet string should be 4 for an ipv4 address and 16 for an ipv6 address.') slapm_subcomponent_policy_name = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 7), slapm_name_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmSubcomponentPolicyName.setStatus('deprecated') if mibBuilder.loadTexts: slapmSubcomponentPolicyName.setDescription('Policy name that this entry relates to. This object, along with slapmSubcomponentTrafficProfileName, have been replaced with the use of an unsigned integer index that is mapped to an slapmPolicyNameEntry to actually identify policy naming.') slapm_subcomponent_traffic_profile_name = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 8), slapm_name_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmSubcomponentTrafficProfileName.setStatus('deprecated') if mibBuilder.loadTexts: slapmSubcomponentTrafficProfileName.setDescription('The corresponding traffic profile name. This object, along with slapmSubcomponentProfileName, have been replaced with the use of an unsigned integer index that is mapped to an slapmPolicyNameEntry to actually identify policy naming.') slapm_subcomponent_last_activity = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 9), date_and_time().clone(hexValue='0000000000000000')).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmSubcomponentLastActivity.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentLastActivity.setDescription('The date and timestamp of when this entry was last used.') slapm_subcomponent_in_octets = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmSubcomponentInOctets.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentInOctets.setDescription('The number of octets received from IP for this connection.') slapm_subcomponent_out_octets = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmSubcomponentOutOctets.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentOutOctets.setDescription('The number of octets sent to IP for this connection.') slapm_subcomponent_tcp_out_buffered_octets = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 12), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmSubcomponentTcpOutBufferedOctets.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentTcpOutBufferedOctets.setDescription('Number of outgoing octets buffered. The value of this object is zero when the entry is not for a TCP connection.') slapm_subcomponent_tcp_in_buffered_octets = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 13), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmSubcomponentTcpInBufferedOctets.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentTcpInBufferedOctets.setDescription('Number of incoming octets buffered. The value of this object is zero when the entry is not for a TCP connection.') slapm_subcomponent_tcp_re_xmts = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 14), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmSubcomponentTcpReXmts.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentTcpReXmts.setDescription('Number of retransmissions. The value of this object is zero when the entry is not for a TCP connection.') slapm_subcomponent_tcp_round_trip_time = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 15), integer32()).setUnits('milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: slapmSubcomponentTcpRoundTripTime.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentTcpRoundTripTime.setDescription('The amount of time that has elapsed, measured in milliseconds, from when the last TCP segment was transmitted by the TCP Stack until the ACK was received. The value of this object is zero when the entry is not for a TCP connection.') slapm_subcomponent_tcp_round_trip_variance = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 16), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmSubcomponentTcpRoundTripVariance.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentTcpRoundTripVariance.setDescription('Round trip time variance. The value of this object is zero when the entry is not for a TCP connection.') slapm_subcomponent_in_pdus = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 17), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmSubcomponentInPdus.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentInPdus.setDescription('The number of protocol related data units transferred inbound: slapmSubcomponentProtocol PDU Type udpListener(1) UDP datagrams tcpConnection(2) TCP segments') slapm_subcomponent_out_pdus = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 18), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmSubcomponentOutPdus.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentOutPdus.setDescription('The number of protocol related data units transferred outbound: slapmSubcomponentProtocol PDU Type udpListener(1) UDP datagrams tcpConnection(2) TCP segments') slapm_subcomponent_appl_name = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 19), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmSubcomponentApplName.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentApplName.setDescription('The application name associated with this entry if known, otherwise a zero-length octet string is returned as the value of this object.') slapm_subcomponent_monitor_status = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 20), slapm_status()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmSubcomponentMonitorStatus.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentMonitorStatus.setDescription("The value of this object indicates when a monitored value has exceeded a threshold or isn't meeting the defined service level. Only the following SlapmStatus BITS setting can be reported here: monitorMinInRateNotAchieved(5), monitorMaxInRateExceeded(6), monitorMaxDelayExceeded(7), monitorMinOutRateNotAchieved(8), monitorMaxOutRateExceeded(9) This object only has meaning when an corresponding slapmPolicyMonitorEntry exists with the slapmPolicyMonitorControl BITS setting monitorSubcomponents(5) enabled.") slapm_subcomponent_monitor_int_time = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 21), date_and_time().clone(hexValue='0000000000000000')).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmSubcomponentMonitorIntTime.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentMonitorIntTime.setDescription('The timestamp for when the last interval ended. This object only has meaning when an corresponding slapmPRMonEntry (or old slapmPolicyMonitorEntry) exists with the slapmPRMonControl (or slapmPolicyMonitorControl) BITS setting monitorSubcomponents(5) enabled. All of the octets returned when monitoring is not in effect must be zero.') slapm_subcomponent_monitor_current_in_rate = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 22), gauge32()).setUnits('kilobits per second').setMaxAccess('readonly') if mibBuilder.loadTexts: slapmSubcomponentMonitorCurrentInRate.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentMonitorCurrentInRate.setDescription('Using the value of the corresponding slapmPRMonInterval (or slapmPolicyMonitorInterval), slapmSubcomponentStatsInOctets is divided by slapmSubcomponentMonitorInterval to determine the current in transfer rate. This object only has meaning when an corresponding slapmPRMonEntry (or slapmPolicyMonitorEntry) exists with the slapmPRMonControl (or slapmPolicyMonitorControl) BITS setting monitorSubcomponents(5) enabled. The value of this object is zero when monitoring is not in effect.') slapm_subcomponent_monitor_current_out_rate = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 23), gauge32()).setUnits('kilobits per second').setMaxAccess('readonly') if mibBuilder.loadTexts: slapmSubcomponentMonitorCurrentOutRate.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentMonitorCurrentOutRate.setDescription('Using the value of the corresponding slapmPRMonInterval (or slapmPolicyMonitorInterva)l, slapmSubcomponentStatsOutOctets is divided by slapmPRMonInterval (or slapmPolicyMonitorInterval) to determine the current out transfer rate. This object only has meaning when an corresponding slapmPRMonEntry (or slapmPolicyMonitorEntry) exists with the slapmPRMonControl (or slapmPolicyMonitorControl) BITS setting monitorSubcomponents(5) enabled. The value of this object is zero when monitoring is not in effect.') slapm_subcomponent_policy_rule_index = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 3, 1, 24), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 4294967295))).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmSubcomponentPolicyRuleIndex.setStatus('current') if mibBuilder.loadTexts: slapmSubcomponentPolicyRuleIndex.setDescription('Points to an slapmPolicyNameEntry when combined with slapmSubcomponentSystemAddress to indicate the policy naming that relates to this entry. A value of 0 for this object MUST be returned when the corresponding slapmSubcomponentEntry has no policy rule associated with it.') slapm_policy_name_table = mib_table((1, 3, 6, 1, 3, 88, 1, 2, 4)) if mibBuilder.loadTexts: slapmPolicyNameTable.setStatus('current') if mibBuilder.loadTexts: slapmPolicyNameTable.setDescription('Provides the mapping between a policy index as a unsigned 32 bit integer and the unique name associated with a policy rule.') slapm_policy_name_entry = mib_table_row((1, 3, 6, 1, 3, 88, 1, 2, 4, 1)).setIndexNames((0, 'SLAPM-MIB', 'slapmPolicyNameSystemAddress'), (0, 'SLAPM-MIB', 'slapmPolicyNameIndex')) if mibBuilder.loadTexts: slapmPolicyNameEntry.setStatus('current') if mibBuilder.loadTexts: slapmPolicyNameEntry.setDescription('Defines an entry in the slapmPolicyNameTable.') slapm_policy_name_system_address = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 4, 1, 1), octet_string().subtype(subtypeSpec=constraints_union(value_size_constraint(0, 0), value_size_constraint(4, 4), value_size_constraint(16, 16)))) if mibBuilder.loadTexts: slapmPolicyNameSystemAddress.setStatus('current') if mibBuilder.loadTexts: slapmPolicyNameSystemAddress.setDescription('Address of a system that an Policy rule definition relates to. A zero length octet string must be used to indicate that only a single system is being represented. Otherwise, the length of the octet string must be 4 for an ipv4 address or 16 for an ipv6 address.') slapm_policy_name_index = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 4, 1, 2), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 4294967295))) if mibBuilder.loadTexts: slapmPolicyNameIndex.setStatus('current') if mibBuilder.loadTexts: slapmPolicyNameIndex.setDescription('A locally arbitrary, but unique identifier associated with this table entry. This value is not expected to remain constant across reIPLs.') slapm_policy_name_of_rule = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 4, 1, 3), slapm_policy_rule_name()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyNameOfRule.setStatus('current') if mibBuilder.loadTexts: slapmPolicyNameOfRule.setDescription('The unique name that identifies a policy rule definition.') slapm_policy_rule_stats_table = mib_table((1, 3, 6, 1, 3, 88, 1, 2, 5)) if mibBuilder.loadTexts: slapmPolicyRuleStatsTable.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsTable.setDescription('Provides statistics on a per system and a per policy rule basis.') slapm_policy_rule_stats_entry = mib_table_row((1, 3, 6, 1, 3, 88, 1, 2, 5, 1)).setIndexNames((0, 'SLAPM-MIB', 'slapmPolicyNameSystemAddress'), (0, 'SLAPM-MIB', 'slapmPolicyNameIndex')) if mibBuilder.loadTexts: slapmPolicyRuleStatsEntry.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsEntry.setDescription('Defines an entry in the slapmPolicyRuleStatsTable. This table defines a set of statistics that is kept on a per system and per policy rule basis. Entries in this table are not created or deleted via SNMP but reflect the set of policy rule definitions known at a system.') slapm_policy_rule_stats_oper_status = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('inactive', 1), ('active', 2), ('deleteNeeded', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsOperStatus.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsOperStatus.setDescription('The state of a policy entry: inactive(1) - An policy entry was either defined by local system definition or discovered via a directory search but has not been activated (not currently being used). active(2) - Policy entry is being used to affect traffic flows. deleteNeeded(3) - Either though local implementation dependent methods or by discovering that the directory entry corresponding to this table entry no longer exists and slapmPolicyPurgeTime needs to expire before attempting to remove the corresponding slapmPolicyStatsEntry and any dependent slapmPolicyMonitor table entries. Note: a policy rule in a state other than active(2) is not being used to affect traffic flows.') slapm_policy_rule_stats_active_conns = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 2), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsActiveConns.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsActiveConns.setDescription('The number of active TCP connections that are affected by the corresponding policy entry.') slapm_policy_rule_stats_total_conns = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsTotalConns.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsTotalConns.setDescription('The number of total TCP connections that are affected by the corresponding policy entry.') slapm_policy_rule_stats_l_activated = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 4), date_and_time().clone(hexValue='0000000000000000')).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsLActivated.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsLActivated.setDescription('The timestamp for when the corresponding policy entry was last activated. The value of this object serves as the discontinuity event indicator when polling entries in this table. The value of this object is updated on transition of slapmPolicyRuleStatsOperStatus into the active(2) state.') slapm_policy_rule_stats_last_mapping = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 5), date_and_time().clone(hexValue='0000000000000000')).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsLastMapping.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsLastMapping.setDescription('The timestamp for when the last time that the associated policy entry was used.') slapm_policy_rule_stats_in_octets = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsInOctets.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsInOctets.setDescription('The number of octets that was received by IP for an entity that map to this entry.') slapm_policy_rule_stats_out_octets = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsOutOctets.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsOutOctets.setDescription('The number of octets that was transmitted by IP for an entity that map to this entry.') slapm_policy_rule_stats_conn_limit = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 8), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsConnLimit.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsConnLimit.setDescription('The limit for the number of active TCP connections that are allowed for this policy definition. A value of zero for this object implies that a connection limit has not been specified.') slapm_policy_rule_stats_count_accepts = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsCountAccepts.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsCountAccepts.setDescription("This counter is incremented when a policy action's Permission value is set to Accept and a session (TCP connection) is accepted.") slapm_policy_rule_stats_count_denies = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsCountDenies.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsCountDenies.setDescription("This counter is incremented when a policy action's Permission value is set to Deny and a session is denied, or when a session (TCP connection) is rejected due to a policy's connection limit (slapmPolicyRuleStatsConnectLimit) being reached.") slapm_policy_rule_stats_in_discards = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsInDiscards.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsInDiscards.setDescription('This counter counts the number of in octets discarded. This occurs when an error is detected. Examples of this are buffer overflow, checksum error, or bad packet format.') slapm_policy_rule_stats_out_discards = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 12), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsOutDiscards.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsOutDiscards.setDescription('This counter counts the number of out octets discarded. Examples of this are buffer overflow, checksum error, or bad packet format.') slapm_policy_rule_stats_in_packets = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 13), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsInPackets.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsInPackets.setDescription('This counter counts the number of in packets received that relate to this policy entry from IP.') slapm_policy_rule_stats_out_packets = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 14), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsOutPackets.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsOutPackets.setDescription('This counter counts the number of out packets sent by IP that relate to this policy entry.') slapm_policy_rule_stats_in_pro_octets = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 15), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsInProOctets.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsInProOctets.setDescription('This counter counts the number of in octets that are determined to be within profile.') slapm_policy_rule_stats_out_pro_octets = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 16), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsOutProOctets.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsOutProOctets.setDescription('This counter counts the number of out octets that are determined to be within profile.') slapm_policy_rule_stats_min_rate = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 17), unsigned32()).setUnits('Kilobits per second').setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsMinRate.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsMinRate.setDescription('The minimum transfer rate defined for this entry.') slapm_policy_rule_stats_max_rate = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 18), unsigned32()).setUnits('Kilobits per second').setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsMaxRate.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsMaxRate.setDescription('The maximum transfer rate defined for this entry.') slapm_policy_rule_stats_max_delay = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 19), unsigned32()).setUnits('milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsMaxDelay.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsMaxDelay.setDescription('The maximum delay defined for this entry.') slapm_policy_rule_stats_total_rsvp_flows = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 20), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsTotalRsvpFlows.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsTotalRsvpFlows.setDescription('Total number of RSVP flows that have be activated.') slapm_policy_rule_stats_act_rsvp_flows = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 5, 1, 21), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPolicyRuleStatsActRsvpFlows.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleStatsActRsvpFlows.setDescription('Current number of active RSVP flows.') slapm_pr_mon_table = mib_table((1, 3, 6, 1, 3, 88, 1, 2, 6)) if mibBuilder.loadTexts: slapmPRMonTable.setStatus('current') if mibBuilder.loadTexts: slapmPRMonTable.setDescription('Provides a method of monitoring policies and their effect at a system.') slapm_pr_mon_entry = mib_table_row((1, 3, 6, 1, 3, 88, 1, 2, 6, 1)).setIndexNames((0, 'SLAPM-MIB', 'slapmPRMonOwnerIndex'), (0, 'SLAPM-MIB', 'slapmPRMonSystemAddress'), (0, 'SLAPM-MIB', 'slapmPRMonIndex')) if mibBuilder.loadTexts: slapmPRMonEntry.setStatus('current') if mibBuilder.loadTexts: slapmPRMonEntry.setDescription('Defines an entry in the slapmPRMonTable. This table defines which policies should be monitored on a per policy rule basis. An attempt to set any read-create object defined within an slapmPRMonEntry while the value of slapmPRMonRowStatus is active(1) will result in an inconsistentValue error.') slapm_pr_mon_owner_index = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 1), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(0, 16))) if mibBuilder.loadTexts: slapmPRMonOwnerIndex.setStatus('current') if mibBuilder.loadTexts: slapmPRMonOwnerIndex.setDescription("To facilitate the provisioning of access control by a security administrator using the View-Based Access Control Model (RFC 2575, VACM) for tables in which multiple users may need to independently create or modify entries, the initial index is used as an 'owner index'. Such an initial index has a syntax of SnmpAdminString, and can thus be trivially mapped to a securityName or groupName as defined in VACM, in accordance with a security policy. All entries in that table belonging to a particular user will have the same value for this initial index. For a given user's entries in a particular table, the object identifiers for the information in these entries will have the same subidentifiers (except for the 'column' subidentifier) up to the end of the encoded owner index. To configure VACM to permit access to this portion of the table, one would create vacmViewTreeFamilyTable entries with the value of vacmViewTreeFamilySubtree including the owner index portion, and vacmViewTreeFamilyMask 'wildcarding' the column subidentifier. More elaborate configurations are possible.") slapm_pr_mon_system_address = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 2), octet_string().subtype(subtypeSpec=constraints_union(value_size_constraint(0, 0), value_size_constraint(4, 4), value_size_constraint(16, 16)))) if mibBuilder.loadTexts: slapmPRMonSystemAddress.setStatus('current') if mibBuilder.loadTexts: slapmPRMonSystemAddress.setDescription('Address of a system that an Policy definition relates to. A zero length octet string can be used to indicate that only a single system is being represented. Otherwise, the length of the octet string should be 4 for an ipv4 address and 16 for an ipv6 address.') slapm_pr_mon_index = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 3), unsigned32()) if mibBuilder.loadTexts: slapmPRMonIndex.setStatus('current') if mibBuilder.loadTexts: slapmPRMonIndex.setDescription('An slapmPolicyNameTable index, slapmPolicyNameIndex, that points to the unique name associated with a policy rule definition.') slapm_pr_mon_control = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 4), bits().clone(namedValues=named_values(('monitorMinRate', 0), ('monitorMaxRate', 1), ('monitorMaxDelay', 2), ('enableAggregateTraps', 3), ('enableSubcomponentTraps', 4), ('monitorSubcomponents', 5))).clone(namedValues=named_values(('monitorMinRate', 0), ('monitorMaxRate', 1), ('monitorMaxDelay', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: slapmPRMonControl.setStatus('current') if mibBuilder.loadTexts: slapmPRMonControl.setDescription("The value of this object determines the type and level of monitoring that is applied to a policy rule. The value of this object can't be changed once the table entry that it is a part of is activated via a slapmPRMonRowStatus transition to active state. monitorMinRate(0) - Monitor minimum transfer rate. monitorMaxRate(1) - Monitor maximum transfer rate. monitorMaxDelay(2) - Monitor maximum delay. enableAggregateTraps(3) - The enableAggregateTraps(3) BITS setting enables notification generation when monitoring a policy rule as an aggregate using the values in the corresponding slapmPRMonStatsEntry. By default this function is not enabled. enableSubcomponentTraps(4) - This BITS setting enables notification generation when monitoring all subcomponents that are mapped to an corresponding slapmPRMonStatsEntry. By default this function is not enabled. monitorSubcomponents(5) - This BITS setting enables monitoring of each subcomponent (typically a TCP connection or UDP listener) individually.") slapm_pr_mon_status = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 5), slapm_status()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPRMonStatus.setStatus('current') if mibBuilder.loadTexts: slapmPRMonStatus.setDescription("The value of this object indicates when a monitored value has not meet a threshold or isn't meeting the defined service level. The SlapmStatus TEXTUAL-CONVENTION defines two levels of not meeting a threshold. The first set: slaMinInRateNotAchieved(0), slaMaxInRateExceeded(1), slaMaxDelayExceeded(2), slaMinOutRateNotAchieved(3), slaMaxOutRateExceeded(4) are used to indicate when the SLA as an aggregate is not meeting a threshold while the second set: monitorMinInRateNotAchieved(5), monitorMaxInRateExceeded(6), monitorMaxDelayExceeded(7), monitorMinOutRateNotAchieved(8), monitorMaxOutRateExceeded(9) indicate that at least one subcomponent is not meeting a threshold.") slapm_pr_mon_interval = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 6), unsigned32().subtype(subtypeSpec=value_range_constraint(15, 86400)).clone(20)).setUnits('seconds').setMaxAccess('readcreate') if mibBuilder.loadTexts: slapmPRMonInterval.setStatus('current') if mibBuilder.loadTexts: slapmPRMonInterval.setDescription('The number of seconds that defines the sample period.') slapm_pr_mon_int_time = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 7), date_and_time().clone(hexValue='0000000000000000')).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPRMonIntTime.setStatus('current') if mibBuilder.loadTexts: slapmPRMonIntTime.setDescription('The timestamp for when the last interval ended.') slapm_pr_mon_current_in_rate = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 8), gauge32()).setUnits('kilobits per second').setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPRMonCurrentInRate.setStatus('current') if mibBuilder.loadTexts: slapmPRMonCurrentInRate.setDescription('Using the value of the corresponding slapmPRMonInterval, slapmPolicyRuleStatsInOctets is sampled and then divided by slapmPRMonInterval to determine the current in transfer rate.') slapm_pr_mon_current_out_rate = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 9), gauge32()).setUnits('kilobits per second').setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPRMonCurrentOutRate.setStatus('current') if mibBuilder.loadTexts: slapmPRMonCurrentOutRate.setDescription('Using the value of the corresponding slapmPolicyMonInterval, slapmPolicyRuleStatsOutOctets is sampled and then divided by slapmPRMonInterval to determine the current out transfer rate.') slapm_pr_mon_min_rate_low = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 10), unsigned32()).setUnits('kilobits per second').setMaxAccess('readcreate') if mibBuilder.loadTexts: slapmPRMonMinRateLow.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMinRateLow.setDescription("The threshold for generating a slapmPolicyRuleMonNotOkay notification, signalling that a monitored minimum transfer rate has not been meet. A slapmPolicyRuleMonNotOkay notification is not generated again for an slapmPRMonEntry until the minimum transfer rate exceeds slapmPRMonMinRateHigh (a slapmPolicyRuleMonOkay notification is then transmitted) and then fails below slapmPRMonMinRateLow. This behavior reduces the slapmPolicyRuleMonNotOkay notifications that are transmitted. A value of zero for this object is returned when the slapmPRMonControl monitorMinRate(0) is not enabled. When enabled the default value for this object is the min rate value specified in the associated action definition minus 10%. If the action definition doesn't have a min rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMinRate(0) is selected. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapm_pr_mon_min_rate_high = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 11), unsigned32()).setUnits('kilobits per second').setMaxAccess('readcreate') if mibBuilder.loadTexts: slapmPRMonMinRateHigh.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMinRateHigh.setDescription("The threshold for generating a slapmPolicyRuleMonOkay notification, signalling that a monitored minimum transfer rate has increased to an acceptable level. A value of zero for this object is returned when the slapmPRMonControl monitorMinRate(0) is not enabled. When enabled the default value for this object is the min rate value specified in the associated action definition plus 10%. If the action definition doesn't have a min rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMinRate(0) is selected. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapm_pr_mon_max_rate_high = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 12), unsigned32()).setUnits('kilobits per second').setMaxAccess('readcreate') if mibBuilder.loadTexts: slapmPRMonMaxRateHigh.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMaxRateHigh.setDescription("The threshold for generating a slapmPolicyRuleMonNotOkay notification, signalling that a monitored maximum transfer rate has been exceeded. A slapmPolicyRuleNotOkay notification is not generated again for an slapmPRMonEntry until the maximum transfer rate fails below slapmPRMonMaxRateLow (a slapmPolicyRuleMonOkay notification is then transmitted) and then raises above slapmPRMonMaxRateHigh. This behavior reduces the slapmPolicyRuleMonNotOkay notifications that are transmitted. A value of zero for this object is returned when the slapmPRMonControl monitorMaxRate(1) is not enabled. When enabled the default value for this object is the max rate value specified in the associated action definition plus 10%. If the action definition doesn't have a max rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxRate(1) is selected. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapm_pr_mon_max_rate_low = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 13), unsigned32()).setUnits('kilobits per second').setMaxAccess('readcreate') if mibBuilder.loadTexts: slapmPRMonMaxRateLow.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMaxRateLow.setDescription("The threshold for generating a slapmPolicyRuleMonOkay notification, signalling that a monitored maximum transfer rate has fallen to an acceptable level. A value of zero for this object is returned when the slapmPRMonControl monitorMaxRate(1) is not enabled. When enabled the default value for this object is the max rate value specified in the associated action definition minus 10%. If the action definition doesn't have a max rate defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxRate(1) is selected. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapm_pr_mon_max_delay_high = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 14), unsigned32()).setUnits('milliseconds').setMaxAccess('readcreate') if mibBuilder.loadTexts: slapmPRMonMaxDelayHigh.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMaxDelayHigh.setDescription("The threshold for generating a slapmPolicyRuleMonNotOkay notification, signalling that a monitored maximum delay rate has been exceeded. A slapmPolicyRuleMonNotOkay notification is not generated again for an slapmPRMonEntry until the maximum delay rate falls below slapmPRMonMaxDelayLow (a slapmPolicyRuleMonOkay notification is then transmitted) and raises above slapmPRMonMaxDelayHigh. This behavior reduces the slapmPolicyRuleMonNotOkay notifications that are transmitted. A value of zero for this object is returned when the slapmPRMonControl monitorMaxDelay(4) is not enabled. When enabled the default value for this object is the max delay value specified in the associated action definition plus 10%. If the action definition doesn't have a max delay defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxDelay(4) is selected. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapm_pr_mon_max_delay_low = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 15), unsigned32()).setUnits('milliseconds').setMaxAccess('readcreate') if mibBuilder.loadTexts: slapmPRMonMaxDelayLow.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMaxDelayLow.setDescription("The threshold for generating a slapmPolicyRuleMonOkay notification, signalling that a monitored maximum delay rate has fallen to an acceptable level. A value of zero for this object is returned when the slapmPRMonControl monitorMaxDelay(4) is not enabled. When enabled the default value for this object is the max delay value specified in the associated action definition minus 10%. If the action definition doesn't have a max delay defined then there is no default for this object and a value MUST be specified prior to activating this entry when monitorMaxDelay(4) is selected. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for any notification relating to this entry to potentially be generated.") slapm_pr_mon_min_in_rate_not_achieves = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 16), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPRMonMinInRateNotAchieves.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMinInRateNotAchieves.setDescription('The number of times that a minimum transfer in rate was not achieved.') slapm_pr_mon_max_in_rate_exceeds = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 17), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPRMonMaxInRateExceeds.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMaxInRateExceeds.setDescription('The number of times that a maximum transfer in rate was exceeded.') slapm_pr_mon_max_delay_exceeds = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 18), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPRMonMaxDelayExceeds.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMaxDelayExceeds.setDescription('The number of times that a maximum delay in rate was exceeded.') slapm_pr_mon_min_out_rate_not_achieves = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 19), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPRMonMinOutRateNotAchieves.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMinOutRateNotAchieves.setDescription('The number of times that a minimum transfer out rate was not achieved.') slapm_pr_mon_max_out_rate_exceeds = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 20), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPRMonMaxOutRateExceeds.setStatus('current') if mibBuilder.loadTexts: slapmPRMonMaxOutRateExceeds.setDescription('The number of times that a maximum transfer out rate was exceeded.') slapm_pr_mon_current_delay_rate = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 21), gauge32()).setUnits('milliseconds').setMaxAccess('readonly') if mibBuilder.loadTexts: slapmPRMonCurrentDelayRate.setStatus('current') if mibBuilder.loadTexts: slapmPRMonCurrentDelayRate.setDescription('The current delay rate for this entry. This is calculated by taking the average of the TCP round trip times for all associating slapmSubcomponentTable entries within a interval.') slapm_pr_mon_row_status = mib_table_column((1, 3, 6, 1, 3, 88, 1, 2, 6, 1, 22), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: slapmPRMonRowStatus.setStatus('current') if mibBuilder.loadTexts: slapmPRMonRowStatus.setDescription('This object allows entries to be created and deleted in the slapmPRMonTable. An entry in this table is deleted by setting this object to destroy(6). Removal of an corresponding (same policy index) slapmPolicyRuleStatsEntry has the side effect of the automatic deletion an entry in this table. Note that an attempt to set any read-create object defined within an slapmPRMonEntry while the value of slapmPRMonRowStatus is active(1) will result in an inconsistentValue error.') slapm_monitored_event_not_achieved = notification_type((1, 3, 6, 1, 3, 88, 0, 1)).setObjects(('SLAPM-MIB', 'slapmPolicyMonitorIntTime'), ('SLAPM-MIB', 'slapmPolicyMonitorControl'), ('SLAPM-MIB', 'slapmPolicyMonitorStatus'), ('SLAPM-MIB', 'slapmPolicyMonitorStatus'), ('SLAPM-MIB', 'slapmPolicyMonitorCurrentInRate'), ('SLAPM-MIB', 'slapmPolicyMonitorCurrentOutRate'), ('SLAPM-MIB', 'slapmPolicyMonitorCurrentDelayRate')) if mibBuilder.loadTexts: slapmMonitoredEventNotAchieved.setStatus('deprecated') if mibBuilder.loadTexts: slapmMonitoredEventNotAchieved.setDescription('This notification is generated when an monitored event is not achieved with respect to threshold. This applies only towards monitoring a policy traffic profile as an aggregate via an associating slapmPolicyStatsEntry. The value of slapmPolicyMonitorControl can be examined to determine what is being monitored. The first slapmPolicyMonitorStatus value supplies the current monitor status while the 2nd value supplies the previous status. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for this notification to potentially be generated.') slapm_monitored_event_okay = notification_type((1, 3, 6, 1, 3, 88, 0, 2)).setObjects(('SLAPM-MIB', 'slapmPolicyMonitorIntTime'), ('SLAPM-MIB', 'slapmPolicyMonitorControl'), ('SLAPM-MIB', 'slapmPolicyMonitorStatus'), ('SLAPM-MIB', 'slapmPolicyMonitorStatus'), ('SLAPM-MIB', 'slapmPolicyMonitorCurrentInRate'), ('SLAPM-MIB', 'slapmPolicyMonitorCurrentOutRate'), ('SLAPM-MIB', 'slapmPolicyMonitorCurrentDelayRate')) if mibBuilder.loadTexts: slapmMonitoredEventOkay.setStatus('deprecated') if mibBuilder.loadTexts: slapmMonitoredEventOkay.setDescription('This notification is generated when a monitored event has improved to an acceptable level. This applies only towards monitoring a policy traffic profile as an aggregate via an associating slapmPolicyStatsEntry. The value of slapmPolicyMonitorControl can be examined to determine what is being monitored. The first slapmPolicyMonitorStatus value supplies the current monitor status while the 2nd value supplies the previous status. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableAggregateTraps(3), MUST be selected in order for this notification to potentially be generated.') slapm_policy_profile_deleted = notification_type((1, 3, 6, 1, 3, 88, 0, 3)).setObjects(('SLAPM-MIB', 'slapmPolicyStatsActiveConns'), ('SLAPM-MIB', 'slapmPolicyStatsTotalConns'), ('SLAPM-MIB', 'slapmPolicyStatsFirstActivated'), ('SLAPM-MIB', 'slapmPolicyStatsLastMapping'), ('SLAPM-MIB', 'slapmPolicyStatsInOctets'), ('SLAPM-MIB', 'slapmPolicyStatsOutOctets'), ('SLAPM-MIB', 'slapmPolicyStatsConnectionLimit'), ('SLAPM-MIB', 'slapmPolicyStatsCountAccepts'), ('SLAPM-MIB', 'slapmPolicyStatsCountDenies'), ('SLAPM-MIB', 'slapmPolicyStatsInDiscards'), ('SLAPM-MIB', 'slapmPolicyStatsOutDiscards'), ('SLAPM-MIB', 'slapmPolicyStatsInPackets'), ('SLAPM-MIB', 'slapmPolicyStatsOutPackets'), ('SLAPM-MIB', 'slapmPolicyStatsInProfileOctets'), ('SLAPM-MIB', 'slapmPolicyStatsOutProfileOctets'), ('SLAPM-MIB', 'slapmPolicyStatsMinRate'), ('SLAPM-MIB', 'slapmPolicyStatsMaxRate'), ('SLAPM-MIB', 'slapmPolicyStatsMaxDelay')) if mibBuilder.loadTexts: slapmPolicyProfileDeleted.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyProfileDeleted.setDescription('A slapmPolicyDeleted notification is sent when a slapmPolicyStatsEntry is deleted if the value of slapmPolicyTrapEnable is enabled(1).') slapm_policy_monitor_deleted = notification_type((1, 3, 6, 1, 3, 88, 0, 4)).setObjects(('SLAPM-MIB', 'slapmPolicyMonitorStatus'), ('SLAPM-MIB', 'slapmPolicyMonitorInterval'), ('SLAPM-MIB', 'slapmPolicyMonitorIntTime'), ('SLAPM-MIB', 'slapmPolicyMonitorCurrentInRate'), ('SLAPM-MIB', 'slapmPolicyMonitorCurrentOutRate'), ('SLAPM-MIB', 'slapmPolicyMonitorCurrentDelayRate'), ('SLAPM-MIB', 'slapmPolicyMonitorMinRateLow'), ('SLAPM-MIB', 'slapmPolicyMonitorMinRateHigh'), ('SLAPM-MIB', 'slapmPolicyMonitorMaxRateHigh'), ('SLAPM-MIB', 'slapmPolicyMonitorMaxRateLow'), ('SLAPM-MIB', 'slapmPolicyMonitorMaxDelayHigh'), ('SLAPM-MIB', 'slapmPolicyMonitorMaxDelayLow'), ('SLAPM-MIB', 'slapmPolicyMonitorMinInRateNotAchieves'), ('SLAPM-MIB', 'slapmPolicyMonitorMaxInRateExceeds'), ('SLAPM-MIB', 'slapmPolicyMonitorMaxDelayExceeds'), ('SLAPM-MIB', 'slapmPolicyMonitorMinOutRateNotAchieves'), ('SLAPM-MIB', 'slapmPolicyMonitorMaxOutRateExceeds')) if mibBuilder.loadTexts: slapmPolicyMonitorDeleted.setStatus('deprecated') if mibBuilder.loadTexts: slapmPolicyMonitorDeleted.setDescription('A slapmPolicyMonitorDeleted notification is sent when a slapmPolicyMonitorEntry is deleted if the value of slapmPolicyTrapEnable is enabled(1).') slapm_subcomponent_monitored_event_not_achieved = notification_type((1, 3, 6, 1, 3, 88, 0, 5)).setObjects(('SLAPM-MIB', 'slapmSubcomponentSystemAddress'), ('SLAPM-MIB', 'slapmSubcomponentPolicyName'), ('SLAPM-MIB', 'slapmSubcomponentTrafficProfileName'), ('SLAPM-MIB', 'slapmSubcomponentMonitorStatus'), ('SLAPM-MIB', 'slapmSubcomponentMonitorStatus'), ('SLAPM-MIB', 'slapmSubcomponentMonitorIntTime'), ('SLAPM-MIB', 'slapmSubcomponentMonitorCurrentInRate'), ('SLAPM-MIB', 'slapmSubcomponentMonitorCurrentOutRate'), ('SLAPM-MIB', 'slapmSubcomponentTcpRoundTripTime')) if mibBuilder.loadTexts: slapmSubcomponentMonitoredEventNotAchieved.setStatus('deprecated') if mibBuilder.loadTexts: slapmSubcomponentMonitoredEventNotAchieved.setDescription('This notification is generated when a monitored value does not achieved a threshold specification. This applies only towards monitoring the individual components of a policy traffic profile. The value of the corresponding slapmPolicyMonitorControl can be examined to determine what is being monitored. The first slapmSubcomponentMonitorStatus value supplies the current monitor status while the 2nd value supplies the previous status. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableSubcomponentTraps(4), MUST be selected in order for this notification to potentially be generated.') slapm_subcomponent_monitored_event_okay = notification_type((1, 3, 6, 1, 3, 88, 0, 6)).setObjects(('SLAPM-MIB', 'slapmSubcomponentSystemAddress'), ('SLAPM-MIB', 'slapmSubcomponentPolicyName'), ('SLAPM-MIB', 'slapmSubcomponentTrafficProfileName'), ('SLAPM-MIB', 'slapmSubcomponentMonitorStatus'), ('SLAPM-MIB', 'slapmSubcomponentMonitorStatus'), ('SLAPM-MIB', 'slapmSubcomponentMonitorIntTime'), ('SLAPM-MIB', 'slapmSubcomponentMonitorCurrentInRate'), ('SLAPM-MIB', 'slapmSubcomponentMonitorCurrentOutRate'), ('SLAPM-MIB', 'slapmSubcomponentTcpRoundTripTime')) if mibBuilder.loadTexts: slapmSubcomponentMonitoredEventOkay.setStatus('deprecated') if mibBuilder.loadTexts: slapmSubcomponentMonitoredEventOkay.setDescription('This notification is generated when a monitored value has reached an acceptable level. Note: The corresponding slapmPolicyMonitorControl BITS setting, enableSubcomponentTraps(3), MUST be selected in order for this notification to potentially be generated.') slapm_policy_rule_mon_not_okay = notification_type((1, 3, 6, 1, 3, 88, 0, 7)).setObjects(('SLAPM-MIB', 'slapmPRMonIntTime'), ('SLAPM-MIB', 'slapmPRMonControl'), ('SLAPM-MIB', 'slapmPRMonStatus'), ('SLAPM-MIB', 'slapmPRMonStatus'), ('SLAPM-MIB', 'slapmPRMonCurrentInRate'), ('SLAPM-MIB', 'slapmPRMonCurrentOutRate'), ('SLAPM-MIB', 'slapmPRMonCurrentDelayRate')) if mibBuilder.loadTexts: slapmPolicyRuleMonNotOkay.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleMonNotOkay.setDescription('This notification is generated when an monitored event is not achieved with respect to a threshold. This applies only towards monitoring a policy rule as an aggregate via an associating slapmPolicyRuleStatsEntry. The value of slapmPRMonControl can be examined to determine what is being monitored. The first slapmPRMonStatus value supplies the current monitor status while the 2nd value supplies the previous status. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for this notification to potentially be generated.') slapm_policy_rule_mon_okay = notification_type((1, 3, 6, 1, 3, 88, 0, 8)).setObjects(('SLAPM-MIB', 'slapmPRMonIntTime'), ('SLAPM-MIB', 'slapmPRMonControl'), ('SLAPM-MIB', 'slapmPRMonStatus'), ('SLAPM-MIB', 'slapmPRMonStatus'), ('SLAPM-MIB', 'slapmPRMonCurrentInRate'), ('SLAPM-MIB', 'slapmPRMonCurrentOutRate'), ('SLAPM-MIB', 'slapmPRMonCurrentDelayRate')) if mibBuilder.loadTexts: slapmPolicyRuleMonOkay.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleMonOkay.setDescription('This notification is generated when a monitored event has improved to an acceptable level. This applies only towards monitoring a policy rule as an aggregate via an associating slapmPolicyRuleStatsEntry. The value of slapmPRMonControl can be examined to determine what is being monitored. The first slapmPRMonStatus value supplies the current monitor status while the 2nd value supplies the previous status. Note: The corresponding slapmPRMonControl BITS setting, enableAggregateTraps(3), MUST be selected in order for this notification to potentially be generated.') slapm_policy_rule_deleted = notification_type((1, 3, 6, 1, 3, 88, 0, 9)).setObjects(('SLAPM-MIB', 'slapmPolicyRuleStatsActiveConns'), ('SLAPM-MIB', 'slapmPolicyRuleStatsTotalConns'), ('SLAPM-MIB', 'slapmPolicyRuleStatsLActivated'), ('SLAPM-MIB', 'slapmPolicyRuleStatsLastMapping'), ('SLAPM-MIB', 'slapmPolicyRuleStatsInOctets'), ('SLAPM-MIB', 'slapmPolicyRuleStatsOutOctets'), ('SLAPM-MIB', 'slapmPolicyRuleStatsConnLimit'), ('SLAPM-MIB', 'slapmPolicyRuleStatsCountAccepts'), ('SLAPM-MIB', 'slapmPolicyRuleStatsCountDenies'), ('SLAPM-MIB', 'slapmPolicyRuleStatsInDiscards'), ('SLAPM-MIB', 'slapmPolicyRuleStatsOutDiscards'), ('SLAPM-MIB', 'slapmPolicyRuleStatsInPackets'), ('SLAPM-MIB', 'slapmPolicyRuleStatsOutPackets'), ('SLAPM-MIB', 'slapmPolicyRuleStatsInProOctets'), ('SLAPM-MIB', 'slapmPolicyRuleStatsOutProOctets'), ('SLAPM-MIB', 'slapmPolicyRuleStatsMinRate'), ('SLAPM-MIB', 'slapmPolicyRuleStatsMaxRate'), ('SLAPM-MIB', 'slapmPolicyRuleStatsMaxDelay'), ('SLAPM-MIB', 'slapmPolicyRuleStatsTotalRsvpFlows'), ('SLAPM-MIB', 'slapmPolicyRuleStatsActRsvpFlows')) if mibBuilder.loadTexts: slapmPolicyRuleDeleted.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleDeleted.setDescription('A slapmPolicyRuleDeleted notification is sent when a slapmPolicyRuleStatsEntry is deleted if the value of slapmPolicyTrapEnable is enabled(1).') slapm_policy_rule_mon_deleted = notification_type((1, 3, 6, 1, 3, 88, 0, 10)).setObjects(('SLAPM-MIB', 'slapmPRMonControl'), ('SLAPM-MIB', 'slapmPRMonStatus'), ('SLAPM-MIB', 'slapmPRMonInterval'), ('SLAPM-MIB', 'slapmPRMonIntTime'), ('SLAPM-MIB', 'slapmPRMonCurrentInRate'), ('SLAPM-MIB', 'slapmPRMonCurrentOutRate'), ('SLAPM-MIB', 'slapmPRMonCurrentDelayRate'), ('SLAPM-MIB', 'slapmPRMonMinRateLow'), ('SLAPM-MIB', 'slapmPRMonMinRateHigh'), ('SLAPM-MIB', 'slapmPRMonMaxRateHigh'), ('SLAPM-MIB', 'slapmPRMonMaxRateLow'), ('SLAPM-MIB', 'slapmPRMonMaxDelayHigh'), ('SLAPM-MIB', 'slapmPRMonMaxDelayLow'), ('SLAPM-MIB', 'slapmPRMonMinInRateNotAchieves'), ('SLAPM-MIB', 'slapmPRMonMaxInRateExceeds'), ('SLAPM-MIB', 'slapmPRMonMaxDelayExceeds'), ('SLAPM-MIB', 'slapmPRMonMinOutRateNotAchieves'), ('SLAPM-MIB', 'slapmPRMonMaxOutRateExceeds')) if mibBuilder.loadTexts: slapmPolicyRuleMonDeleted.setStatus('current') if mibBuilder.loadTexts: slapmPolicyRuleMonDeleted.setDescription('A slapmPolicyRuleMonDeleted notification is sent when a slapmPRMonEntry is deleted if the value of slapmPolicyTrapEnable is enabled(1).') slapm_subc_monitor_not_okay = notification_type((1, 3, 6, 1, 3, 88, 0, 11)).setObjects(('SLAPM-MIB', 'slapmSubcomponentSystemAddress'), ('SLAPM-MIB', 'slapmSubcomponentPolicyRuleIndex'), ('SLAPM-MIB', 'slapmPRMonControl'), ('SLAPM-MIB', 'slapmSubcomponentMonitorStatus'), ('SLAPM-MIB', 'slapmSubcomponentMonitorStatus'), ('SLAPM-MIB', 'slapmSubcomponentMonitorIntTime'), ('SLAPM-MIB', 'slapmSubcomponentMonitorCurrentInRate'), ('SLAPM-MIB', 'slapmSubcomponentMonitorCurrentOutRate'), ('SLAPM-MIB', 'slapmSubcomponentTcpRoundTripTime')) if mibBuilder.loadTexts: slapmSubcMonitorNotOkay.setStatus('current') if mibBuilder.loadTexts: slapmSubcMonitorNotOkay.setDescription('This notification is generated when a monitored value does not achieved a threshold specification. This applies only towards monitoring the individual components of a policy rule. The value of the corresponding slapmPRMonControl can be examined to determine what is being monitored. The first slapmSubcomponentMonitorStatus value supplies the current monitor status while the 2nd value supplies the previous status. Note: The corresponding slapmPRMonControl BITS setting, enableSubcomponentTraps(4), MUST be selected in order for this notification to potentially be generated.') slapm_subc_monitor_okay = notification_type((1, 3, 6, 1, 3, 88, 0, 12)).setObjects(('SLAPM-MIB', 'slapmSubcomponentSystemAddress'), ('SLAPM-MIB', 'slapmSubcomponentPolicyRuleIndex'), ('SLAPM-MIB', 'slapmPRMonControl'), ('SLAPM-MIB', 'slapmSubcomponentMonitorStatus'), ('SLAPM-MIB', 'slapmSubcomponentMonitorStatus'), ('SLAPM-MIB', 'slapmSubcomponentMonitorIntTime'), ('SLAPM-MIB', 'slapmSubcomponentMonitorCurrentInRate'), ('SLAPM-MIB', 'slapmSubcomponentMonitorCurrentOutRate'), ('SLAPM-MIB', 'slapmSubcomponentTcpRoundTripTime')) if mibBuilder.loadTexts: slapmSubcMonitorOkay.setStatus('current') if mibBuilder.loadTexts: slapmSubcMonitorOkay.setDescription('This notification is generated when a monitored value has reached an acceptable level. Note: The corresponding slapmPRMonControl BITS setting, enableSubcomponentTraps(3), MUST be selected in order for this notification to potentially be generated.') slapm_compliances = mib_identifier((1, 3, 6, 1, 3, 88, 2, 1)) slapm_groups = mib_identifier((1, 3, 6, 1, 3, 88, 2, 2)) slapm_compliance = module_compliance((1, 3, 6, 1, 3, 88, 2, 1, 1)).setObjects(('SLAPM-MIB', 'slapmBaseGroup2'), ('SLAPM-MIB', 'slapmNotGroup2'), ('SLAPM-MIB', 'slapmEndSystemGroup2'), ('SLAPM-MIB', 'slapmEndSystemNotGroup2'), ('SLAPM-MIB', 'slapmBaseGroup'), ('SLAPM-MIB', 'slapmNotGroup'), ('SLAPM-MIB', 'slapmOptionalGroup'), ('SLAPM-MIB', 'slapmEndSystemGroup'), ('SLAPM-MIB', 'slapmEndSystemNotGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): slapm_compliance = slapmCompliance.setStatus('current') if mibBuilder.loadTexts: slapmCompliance.setDescription('The compliance statement for the SLAPM-MIB.') slapm_base_group = object_group((1, 3, 6, 1, 3, 88, 2, 2, 1)).setObjects(('SLAPM-MIB', 'slapmSpinLock'), ('SLAPM-MIB', 'slapmPolicyCountQueries'), ('SLAPM-MIB', 'slapmPolicyCountAccesses'), ('SLAPM-MIB', 'slapmPolicyCountSuccessAccesses'), ('SLAPM-MIB', 'slapmPolicyCountNotFounds'), ('SLAPM-MIB', 'slapmPolicyPurgeTime'), ('SLAPM-MIB', 'slapmPolicyTrapEnable'), ('SLAPM-MIB', 'slapmPolicyStatsOperStatus'), ('SLAPM-MIB', 'slapmPolicyStatsActiveConns'), ('SLAPM-MIB', 'slapmPolicyStatsFirstActivated'), ('SLAPM-MIB', 'slapmPolicyStatsLastMapping'), ('SLAPM-MIB', 'slapmPolicyStatsInOctets'), ('SLAPM-MIB', 'slapmPolicyStatsOutOctets'), ('SLAPM-MIB', 'slapmPolicyStatsConnectionLimit'), ('SLAPM-MIB', 'slapmPolicyStatsTotalConns'), ('SLAPM-MIB', 'slapmPolicyStatsCountAccepts'), ('SLAPM-MIB', 'slapmPolicyStatsCountDenies'), ('SLAPM-MIB', 'slapmPolicyStatsInDiscards'), ('SLAPM-MIB', 'slapmPolicyStatsOutDiscards'), ('SLAPM-MIB', 'slapmPolicyStatsInPackets'), ('SLAPM-MIB', 'slapmPolicyStatsOutPackets'), ('SLAPM-MIB', 'slapmPolicyStatsMinRate'), ('SLAPM-MIB', 'slapmPolicyStatsMaxRate'), ('SLAPM-MIB', 'slapmPolicyStatsMaxDelay'), ('SLAPM-MIB', 'slapmPolicyMonitorControl'), ('SLAPM-MIB', 'slapmPolicyMonitorStatus'), ('SLAPM-MIB', 'slapmPolicyMonitorInterval'), ('SLAPM-MIB', 'slapmPolicyMonitorIntTime'), ('SLAPM-MIB', 'slapmPolicyMonitorCurrentInRate'), ('SLAPM-MIB', 'slapmPolicyMonitorCurrentOutRate'), ('SLAPM-MIB', 'slapmPolicyMonitorMinRateLow'), ('SLAPM-MIB', 'slapmPolicyMonitorMinRateHigh'), ('SLAPM-MIB', 'slapmPolicyMonitorMaxRateHigh'), ('SLAPM-MIB', 'slapmPolicyMonitorMaxRateLow'), ('SLAPM-MIB', 'slapmPolicyMonitorMaxDelayHigh'), ('SLAPM-MIB', 'slapmPolicyMonitorMaxDelayLow'), ('SLAPM-MIB', 'slapmPolicyMonitorMinInRateNotAchieves'), ('SLAPM-MIB', 'slapmPolicyMonitorMaxInRateExceeds'), ('SLAPM-MIB', 'slapmPolicyMonitorMaxDelayExceeds'), ('SLAPM-MIB', 'slapmPolicyMonitorMinOutRateNotAchieves'), ('SLAPM-MIB', 'slapmPolicyMonitorMaxOutRateExceeds'), ('SLAPM-MIB', 'slapmPolicyMonitorCurrentDelayRate'), ('SLAPM-MIB', 'slapmPolicyMonitorRowStatus')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): slapm_base_group = slapmBaseGroup.setStatus('deprecated') if mibBuilder.loadTexts: slapmBaseGroup.setDescription('The group of objects defined by this MIB that are required for all implementations to be compliant.') slapm_optional_group = object_group((1, 3, 6, 1, 3, 88, 2, 2, 2)).setObjects(('SLAPM-MIB', 'slapmPolicyStatsInProfileOctets'), ('SLAPM-MIB', 'slapmPolicyStatsOutProfileOctets')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): slapm_optional_group = slapmOptionalGroup.setStatus('deprecated') if mibBuilder.loadTexts: slapmOptionalGroup.setDescription('The group of objects defined by this MIB that are optional.') slapm_end_system_group = object_group((1, 3, 6, 1, 3, 88, 2, 2, 3)).setObjects(('SLAPM-MIB', 'slapmPolicyTrapFilter'), ('SLAPM-MIB', 'slapmSubcomponentProtocol'), ('SLAPM-MIB', 'slapmSubcomponentSystemAddress'), ('SLAPM-MIB', 'slapmSubcomponentPolicyName'), ('SLAPM-MIB', 'slapmSubcomponentTrafficProfileName'), ('SLAPM-MIB', 'slapmSubcomponentLastActivity'), ('SLAPM-MIB', 'slapmSubcomponentInOctets'), ('SLAPM-MIB', 'slapmSubcomponentOutOctets'), ('SLAPM-MIB', 'slapmSubcomponentTcpOutBufferedOctets'), ('SLAPM-MIB', 'slapmSubcomponentTcpInBufferedOctets'), ('SLAPM-MIB', 'slapmSubcomponentTcpReXmts'), ('SLAPM-MIB', 'slapmSubcomponentTcpRoundTripTime'), ('SLAPM-MIB', 'slapmSubcomponentTcpRoundTripVariance'), ('SLAPM-MIB', 'slapmSubcomponentInPdus'), ('SLAPM-MIB', 'slapmSubcomponentOutPdus'), ('SLAPM-MIB', 'slapmSubcomponentApplName'), ('SLAPM-MIB', 'slapmSubcomponentMonitorStatus'), ('SLAPM-MIB', 'slapmSubcomponentMonitorIntTime'), ('SLAPM-MIB', 'slapmSubcomponentMonitorCurrentOutRate'), ('SLAPM-MIB', 'slapmSubcomponentMonitorCurrentInRate')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): slapm_end_system_group = slapmEndSystemGroup.setStatus('deprecated') if mibBuilder.loadTexts: slapmEndSystemGroup.setDescription('The group of objects defined by this MIB that are required for end system implementations.') slapm_not_group = notification_group((1, 3, 6, 1, 3, 88, 2, 2, 4)).setObjects(('SLAPM-MIB', 'slapmMonitoredEventNotAchieved'), ('SLAPM-MIB', 'slapmMonitoredEventOkay'), ('SLAPM-MIB', 'slapmPolicyProfileDeleted'), ('SLAPM-MIB', 'slapmPolicyMonitorDeleted')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): slapm_not_group = slapmNotGroup.setStatus('deprecated') if mibBuilder.loadTexts: slapmNotGroup.setDescription('The group of notifications defined by this MIB that MUST be implemented.') slapm_end_system_not_group = notification_group((1, 3, 6, 1, 3, 88, 2, 2, 5)).setObjects(('SLAPM-MIB', 'slapmSubcomponentMonitoredEventNotAchieved'), ('SLAPM-MIB', 'slapmSubcomponentMonitoredEventOkay')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): slapm_end_system_not_group = slapmEndSystemNotGroup.setStatus('deprecated') if mibBuilder.loadTexts: slapmEndSystemNotGroup.setDescription('The group of objects defined by this MIB that are required for end system implementations.') slapm_base_group2 = object_group((1, 3, 6, 1, 3, 88, 2, 2, 6)).setObjects(('SLAPM-MIB', 'slapmSpinLock'), ('SLAPM-MIB', 'slapmPolicyCountQueries'), ('SLAPM-MIB', 'slapmPolicyCountAccesses'), ('SLAPM-MIB', 'slapmPolicyCountSuccessAccesses'), ('SLAPM-MIB', 'slapmPolicyCountNotFounds'), ('SLAPM-MIB', 'slapmPolicyPurgeTime'), ('SLAPM-MIB', 'slapmPolicyTrapEnable'), ('SLAPM-MIB', 'slapmPolicyNameOfRule'), ('SLAPM-MIB', 'slapmPolicyRuleStatsOperStatus'), ('SLAPM-MIB', 'slapmPolicyRuleStatsActiveConns'), ('SLAPM-MIB', 'slapmPolicyRuleStatsTotalConns'), ('SLAPM-MIB', 'slapmPolicyRuleStatsLActivated'), ('SLAPM-MIB', 'slapmPolicyRuleStatsLastMapping'), ('SLAPM-MIB', 'slapmPolicyRuleStatsInOctets'), ('SLAPM-MIB', 'slapmPolicyRuleStatsOutOctets'), ('SLAPM-MIB', 'slapmPolicyRuleStatsConnLimit'), ('SLAPM-MIB', 'slapmPolicyRuleStatsCountAccepts'), ('SLAPM-MIB', 'slapmPolicyRuleStatsCountDenies'), ('SLAPM-MIB', 'slapmPolicyRuleStatsInDiscards'), ('SLAPM-MIB', 'slapmPolicyRuleStatsOutDiscards'), ('SLAPM-MIB', 'slapmPolicyRuleStatsInPackets'), ('SLAPM-MIB', 'slapmPolicyRuleStatsOutPackets'), ('SLAPM-MIB', 'slapmPolicyRuleStatsInProOctets'), ('SLAPM-MIB', 'slapmPolicyRuleStatsOutProOctets'), ('SLAPM-MIB', 'slapmPolicyRuleStatsMinRate'), ('SLAPM-MIB', 'slapmPolicyRuleStatsMaxRate'), ('SLAPM-MIB', 'slapmPolicyRuleStatsMaxDelay'), ('SLAPM-MIB', 'slapmPolicyRuleStatsTotalRsvpFlows'), ('SLAPM-MIB', 'slapmPolicyRuleStatsActRsvpFlows'), ('SLAPM-MIB', 'slapmPRMonControl'), ('SLAPM-MIB', 'slapmPRMonStatus'), ('SLAPM-MIB', 'slapmPRMonInterval'), ('SLAPM-MIB', 'slapmPRMonIntTime'), ('SLAPM-MIB', 'slapmPRMonCurrentInRate'), ('SLAPM-MIB', 'slapmPRMonCurrentOutRate'), ('SLAPM-MIB', 'slapmPRMonMinRateLow'), ('SLAPM-MIB', 'slapmPRMonMinRateHigh'), ('SLAPM-MIB', 'slapmPRMonMaxRateHigh'), ('SLAPM-MIB', 'slapmPRMonMaxRateLow'), ('SLAPM-MIB', 'slapmPRMonMaxDelayHigh'), ('SLAPM-MIB', 'slapmPRMonMaxDelayLow'), ('SLAPM-MIB', 'slapmPRMonMinInRateNotAchieves'), ('SLAPM-MIB', 'slapmPRMonMaxInRateExceeds'), ('SLAPM-MIB', 'slapmPRMonMaxDelayExceeds'), ('SLAPM-MIB', 'slapmPRMonMinOutRateNotAchieves'), ('SLAPM-MIB', 'slapmPRMonMaxOutRateExceeds'), ('SLAPM-MIB', 'slapmPRMonCurrentDelayRate'), ('SLAPM-MIB', 'slapmPRMonRowStatus')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): slapm_base_group2 = slapmBaseGroup2.setStatus('current') if mibBuilder.loadTexts: slapmBaseGroup2.setDescription('The group of objects defined by this MIB that are required for all implementations to be compliant.') slapm_end_system_group2 = object_group((1, 3, 6, 1, 3, 88, 2, 2, 7)).setObjects(('SLAPM-MIB', 'slapmPolicyTrapFilter'), ('SLAPM-MIB', 'slapmSubcomponentProtocol'), ('SLAPM-MIB', 'slapmSubcomponentSystemAddress'), ('SLAPM-MIB', 'slapmSubcomponentLastActivity'), ('SLAPM-MIB', 'slapmSubcomponentInOctets'), ('SLAPM-MIB', 'slapmSubcomponentOutOctets'), ('SLAPM-MIB', 'slapmSubcomponentTcpOutBufferedOctets'), ('SLAPM-MIB', 'slapmSubcomponentTcpInBufferedOctets'), ('SLAPM-MIB', 'slapmSubcomponentTcpReXmts'), ('SLAPM-MIB', 'slapmSubcomponentTcpRoundTripTime'), ('SLAPM-MIB', 'slapmSubcomponentTcpRoundTripVariance'), ('SLAPM-MIB', 'slapmSubcomponentInPdus'), ('SLAPM-MIB', 'slapmSubcomponentOutPdus'), ('SLAPM-MIB', 'slapmSubcomponentApplName'), ('SLAPM-MIB', 'slapmSubcomponentMonitorStatus'), ('SLAPM-MIB', 'slapmSubcomponentMonitorIntTime'), ('SLAPM-MIB', 'slapmSubcomponentMonitorCurrentOutRate'), ('SLAPM-MIB', 'slapmSubcomponentMonitorCurrentInRate'), ('SLAPM-MIB', 'slapmSubcomponentPolicyRuleIndex')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): slapm_end_system_group2 = slapmEndSystemGroup2.setStatus('current') if mibBuilder.loadTexts: slapmEndSystemGroup2.setDescription('The group of objects defined by this MIB that are required for end system implementations.') slapm_not_group2 = notification_group((1, 3, 6, 1, 3, 88, 2, 2, 8)).setObjects(('SLAPM-MIB', 'slapmPolicyRuleMonNotOkay'), ('SLAPM-MIB', 'slapmPolicyRuleMonOkay'), ('SLAPM-MIB', 'slapmPolicyRuleDeleted'), ('SLAPM-MIB', 'slapmPolicyRuleMonDeleted')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): slapm_not_group2 = slapmNotGroup2.setStatus('current') if mibBuilder.loadTexts: slapmNotGroup2.setDescription('The group of notifications defined by this MIB that MUST be implemented.') slapm_end_system_not_group2 = notification_group((1, 3, 6, 1, 3, 88, 2, 2, 9)).setObjects(('SLAPM-MIB', 'slapmSubcMonitorNotOkay'), ('SLAPM-MIB', 'slapmSubcMonitorOkay')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): slapm_end_system_not_group2 = slapmEndSystemNotGroup2.setStatus('current') if mibBuilder.loadTexts: slapmEndSystemNotGroup2.setDescription('The group of objects defined by this MIB that are required for end system implementations.') mibBuilder.exportSymbols('SLAPM-MIB', slapmPRMonCurrentOutRate=slapmPRMonCurrentOutRate, slapmPRMonMaxRateLow=slapmPRMonMaxRateLow, slapmPolicyRuleDeleted=slapmPolicyRuleDeleted, slapmPolicyStatsLastMapping=slapmPolicyStatsLastMapping, slapmPolicyMonitorMaxDelayExceeds=slapmPolicyMonitorMaxDelayExceeds, slapmPolicyStatsOutOctets=slapmPolicyStatsOutOctets, slapmPolicyMonitorIntTime=slapmPolicyMonitorIntTime, slapmPolicyRuleStatsCountDenies=slapmPolicyRuleStatsCountDenies, slapmSubcomponentTrafficProfileName=slapmSubcomponentTrafficProfileName, slapmPolicyRuleStatsTotalRsvpFlows=slapmPolicyRuleStatsTotalRsvpFlows, slapmPolicyRuleStatsInPackets=slapmPolicyRuleStatsInPackets, slapmPolicyMonitorMinRateLow=slapmPolicyMonitorMinRateLow, slapmPolicyMonitorCurrentDelayRate=slapmPolicyMonitorCurrentDelayRate, slapmSubcomponentInPdus=slapmSubcomponentInPdus, slapmSubcomponentOutOctets=slapmSubcomponentOutOctets, slapmPolicyStatsInOctets=slapmPolicyStatsInOctets, slapmPolicyMonitorMaxInRateExceeds=slapmPolicyMonitorMaxInRateExceeds, slapmPolicyCountAccesses=slapmPolicyCountAccesses, slapmPolicyStatsPolicyName=slapmPolicyStatsPolicyName, slapmSubcomponentRemPort=slapmSubcomponentRemPort, slapmPolicyMonitorTrafficProfileName=slapmPolicyMonitorTrafficProfileName, slapmPolicyMonitorMaxRateHigh=slapmPolicyMonitorMaxRateHigh, slapmMonitoredEventOkay=slapmMonitoredEventOkay, slapmOptionalGroup=slapmOptionalGroup, slapmPolicyRuleStatsCountAccepts=slapmPolicyRuleStatsCountAccepts, slapmPRMonTable=slapmPRMonTable, slapmPolicyStatsInDiscards=slapmPolicyStatsInDiscards, slapmSubcomponentPolicyName=slapmSubcomponentPolicyName, slapmPRMonMinOutRateNotAchieves=slapmPRMonMinOutRateNotAchieves, slapmSubcomponentOutPdus=slapmSubcomponentOutPdus, slapmPolicyMonitorControl=slapmPolicyMonitorControl, slapmSubcomponentMonitorCurrentInRate=slapmSubcomponentMonitorCurrentInRate, slapmPolicyRuleStatsTable=slapmPolicyRuleStatsTable, slapmPolicyRuleStatsOperStatus=slapmPolicyRuleStatsOperStatus, slapmSubcomponentTcpRoundTripVariance=slapmSubcomponentTcpRoundTripVariance, slapmMIB=slapmMIB, slapmPolicyRuleMonNotOkay=slapmPolicyRuleMonNotOkay, slapmPolicyStatsTrafficProfileName=slapmPolicyStatsTrafficProfileName, slapmPolicyRuleStatsInDiscards=slapmPolicyRuleStatsInDiscards, slapmPolicyStatsTable=slapmPolicyStatsTable, slapmSubcomponentMonitoredEventOkay=slapmSubcomponentMonitoredEventOkay, slapmPolicyNameTable=slapmPolicyNameTable, slapmPolicyStatsCountAccepts=slapmPolicyStatsCountAccepts, slapmPolicyStatsOutDiscards=slapmPolicyStatsOutDiscards, slapmBaseGroup2=slapmBaseGroup2, slapmObjects=slapmObjects, slapmPolicyMonitorCurrentInRate=slapmPolicyMonitorCurrentInRate, slapmPRMonMaxDelayLow=slapmPRMonMaxDelayLow, slapmPolicyStatsFirstActivated=slapmPolicyStatsFirstActivated, slapmPRMonIntTime=slapmPRMonIntTime, slapmPolicyRuleStatsTotalConns=slapmPolicyRuleStatsTotalConns, slapmPRMonRowStatus=slapmPRMonRowStatus, slapmPolicyStatsActiveConns=slapmPolicyStatsActiveConns, slapmPolicyMonitorMinInRateNotAchieves=slapmPolicyMonitorMinInRateNotAchieves, slapmSubcomponentApplName=slapmSubcomponentApplName, slapmEndSystemGroup2=slapmEndSystemGroup2, slapmEndSystemNotGroup2=slapmEndSystemNotGroup2, slapmSubcomponentLocalPort=slapmSubcomponentLocalPort, slapmPolicyStatsOutProfileOctets=slapmPolicyStatsOutProfileOctets, slapmPRMonCurrentInRate=slapmPRMonCurrentInRate, slapmPolicyRuleStatsActiveConns=slapmPolicyRuleStatsActiveConns, slapmEndSystemNotGroup=slapmEndSystemNotGroup, slapmPolicyMonitorMaxOutRateExceeds=slapmPolicyMonitorMaxOutRateExceeds, slapmPolicyRuleStatsOutProOctets=slapmPolicyRuleStatsOutProOctets, slapmPolicyStatsOutPackets=slapmPolicyStatsOutPackets, slapmPolicyStatsMinRate=slapmPolicyStatsMinRate, slapmPolicyMonitorMaxRateLow=slapmPolicyMonitorMaxRateLow, slapmSubcomponentTcpInBufferedOctets=slapmSubcomponentTcpInBufferedOctets, slapmPolicyStatsOperStatus=slapmPolicyStatsOperStatus, slapmPRMonMaxOutRateExceeds=slapmPRMonMaxOutRateExceeds, slapmPRMonMinRateLow=slapmPRMonMinRateLow, slapmSubcomponentRemAddress=slapmSubcomponentRemAddress, slapmBaseObjects=slapmBaseObjects, slapmPolicyMonitorMaxDelayHigh=slapmPolicyMonitorMaxDelayHigh, slapmSubcomponentLocalAddress=slapmSubcomponentLocalAddress, slapmPRMonIndex=slapmPRMonIndex, slapmBaseGroup=slapmBaseGroup, slapmPolicyCountQueries=slapmPolicyCountQueries, slapmPolicyRuleStatsConnLimit=slapmPolicyRuleStatsConnLimit, slapmCompliance=slapmCompliance, slapmPolicyMonitorRowStatus=slapmPolicyMonitorRowStatus, slapmConformance=slapmConformance, slapmPolicyRuleStatsActRsvpFlows=slapmPolicyRuleStatsActRsvpFlows, slapmPolicyRuleMonDeleted=slapmPolicyRuleMonDeleted, slapmPolicyMonitorPolicyName=slapmPolicyMonitorPolicyName, slapmPolicyMonitorTable=slapmPolicyMonitorTable, slapmPRMonMinRateHigh=slapmPRMonMinRateHigh, slapmCompliances=slapmCompliances, slapmPolicyMonitorMinRateHigh=slapmPolicyMonitorMinRateHigh, slapmPolicyPurgeTime=slapmPolicyPurgeTime, slapmPRMonMaxRateHigh=slapmPRMonMaxRateHigh, slapmPRMonMaxDelayExceeds=slapmPRMonMaxDelayExceeds, slapmPolicyNameIndex=slapmPolicyNameIndex, slapmPolicyRuleStatsMinRate=slapmPolicyRuleStatsMinRate, slapmEndSystemGroup=slapmEndSystemGroup, slapmPRMonMaxDelayHigh=slapmPRMonMaxDelayHigh, slapmNotifications=slapmNotifications, slapmPolicyStatsCountDenies=slapmPolicyStatsCountDenies, slapmPolicyRuleStatsLActivated=slapmPolicyRuleStatsLActivated, slapmSubcMonitorNotOkay=slapmSubcMonitorNotOkay, slapmPolicyRuleStatsLastMapping=slapmPolicyRuleStatsLastMapping, slapmPRMonMinInRateNotAchieves=slapmPRMonMinInRateNotAchieves, slapmPolicyTrapFilter=slapmPolicyTrapFilter, slapmSubcomponentMonitorStatus=slapmSubcomponentMonitorStatus, slapmPolicyCountNotFounds=slapmPolicyCountNotFounds, slapmSubcomponentLastActivity=slapmSubcomponentLastActivity, slapmPolicyRuleStatsInOctets=slapmPolicyRuleStatsInOctets, slapmPolicyMonitorOwnerIndex=slapmPolicyMonitorOwnerIndex, slapmPRMonCurrentDelayRate=slapmPRMonCurrentDelayRate, slapmSubcomponentMonitorIntTime=slapmSubcomponentMonitorIntTime, slapmSubcomponentSystemAddress=slapmSubcomponentSystemAddress, slapmPolicyMonitorEntry=slapmPolicyMonitorEntry, slapmPolicyRuleMonOkay=slapmPolicyRuleMonOkay, slapmPolicyRuleStatsMaxDelay=slapmPolicyRuleStatsMaxDelay, slapmSubcomponentTable=slapmSubcomponentTable, slapmPRMonInterval=slapmPRMonInterval, SlapmStatus=SlapmStatus, PYSNMP_MODULE_ID=slapmMIB, slapmPolicyMonitorStatus=slapmPolicyMonitorStatus, slapmSubcomponentProtocol=slapmSubcomponentProtocol, slapmSubcomponentTcpOutBufferedOctets=slapmSubcomponentTcpOutBufferedOctets, slapmPRMonOwnerIndex=slapmPRMonOwnerIndex, slapmSubcomponentInOctets=slapmSubcomponentInOctets, slapmSpinLock=slapmSpinLock, slapmPolicyMonitorMinOutRateNotAchieves=slapmPolicyMonitorMinOutRateNotAchieves, slapmPolicyStatsSystemAddress=slapmPolicyStatsSystemAddress, slapmPolicyMonitorDeleted=slapmPolicyMonitorDeleted, slapmPolicyStatsInPackets=slapmPolicyStatsInPackets, slapmPolicyStatsInProfileOctets=slapmPolicyStatsInProfileOctets, slapmSubcomponentTcpRoundTripTime=slapmSubcomponentTcpRoundTripTime, slapmNotGroup=slapmNotGroup, slapmPolicyRuleStatsOutOctets=slapmPolicyRuleStatsOutOctets, slapmSubcomponentPolicyRuleIndex=slapmSubcomponentPolicyRuleIndex, slapmPRMonControl=slapmPRMonControl, slapmPolicyNameEntry=slapmPolicyNameEntry, slapmPRMonSystemAddress=slapmPRMonSystemAddress, slapmPolicyStatsEntry=slapmPolicyStatsEntry, SlapmNameType=SlapmNameType, slapmPolicyMonitorCurrentOutRate=slapmPolicyMonitorCurrentOutRate, slapmPolicyStatsTotalConns=slapmPolicyStatsTotalConns, slapmPolicyTrapEnable=slapmPolicyTrapEnable, SlapmPolicyRuleName=SlapmPolicyRuleName, slapmSubcomponentTcpReXmts=slapmSubcomponentTcpReXmts, slapmPolicyRuleStatsEntry=slapmPolicyRuleStatsEntry, slapmPolicyStatsConnectionLimit=slapmPolicyStatsConnectionLimit, slapmPRMonStatus=slapmPRMonStatus, slapmPolicyNameOfRule=slapmPolicyNameOfRule, slapmPolicyMonitorSystemAddress=slapmPolicyMonitorSystemAddress, slapmTableObjects=slapmTableObjects, slapmGroups=slapmGroups, slapmPolicyStatsMaxRate=slapmPolicyStatsMaxRate, slapmPolicyRuleStatsOutPackets=slapmPolicyRuleStatsOutPackets, slapmMonitoredEventNotAchieved=slapmMonitoredEventNotAchieved, slapmPolicyNameSystemAddress=slapmPolicyNameSystemAddress, slapmSubcMonitorOkay=slapmSubcMonitorOkay, slapmPolicyRuleStatsInProOctets=slapmPolicyRuleStatsInProOctets, slapmPolicyMonitorInterval=slapmPolicyMonitorInterval, slapmPolicyProfileDeleted=slapmPolicyProfileDeleted, slapmSubcomponentMonitoredEventNotAchieved=slapmSubcomponentMonitoredEventNotAchieved, slapmSubcomponentEntry=slapmSubcomponentEntry, slapmPolicyRuleStatsMaxRate=slapmPolicyRuleStatsMaxRate, slapmPolicyCountSuccessAccesses=slapmPolicyCountSuccessAccesses, slapmPRMonEntry=slapmPRMonEntry, slapmPolicyStatsMaxDelay=slapmPolicyStatsMaxDelay, slapmSubcomponentMonitorCurrentOutRate=slapmSubcomponentMonitorCurrentOutRate, slapmPRMonMaxInRateExceeds=slapmPRMonMaxInRateExceeds, slapmPolicyRuleStatsOutDiscards=slapmPolicyRuleStatsOutDiscards, slapmPolicyMonitorMaxDelayLow=slapmPolicyMonitorMaxDelayLow, slapmNotGroup2=slapmNotGroup2)
"""The CLI package.""" __all__ = [ "main", "bootstrap", "config", "log", "project", "experiment", "report", "run", "slurm" ]
"""The CLI package.""" __all__ = ['main', 'bootstrap', 'config', 'log', 'project', 'experiment', 'report', 'run', 'slurm']
# To format the names in title case input_first_name=input("Enter the first name: ") input_last_name= input("Enter the last name: ") def format_name(first_name,last_name): first_name = first_name.title() last_name = last_name.title() full_name = first_name + " "+last_name return full_name name = format_name(input_first_name,input_last_name) print(name)
input_first_name = input('Enter the first name: ') input_last_name = input('Enter the last name: ') def format_name(first_name, last_name): first_name = first_name.title() last_name = last_name.title() full_name = first_name + ' ' + last_name return full_name name = format_name(input_first_name, input_last_name) print(name)
def determine_dim_size(dim_modalities, pick_modalities): if len(pick_modalities) < len(dim_modalities): dim_modalities = [dim_modalities[mod_idx] for mod_idx in pick_modalities] return dim_modalities def prepare_batch(multidimensional_ts, split_modalities, pick_modalities, dim_modalities): if split_modalities: sig = list() start_idx = 0 for mod_idx, mod_dim in zip(pick_modalities, dim_modalities): end_idx = start_idx + mod_dim sig.append(multidimensional_ts[..., start_idx:end_idx]) start_idx = end_idx else: sig = multidimensional_ts return sig
def determine_dim_size(dim_modalities, pick_modalities): if len(pick_modalities) < len(dim_modalities): dim_modalities = [dim_modalities[mod_idx] for mod_idx in pick_modalities] return dim_modalities def prepare_batch(multidimensional_ts, split_modalities, pick_modalities, dim_modalities): if split_modalities: sig = list() start_idx = 0 for (mod_idx, mod_dim) in zip(pick_modalities, dim_modalities): end_idx = start_idx + mod_dim sig.append(multidimensional_ts[..., start_idx:end_idx]) start_idx = end_idx else: sig = multidimensional_ts return sig
################################################################# # # # Program Code for Spot Micro MRL # # Of the Cyber_One YouTube Channel # # https://www.youtube.com/cyber_one # # # # This is version 0.1 # # Divided up into sub programs # # Coded for the Nixie Version of MyRobotLab. # # # # Running on MyRobotLab (MRL) http://myrobotlab.org/ # # Spot Micro MRL is a set of Python scripts that run inside # # the MRL system # # # # Start.py # # This file starts the GUI if required and runs all the # # other files required for the Spot Micro robot to run. # # # ################################################################# # Because you might want to place your robots files into a # # different dicrectory compared to what I have, # # the RunningFolder variable is the name of the folder you # # will be using. # ################################################################# RuningFolder="Spot" ################################################################# # The execfile() function loads and executes the named program. # # This is handy for breaking a program into smaller more # # manageable parts. # # This file is the system configuration file. # ################################################################# execfile(RuningFolder+'/1_Configuration/1_Sys_Config.py') ################################################################# # Before we get too carried away, I plan to start Spot using a # # shell script called start_spot.sh # # This will start the MRL and the Spot scripts with no # # Graphical User Interfaces (GUI) at all. # # Under normal conditions, this would be desirable as spot # # doesn't have a monitor at all, however we can connect to it # # with VNC which does give us a monitor so we may want a GUI. # # To overcome this issue, we will start the GUI here. # # # # Python uses indentation or white space to show each of the # # lines to be executed as part of an if statement. # # In the first if statement, there is only one indented line # # following, then we have a blank line (for clarity) before # # we have another if statement. The second If statement needs # # to execute a number of line, and you can see these lines are # # all indented. There is also one nested if statement. # ################################################################# if RunWebGUI == True: plan = runtime.load("webgui","WebGui") config = plan.get("webgui") config.autoStartBrowser = False runtime.start("webgui", "WebGui") #WebGui = Runtime.create("WebGui","WebGui") #WebGui.hide('cli') #sleep(1) #WebGui.show('cli') #sleep(1) #WebGui.set('cli', 400, 400, 999) ############################################################# # if you don't want the browser to autostart to homepage # # then set the autoStartBrowser to False # ############################################################# #if RunWebGUIbrowser == False: # WebGui.autoStartBrowser(False) ############################################################# # set a different port number to listen to. default is 8888 # # WebGui.setPort(7777) # # on startup the WebGui will look for a "resources" # # directory (may change in the future) # # static html files can be placed here and accessed # # through the WebGui service starts the websocket server # # and attempts to autostart browser unless it was disabled # ############################################################# #WebGui.startService(); ################################################################# # Load in the Common Variables used to help track and control # # various functions # ################################################################# execfile(RuningFolder+'/Common_Variables.py') ################################################################# # Controllers.py starts the major controller interface services # # such as the Raspberry Pi service and the Adafruit Servo # # controller services # # This is also where you would start any Arduino services you # # might want to add like the Nano for the Ultra-Sonic sensors. # ################################################################# execfile(RuningFolder+'/Controllers.py') ################################################################# # The IO services are for things like the PIR, Ultrasonic # range finders and NeoPixel rings ect. ################################################################# execfile(RuningFolder+'/IO.py') ################################################################# # The next is for the different servos we will be running. # # This set of files are responsible for starting and # # configuring each of the servos throughout the robot. # ################################################################# execfile(RuningFolder+'/Servos.py') ################################################################# # There are a number of options for Text To Speech (TTS) and # # Speech To Text (STT) service. You will need to have a look # # in this file to select which ones you want to use. # ################################################################# #execfile(RuningFolder+'/Speech.py') ################################################################# # When not activly executing a command, we don't want the # # robot to just stand there, This file is responsible for # # giving our robot a bitof life. # # By blinking the eyes, coordinating the left and right eyes # # and performing other random like movements, just to make our # # robot appear to be alive. # ################################################################# execfile(RuningFolder+'/Life.py') ################################################################# # When not activly executing a command, we don't want the # # robot to just stand there, This file is responsible for # # giving our robot a bitof life. # # By blinking the eyes, coordinating the left and right eyes # # and performing other random like movements, just to make our # # robot appear to be alive. # ################################################################# execfile(RuningFolder+'/Gestures.py') ################################################################# # If your robot has cameras in it's eye, then we may want to # # add in Open Computer Vison to help the robot make sense of # # the world around it. # ################################################################# #execfile(RuningFolder+'/OpenCV.py') ################################################################# # This file sets up the WebKitSpeechRecognition service # # The MarySpeech TTS service and the ProgramAB service that # # interperates the Alice2 AIML files # ################################################################# #execfile(RuningFolder+'/Brain.py')
runing_folder = 'Spot' execfile(RuningFolder + '/1_Configuration/1_Sys_Config.py') if RunWebGUI == True: plan = runtime.load('webgui', 'WebGui') config = plan.get('webgui') config.autoStartBrowser = False runtime.start('webgui', 'WebGui') execfile(RuningFolder + '/Common_Variables.py') execfile(RuningFolder + '/Controllers.py') execfile(RuningFolder + '/IO.py') execfile(RuningFolder + '/Servos.py') execfile(RuningFolder + '/Life.py') execfile(RuningFolder + '/Gestures.py')
#!/usr/bin/env python3 # Extra Line added # -*- coding: utf-8 -*- """ Created on Sun Sep 30 13:52:32 2018 @author: jaley """ class Dog(object): # 2 Underscores def __init__(self,breed): self.breed = breed sam = Dog(breed='Lab') frank = Dog(breed='Huskie') print (sam.breed) class Animal(object): def __init__(self,name): self.name = name print (self.name + " created") def whoAmI(self): print ("Animal") def eat(self): print ("Eating") class Dog(Animal): def __init__(self,name): self.name = name #Animal.__init__(self,name) print (self.name + " object created") self.name = "Lab" def whoAmI(self): print (self.name) def bark(self): print ("Woof!") tommyObject = Dog("tommy") # Creating the class instancce germanShepherdObject = Dog("gs") # Creating the class instancce
""" Created on Sun Sep 30 13:52:32 2018 @author: jaley """ class Dog(object): def __init__(self, breed): self.breed = breed sam = dog(breed='Lab') frank = dog(breed='Huskie') print(sam.breed) class Animal(object): def __init__(self, name): self.name = name print(self.name + ' created') def who_am_i(self): print('Animal') def eat(self): print('Eating') class Dog(Animal): def __init__(self, name): self.name = name print(self.name + ' object created') self.name = 'Lab' def who_am_i(self): print(self.name) def bark(self): print('Woof!') tommy_object = dog('tommy') german_shepherd_object = dog('gs')
def printg(grid, name): print( '%s: [' % name) for row in grid: print( row) print( ']') def dist(p, q): dx = abs(p[0] - q[0]) dy = abs(p[1] - q[1]) return dx + dy; def reconstruct_path(came_from, current): total_path = [current] while current in came_from.keys(): current = came_from[current] total_path.append(current) return list(reversed(total_path)) def neighbours(node, grid, score, tail, ignore_list): width = len(grid) height = len(grid[0]) subtail = [] if score >= len(tail): subtail = [tuple(x) for x in tail] else: subtail = [tuple(x) for x in tail[len(tail)-score:]] result = [] if (node[0] > 0): result.append((node[0]-1,node[1])) if (node[0] < width-1): result.append((node[0]+1,node[1])) if (node[1] > 0): result.append((node[0],node[1]-1)) if (node[1] < height-1): result.append((node[0],node[1]+1)) result = filter(lambda p: (grid[p[0]][p[1]] not in ignore_list) or (p in subtail), result) return result def a_star(start, goal, grid, tail): start = tuple(start) goal = tuple(goal) closed_set = [] open_set = [start] came_from = {} #empty map #for x in range(len(grid[y])) g_score = [[10000 for x in range(len(grid[y]))] for y in range(len(grid))] g_score[start[0]][start[1]] = 0 f_score = [[10000 for x in range(len(grid[y]))] for y in range(len(grid))] f_score[start[0]][start[1]] = dist(start,goal) while(len(open_set) > 0): current = min(open_set, key=lambda p: f_score[p[0]][p[1]]) if (current == goal): return reconstruct_path(came_from, goal) open_set.remove(current) closed_set.append(current) for neighbour in neighbours(current, grid, g_score[current[0]][current[1]], tail,[1,2,5]): if neighbour in closed_set: continue tentative_g_score = g_score[current[0]][current[1]] + dist(current,neighbour) if neighbour not in open_set: open_set.append(neighbour) elif tentative_g_score >= g_score[neighbour[0]][neighbour[1]]: continue came_from[neighbour] = current g_score[neighbour[0]][neighbour[1]] = tentative_g_score f_score[neighbour[0]][neighbour[1]] = tentative_g_score + dist(neighbour,goal) return None
def printg(grid, name): print('%s: [' % name) for row in grid: print(row) print(']') def dist(p, q): dx = abs(p[0] - q[0]) dy = abs(p[1] - q[1]) return dx + dy def reconstruct_path(came_from, current): total_path = [current] while current in came_from.keys(): current = came_from[current] total_path.append(current) return list(reversed(total_path)) def neighbours(node, grid, score, tail, ignore_list): width = len(grid) height = len(grid[0]) subtail = [] if score >= len(tail): subtail = [tuple(x) for x in tail] else: subtail = [tuple(x) for x in tail[len(tail) - score:]] result = [] if node[0] > 0: result.append((node[0] - 1, node[1])) if node[0] < width - 1: result.append((node[0] + 1, node[1])) if node[1] > 0: result.append((node[0], node[1] - 1)) if node[1] < height - 1: result.append((node[0], node[1] + 1)) result = filter(lambda p: grid[p[0]][p[1]] not in ignore_list or p in subtail, result) return result def a_star(start, goal, grid, tail): start = tuple(start) goal = tuple(goal) closed_set = [] open_set = [start] came_from = {} g_score = [[10000 for x in range(len(grid[y]))] for y in range(len(grid))] g_score[start[0]][start[1]] = 0 f_score = [[10000 for x in range(len(grid[y]))] for y in range(len(grid))] f_score[start[0]][start[1]] = dist(start, goal) while len(open_set) > 0: current = min(open_set, key=lambda p: f_score[p[0]][p[1]]) if current == goal: return reconstruct_path(came_from, goal) open_set.remove(current) closed_set.append(current) for neighbour in neighbours(current, grid, g_score[current[0]][current[1]], tail, [1, 2, 5]): if neighbour in closed_set: continue tentative_g_score = g_score[current[0]][current[1]] + dist(current, neighbour) if neighbour not in open_set: open_set.append(neighbour) elif tentative_g_score >= g_score[neighbour[0]][neighbour[1]]: continue came_from[neighbour] = current g_score[neighbour[0]][neighbour[1]] = tentative_g_score f_score[neighbour[0]][neighbour[1]] = tentative_g_score + dist(neighbour, goal) return None
#!/usr/bin/env python #pylint: skip-file # This source code is licensed under the Apache license found in the # LICENSE file in the root directory of this project. class ZtdDevice(object): def __init__(self): """ Attributes: swaggerTypes (dict): The key is attribute name and the value is attribute type. attributeMap (dict): The key is attribute name and the value is json key in definition. """ self.swaggerTypes = { 'serialNumber': 'str', 'source': 'str', 'aliases': 'list[str]', 'ipAddress': 'str', 'id': 'str', 'platformId': 'str', 'site': 'str', 'imageId': 'str', 'configId': 'str', 'pkiEnabled': 'bool', 'eulaAccepted': 'bool', 'licenseLevel': 'str', 'templateConfigId': 'str', 'licenseString': 'str', 'apCount': 'str', 'isMobilityController': 'str', 'deviceDiscoveryInfo': 'ZtdDeviceDiscoveryInfo', 'macAddress': 'str', 'sudiRequired': 'bool', 'memberUdi': 'str', 'fileDestination': 'str', 'backoffTimer': 'str', 'provisioningType': 'str', 'unclaimedHint': 'str', 'bootstrapId': 'str', 'hwRevision': 'str', 'mainMemSize': 'str', 'boardId': 'str', 'boardReworkId': 'str', 'midplaneVersion': 'str', 'versionString': 'str', 'imageFile': 'str', 'returnToRomReason': 'str', 'bootVariable': 'str', 'bootLdrVariable': 'str', 'configVariable': 'str', 'configReg': 'str', 'configRegNext': 'str', 'topologyInfo': 'str', 'filesystemInfo': 'str', 'deviceDetailsLastUpdate': 'str', 'slotNumber': 'str', 'certificateNeededState': 'str', 'pnpProfileUsedAddr': 'str', 'pnpProfileUsedHost': 'str', 'authStatus': 'DeviceAuthState', 'deviceCertificate': 'str', 'deviceType': 'str', 'memberDetail': 'list[ZtdMemberDetail]', 'requestHeader': 'ZtdRequestHeader', 'lastStateTransitionTime': 'str', 'firstContact': 'str', 'lastContact': 'str', 'cleanup': 'bool', 'stateDisplay': 'str', 'versionCompatible': 'str', 'state': 'str', 'hostName': 'str' } self.attributeMap = { 'serialNumber': 'serialNumber', 'source': 'source', 'aliases': 'aliases', 'ipAddress': 'ipAddress', 'id': 'id', 'platformId': 'platformId', 'site': 'site', 'imageId': 'imageId', 'configId': 'configId', 'pkiEnabled': 'pkiEnabled', 'eulaAccepted': 'eulaAccepted', 'licenseLevel': 'licenseLevel', 'templateConfigId': 'templateConfigId', 'licenseString': 'licenseString', 'apCount': 'apCount', 'isMobilityController': 'isMobilityController', 'deviceDiscoveryInfo': 'deviceDiscoveryInfo', 'macAddress': 'macAddress', 'sudiRequired': 'sudiRequired', 'memberUdi': 'memberUdi', 'fileDestination': 'fileDestination', 'backoffTimer': 'backoffTimer', 'provisioningType': 'provisioningType', 'unclaimedHint': 'unclaimedHint', 'bootstrapId': 'bootstrapId', 'hwRevision': 'hwRevision', 'mainMemSize': 'mainMemSize', 'boardId': 'boardId', 'boardReworkId': 'boardReworkId', 'midplaneVersion': 'midplaneVersion', 'versionString': 'versionString', 'imageFile': 'imageFile', 'returnToRomReason': 'returnToRomReason', 'bootVariable': 'bootVariable', 'bootLdrVariable': 'bootLdrVariable', 'configVariable': 'configVariable', 'configReg': 'configReg', 'configRegNext': 'configRegNext', 'topologyInfo': 'topologyInfo', 'filesystemInfo': 'filesystemInfo', 'deviceDetailsLastUpdate': 'deviceDetailsLastUpdate', 'slotNumber': 'slotNumber', 'certificateNeededState': 'certificateNeededState', 'pnpProfileUsedAddr': 'pnpProfileUsedAddr', 'pnpProfileUsedHost': 'pnpProfileUsedHost', 'authStatus': 'authStatus', 'deviceCertificate': 'deviceCertificate', 'deviceType': 'deviceType', 'memberDetail': 'memberDetail', 'requestHeader': 'requestHeader', 'lastStateTransitionTime': 'lastStateTransitionTime', 'firstContact': 'firstContact', 'lastContact': 'lastContact', 'cleanup': 'cleanup', 'stateDisplay': 'stateDisplay', 'versionCompatible': 'versionCompatible', 'state': 'state', 'hostName': 'hostName' } #Serial number self.serialNumber = None # str #Source of device,set to CLOUD if device matches synced cloud device self.source = None # str self.aliases = None # list[str] self.ipAddress = None # str #Device ID self.id = None # str #Platform ID self.platformId = None # str #Project to which device belongs if pre-provisioned self.site = None # str #Image file ID self.imageId = None # str #Configuration file ID self.configId = None # str #Configure PKCS#12 trust point during PNP workflow if true self.pkiEnabled = None # bool #CLI execution EULA accepted or not self.eulaAccepted = None # bool #CLI execution license level self.licenseLevel = None # str #Template config ID self.templateConfigId = None # str #License information self.licenseString = None # str #Wireless AP count self.apCount = None # str #Specify if device is a wireless mobility controller self.isMobilityController = None # str #Device discovery info self.deviceDiscoveryInfo = None # ZtdDeviceDiscoveryInfo self.macAddress = None # str self.sudiRequired = None # bool #Unique device ID of redundant/stack switches self.memberUdi = None # str #Location on device to which image/config files will be copied self.fileDestination = None # str #Backoff timer self.backoffTimer = None # str #Type of device self.provisioningType = None # str #Hint whether device might be RMA self.unclaimedHint = None # str #Bootstrap file ID self.bootstrapId = None # str #HW revision self.hwRevision = None # str #Main memory size self.mainMemSize = None # str #Board ID self.boardId = None # str #Board rework ID self.boardReworkId = None # str #Mid plane version self.midplaneVersion = None # str #IOS Version self.versionString = None # str #Image ID self.imageFile = None # str #Return to rom reason self.returnToRomReason = None # str #Boot variable self.bootVariable = None # str #Boot ldr variable self.bootLdrVariable = None # str #Config variable self.configVariable = None # str #Config reg self.configReg = None # str #Config reg next self.configRegNext = None # str #Information about topology self.topologyInfo = None # str #Information about filesystem self.filesystemInfo = None # str #Timestamp when the device details were last read self.deviceDetailsLastUpdate = None # str #Slot number self.slotNumber = None # str #State which is detected as happening over http instead of https self.certificateNeededState = None # str #PnP server ipv4 address used by pnp profile self.pnpProfileUsedAddr = None # str #PnP server hostname used by pnp profile self.pnpProfileUsedHost = None # str self.authStatus = None # DeviceAuthState self.deviceCertificate = None # str self.deviceType = None # str self.memberDetail = None # list[ZtdMemberDetail] self.requestHeader = None # ZtdRequestHeader #Last state transition time of device self.lastStateTransitionTime = None # str #First contact time of device self.firstContact = None # str #Last contact time of device self.lastContact = None # str self.cleanup = None # bool self.stateDisplay = None # str self.versionCompatible = None # str #Device state self.state = None # str #Host name self.hostName = None # str
class Ztddevice(object): def __init__(self): """ Attributes: swaggerTypes (dict): The key is attribute name and the value is attribute type. attributeMap (dict): The key is attribute name and the value is json key in definition. """ self.swaggerTypes = {'serialNumber': 'str', 'source': 'str', 'aliases': 'list[str]', 'ipAddress': 'str', 'id': 'str', 'platformId': 'str', 'site': 'str', 'imageId': 'str', 'configId': 'str', 'pkiEnabled': 'bool', 'eulaAccepted': 'bool', 'licenseLevel': 'str', 'templateConfigId': 'str', 'licenseString': 'str', 'apCount': 'str', 'isMobilityController': 'str', 'deviceDiscoveryInfo': 'ZtdDeviceDiscoveryInfo', 'macAddress': 'str', 'sudiRequired': 'bool', 'memberUdi': 'str', 'fileDestination': 'str', 'backoffTimer': 'str', 'provisioningType': 'str', 'unclaimedHint': 'str', 'bootstrapId': 'str', 'hwRevision': 'str', 'mainMemSize': 'str', 'boardId': 'str', 'boardReworkId': 'str', 'midplaneVersion': 'str', 'versionString': 'str', 'imageFile': 'str', 'returnToRomReason': 'str', 'bootVariable': 'str', 'bootLdrVariable': 'str', 'configVariable': 'str', 'configReg': 'str', 'configRegNext': 'str', 'topologyInfo': 'str', 'filesystemInfo': 'str', 'deviceDetailsLastUpdate': 'str', 'slotNumber': 'str', 'certificateNeededState': 'str', 'pnpProfileUsedAddr': 'str', 'pnpProfileUsedHost': 'str', 'authStatus': 'DeviceAuthState', 'deviceCertificate': 'str', 'deviceType': 'str', 'memberDetail': 'list[ZtdMemberDetail]', 'requestHeader': 'ZtdRequestHeader', 'lastStateTransitionTime': 'str', 'firstContact': 'str', 'lastContact': 'str', 'cleanup': 'bool', 'stateDisplay': 'str', 'versionCompatible': 'str', 'state': 'str', 'hostName': 'str'} self.attributeMap = {'serialNumber': 'serialNumber', 'source': 'source', 'aliases': 'aliases', 'ipAddress': 'ipAddress', 'id': 'id', 'platformId': 'platformId', 'site': 'site', 'imageId': 'imageId', 'configId': 'configId', 'pkiEnabled': 'pkiEnabled', 'eulaAccepted': 'eulaAccepted', 'licenseLevel': 'licenseLevel', 'templateConfigId': 'templateConfigId', 'licenseString': 'licenseString', 'apCount': 'apCount', 'isMobilityController': 'isMobilityController', 'deviceDiscoveryInfo': 'deviceDiscoveryInfo', 'macAddress': 'macAddress', 'sudiRequired': 'sudiRequired', 'memberUdi': 'memberUdi', 'fileDestination': 'fileDestination', 'backoffTimer': 'backoffTimer', 'provisioningType': 'provisioningType', 'unclaimedHint': 'unclaimedHint', 'bootstrapId': 'bootstrapId', 'hwRevision': 'hwRevision', 'mainMemSize': 'mainMemSize', 'boardId': 'boardId', 'boardReworkId': 'boardReworkId', 'midplaneVersion': 'midplaneVersion', 'versionString': 'versionString', 'imageFile': 'imageFile', 'returnToRomReason': 'returnToRomReason', 'bootVariable': 'bootVariable', 'bootLdrVariable': 'bootLdrVariable', 'configVariable': 'configVariable', 'configReg': 'configReg', 'configRegNext': 'configRegNext', 'topologyInfo': 'topologyInfo', 'filesystemInfo': 'filesystemInfo', 'deviceDetailsLastUpdate': 'deviceDetailsLastUpdate', 'slotNumber': 'slotNumber', 'certificateNeededState': 'certificateNeededState', 'pnpProfileUsedAddr': 'pnpProfileUsedAddr', 'pnpProfileUsedHost': 'pnpProfileUsedHost', 'authStatus': 'authStatus', 'deviceCertificate': 'deviceCertificate', 'deviceType': 'deviceType', 'memberDetail': 'memberDetail', 'requestHeader': 'requestHeader', 'lastStateTransitionTime': 'lastStateTransitionTime', 'firstContact': 'firstContact', 'lastContact': 'lastContact', 'cleanup': 'cleanup', 'stateDisplay': 'stateDisplay', 'versionCompatible': 'versionCompatible', 'state': 'state', 'hostName': 'hostName'} self.serialNumber = None self.source = None self.aliases = None self.ipAddress = None self.id = None self.platformId = None self.site = None self.imageId = None self.configId = None self.pkiEnabled = None self.eulaAccepted = None self.licenseLevel = None self.templateConfigId = None self.licenseString = None self.apCount = None self.isMobilityController = None self.deviceDiscoveryInfo = None self.macAddress = None self.sudiRequired = None self.memberUdi = None self.fileDestination = None self.backoffTimer = None self.provisioningType = None self.unclaimedHint = None self.bootstrapId = None self.hwRevision = None self.mainMemSize = None self.boardId = None self.boardReworkId = None self.midplaneVersion = None self.versionString = None self.imageFile = None self.returnToRomReason = None self.bootVariable = None self.bootLdrVariable = None self.configVariable = None self.configReg = None self.configRegNext = None self.topologyInfo = None self.filesystemInfo = None self.deviceDetailsLastUpdate = None self.slotNumber = None self.certificateNeededState = None self.pnpProfileUsedAddr = None self.pnpProfileUsedHost = None self.authStatus = None self.deviceCertificate = None self.deviceType = None self.memberDetail = None self.requestHeader = None self.lastStateTransitionTime = None self.firstContact = None self.lastContact = None self.cleanup = None self.stateDisplay = None self.versionCompatible = None self.state = None self.hostName = None
msg_soc='BA:?' msg_p='P:?' msg_ppvt='PV:?' msg_conso='CON:?' soc=101 try: tree = etree.parse(configGet('tmpFileDataXml')) for datas in tree.xpath("/devices/device/datas/data"): if datas.get("id") in configGet('lcd','dataPrint'): for data in datas.getchildren(): if data.tag == "value": if datas.get("id") == 'SOC': msg_soc='BA:'+data.text + '%' soc=data.text elif datas.get("id") == 'P': msg_p = 'P:'+data.text + 'W' elif datas.get("id") == 'PPVT': msg_ppvt = 'PV:'+data.text + 'W' elif datas.get("id") == 'CONSO' and data.text != 'NODATA': msg_conso = 'CON:'+data.text + 'W' except: debugTerm("Erreur dans la lecture du XML la syntax n'est pas bonne ?") # Construction de l'affichage lcd.clear() nb_ligne1_space=lcd_columns-len(msg_soc)-len(msg_p) ligne1_msg=msg_soc for nb_space1 in range(nb_ligne1_space): ligne1_msg=ligne1_msg+' ' ligne1_msg=ligne1_msg+msg_p nb_ligne2_space=lcd_columns-len(msg_ppvt)-len(msg_conso) ligne2_msg=msg_ppvt for nb_space2 in range(nb_ligne2_space): ligne2_msg=ligne2_msg+' ' ligne2_msg=ligne2_msg+msg_conso lcd.message = ligne1_msg+'\n'+ligne2_msg debugTerm('Affichage\n' + ligne1_msg+'\n'+ligne2_msg) if etat_lcd == True: if float(soc) >= 94 and float(soc) < 100: # Vert lcd.color = [0, 100, 0] elif float(soc) <= 85: # Rouge lcd.color = [100, 0, 0] elif float(soc) > 85: # Jaune lcd.color = [100, 100, 0] else: lcd.color = [100, 100, 100]
msg_soc = 'BA:?' msg_p = 'P:?' msg_ppvt = 'PV:?' msg_conso = 'CON:?' soc = 101 try: tree = etree.parse(config_get('tmpFileDataXml')) for datas in tree.xpath('/devices/device/datas/data'): if datas.get('id') in config_get('lcd', 'dataPrint'): for data in datas.getchildren(): if data.tag == 'value': if datas.get('id') == 'SOC': msg_soc = 'BA:' + data.text + '%' soc = data.text elif datas.get('id') == 'P': msg_p = 'P:' + data.text + 'W' elif datas.get('id') == 'PPVT': msg_ppvt = 'PV:' + data.text + 'W' elif datas.get('id') == 'CONSO' and data.text != 'NODATA': msg_conso = 'CON:' + data.text + 'W' except: debug_term("Erreur dans la lecture du XML la syntax n'est pas bonne ?") lcd.clear() nb_ligne1_space = lcd_columns - len(msg_soc) - len(msg_p) ligne1_msg = msg_soc for nb_space1 in range(nb_ligne1_space): ligne1_msg = ligne1_msg + ' ' ligne1_msg = ligne1_msg + msg_p nb_ligne2_space = lcd_columns - len(msg_ppvt) - len(msg_conso) ligne2_msg = msg_ppvt for nb_space2 in range(nb_ligne2_space): ligne2_msg = ligne2_msg + ' ' ligne2_msg = ligne2_msg + msg_conso lcd.message = ligne1_msg + '\n' + ligne2_msg debug_term('Affichage\n' + ligne1_msg + '\n' + ligne2_msg) if etat_lcd == True: if float(soc) >= 94 and float(soc) < 100: lcd.color = [0, 100, 0] elif float(soc) <= 85: lcd.color = [100, 0, 0] elif float(soc) > 85: lcd.color = [100, 100, 0] else: lcd.color = [100, 100, 100]
HP_SERIAL_FORMAT_DEFAULT = "auto" HP_SERIAL_FORMAT_CHOICES = ["auto", "yaml", "pickle"] HP_ACTION_PREFIX_DEFAULT = "hp"
hp_serial_format_default = 'auto' hp_serial_format_choices = ['auto', 'yaml', 'pickle'] hp_action_prefix_default = 'hp'
"""Implements the BiDi Rule. (Source: RFC 5893, Section 2) The following rule, consisting of six conditions, applies to labels in Bidi domain names. The requirements that this rule satisfies are described in Section 3. All of the conditions must be satisfied for the rule to be satisfied. 1. The first character must be a character with Bidi property L, R, or AL. If it has the R or AL property, it is an RTL label; if it has the L property, it is an LTR label. 2. In an RTL label, only characters with the Bidi properties R, AL, AN, EN, ES, CS, ET, ON, BN, or NSM are allowed. 3. In an RTL label, the end of the label must be a character with Bidi property R, AL, EN, or AN, followed by zero or more characters with Bidi property NSM. 4. In an RTL label, if an EN is present, no AN may be present, and vice versa. 5. In an LTR label, only characters with the Bidi properties L, EN, ES, CS, ET, ON, BN, or NSM are allowed. 6. In an LTR label, the end of the label must be a character with Bidi property L or EN, followed by zero or more characters with Bidi property NSM. """ _LTR_FIRST = {'L'} _LTR_ALLOWED = {'L', 'EN', 'ES', 'CS', 'ET', 'ON', 'BN', 'NSM'} _LTR_LAST = {'L', 'EN'} _LTR_EXCL = set() _RTL_FIRST = {'R', 'AL'} _RTL_ALLOWED = {'R', 'AL', 'AN', 'EN', 'ES', 'CS', 'ET', 'ON', 'BN', 'NSM'} _RTL_LAST = {'R', 'AL', 'EN', 'AN'} _RTL_EXCL = {'EN', 'AN'} _RTL_ANY = {'R', 'AL', 'AN'} def bidi_rule(value, ucd): """Check if `value` obeys the BiDi rule. Args: value (str): String value to check. ucd (UnicodeData): Unicode character database. Returns: bool: True if value satisfies BiDi rule. """ bidi = ucd.bidirectional(value[0]) if bidi in _LTR_FIRST: return _bidi_rule(value, ucd, _LTR_ALLOWED, _LTR_LAST, _LTR_EXCL) if bidi in _RTL_FIRST: return _bidi_rule(value, ucd, _RTL_ALLOWED, _RTL_LAST, _RTL_EXCL) return False def _bidi_rule(value, ucd, allowed, last, exclusive): """Check the bidi_rule for LTR or RTL, depending on parameters. Args: value (str): String value to check. ucd (UnicodeData): Unicode character database. allowed (set): Set of allowed BiDi properties. last (set): Set of BiDi properties allowed at end (followed by NSM). exclusive (set): Set of BiDi properties that are mutually exclusive. Returns: bool: True if value satisfies the BiDi rule. """ assert ucd.bidirectional(value[0]) in _LTR_FIRST | _RTL_FIRST # Starting from the end, find the first character whose bidi is not 'NSM'. bidi = None found = -1 for i in reversed(range(len(value))): bidi = ucd.bidirectional(value[i]) if bidi != 'NSM': found = i break # Last non-NSM character must be in `last`. if found < 0 or bidi not in last: return False # Check if last char is in the exclusive set. bidi_seen = bidi if bidi in exclusive else None # Make sure the remaining characters are allowed. for i in range(1, found): bidi = ucd.bidirectional(value[i]) if bidi not in allowed: return False if bidi in exclusive and bidi_seen != bidi: if bidi_seen: return False bidi_seen = bidi return True def has_rtl(value, ucd): """Check if value contains any RTL characters. Args: value (str): String value to check. ucd (UnicodeData): Unicode character database. Returns: bool: True if value contains RTL characters. """ return any(ucd.bidirectional(x) in _RTL_ANY for x in value)
"""Implements the BiDi Rule. (Source: RFC 5893, Section 2) The following rule, consisting of six conditions, applies to labels in Bidi domain names. The requirements that this rule satisfies are described in Section 3. All of the conditions must be satisfied for the rule to be satisfied. 1. The first character must be a character with Bidi property L, R, or AL. If it has the R or AL property, it is an RTL label; if it has the L property, it is an LTR label. 2. In an RTL label, only characters with the Bidi properties R, AL, AN, EN, ES, CS, ET, ON, BN, or NSM are allowed. 3. In an RTL label, the end of the label must be a character with Bidi property R, AL, EN, or AN, followed by zero or more characters with Bidi property NSM. 4. In an RTL label, if an EN is present, no AN may be present, and vice versa. 5. In an LTR label, only characters with the Bidi properties L, EN, ES, CS, ET, ON, BN, or NSM are allowed. 6. In an LTR label, the end of the label must be a character with Bidi property L or EN, followed by zero or more characters with Bidi property NSM. """ _ltr_first = {'L'} _ltr_allowed = {'L', 'EN', 'ES', 'CS', 'ET', 'ON', 'BN', 'NSM'} _ltr_last = {'L', 'EN'} _ltr_excl = set() _rtl_first = {'R', 'AL'} _rtl_allowed = {'R', 'AL', 'AN', 'EN', 'ES', 'CS', 'ET', 'ON', 'BN', 'NSM'} _rtl_last = {'R', 'AL', 'EN', 'AN'} _rtl_excl = {'EN', 'AN'} _rtl_any = {'R', 'AL', 'AN'} def bidi_rule(value, ucd): """Check if `value` obeys the BiDi rule. Args: value (str): String value to check. ucd (UnicodeData): Unicode character database. Returns: bool: True if value satisfies BiDi rule. """ bidi = ucd.bidirectional(value[0]) if bidi in _LTR_FIRST: return _bidi_rule(value, ucd, _LTR_ALLOWED, _LTR_LAST, _LTR_EXCL) if bidi in _RTL_FIRST: return _bidi_rule(value, ucd, _RTL_ALLOWED, _RTL_LAST, _RTL_EXCL) return False def _bidi_rule(value, ucd, allowed, last, exclusive): """Check the bidi_rule for LTR or RTL, depending on parameters. Args: value (str): String value to check. ucd (UnicodeData): Unicode character database. allowed (set): Set of allowed BiDi properties. last (set): Set of BiDi properties allowed at end (followed by NSM). exclusive (set): Set of BiDi properties that are mutually exclusive. Returns: bool: True if value satisfies the BiDi rule. """ assert ucd.bidirectional(value[0]) in _LTR_FIRST | _RTL_FIRST bidi = None found = -1 for i in reversed(range(len(value))): bidi = ucd.bidirectional(value[i]) if bidi != 'NSM': found = i break if found < 0 or bidi not in last: return False bidi_seen = bidi if bidi in exclusive else None for i in range(1, found): bidi = ucd.bidirectional(value[i]) if bidi not in allowed: return False if bidi in exclusive and bidi_seen != bidi: if bidi_seen: return False bidi_seen = bidi return True def has_rtl(value, ucd): """Check if value contains any RTL characters. Args: value (str): String value to check. ucd (UnicodeData): Unicode character database. Returns: bool: True if value contains RTL characters. """ return any((ucd.bidirectional(x) in _RTL_ANY for x in value))
class TranslatorExceptions(Exception): def __init__(self, message): super().__init__() self.message = message class LangDoesNotExists(TranslatorExceptions): def __init__(self): super().__init__( 'Requested language does not exists\nTry to run \'lang\' command to be familiar with supported languages') class EnglishNotFound(TranslatorExceptions): def __init__(self): super().__init__('Either source language or destination language has to be English') class InvalidApiKey(TranslatorExceptions): def __init__(self): super().__init__('Make sure that your API Key is valid')
class Translatorexceptions(Exception): def __init__(self, message): super().__init__() self.message = message class Langdoesnotexists(TranslatorExceptions): def __init__(self): super().__init__("Requested language does not exists\nTry to run 'lang' command to be familiar with supported languages") class Englishnotfound(TranslatorExceptions): def __init__(self): super().__init__('Either source language or destination language has to be English') class Invalidapikey(TranslatorExceptions): def __init__(self): super().__init__('Make sure that your API Key is valid')
class Solution(object): def strStr(self, haystack, needle): """ :type haystack: str :type needle: str :rtype: int """ # Runtime: 20 ms # Memory: 13.7 MB if needle in haystack: return haystack.index(needle) else: return -1 # One thing to take note here is if needle="" the condition will be True and str.index() will return 0
class Solution(object): def str_str(self, haystack, needle): """ :type haystack: str :type needle: str :rtype: int """ if needle in haystack: return haystack.index(needle) else: return -1
{ "targets": [ { "target_name": "mtrace", "sources": [ "mtrace.cc" ], "include_dirs" : [ "<!(node -e \"require('nan')\")" ] } ] }
{'targets': [{'target_name': 'mtrace', 'sources': ['mtrace.cc'], 'include_dirs': ['<!(node -e "require(\'nan\')")']}]}
class TCPServer(object): def process_request(self, request, client_address): self.do_work(request, client_address) self.shutdown_request(request) class ThreadingMixIn: """Mix-in class to handle each request in a new thread.""" def process_request(self, request, client_address): """Start a new thread to process the request.""" t = threading.Thread(target = self.do_work, args = (request, client_address)) t.daemon = self.daemon_threads t.start() class ThreadingTCPServer(ThreadingMixIn, TCPServer): pass
class Tcpserver(object): def process_request(self, request, client_address): self.do_work(request, client_address) self.shutdown_request(request) class Threadingmixin: """Mix-in class to handle each request in a new thread.""" def process_request(self, request, client_address): """Start a new thread to process the request.""" t = threading.Thread(target=self.do_work, args=(request, client_address)) t.daemon = self.daemon_threads t.start() class Threadingtcpserver(ThreadingMixIn, TCPServer): pass
class Node: def __init__(self, data, parent=None): self.parent = parent self.data = data self.left = None self.right = None def leftChild(self, left): self.left = Node(left, self) def rightChild(self, right): self.right = Node(right, self) def __str__(self): return self.data def ask(node): ans = input(str(node.data) + " Y/N ") if ans.upper() == 'Y': return node.left else: return node.right root = Node("Does it bark?") root.leftChild("Dog") root.rightChild("Cat") response = root while True: response = ask(response) if response.left == None: new = input("Is it a " + str(response.data) + "? Y/N ") if new.upper() == 'y': print('Thanks for playing!') quit() else: # TODO make the user ask a question to differaniate their animal to the guess # Then add that to database for the binary tree print("FAILURE!") quit()
class Node: def __init__(self, data, parent=None): self.parent = parent self.data = data self.left = None self.right = None def left_child(self, left): self.left = node(left, self) def right_child(self, right): self.right = node(right, self) def __str__(self): return self.data def ask(node): ans = input(str(node.data) + ' Y/N ') if ans.upper() == 'Y': return node.left else: return node.right root = node('Does it bark?') root.leftChild('Dog') root.rightChild('Cat') response = root while True: response = ask(response) if response.left == None: new = input('Is it a ' + str(response.data) + '? Y/N ') if new.upper() == 'y': print('Thanks for playing!') quit() else: print('FAILURE!') quit()
class Solution: def isPalindrome(self, s: str) -> bool: formattedString = ''.join([c.lower() for c in s if c.isalnum()]) if formattedString == formattedString[::-1]: return True return False
class Solution: def is_palindrome(self, s: str) -> bool: formatted_string = ''.join([c.lower() for c in s if c.isalnum()]) if formattedString == formattedString[::-1]: return True return False
VERSION = (0, 0, 2, 3) __version__ = '.'.join(map(str, VERSION)) default_app_config = 'django.chatbot.apps.DjangoChatBotConfig'
version = (0, 0, 2, 3) __version__ = '.'.join(map(str, VERSION)) default_app_config = 'django.chatbot.apps.DjangoChatBotConfig'
# Use right join to merge the movie_to_genres and pop_movies tables genres_movies = movie_to_genres.merge(pop_movies, how='right', left_on='movie_id', right_on='id') # Count the number of genres genre_count = genres_movies.groupby('genre').agg({'id':'count'}) # Plot a bar chart of the genre_count genre_count.plot(kind='bar') plt.show()
genres_movies = movie_to_genres.merge(pop_movies, how='right', left_on='movie_id', right_on='id') genre_count = genres_movies.groupby('genre').agg({'id': 'count'}) genre_count.plot(kind='bar') plt.show()
counter = 10 sums = 1 k = 2 currLast = 1 while counter > 0: k += 1 while sums < (k + 1) ** 2: currLast += 1 sums += currLast if sums == (k + 1) ** 2: counter -= 1 print (k + 1), currLast
counter = 10 sums = 1 k = 2 curr_last = 1 while counter > 0: k += 1 while sums < (k + 1) ** 2: curr_last += 1 sums += currLast if sums == (k + 1) ** 2: counter -= 1 (print(k + 1), currLast)
# IMPORTS # DATA data = [] with open("Data - Day11.txt") as file: for line in file: for direction in line.strip().split(","): data.append(direction) # GOAL 1 """ The hexagons ("hexes") in this grid are aligned such that adjacent hexes can be found to the north, northeast, southeast, south, southwest, and northwest: You have the path the child process took. Starting where he started, you need to determine the fewest number of steps required to reach him. (A "step" means to move from the hex you are in to any adjacent hex.) """ # ANSWER 1 def find_kid(data): y = 0 # North - South x = 0 # North West - South East for direction in data: if direction == "n": y += 1 elif direction == "s": y -= 1 elif direction == "nw": x += 1 elif direction == "se": x -= 1 elif direction == "ne": x -= 1 y += 1 elif direction == "sw": x += 1 y -= 1 return abs(y), abs(x), abs(-x-y) location = find_kid(data) print(f"Distance to kid: {sum(location) / 2} tiles") # Goal 2 """ How many steps away is the furthest he ever got from his starting position? """ def max_dist(data): y = 0 # North - South x = 0 # North West - South East max_loc = 0 for direction in data: if direction == "n": y += 1 elif direction == "s": y -= 1 elif direction == "nw": x += 1 elif direction == "se": x -= 1 elif direction == "ne": x -= 1 y += 1 elif direction == "sw": x += 1 y -= 1 max_loc = max(abs(y), abs(x), abs(-x-y), max_loc) return max_loc print(f"Max distance kid: {max_dist(data)}")
data = [] with open('Data - Day11.txt') as file: for line in file: for direction in line.strip().split(','): data.append(direction) '\nThe hexagons ("hexes") in this grid are aligned such that adjacent hexes can be found to the north,\n northeast, southeast, south, southwest, and northwest:\n\nYou have the path the child process took. \nStarting where he started, you need to determine the\nfewest number of steps required to reach him. \n(A "step" means to move from the hex you are in to any adjacent hex.)\n' def find_kid(data): y = 0 x = 0 for direction in data: if direction == 'n': y += 1 elif direction == 's': y -= 1 elif direction == 'nw': x += 1 elif direction == 'se': x -= 1 elif direction == 'ne': x -= 1 y += 1 elif direction == 'sw': x += 1 y -= 1 return (abs(y), abs(x), abs(-x - y)) location = find_kid(data) print(f'Distance to kid: {sum(location) / 2} tiles') '\nHow many steps away is the furthest he ever got from his starting position?\n' def max_dist(data): y = 0 x = 0 max_loc = 0 for direction in data: if direction == 'n': y += 1 elif direction == 's': y -= 1 elif direction == 'nw': x += 1 elif direction == 'se': x -= 1 elif direction == 'ne': x -= 1 y += 1 elif direction == 'sw': x += 1 y -= 1 max_loc = max(abs(y), abs(x), abs(-x - y), max_loc) return max_loc print(f'Max distance kid: {max_dist(data)}')
class Solution(object): def sortColors(self, nums): """ :type nums: List[int] :rtype: None Do not return anything, modify nums in-place instead. """ lo = 0 hi = len(nums) - 1 while (lo < hi): if nums[lo] == 0: lo += 1 elif nums[hi] == 2: hi -= 1 elif nums[lo] == 1 and nums[hi] == 1: mi = lo + 1 while (mi < hi): if nums[mi] == 2 or nums[mi] == 0: nums[mi], nums[hi] = nums[hi], nums[mi] break else: mi += 1 if mi == hi: return else: nums[lo], nums[hi] = nums[hi], nums[lo] class Solution(object): def sortColors(self, nums): lo, mi, hi = 0, 0, len(nums) - 1 while mi <= hi: # Nottice!: here has to be <= if nums[mi] == 0: nums[mi], nums[lo] = nums[lo], nums[mi] lo += 1 mi += 1 elif nums[mi] == 2: nums[mi], nums[hi] = nums[hi], nums[mi] hi -= 1 else: mi += 1
class Solution(object): def sort_colors(self, nums): """ :type nums: List[int] :rtype: None Do not return anything, modify nums in-place instead. """ lo = 0 hi = len(nums) - 1 while lo < hi: if nums[lo] == 0: lo += 1 elif nums[hi] == 2: hi -= 1 elif nums[lo] == 1 and nums[hi] == 1: mi = lo + 1 while mi < hi: if nums[mi] == 2 or nums[mi] == 0: (nums[mi], nums[hi]) = (nums[hi], nums[mi]) break else: mi += 1 if mi == hi: return else: (nums[lo], nums[hi]) = (nums[hi], nums[lo]) class Solution(object): def sort_colors(self, nums): (lo, mi, hi) = (0, 0, len(nums) - 1) while mi <= hi: if nums[mi] == 0: (nums[mi], nums[lo]) = (nums[lo], nums[mi]) lo += 1 mi += 1 elif nums[mi] == 2: (nums[mi], nums[hi]) = (nums[hi], nums[mi]) hi -= 1 else: mi += 1
CONVERT_JSON_TO_YAML = { "type": "post", "endpoint": "/convertJSONtoYAML", "call_message": "{type} {endpoint}", "error_message": "{type} {endpoint} {response_code}" } CONVERT_RANGE_FROM_TO = { "type": "get", "endpoint": "/convertRangeFromTo", "call_message": "{type} {endpoint}", "error_message": "{type} {endpoint} {response_code}" } CONVERT_TEXT_FILE_FROM_TO = { "type": "get", "endpoint": "/convertTextFileFromTo", "call_message": "{type} {endpoint}", "error_message": "{type} {endpoint} {response_code}" } CONVERT_YAML_TO_JSON = { "type": "post", "endpoint": "/convertYAMLtoJSON", "call_message": "{type} {endpoint}", "error_message": "{type} {endpoint} {response_code}" } COPY_FILE = { "type": "get", "endpoint": "/copyFile", "call_message": "{type} {endpoint}", "error_message": "{type} {endpoint} {response_code}" } GET_FILE = { "type": "get", "endpoint": "/getFile", "call_message": "{type} {endpoint}", "error_message": "{type} {endpoint} {response_code}" }
convert_json_to_yaml = {'type': 'post', 'endpoint': '/convertJSONtoYAML', 'call_message': '{type} {endpoint}', 'error_message': '{type} {endpoint} {response_code}'} convert_range_from_to = {'type': 'get', 'endpoint': '/convertRangeFromTo', 'call_message': '{type} {endpoint}', 'error_message': '{type} {endpoint} {response_code}'} convert_text_file_from_to = {'type': 'get', 'endpoint': '/convertTextFileFromTo', 'call_message': '{type} {endpoint}', 'error_message': '{type} {endpoint} {response_code}'} convert_yaml_to_json = {'type': 'post', 'endpoint': '/convertYAMLtoJSON', 'call_message': '{type} {endpoint}', 'error_message': '{type} {endpoint} {response_code}'} copy_file = {'type': 'get', 'endpoint': '/copyFile', 'call_message': '{type} {endpoint}', 'error_message': '{type} {endpoint} {response_code}'} get_file = {'type': 'get', 'endpoint': '/getFile', 'call_message': '{type} {endpoint}', 'error_message': '{type} {endpoint} {response_code}'}
number = 0 total = 0 while number != -1: total += number number = float(input("Please enter a positive number (-1 to stop):")) print(total)
number = 0 total = 0 while number != -1: total += number number = float(input('Please enter a positive number (-1 to stop):')) print(total)
""" This module contains several parsers. This includes utilities for reading and converting molecular dynamics input files to instructions for the :obj:`schnetpack.md.simulator.Simulator`. In addition, there is a full package for parsing ORCA output files. """
""" This module contains several parsers. This includes utilities for reading and converting molecular dynamics input files to instructions for the :obj:`schnetpack.md.simulator.Simulator`. In addition, there is a full package for parsing ORCA output files. """
# Define your handoff handlers here # for more information, see: # http://docs.tethysplatform.org/en/dev/tethys_sdk/handoff.html def csv(request, csv_url): """ Test Handoff handler. """ return 'test_app:home'
def csv(request, csv_url): """ Test Handoff handler. """ return 'test_app:home'
# # PySNMP MIB module ZHONE-CARD-DIAGNOSTICS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ZHONE-CARD-DIAGNOSTICS-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:46:50 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") ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsIntersection") InterfaceIndexOrZero, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndexOrZero") NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance") ModuleIdentity, MibIdentifier, TimeTicks, iso, Unsigned32, ObjectIdentity, Integer32, NotificationType, Bits, Counter64, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, Gauge32, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "MibIdentifier", "TimeTicks", "iso", "Unsigned32", "ObjectIdentity", "Integer32", "NotificationType", "Bits", "Counter64", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Gauge32", "Counter32") DateAndTime, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DateAndTime", "DisplayString", "TextualConvention") zhoneSlotIndex, zhoneCard, zhoneModules, zhoneShelfIndex = mibBuilder.importSymbols("Zhone", "zhoneSlotIndex", "zhoneCard", "zhoneModules", "zhoneShelfIndex") ZhoneDiagAction, ZhoneDiagResult, ZhoneRowStatus = mibBuilder.importSymbols("Zhone-TC", "ZhoneDiagAction", "ZhoneDiagResult", "ZhoneRowStatus") zhoneCardDiagnosticsModule = ModuleIdentity((1, 3, 6, 1, 4, 1, 5504, 6, 11)) zhoneCardDiagnosticsModule.setRevisions(('2010-03-05 14:05', '2009-05-14 09:39', '2009-05-07 22:37', '2009-01-12 15:36', '2008-10-22 05:28', '2006-07-24 11:28', '2001-11-14 15:28', '2001-08-30 11:21', '2001-08-27 18:14', '2001-06-28 12:01', '2001-06-26 12:40', '2000-12-12 16:30', '2000-10-19 19:45', '2000-10-17 10:32', '2000-09-12 11:07',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: zhoneCardDiagnosticsModule.setRevisionsDescriptions(('V01.00.14 change tactestresults to persistent', 'V01.00.13 add optional parameters for line test', 'V01.00.12 mtac name changes', 'add trap for mtac ringer power bus fault alarm', 'Changing the mtac name into tac and removing the name metallic.', 'V01.00.09 - Add new Mtac test controls for the Legerity Test Suite.', 'V01.00.08. Added comments for mtactestmode', 'V01.00.07 - Modify description of zhoneCardDiagType to include specific diagnostics for T3TDM card', 'V01.00.06 - Modify description of zhoneCardDiagType to include specific diagnostics for VASP card - Add DEFVAL for zhoneCardDiagType - Modify DEFVAL for zhoneCardDiagRepetition, zhoneCardDiagDuration', 'V01.00.05 - fix the 17 slot problem', 'V01.00.04 - Added zhoneMetallicTest Table entry,and also added the markups. Removed zhoneCardDiagIndex field from zhoneCardDiagObjects. ', 'V01.00.03 - move zhoneCardDiagNextIndex into table.', 'V01.00.02 - Corrected revision information.', 'VO1.00.01 - Added ZHONE_KEYWORD markup.', 'V01.00.00 - Initial Release',)) if mibBuilder.loadTexts: zhoneCardDiagnosticsModule.setLastUpdated('201003030930Z') if mibBuilder.loadTexts: zhoneCardDiagnosticsModule.setOrganization('Zhone Technologies, Inc.') if mibBuilder.loadTexts: zhoneCardDiagnosticsModule.setContactInfo(' Postal: Zhone Technologies, Inc. @ Zhone Way 7001 Oakport Street Oakland, CA 94621 USA Toll-Free: +1 877-ZHONE20 (+1 877-946-6320) Tel: +1-510-777-7000 Fax: +1-510-777-7001 E-mail: support@zhone.com') if mibBuilder.loadTexts: zhoneCardDiagnosticsModule.setDescription('Contains the diagnostics and results available on a per card or resource basis.') zhoneCardDiagNextTable = MibTable((1, 3, 6, 1, 4, 1, 5504, 3, 3, 5), ) if mibBuilder.loadTexts: zhoneCardDiagNextTable.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagNextTable.setDescription('Augment table of the unit/card resource but specific to the diagnostic results information. This card contains the index to create diagnostics table entries (zhoneCardDiagEntry) which contains all the data for executing and obtaining diagnostic results.') zhoneCardDiagNextEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5504, 3, 3, 5, 1), ).setIndexNames((0, "Zhone", "zhoneShelfIndex"), (0, "Zhone", "zhoneSlotIndex")) if mibBuilder.loadTexts: zhoneCardDiagNextEntry.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagNextEntry.setDescription('This is the card diagnostics next index table which contains all the data for: - index for creating next zhoneCardDiagEntry.') zhoneCardDiagNextIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 10))).setMaxAccess("readonly") if mibBuilder.loadTexts: zhoneCardDiagNextIndex.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagNextIndex.setDescription('We allow ten diagnostic requests from multiple interfaces. The diagNextIndex represents the next available diagnostic request handle for requesting a diagnostic. NOTE: this operates as a wrap-around counter starting at 1 and wrapping around to 1 after reaching 10.') zhoneCardDiagTable = MibTable((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6), ) if mibBuilder.loadTexts: zhoneCardDiagTable.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagTable.setDescription('Augment table of the unit/card resource but specific to the diagnostic results information. This is the card diagnostics table which contains all the data for executing and obtaining diagnostic results.') zhoneCardDiagEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1), ).setIndexNames((0, "Zhone", "zhoneShelfIndex"), (0, "Zhone", "zhoneSlotIndex"), (0, "ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneCardDiagIndex")) if mibBuilder.loadTexts: zhoneCardDiagEntry.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagEntry.setDescription('This is the card diagnostics table which contains all the data for: - invoking diagnostics, - obtaining diagnostic results.') zhoneCardDiagIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 10))) if mibBuilder.loadTexts: zhoneCardDiagIndex.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagIndex.setDescription('We allow ten diagnostic requests from multiple interfaces. The diagIndex represents the diagnostic request to start a diagnostic or obtain test results for a completed diagnostic. NOTE: this operates as a wrap-around counter starting at 1 and wrapping around to 1 after reaching 10.') zhoneCardDiagType = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13))).clone(namedValues=NamedValues(("selftest", 1), ("supvBus", 2), ("cardEEprom", 3), ("frbus", 4), ("pcmcia", 5), ("shelfLamp", 6), ("realTimeClock", 7), ("fanTray", 8), ("shelfMonitor", 9), ("ioCard", 10), ("mezzanineCard", 11), ("backPlane", 12), ("midPlane", 13))).clone('selftest')).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneCardDiagType.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagType.setDescription("This field specifies the diagnostic to execute. The default value is 'selftest'. NOTE: not all of the individual diagnostics are available on every Zhone card type. NOTE: Zhone card types (cardZhoneType) are defined in the genCardResources.mib List of possible diagnostics: ============================ Common to all PLS cards ----------------------- selftest(1) - this diagnostic will execute all of the individual tests available on this card. Supports: diagStart, diagStop, diagRepetition. cardEEprom(3) - this diagnostic will verify the main card EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. frbus(4) - this diagnostic will verify that the BAN slot card can access the Fhrame Bus by doing a loopback with 10 message of 100 bytes. Supports: diagStart, diagStop, diagRepetition. backPlane(12) - this diagnostic will verify that the BAN slot card can access the back plane by verifying the back plane EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. cardZhoneType::infoServices(3) specific --------------------------------------- supvBus(2) - this diagnostic will verify that the BAN slot card can access the supervisory Bus by doing a loopback of 20 bytes. Supports: diagStart, diagStop, diagRepetition. pcmcia(5) - this diagnostic will verify that the InfoServ card can access the PCMCIA flash card I/O by doing a file create, write, and read of length 4000 bytes. Supports: diagStart, diagStop, diagRepetition. shelfLamp(6) - this diagnostic will illuminate the shelf alarm indicators for a period of 1.5 seconds. The indicators will return to their original settings after the diagnostic completes. Supports: diagStart, diagStop, diagRepetition. realTimeClk(7) - this diagnostic will verify that the real time clock increments. Supports: diagStart, diagStop, diagRepetition. fanTray(8) - this diagnostic tests that the fan tray is operational by verifying the fan tray EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. shelfMonitor(9) - this diagnostic tests the shelf monitor board is operational by checking the POST status register and verifying the shelf monitor board EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. midPlane(13) - this diagnostic will verify that the mid plane card is present by verifying the mid plane card EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. cardZhoneType::vasp(5) specific --------------------------------- ioCard(10) - this diagnostic will verify that the I/O card is present by verifying the I/O card EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. mezzanineCard(11) - this diagnostic will test that the mezzanine card is operational by verifying the mezzanine card EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. cardZhoneType::t3Tdm(6) specific --------------------------------- ioCard(10) - this diagnostic will verify that the I/O card is present by verifying the I/O card EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. midPlane(13) - this diagnostic will verify that the mid plane card is present by verifying the mid plane card EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. cardZhoneType::ethernet(9) specific ----------------------------------- midPlane(13) - this diagnostic will verify that the mid plane card is present by verifying the mid plane card EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. cardZhoneType::hdsl2(10) specific --------------------------------- ioCard(10) - this diagnostic will verify that the I/O card is present by verifying the I/O card EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. mezzanineCard(11) - this diagnostic will test that the mezzanine card is operational by verifying the mezzanine card EEPROM checksum. Supports: diagStart, diagStop, diagRepetition.") zhoneCardDiagAction = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 3), ZhoneDiagAction().clone('diagStart')).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneCardDiagAction.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagAction.setDescription('The diagAction field represents the diagnostic operation to execute. Current supported actions are as follows: diagStart : begin diagnostics and initialize results. diagStop : stop diagnostics if not yet complete. diagSuspend: suspend diagnostics at current point. diagResume : resume diagnostics from point of suspension.') zhoneCardDiagRepetition = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 10)).clone(1)).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneCardDiagRepetition.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagRepetition.setDescription('This field specifies the number of repetitions of diagnostics to execute. The default value is 1. NOTE: this field operates as an OR with the diagDuration field. If this field is set to non-zero then the diagnostics will be executed that amount of repetitions.') zhoneCardDiagDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 600)).clone(60)).setUnits('seconds').setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneCardDiagDuration.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagDuration.setDescription('This field specifies the duration of diagnostics to execute. The default value is 60 seconds. NOTE: this field operates as an OR with the diagRepetition field. If this field is set to non-zero then the diagnostics will be executed that amount of time.') zhoneCardDiagResult = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 6), ZhoneDiagResult()).setMaxAccess("readonly") if mibBuilder.loadTexts: zhoneCardDiagResult.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagResult.setDescription('This represents the overall diagnostic result.') zhoneCardDiagPassCount = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zhoneCardDiagPassCount.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagPassCount.setDescription('The number of diagnostics that executed successfully.') zhoneCardDiagFailCount = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zhoneCardDiagFailCount.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagFailCount.setDescription('The number of diagnostics that have failed.') zhoneCardDiagDetails = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 9), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: zhoneCardDiagDetails.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagDetails.setDescription('The failure reason, if any, for the last diagnostic which has executed. NOTE: An empty string indicates that no additional information is available.') zhoneCardDiagStartTime = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 10), DateAndTime()).setMaxAccess("readonly") if mibBuilder.loadTexts: zhoneCardDiagStartTime.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagStartTime.setDescription('Starting date and time of last selftest execution.') zhoneCardDiagEndTime = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 11), DateAndTime()).setMaxAccess("readonly") if mibBuilder.loadTexts: zhoneCardDiagEndTime.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagEndTime.setDescription('Ending date and time of last selftest execution.') zhoneCardDiagRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 12), ZhoneRowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneCardDiagRowStatus.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagRowStatus.setDescription('In any case where a new row can be created either via the cli or zms there will always be a proprietary mib entity of type ZhoneRowStatus which has the basic equivalence of the standard rowstatus object_id.') zhoneTacTestTable = MibTable((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7), ) if mibBuilder.loadTexts: zhoneTacTestTable.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestTable.setDescription('This table contains one entry for each tac test channel available on Zhone devices. In the initial release only the primary channel (1) is supported. Future line cards may support the second channel. If the second channel is supported the row will be populated, if the second channel is not supported a get will return no such instance. ') zhoneTacTestEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7, 1), ).setIndexNames((0, "ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneTacIndex")) if mibBuilder.loadTexts: zhoneTacTestEntry.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestEntry.setDescription('One row per tac test channel.') zhoneTacIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2))) if mibBuilder.loadTexts: zhoneTacIndex.setStatus('current') if mibBuilder.loadTexts: zhoneTacIndex.setDescription('This field is the index field for the tac test channel which will be connected on the external port. This device supports a maximum of two channels, one or both channels may be supported by a device depending on which lines cards are installed.') zhoneTacInterfaceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7, 1, 2), InterfaceIndexOrZero()).setMaxAccess("readwrite") if mibBuilder.loadTexts: zhoneTacInterfaceIndex.setStatus('current') if mibBuilder.loadTexts: zhoneTacInterfaceIndex.setDescription('This field contains the InterfaceIndex of the physical line to be tested. If no line is currently being tested this value is 0. The ability of a physical line type to support tac test may vary depending on the line cards installed and the external test equipment. This field may not be modified when an tac test is in progress as indicated by a non-zero value in this field and the test mode set to one of tacModeLookIn, tacModeLookOut or tacModeBridge') zhoneTacTestMode = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("mtacModeBridge", 1), ("mtacModeLookIn", 2), ("mtacModeLookOut", 3), ("mtacModeNone", 4))).clone('mtacModeNone')).setMaxAccess("readwrite") if mibBuilder.loadTexts: zhoneTacTestMode.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestMode.setDescription('This field is used to set the mtac test mode for a given line. The options are: mtacModeBridge - All traffic on the given line is bridged across the mtac lines mtacModeLookIn - All outbound traffic on the given line originates exclusively to the mtac lines mtacModeLookIn - All inbound traffic on the given line originates exclusively to the mtac lines mtacModeNone - No mtac test is in progress. The mtac test mode may be changed only if the zhoneInterfaceIndex is set, Otherwise it defaults to mtacModeNone. And can be changed again by setting InterfaceIndex to non-zero values. ') zhoneTacTestId = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32))).clone(namedValues=NamedValues(("none", 1), ("runAllTests", 2), ("abortTest", 3), ("calibration", 4), ("foreignDCVoltage", 5), ("foreignACVoltage", 6), ("dcLoopResistance", 7), ("threeElementInsulationResistance", 8), ("fiveElementInsulationResistance", 9), ("threeElementCapacitance", 10), ("receiverOffHook", 11), ("distanceToOpen", 12), ("foreignACCurrents", 13), ("ringerEquivalencyNumber", 14), ("dtmfAndPulseDigitMeasurement", 15), ("noiseMeasurement", 16), ("signalToNoiseRatio", 17), ("arbitrarySignalToneMeasurement", 18), ("toneGeneration", 19), ("transHybridLoss", 20), ("drawAndBreakDialTone", 21), ("inwardCurrent", 22), ("dcFeedSelf", 23), ("onAndOffHookSelfTest", 24), ("ringingSelfTest", 25), ("ringingMonitor", 26), ("meteringSelfTest", 27), ("transmissionSelfTest", 28), ("dialingSelfTest", 29), ("howlerTest", 30), ("fuseTest", 31), ("readLoopAndBatteryConditions", 32))).clone('none')).setMaxAccess("readwrite") if mibBuilder.loadTexts: zhoneTacTestId.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestId.setDescription('This object is only valid for Tac Cards which support the new Legerity Suite of tests. This object identifies which test is to be run, or can be set to abort the current test. Test results are sent to the zhoneTacTestResultsTable. There are 3 Legerity software packages: Basic Test (VCP-BT), Advanced Test (VCP-AT), and Advanced Test Plus (VCP-ATP). We currently support Basic Test package. The following lists which tests are supported in each software package. Calibration VCP-ATP Foreign DC Voltage Test VCP-BT, VCP-AT, VCP-ATP Foreign AC VoltageTest VCP-BT, VCP-AT, VCP-ATP DC Loop Resistance Test VCP-BT, VCP-AT, VCP-ATP Three-Element Insulation Resistance Test VCP-BT, VCP-AT, VCP-ATP Five-Element Insulation Resistance Test VCP-ATP Three-Element Capacitance Test VCP-BT, VCP-AT Receiver Off-Hook Test VCP-BT, VCP-AT, VCP-ATP Distance to Open Test VCP-BT, VCP-AT Foreign AC Currents Test VCP-BT, VCP-AT Ringer Equivalency Number Test VCP-BT, VCP-AT, VCP-ATP DTMF and Pulse Digit Measurement Test VCP-BT, VCP-AT Noise Measurement Test VCP-BT, VCP-AT, VCP-ATP Signal to Noise Ratio Test VCP-ATP Arbitrary Single Tone Measurement Test VCP-ATP Tone Generation Test VCP-BT, VCP-AT Trans-Hybrid Loss Test VCP-BT, VCP-AT, VCP-ATP Draw and Break Dial Tone Test VCP-BT, VCP-AT Inward Current Test VCP-ATP DC Feed Self-Test VCP-BT, VCP-AT, VCP-ATP On/Off Hook Self-Test VCP-BT, VCP-AT, VCP-ATP Ringing Self-Test VCP-BT, VCP-AT, VCP-ATP Ringing Monitor Test VCP-BT, VCP-AT, VCP-ATP Metering Self-Test VCP-BT, VCP-AT Transmission Self-Test VCP-BT, VCP-AT, VCP-ATP Dialing Sef Test VCP-BT, VCP-AT Howler Test VCP-BT, VCP-AT Fuse Test VCP-ATP Read Loop and Battery Conditions VCP-BT, VCP-AT, VCP-ATP ') zhoneTacTestParam1 = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7, 1, 5), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: zhoneTacTestParam1.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestParam1.setDescription('Optional Test Parameter #1') zhoneTacTestParam2 = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7, 1, 6), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: zhoneTacTestParam2.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestParam2.setDescription('Optional Test Paramerter #2') zhoneTacTestParam3 = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7, 1, 7), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: zhoneTacTestParam3.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestParam3.setDescription('Optional Test Parameter #3') zhoneTacTestParam4 = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7, 1, 8), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: zhoneTacTestParam4.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestParam4.setDescription('Optional Test Parameter #4') zhoneTacTestParam5 = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7, 1, 9), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: zhoneTacTestParam5.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestParam5.setDescription('Optional Test Parameter #5 Value: 0x00000001 Force Line-Test mode') zhoneTacTestResultsTable = MibTable((1, 3, 6, 1, 4, 1, 5504, 3, 3, 12), ) if mibBuilder.loadTexts: zhoneTacTestResultsTable.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestResultsTable.setDescription('Table of Tac Test Results objects. Indexed by same index as zhoneTacTestTable. This table is only valid for Tac cards which support the Legerity Suite of tests.') zhoneTacTestResultsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5504, 3, 3, 12, 1), ).setIndexNames((0, "ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneTacIndex")) if mibBuilder.loadTexts: zhoneTacTestResultsEntry.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestResultsEntry.setDescription('Entry of Test Results objects. Indexed by same index as zhoneTacTestEntry. This entry is only valid for Tac cards which support the Legerity Suite of tests.') zhoneTacTestResultsTimeStarted = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 12, 1, 1), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: zhoneTacTestResultsTimeStarted.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestResultsTimeStarted.setDescription('Description.') zhoneTacTestResultsTimeEnded = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 12, 1, 2), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: zhoneTacTestResultsTimeEnded.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestResultsTimeEnded.setDescription('Description.') zhoneTacTestResultStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 12, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("testNotStarted", 1), ("testInProgress", 2), ("testCompleted", 3), ("testAborted", 4), ("testNotSupported", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: zhoneTacTestResultStatus.setReference('Contains the test status.') if mibBuilder.loadTexts: zhoneTacTestResultStatus.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestResultStatus.setDescription('Contains test results.') zhoneTacTestResultsOutput = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 3, 3, 12, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 8000))).setMaxAccess("readonly") if mibBuilder.loadTexts: zhoneTacTestResultsOutput.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestResultsOutput.setDescription("For Legerity Test Suite, results of test(s) are output to this object as one string, separated by UNIX '/n' for newline characters and terminated by the NULL character. This test results will persist until the next test is run or until tac card reboot.") zhoneTacTestTraps = ObjectIdentity((1, 3, 6, 1, 4, 1, 5504, 3, 3, 13)) if mibBuilder.loadTexts: zhoneTacTestTraps.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestTraps.setDescription('Traps for the tac system.') zhoneRingerTraps = ObjectIdentity((1, 3, 6, 1, 4, 1, 5504, 3, 3, 13, 0)) if mibBuilder.loadTexts: zhoneRingerTraps.setStatus('current') if mibBuilder.loadTexts: zhoneRingerTraps.setDescription('Traps associated with ring generator. Traps should be added below - the .0 on this entry is required.') zhoneRingerStatusAlarm = NotificationType((1, 3, 6, 1, 4, 1, 5504, 3, 3, 13, 0, 1)) if mibBuilder.loadTexts: zhoneRingerStatusAlarm.setStatus('current') if mibBuilder.loadTexts: zhoneRingerStatusAlarm.setDescription('This trap occurs when a ring signal fails to be detected, or when it re-starts after failure.') zhoneRingerBusFaultAlarm = NotificationType((1, 3, 6, 1, 4, 1, 5504, 3, 3, 13, 0, 2)) if mibBuilder.loadTexts: zhoneRingerBusFaultAlarm.setStatus('current') if mibBuilder.loadTexts: zhoneRingerBusFaultAlarm.setDescription('This trap occurs when a fault in the ringer power bus is detected. Such fault may be caused by the possible shortage in the POTS or DSL line.') zhoneCardDiagObjects = ObjectGroup((1, 3, 6, 1, 4, 1, 5504, 6, 11, 1)).setObjects(("ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneCardDiagNextIndex"), ("ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneCardDiagType"), ("ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneCardDiagAction"), ("ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneCardDiagRepetition"), ("ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneCardDiagDuration"), ("ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneCardDiagResult"), ("ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneCardDiagPassCount"), ("ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneCardDiagFailCount"), ("ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneCardDiagDetails"), ("ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneCardDiagStartTime"), ("ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneCardDiagEndTime"), ("ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneCardDiagRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): zhoneCardDiagObjects = zhoneCardDiagObjects.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagObjects.setDescription('This group contains objects associated with Zhone Card Diagnostics') zhoneTacTestObjects = ObjectGroup((1, 3, 6, 1, 4, 1, 5504, 6, 11, 2)).setObjects(("ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneTacInterfaceIndex"), ("ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneTacTestMode"), ("ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneTacTestId"), ("ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneTacTestResultsTimeStarted"), ("ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneTacTestResultsTimeEnded"), ("ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneTacTestResultStatus"), ("ZHONE-CARD-DIAGNOSTICS-MIB", "zhoneTacTestResultsOutput")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): zhoneTacTestObjects = zhoneTacTestObjects.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestObjects.setDescription('This group contains objects associated with initiating tac tests') mibBuilder.exportSymbols("ZHONE-CARD-DIAGNOSTICS-MIB", zhoneCardDiagDetails=zhoneCardDiagDetails, zhoneTacTestMode=zhoneTacTestMode, zhoneRingerBusFaultAlarm=zhoneRingerBusFaultAlarm, zhoneCardDiagNextIndex=zhoneCardDiagNextIndex, zhoneTacTestResultsTimeEnded=zhoneTacTestResultsTimeEnded, zhoneCardDiagEntry=zhoneCardDiagEntry, zhoneTacTestParam4=zhoneTacTestParam4, zhoneCardDiagRowStatus=zhoneCardDiagRowStatus, zhoneTacIndex=zhoneTacIndex, zhoneTacTestParam1=zhoneTacTestParam1, zhoneTacInterfaceIndex=zhoneTacInterfaceIndex, zhoneTacTestTable=zhoneTacTestTable, zhoneRingerTraps=zhoneRingerTraps, zhoneCardDiagStartTime=zhoneCardDiagStartTime, zhoneTacTestResultsOutput=zhoneTacTestResultsOutput, zhoneTacTestResultsTimeStarted=zhoneTacTestResultsTimeStarted, zhoneCardDiagResult=zhoneCardDiagResult, zhoneCardDiagPassCount=zhoneCardDiagPassCount, zhoneTacTestTraps=zhoneTacTestTraps, zhoneCardDiagTable=zhoneCardDiagTable, zhoneCardDiagObjects=zhoneCardDiagObjects, zhoneCardDiagnosticsModule=zhoneCardDiagnosticsModule, zhoneTacTestParam2=zhoneTacTestParam2, zhoneTacTestParam5=zhoneTacTestParam5, zhoneCardDiagNextTable=zhoneCardDiagNextTable, zhoneCardDiagEndTime=zhoneCardDiagEndTime, zhoneTacTestEntry=zhoneTacTestEntry, zhoneTacTestResultStatus=zhoneTacTestResultStatus, zhoneTacTestId=zhoneTacTestId, zhoneTacTestResultsEntry=zhoneTacTestResultsEntry, zhoneCardDiagDuration=zhoneCardDiagDuration, zhoneTacTestObjects=zhoneTacTestObjects, zhoneCardDiagNextEntry=zhoneCardDiagNextEntry, zhoneTacTestParam3=zhoneTacTestParam3, zhoneCardDiagFailCount=zhoneCardDiagFailCount, zhoneCardDiagIndex=zhoneCardDiagIndex, zhoneCardDiagAction=zhoneCardDiagAction, zhoneTacTestResultsTable=zhoneTacTestResultsTable, zhoneCardDiagRepetition=zhoneCardDiagRepetition, zhoneRingerStatusAlarm=zhoneRingerStatusAlarm, zhoneCardDiagType=zhoneCardDiagType, PYSNMP_MODULE_ID=zhoneCardDiagnosticsModule)
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, single_value_constraint, value_range_constraint, value_size_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'SingleValueConstraint', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsIntersection') (interface_index_or_zero,) = mibBuilder.importSymbols('IF-MIB', 'InterfaceIndexOrZero') (notification_group, object_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ObjectGroup', 'ModuleCompliance') (module_identity, mib_identifier, time_ticks, iso, unsigned32, object_identity, integer32, notification_type, bits, counter64, ip_address, mib_scalar, mib_table, mib_table_row, mib_table_column, gauge32, counter32) = mibBuilder.importSymbols('SNMPv2-SMI', 'ModuleIdentity', 'MibIdentifier', 'TimeTicks', 'iso', 'Unsigned32', 'ObjectIdentity', 'Integer32', 'NotificationType', 'Bits', 'Counter64', 'IpAddress', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Gauge32', 'Counter32') (date_and_time, display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DateAndTime', 'DisplayString', 'TextualConvention') (zhone_slot_index, zhone_card, zhone_modules, zhone_shelf_index) = mibBuilder.importSymbols('Zhone', 'zhoneSlotIndex', 'zhoneCard', 'zhoneModules', 'zhoneShelfIndex') (zhone_diag_action, zhone_diag_result, zhone_row_status) = mibBuilder.importSymbols('Zhone-TC', 'ZhoneDiagAction', 'ZhoneDiagResult', 'ZhoneRowStatus') zhone_card_diagnostics_module = module_identity((1, 3, 6, 1, 4, 1, 5504, 6, 11)) zhoneCardDiagnosticsModule.setRevisions(('2010-03-05 14:05', '2009-05-14 09:39', '2009-05-07 22:37', '2009-01-12 15:36', '2008-10-22 05:28', '2006-07-24 11:28', '2001-11-14 15:28', '2001-08-30 11:21', '2001-08-27 18:14', '2001-06-28 12:01', '2001-06-26 12:40', '2000-12-12 16:30', '2000-10-19 19:45', '2000-10-17 10:32', '2000-09-12 11:07')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: zhoneCardDiagnosticsModule.setRevisionsDescriptions(('V01.00.14 change tactestresults to persistent', 'V01.00.13 add optional parameters for line test', 'V01.00.12 mtac name changes', 'add trap for mtac ringer power bus fault alarm', 'Changing the mtac name into tac and removing the name metallic.', 'V01.00.09 - Add new Mtac test controls for the Legerity Test Suite.', 'V01.00.08. Added comments for mtactestmode', 'V01.00.07 - Modify description of zhoneCardDiagType to include specific diagnostics for T3TDM card', 'V01.00.06 - Modify description of zhoneCardDiagType to include specific diagnostics for VASP card - Add DEFVAL for zhoneCardDiagType - Modify DEFVAL for zhoneCardDiagRepetition, zhoneCardDiagDuration', 'V01.00.05 - fix the 17 slot problem', 'V01.00.04 - Added zhoneMetallicTest Table entry,and also added the markups. Removed zhoneCardDiagIndex field from zhoneCardDiagObjects. ', 'V01.00.03 - move zhoneCardDiagNextIndex into table.', 'V01.00.02 - Corrected revision information.', 'VO1.00.01 - Added ZHONE_KEYWORD markup.', 'V01.00.00 - Initial Release')) if mibBuilder.loadTexts: zhoneCardDiagnosticsModule.setLastUpdated('201003030930Z') if mibBuilder.loadTexts: zhoneCardDiagnosticsModule.setOrganization('Zhone Technologies, Inc.') if mibBuilder.loadTexts: zhoneCardDiagnosticsModule.setContactInfo(' Postal: Zhone Technologies, Inc. @ Zhone Way 7001 Oakport Street Oakland, CA 94621 USA Toll-Free: +1 877-ZHONE20 (+1 877-946-6320) Tel: +1-510-777-7000 Fax: +1-510-777-7001 E-mail: support@zhone.com') if mibBuilder.loadTexts: zhoneCardDiagnosticsModule.setDescription('Contains the diagnostics and results available on a per card or resource basis.') zhone_card_diag_next_table = mib_table((1, 3, 6, 1, 4, 1, 5504, 3, 3, 5)) if mibBuilder.loadTexts: zhoneCardDiagNextTable.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagNextTable.setDescription('Augment table of the unit/card resource but specific to the diagnostic results information. This card contains the index to create diagnostics table entries (zhoneCardDiagEntry) which contains all the data for executing and obtaining diagnostic results.') zhone_card_diag_next_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5504, 3, 3, 5, 1)).setIndexNames((0, 'Zhone', 'zhoneShelfIndex'), (0, 'Zhone', 'zhoneSlotIndex')) if mibBuilder.loadTexts: zhoneCardDiagNextEntry.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagNextEntry.setDescription('This is the card diagnostics next index table which contains all the data for: - index for creating next zhoneCardDiagEntry.') zhone_card_diag_next_index = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 5, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 10))).setMaxAccess('readonly') if mibBuilder.loadTexts: zhoneCardDiagNextIndex.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagNextIndex.setDescription('We allow ten diagnostic requests from multiple interfaces. The diagNextIndex represents the next available diagnostic request handle for requesting a diagnostic. NOTE: this operates as a wrap-around counter starting at 1 and wrapping around to 1 after reaching 10.') zhone_card_diag_table = mib_table((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6)) if mibBuilder.loadTexts: zhoneCardDiagTable.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagTable.setDescription('Augment table of the unit/card resource but specific to the diagnostic results information. This is the card diagnostics table which contains all the data for executing and obtaining diagnostic results.') zhone_card_diag_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1)).setIndexNames((0, 'Zhone', 'zhoneShelfIndex'), (0, 'Zhone', 'zhoneSlotIndex'), (0, 'ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneCardDiagIndex')) if mibBuilder.loadTexts: zhoneCardDiagEntry.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagEntry.setDescription('This is the card diagnostics table which contains all the data for: - invoking diagnostics, - obtaining diagnostic results.') zhone_card_diag_index = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 10))) if mibBuilder.loadTexts: zhoneCardDiagIndex.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagIndex.setDescription('We allow ten diagnostic requests from multiple interfaces. The diagIndex represents the diagnostic request to start a diagnostic or obtain test results for a completed diagnostic. NOTE: this operates as a wrap-around counter starting at 1 and wrapping around to 1 after reaching 10.') zhone_card_diag_type = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13))).clone(namedValues=named_values(('selftest', 1), ('supvBus', 2), ('cardEEprom', 3), ('frbus', 4), ('pcmcia', 5), ('shelfLamp', 6), ('realTimeClock', 7), ('fanTray', 8), ('shelfMonitor', 9), ('ioCard', 10), ('mezzanineCard', 11), ('backPlane', 12), ('midPlane', 13))).clone('selftest')).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneCardDiagType.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagType.setDescription("This field specifies the diagnostic to execute. The default value is 'selftest'. NOTE: not all of the individual diagnostics are available on every Zhone card type. NOTE: Zhone card types (cardZhoneType) are defined in the genCardResources.mib List of possible diagnostics: ============================ Common to all PLS cards ----------------------- selftest(1) - this diagnostic will execute all of the individual tests available on this card. Supports: diagStart, diagStop, diagRepetition. cardEEprom(3) - this diagnostic will verify the main card EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. frbus(4) - this diagnostic will verify that the BAN slot card can access the Fhrame Bus by doing a loopback with 10 message of 100 bytes. Supports: diagStart, diagStop, diagRepetition. backPlane(12) - this diagnostic will verify that the BAN slot card can access the back plane by verifying the back plane EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. cardZhoneType::infoServices(3) specific --------------------------------------- supvBus(2) - this diagnostic will verify that the BAN slot card can access the supervisory Bus by doing a loopback of 20 bytes. Supports: diagStart, diagStop, diagRepetition. pcmcia(5) - this diagnostic will verify that the InfoServ card can access the PCMCIA flash card I/O by doing a file create, write, and read of length 4000 bytes. Supports: diagStart, diagStop, diagRepetition. shelfLamp(6) - this diagnostic will illuminate the shelf alarm indicators for a period of 1.5 seconds. The indicators will return to their original settings after the diagnostic completes. Supports: diagStart, diagStop, diagRepetition. realTimeClk(7) - this diagnostic will verify that the real time clock increments. Supports: diagStart, diagStop, diagRepetition. fanTray(8) - this diagnostic tests that the fan tray is operational by verifying the fan tray EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. shelfMonitor(9) - this diagnostic tests the shelf monitor board is operational by checking the POST status register and verifying the shelf monitor board EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. midPlane(13) - this diagnostic will verify that the mid plane card is present by verifying the mid plane card EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. cardZhoneType::vasp(5) specific --------------------------------- ioCard(10) - this diagnostic will verify that the I/O card is present by verifying the I/O card EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. mezzanineCard(11) - this diagnostic will test that the mezzanine card is operational by verifying the mezzanine card EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. cardZhoneType::t3Tdm(6) specific --------------------------------- ioCard(10) - this diagnostic will verify that the I/O card is present by verifying the I/O card EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. midPlane(13) - this diagnostic will verify that the mid plane card is present by verifying the mid plane card EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. cardZhoneType::ethernet(9) specific ----------------------------------- midPlane(13) - this diagnostic will verify that the mid plane card is present by verifying the mid plane card EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. cardZhoneType::hdsl2(10) specific --------------------------------- ioCard(10) - this diagnostic will verify that the I/O card is present by verifying the I/O card EEPROM checksum. Supports: diagStart, diagStop, diagRepetition. mezzanineCard(11) - this diagnostic will test that the mezzanine card is operational by verifying the mezzanine card EEPROM checksum. Supports: diagStart, diagStop, diagRepetition.") zhone_card_diag_action = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 3), zhone_diag_action().clone('diagStart')).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneCardDiagAction.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagAction.setDescription('The diagAction field represents the diagnostic operation to execute. Current supported actions are as follows: diagStart : begin diagnostics and initialize results. diagStop : stop diagnostics if not yet complete. diagSuspend: suspend diagnostics at current point. diagResume : resume diagnostics from point of suspension.') zhone_card_diag_repetition = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 10)).clone(1)).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneCardDiagRepetition.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagRepetition.setDescription('This field specifies the number of repetitions of diagnostics to execute. The default value is 1. NOTE: this field operates as an OR with the diagDuration field. If this field is set to non-zero then the diagnostics will be executed that amount of repetitions.') zhone_card_diag_duration = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 600)).clone(60)).setUnits('seconds').setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneCardDiagDuration.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagDuration.setDescription('This field specifies the duration of diagnostics to execute. The default value is 60 seconds. NOTE: this field operates as an OR with the diagRepetition field. If this field is set to non-zero then the diagnostics will be executed that amount of time.') zhone_card_diag_result = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 6), zhone_diag_result()).setMaxAccess('readonly') if mibBuilder.loadTexts: zhoneCardDiagResult.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagResult.setDescription('This represents the overall diagnostic result.') zhone_card_diag_pass_count = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zhoneCardDiagPassCount.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagPassCount.setDescription('The number of diagnostics that executed successfully.') zhone_card_diag_fail_count = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zhoneCardDiagFailCount.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagFailCount.setDescription('The number of diagnostics that have failed.') zhone_card_diag_details = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 9), octet_string().subtype(subtypeSpec=value_size_constraint(0, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: zhoneCardDiagDetails.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagDetails.setDescription('The failure reason, if any, for the last diagnostic which has executed. NOTE: An empty string indicates that no additional information is available.') zhone_card_diag_start_time = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 10), date_and_time()).setMaxAccess('readonly') if mibBuilder.loadTexts: zhoneCardDiagStartTime.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagStartTime.setDescription('Starting date and time of last selftest execution.') zhone_card_diag_end_time = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 11), date_and_time()).setMaxAccess('readonly') if mibBuilder.loadTexts: zhoneCardDiagEndTime.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagEndTime.setDescription('Ending date and time of last selftest execution.') zhone_card_diag_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 6, 1, 12), zhone_row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneCardDiagRowStatus.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagRowStatus.setDescription('In any case where a new row can be created either via the cli or zms there will always be a proprietary mib entity of type ZhoneRowStatus which has the basic equivalence of the standard rowstatus object_id.') zhone_tac_test_table = mib_table((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7)) if mibBuilder.loadTexts: zhoneTacTestTable.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestTable.setDescription('This table contains one entry for each tac test channel available on Zhone devices. In the initial release only the primary channel (1) is supported. Future line cards may support the second channel. If the second channel is supported the row will be populated, if the second channel is not supported a get will return no such instance. ') zhone_tac_test_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7, 1)).setIndexNames((0, 'ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneTacIndex')) if mibBuilder.loadTexts: zhoneTacTestEntry.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestEntry.setDescription('One row per tac test channel.') zhone_tac_index = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2))) if mibBuilder.loadTexts: zhoneTacIndex.setStatus('current') if mibBuilder.loadTexts: zhoneTacIndex.setDescription('This field is the index field for the tac test channel which will be connected on the external port. This device supports a maximum of two channels, one or both channels may be supported by a device depending on which lines cards are installed.') zhone_tac_interface_index = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7, 1, 2), interface_index_or_zero()).setMaxAccess('readwrite') if mibBuilder.loadTexts: zhoneTacInterfaceIndex.setStatus('current') if mibBuilder.loadTexts: zhoneTacInterfaceIndex.setDescription('This field contains the InterfaceIndex of the physical line to be tested. If no line is currently being tested this value is 0. The ability of a physical line type to support tac test may vary depending on the line cards installed and the external test equipment. This field may not be modified when an tac test is in progress as indicated by a non-zero value in this field and the test mode set to one of tacModeLookIn, tacModeLookOut or tacModeBridge') zhone_tac_test_mode = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('mtacModeBridge', 1), ('mtacModeLookIn', 2), ('mtacModeLookOut', 3), ('mtacModeNone', 4))).clone('mtacModeNone')).setMaxAccess('readwrite') if mibBuilder.loadTexts: zhoneTacTestMode.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestMode.setDescription('This field is used to set the mtac test mode for a given line. The options are: mtacModeBridge - All traffic on the given line is bridged across the mtac lines mtacModeLookIn - All outbound traffic on the given line originates exclusively to the mtac lines mtacModeLookIn - All inbound traffic on the given line originates exclusively to the mtac lines mtacModeNone - No mtac test is in progress. The mtac test mode may be changed only if the zhoneInterfaceIndex is set, Otherwise it defaults to mtacModeNone. And can be changed again by setting InterfaceIndex to non-zero values. ') zhone_tac_test_id = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32))).clone(namedValues=named_values(('none', 1), ('runAllTests', 2), ('abortTest', 3), ('calibration', 4), ('foreignDCVoltage', 5), ('foreignACVoltage', 6), ('dcLoopResistance', 7), ('threeElementInsulationResistance', 8), ('fiveElementInsulationResistance', 9), ('threeElementCapacitance', 10), ('receiverOffHook', 11), ('distanceToOpen', 12), ('foreignACCurrents', 13), ('ringerEquivalencyNumber', 14), ('dtmfAndPulseDigitMeasurement', 15), ('noiseMeasurement', 16), ('signalToNoiseRatio', 17), ('arbitrarySignalToneMeasurement', 18), ('toneGeneration', 19), ('transHybridLoss', 20), ('drawAndBreakDialTone', 21), ('inwardCurrent', 22), ('dcFeedSelf', 23), ('onAndOffHookSelfTest', 24), ('ringingSelfTest', 25), ('ringingMonitor', 26), ('meteringSelfTest', 27), ('transmissionSelfTest', 28), ('dialingSelfTest', 29), ('howlerTest', 30), ('fuseTest', 31), ('readLoopAndBatteryConditions', 32))).clone('none')).setMaxAccess('readwrite') if mibBuilder.loadTexts: zhoneTacTestId.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestId.setDescription('This object is only valid for Tac Cards which support the new Legerity Suite of tests. This object identifies which test is to be run, or can be set to abort the current test. Test results are sent to the zhoneTacTestResultsTable. There are 3 Legerity software packages: Basic Test (VCP-BT), Advanced Test (VCP-AT), and Advanced Test Plus (VCP-ATP). We currently support Basic Test package. The following lists which tests are supported in each software package. Calibration VCP-ATP Foreign DC Voltage Test VCP-BT, VCP-AT, VCP-ATP Foreign AC VoltageTest VCP-BT, VCP-AT, VCP-ATP DC Loop Resistance Test VCP-BT, VCP-AT, VCP-ATP Three-Element Insulation Resistance Test VCP-BT, VCP-AT, VCP-ATP Five-Element Insulation Resistance Test VCP-ATP Three-Element Capacitance Test VCP-BT, VCP-AT Receiver Off-Hook Test VCP-BT, VCP-AT, VCP-ATP Distance to Open Test VCP-BT, VCP-AT Foreign AC Currents Test VCP-BT, VCP-AT Ringer Equivalency Number Test VCP-BT, VCP-AT, VCP-ATP DTMF and Pulse Digit Measurement Test VCP-BT, VCP-AT Noise Measurement Test VCP-BT, VCP-AT, VCP-ATP Signal to Noise Ratio Test VCP-ATP Arbitrary Single Tone Measurement Test VCP-ATP Tone Generation Test VCP-BT, VCP-AT Trans-Hybrid Loss Test VCP-BT, VCP-AT, VCP-ATP Draw and Break Dial Tone Test VCP-BT, VCP-AT Inward Current Test VCP-ATP DC Feed Self-Test VCP-BT, VCP-AT, VCP-ATP On/Off Hook Self-Test VCP-BT, VCP-AT, VCP-ATP Ringing Self-Test VCP-BT, VCP-AT, VCP-ATP Ringing Monitor Test VCP-BT, VCP-AT, VCP-ATP Metering Self-Test VCP-BT, VCP-AT Transmission Self-Test VCP-BT, VCP-AT, VCP-ATP Dialing Sef Test VCP-BT, VCP-AT Howler Test VCP-BT, VCP-AT Fuse Test VCP-ATP Read Loop and Battery Conditions VCP-BT, VCP-AT, VCP-ATP ') zhone_tac_test_param1 = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7, 1, 5), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: zhoneTacTestParam1.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestParam1.setDescription('Optional Test Parameter #1') zhone_tac_test_param2 = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7, 1, 6), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: zhoneTacTestParam2.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestParam2.setDescription('Optional Test Paramerter #2') zhone_tac_test_param3 = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7, 1, 7), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: zhoneTacTestParam3.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestParam3.setDescription('Optional Test Parameter #3') zhone_tac_test_param4 = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7, 1, 8), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: zhoneTacTestParam4.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestParam4.setDescription('Optional Test Parameter #4') zhone_tac_test_param5 = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 7, 1, 9), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: zhoneTacTestParam5.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestParam5.setDescription('Optional Test Parameter #5 Value: 0x00000001 Force Line-Test mode') zhone_tac_test_results_table = mib_table((1, 3, 6, 1, 4, 1, 5504, 3, 3, 12)) if mibBuilder.loadTexts: zhoneTacTestResultsTable.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestResultsTable.setDescription('Table of Tac Test Results objects. Indexed by same index as zhoneTacTestTable. This table is only valid for Tac cards which support the Legerity Suite of tests.') zhone_tac_test_results_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5504, 3, 3, 12, 1)).setIndexNames((0, 'ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneTacIndex')) if mibBuilder.loadTexts: zhoneTacTestResultsEntry.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestResultsEntry.setDescription('Entry of Test Results objects. Indexed by same index as zhoneTacTestEntry. This entry is only valid for Tac cards which support the Legerity Suite of tests.') zhone_tac_test_results_time_started = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 12, 1, 1), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: zhoneTacTestResultsTimeStarted.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestResultsTimeStarted.setDescription('Description.') zhone_tac_test_results_time_ended = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 12, 1, 2), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: zhoneTacTestResultsTimeEnded.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestResultsTimeEnded.setDescription('Description.') zhone_tac_test_result_status = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 12, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('testNotStarted', 1), ('testInProgress', 2), ('testCompleted', 3), ('testAborted', 4), ('testNotSupported', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: zhoneTacTestResultStatus.setReference('Contains the test status.') if mibBuilder.loadTexts: zhoneTacTestResultStatus.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestResultStatus.setDescription('Contains test results.') zhone_tac_test_results_output = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 3, 3, 12, 1, 4), octet_string().subtype(subtypeSpec=value_size_constraint(1, 8000))).setMaxAccess('readonly') if mibBuilder.loadTexts: zhoneTacTestResultsOutput.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestResultsOutput.setDescription("For Legerity Test Suite, results of test(s) are output to this object as one string, separated by UNIX '/n' for newline characters and terminated by the NULL character. This test results will persist until the next test is run or until tac card reboot.") zhone_tac_test_traps = object_identity((1, 3, 6, 1, 4, 1, 5504, 3, 3, 13)) if mibBuilder.loadTexts: zhoneTacTestTraps.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestTraps.setDescription('Traps for the tac system.') zhone_ringer_traps = object_identity((1, 3, 6, 1, 4, 1, 5504, 3, 3, 13, 0)) if mibBuilder.loadTexts: zhoneRingerTraps.setStatus('current') if mibBuilder.loadTexts: zhoneRingerTraps.setDescription('Traps associated with ring generator. Traps should be added below - the .0 on this entry is required.') zhone_ringer_status_alarm = notification_type((1, 3, 6, 1, 4, 1, 5504, 3, 3, 13, 0, 1)) if mibBuilder.loadTexts: zhoneRingerStatusAlarm.setStatus('current') if mibBuilder.loadTexts: zhoneRingerStatusAlarm.setDescription('This trap occurs when a ring signal fails to be detected, or when it re-starts after failure.') zhone_ringer_bus_fault_alarm = notification_type((1, 3, 6, 1, 4, 1, 5504, 3, 3, 13, 0, 2)) if mibBuilder.loadTexts: zhoneRingerBusFaultAlarm.setStatus('current') if mibBuilder.loadTexts: zhoneRingerBusFaultAlarm.setDescription('This trap occurs when a fault in the ringer power bus is detected. Such fault may be caused by the possible shortage in the POTS or DSL line.') zhone_card_diag_objects = object_group((1, 3, 6, 1, 4, 1, 5504, 6, 11, 1)).setObjects(('ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneCardDiagNextIndex'), ('ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneCardDiagType'), ('ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneCardDiagAction'), ('ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneCardDiagRepetition'), ('ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneCardDiagDuration'), ('ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneCardDiagResult'), ('ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneCardDiagPassCount'), ('ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneCardDiagFailCount'), ('ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneCardDiagDetails'), ('ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneCardDiagStartTime'), ('ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneCardDiagEndTime'), ('ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneCardDiagRowStatus')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): zhone_card_diag_objects = zhoneCardDiagObjects.setStatus('current') if mibBuilder.loadTexts: zhoneCardDiagObjects.setDescription('This group contains objects associated with Zhone Card Diagnostics') zhone_tac_test_objects = object_group((1, 3, 6, 1, 4, 1, 5504, 6, 11, 2)).setObjects(('ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneTacInterfaceIndex'), ('ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneTacTestMode'), ('ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneTacTestId'), ('ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneTacTestResultsTimeStarted'), ('ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneTacTestResultsTimeEnded'), ('ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneTacTestResultStatus'), ('ZHONE-CARD-DIAGNOSTICS-MIB', 'zhoneTacTestResultsOutput')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): zhone_tac_test_objects = zhoneTacTestObjects.setStatus('current') if mibBuilder.loadTexts: zhoneTacTestObjects.setDescription('This group contains objects associated with initiating tac tests') mibBuilder.exportSymbols('ZHONE-CARD-DIAGNOSTICS-MIB', zhoneCardDiagDetails=zhoneCardDiagDetails, zhoneTacTestMode=zhoneTacTestMode, zhoneRingerBusFaultAlarm=zhoneRingerBusFaultAlarm, zhoneCardDiagNextIndex=zhoneCardDiagNextIndex, zhoneTacTestResultsTimeEnded=zhoneTacTestResultsTimeEnded, zhoneCardDiagEntry=zhoneCardDiagEntry, zhoneTacTestParam4=zhoneTacTestParam4, zhoneCardDiagRowStatus=zhoneCardDiagRowStatus, zhoneTacIndex=zhoneTacIndex, zhoneTacTestParam1=zhoneTacTestParam1, zhoneTacInterfaceIndex=zhoneTacInterfaceIndex, zhoneTacTestTable=zhoneTacTestTable, zhoneRingerTraps=zhoneRingerTraps, zhoneCardDiagStartTime=zhoneCardDiagStartTime, zhoneTacTestResultsOutput=zhoneTacTestResultsOutput, zhoneTacTestResultsTimeStarted=zhoneTacTestResultsTimeStarted, zhoneCardDiagResult=zhoneCardDiagResult, zhoneCardDiagPassCount=zhoneCardDiagPassCount, zhoneTacTestTraps=zhoneTacTestTraps, zhoneCardDiagTable=zhoneCardDiagTable, zhoneCardDiagObjects=zhoneCardDiagObjects, zhoneCardDiagnosticsModule=zhoneCardDiagnosticsModule, zhoneTacTestParam2=zhoneTacTestParam2, zhoneTacTestParam5=zhoneTacTestParam5, zhoneCardDiagNextTable=zhoneCardDiagNextTable, zhoneCardDiagEndTime=zhoneCardDiagEndTime, zhoneTacTestEntry=zhoneTacTestEntry, zhoneTacTestResultStatus=zhoneTacTestResultStatus, zhoneTacTestId=zhoneTacTestId, zhoneTacTestResultsEntry=zhoneTacTestResultsEntry, zhoneCardDiagDuration=zhoneCardDiagDuration, zhoneTacTestObjects=zhoneTacTestObjects, zhoneCardDiagNextEntry=zhoneCardDiagNextEntry, zhoneTacTestParam3=zhoneTacTestParam3, zhoneCardDiagFailCount=zhoneCardDiagFailCount, zhoneCardDiagIndex=zhoneCardDiagIndex, zhoneCardDiagAction=zhoneCardDiagAction, zhoneTacTestResultsTable=zhoneTacTestResultsTable, zhoneCardDiagRepetition=zhoneCardDiagRepetition, zhoneRingerStatusAlarm=zhoneRingerStatusAlarm, zhoneCardDiagType=zhoneCardDiagType, PYSNMP_MODULE_ID=zhoneCardDiagnosticsModule)
line = input() party = {} unlikes = 0 while line != "Stop": act, guest, meal = line.split("-") if act == "Like": if guest in party.keys(): if meal in party[guest]: line = input() continue party[guest].append(meal) line = input() continue party[guest] = [meal] elif act == "Unlike": if guest not in party.keys(): print(f"{guest} is not at the party.") line = input() continue elif meal not in party[guest]: print(f"{guest} doesn't have the {meal} in his/her collection.") line = input() continue else: party[guest].remove(meal) print(f"{guest} doesn't like the {meal}.") unlikes += 1 line = input() continue line = input() for member, foods in sorted(party.items(), key=lambda x: (-len(x[1]), x[0])): if len(foods) == 0: print(f"{member}:") else: print(f"{member}: {', '.join(foods)}") print(f"Unliked meals: {unlikes}")
line = input() party = {} unlikes = 0 while line != 'Stop': (act, guest, meal) = line.split('-') if act == 'Like': if guest in party.keys(): if meal in party[guest]: line = input() continue party[guest].append(meal) line = input() continue party[guest] = [meal] elif act == 'Unlike': if guest not in party.keys(): print(f'{guest} is not at the party.') line = input() continue elif meal not in party[guest]: print(f"{guest} doesn't have the {meal} in his/her collection.") line = input() continue else: party[guest].remove(meal) print(f"{guest} doesn't like the {meal}.") unlikes += 1 line = input() continue line = input() for (member, foods) in sorted(party.items(), key=lambda x: (-len(x[1]), x[0])): if len(foods) == 0: print(f'{member}:') else: print(f"{member}: {', '.join(foods)}") print(f'Unliked meals: {unlikes}')
L=raw_input("Please Enter the length of the layer (in m): ") A=raw_input("Please Enter the area of the wall (in m2): ") material=raw_input("Please Enter the material of the layer: ") if material=="glass": type_glas=raw_input("which type of glass do you mean:window=1, wool insulation=2 ") if int(type_glas)==1: k=str(0.96) #W/mK elif int(type_glas)==2: k= str(0.04) #W/mK else: print("The selected glass type is not acceptable") elif material=="brick": k=str(0.8) #W/mK else: print("I do not have the properties of this material") k=(raw_input("Please Enter the conductivity off the layer(in W/(m K): ")) print("\n you just said "+ "L= " + L+ " m "+ "A= " + A+ " m2 "+ "k= "+ k +" W/(m*K) \n") R=float(L)/(float(k)*float(A)) print("Well the Thermal Resistnace is "+ str(R)+ " degC/W")
l = raw_input('Please Enter the length of the layer (in m): ') a = raw_input('Please Enter the area of the wall (in m2): ') material = raw_input('Please Enter the material of the layer: ') if material == 'glass': type_glas = raw_input('which type of glass do you mean:window=1, wool insulation=2 ') if int(type_glas) == 1: k = str(0.96) elif int(type_glas) == 2: k = str(0.04) else: print('The selected glass type is not acceptable') elif material == 'brick': k = str(0.8) else: print('I do not have the properties of this material') k = raw_input('Please Enter the conductivity off the layer(in W/(m K): ') print('\n you just said ' + 'L= ' + L + ' m ' + 'A= ' + A + ' m2 ' + 'k= ' + k + ' W/(m*K) \n') r = float(L) / (float(k) * float(A)) print('Well the Thermal Resistnace is ' + str(R) + ' degC/W')
def test_user_create_public_group( # noqa user, public_group, ): accessible = public_group.is_accessible_by(user, mode="create") assert accessible def test_user_create_public_groupuser( user, public_groupuser, ): accessible = public_groupuser.is_accessible_by(user, mode="create") assert not accessible # needs GroupAdmin def test_user_create_public_stream( user, public_stream, ): accessible = public_stream.is_accessible_by(user, mode="create") assert not accessible # needs system admin def test_user_create_public_groupstream( user, public_groupstream, ): accessible = public_groupstream.is_accessible_by(user, mode="create") assert not accessible # needs system admin def test_user_create_public_streamuser( user, public_streamuser, ): accessible = public_streamuser.is_accessible_by(user, mode="create") assert not accessible # needs system admin def test_user_create_public_filter( user, public_filter, ): accessible = public_filter.is_accessible_by(user, mode="create") assert accessible def test_user_create_public_candidate_object( user, public_candidate_object, ): accessible = public_candidate_object.is_accessible_by(user, mode="create") assert accessible def test_user_create_public_source_object( user, public_source_object, ): accessible = public_source_object.is_accessible_by(user, mode="create") assert accessible def test_user_create_keck1_telescope( user, keck1_telescope, ): accessible = keck1_telescope.is_accessible_by(user, mode="create") assert accessible def test_user_create_sedm( user, sedm, ): accessible = sedm.is_accessible_by(user, mode="create") assert accessible def test_user_create_public_group_sedm_allocation( user, public_group_sedm_allocation, ): accessible = public_group_sedm_allocation.is_accessible_by(user, mode="create") assert accessible def test_user_read_public_group( user, public_group, ): accessible = public_group.is_accessible_by(user, mode="read") assert accessible def test_user_read_public_groupuser( user, public_groupuser, ): accessible = public_groupuser.is_accessible_by(user, mode="read") assert accessible def test_user_read_public_stream( user, public_stream, ): accessible = public_stream.is_accessible_by(user, mode="read") assert accessible def test_user_read_public_groupstream( user, public_groupstream, ): accessible = public_groupstream.is_accessible_by(user, mode="read") assert accessible def test_user_read_public_streamuser( user, public_streamuser, ): accessible = public_streamuser.is_accessible_by(user, mode="read") assert accessible def test_user_read_public_filter( user, public_filter, ): accessible = public_filter.is_accessible_by(user, mode="read") assert accessible def test_user_read_public_candidate_object( user, public_candidate_object, ): accessible = public_candidate_object.is_accessible_by(user, mode="read") assert accessible def test_user_read_public_source_object( user, public_source_object, ): accessible = public_source_object.is_accessible_by(user, mode="read") assert accessible def test_user_read_keck1_telescope( user, keck1_telescope, ): accessible = keck1_telescope.is_accessible_by(user, mode="read") assert accessible def test_user_read_sedm( user, sedm, ): accessible = sedm.is_accessible_by(user, mode="read") assert accessible def test_user_read_public_group_sedm_allocation( user, public_group_sedm_allocation, ): accessible = public_group_sedm_allocation.is_accessible_by(user, mode="read") assert accessible def test_user_update_public_group( user, public_group, ): accessible = public_group.is_accessible_by(user, mode="update") assert not accessible # needs groupadmin def test_user_update_public_groupuser( user, public_groupuser, ): accessible = public_groupuser.is_accessible_by(user, mode="update") assert not accessible # needs groupadmin def test_user_update_public_stream( user, public_stream, ): accessible = public_stream.is_accessible_by(user, mode="update") assert not accessible # needs systemadmin def test_user_update_public_groupstream( user, public_groupstream, ): accessible = public_groupstream.is_accessible_by(user, mode="update") assert not accessible # needs systemadmin def test_user_update_public_streamuser( user, public_streamuser, ): accessible = public_streamuser.is_accessible_by(user, mode="update") assert not accessible # needs systemadmin def test_user_update_public_filter( user, public_filter, ): accessible = public_filter.is_accessible_by(user, mode="update") assert accessible def test_user_update_public_candidate_object( user, public_candidate_object, ): accessible = public_candidate_object.is_accessible_by(user, mode="update") assert accessible def test_user_update_public_source_object( user, public_source_object, ): accessible = public_source_object.is_accessible_by(user, mode="update") assert accessible def test_user_update_keck1_telescope( user, keck1_telescope, ): accessible = keck1_telescope.is_accessible_by(user, mode="update") assert not accessible # needs system admin def test_user_update_sedm( user, sedm, ): accessible = sedm.is_accessible_by(user, mode="update") assert not accessible # needs system admin def test_user_update_public_group_sedm_allocation( user, public_group_sedm_allocation, ): accessible = public_group_sedm_allocation.is_accessible_by(user, mode="update") assert accessible def test_user_delete_public_group( user, public_group, ): accessible = public_group.is_accessible_by(user, mode="delete") assert not accessible # needs group admin def test_user_delete_public_groupuser( user, public_groupuser, ): accessible = public_groupuser.is_accessible_by(user, mode="delete") assert not accessible # needs group admin def test_user_delete_public_stream( user, public_stream, ): accessible = public_stream.is_accessible_by(user, mode="delete") assert not accessible # needs system admin def test_user_delete_public_groupstream( user, public_groupstream, ): accessible = public_groupstream.is_accessible_by(user, mode="delete") assert not accessible # needs system admin def test_user_delete_public_streamuser( user, public_streamuser, ): accessible = public_streamuser.is_accessible_by(user, mode="delete") assert not accessible # needs system admin def test_user_delete_public_filter( user, public_filter, ): accessible = public_filter.is_accessible_by(user, mode="delete") assert accessible # any group member can delete a group filter for now def test_user_delete_public_candidate_object( user, public_candidate_object, ): accessible = public_candidate_object.is_accessible_by(user, mode="delete") assert accessible def test_user_delete_public_source_object( user, public_source_object, ): accessible = public_source_object.is_accessible_by(user, mode="delete") assert accessible def test_user_delete_keck1_telescope( user, keck1_telescope, ): accessible = keck1_telescope.is_accessible_by(user, mode="delete") assert not accessible # needs sysadmin def test_user_delete_sedm( user, sedm, ): accessible = sedm.is_accessible_by(user, mode="delete") assert not accessible # needs sysadmin def test_user_delete_public_group_sedm_allocation( user, public_group_sedm_allocation, ): accessible = public_group_sedm_allocation.is_accessible_by(user, mode="delete") assert accessible def test_user_group2_create_public_group( user_group2, public_group, ): accessible = public_group.is_accessible_by(user_group2, mode="create") assert accessible def test_user_group2_create_public_groupuser( user_group2, public_groupuser, ): accessible = public_groupuser.is_accessible_by(user_group2, mode="create") assert not accessible # must be in the group and be a group admin def test_user_group2_create_public_stream( user_group2, public_stream, ): accessible = public_stream.is_accessible_by(user_group2, mode="create") assert not accessible # needs sys admin def test_user_group2_create_public_groupstream( user_group2, public_groupstream, ): accessible = public_groupstream.is_accessible_by(user_group2, mode="create") assert not accessible # needs sys admin def test_user_group2_create_public_streamuser( user_group2, public_streamuser, ): accessible = public_streamuser.is_accessible_by(user_group2, mode="create") assert not accessible # needs system admin def test_user_group2_create_public_filter( user_group2, public_filter, ): accessible = public_filter.is_accessible_by(user_group2, mode="create") assert not accessible # must be in the filter's group def test_user_group2_create_public_candidate_object( user_group2, public_candidate_object, ): accessible = public_candidate_object.is_accessible_by(user_group2, mode="create") assert not accessible # must be in the filter's group def test_user_group2_create_public_source_object( user_group2, public_source_object, ): accessible = public_source_object.is_accessible_by(user_group2, mode="create") assert not accessible # must be in the source's group def test_user_group2_create_keck1_telescope( user_group2, keck1_telescope, ): accessible = keck1_telescope.is_accessible_by(user_group2, mode="create") assert accessible def test_user_group2_create_sedm( user_group2, sedm, ): accessible = sedm.is_accessible_by(user_group2, mode="create") assert accessible def test_user_group2_create_public_group_sedm_allocation( user_group2, public_group_sedm_allocation, ): accessible = public_group_sedm_allocation.is_accessible_by( user_group2, mode="create" ) assert not accessible # must be in the allocation's group def test_user_group2_read_public_group( user_group2, public_group, ): accessible = public_group.is_accessible_by(user_group2, mode="read") assert accessible def test_user_group2_read_public_groupuser( user_group2, public_groupuser, ): accessible = public_groupuser.is_accessible_by(user_group2, mode="read") assert accessible def test_user_group2_read_public_stream( user_group2, public_stream, ): accessible = public_stream.is_accessible_by(user_group2, mode="read") assert accessible def test_user_group2_read_public_groupstream( user_group2, public_groupstream, ): accessible = public_groupstream.is_accessible_by(user_group2, mode="read") assert accessible def test_user_group2_read_public_streamuser( user_group2, public_streamuser, ): accessible = public_streamuser.is_accessible_by(user_group2, mode="read") assert accessible == public_streamuser.user.is_accessible_by( user_group2, mode="read" ) and public_streamuser.stream.is_accessible_by(user_group2, mode="read") def test_user_group2_read_public_filter( user_group2, public_filter, ): accessible = public_filter.is_accessible_by(user_group2, mode="read") assert not accessible # must be a member of the group def test_user_group2_read_public_candidate_object( user_group2, public_candidate_object, ): accessible = public_candidate_object.is_accessible_by(user_group2, mode="read") assert not accessible # must be a member of the filter's group def test_user_group2_read_public_source_object( user_group2, public_source_object, ): accessible = public_source_object.is_accessible_by(user_group2, mode="read") assert not accessible # must be a member of the source's group def test_user_group2_read_keck1_telescope( user_group2, keck1_telescope, ): accessible = keck1_telescope.is_accessible_by(user_group2, mode="read") assert accessible def test_user_group2_read_sedm( user_group2, sedm, ): accessible = sedm.is_accessible_by(user_group2, mode="read") assert accessible def test_user_group2_read_public_group_sedm_allocation( user_group2, public_group_sedm_allocation, ): accessible = public_group_sedm_allocation.is_accessible_by(user_group2, mode="read") assert not accessible # must be a member of the allocation's group def test_user_group2_update_public_group( user_group2, public_group, ): accessible = public_group.is_accessible_by(user_group2, mode="update") assert not accessible # must be an admin of the group def test_user_group2_update_public_groupuser( user_group2, public_groupuser, ): accessible = public_groupuser.is_accessible_by(user_group2, mode="update") assert not accessible # must be an admin of the group def test_user_group2_update_public_stream( user_group2, public_stream, ): accessible = public_stream.is_accessible_by(user_group2, mode="update") assert not accessible # must be a system admin def test_user_group2_update_public_groupstream( user_group2, public_groupstream, ): accessible = public_groupstream.is_accessible_by(user_group2, mode="update") assert not accessible # must be a system admin def test_user_group2_update_public_streamuser( user_group2, public_streamuser, ): accessible = public_streamuser.is_accessible_by(user_group2, mode="update") assert not accessible # must be a system admin def test_user_group2_update_public_filter( user_group2, public_filter, ): accessible = public_filter.is_accessible_by(user_group2, mode="update") assert not accessible # must be an admin of the filter's group def test_user_group2_update_public_candidate_object( user_group2, public_candidate_object, ): accessible = public_candidate_object.is_accessible_by(user_group2, mode="update") assert not accessible # must be a member of the candidate's filter's group def test_user_group2_update_public_source_object( user_group2, public_source_object, ): accessible = public_source_object.is_accessible_by(user_group2, mode="update") assert not accessible # must be a member of the source's group def test_user_group2_update_keck1_telescope( user_group2, keck1_telescope, ): accessible = keck1_telescope.is_accessible_by(user_group2, mode="update") assert not accessible # must be system admin def test_user_group2_update_sedm( user_group2, sedm, ): accessible = sedm.is_accessible_by(user_group2, mode="update") assert not accessible # must be system admin def test_user_group2_update_public_group_sedm_allocation( user_group2, public_group_sedm_allocation, ): accessible = public_group_sedm_allocation.is_accessible_by( user_group2, mode="update" ) assert not accessible # must be a member of the group def test_user_group2_delete_public_group( user_group2, public_group, ): accessible = public_group.is_accessible_by(user_group2, mode="delete") assert not accessible # must be a group admin def test_user_group2_delete_public_groupuser( user_group2, public_groupuser, ): accessible = public_groupuser.is_accessible_by(user_group2, mode="delete") assert not accessible # must be a group admin of the target group def test_user_group2_delete_public_stream( user_group2, public_stream, ): accessible = public_stream.is_accessible_by(user_group2, mode="delete") assert not accessible # must be a system admin def test_user_group2_delete_public_groupstream( user_group2, public_groupstream, ): accessible = public_groupstream.is_accessible_by(user_group2, mode="delete") assert not accessible # must be a system admin def test_user_group2_delete_public_streamuser( user_group2, public_streamuser, ): accessible = public_streamuser.is_accessible_by(user_group2, mode="delete") assert not accessible # must be a system admin def test_user_group2_delete_public_filter( user_group2, public_filter, ): accessible = public_filter.is_accessible_by(user_group2, mode="delete") assert not accessible # must be a group member of target group def test_user_group2_delete_public_candidate_object( user_group2, public_candidate_object, ): accessible = public_candidate_object.is_accessible_by(user_group2, mode="delete") assert not accessible # must be a member of target group def test_user_group2_delete_public_source_object( user_group2, public_source_object, ): accessible = public_source_object.is_accessible_by(user_group2, mode="delete") assert not accessible # must be a member of target group def test_user_group2_delete_keck1_telescope( user_group2, keck1_telescope, ): accessible = keck1_telescope.is_accessible_by(user_group2, mode="delete") assert not accessible # must be a system admin def test_user_group2_delete_sedm( user_group2, sedm, ): accessible = sedm.is_accessible_by(user_group2, mode="delete") assert not accessible # must be a system admin def test_user_group2_delete_public_group_sedm_allocation( user_group2, public_group_sedm_allocation, ): accessible = public_group_sedm_allocation.is_accessible_by( user_group2, mode="delete" ) assert not accessible # must be a member of target group def test_super_admin_user_create_public_group( super_admin_user, public_group, ): accessible = public_group.is_accessible_by(super_admin_user, mode="create") assert accessible def test_super_admin_user_create_public_groupuser( super_admin_user, public_groupuser, ): accessible = public_groupuser.is_accessible_by(super_admin_user, mode="create") assert accessible def test_super_admin_user_create_public_stream( super_admin_user, public_stream, ): accessible = public_stream.is_accessible_by(super_admin_user, mode="create") assert accessible def test_super_admin_user_create_public_groupstream( super_admin_user, public_groupstream, ): accessible = public_groupstream.is_accessible_by(super_admin_user, mode="create") assert accessible def test_super_admin_user_create_public_streamuser( super_admin_user, public_streamuser, ): accessible = public_streamuser.is_accessible_by(super_admin_user, mode="create") assert accessible def test_super_admin_user_create_public_filter( super_admin_user, public_filter, ): accessible = public_filter.is_accessible_by(super_admin_user, mode="create") assert accessible def test_super_admin_user_create_public_candidate_object( super_admin_user, public_candidate_object, ): accessible = public_candidate_object.is_accessible_by( super_admin_user, mode="create" ) assert accessible def test_super_admin_user_create_public_source_object( super_admin_user, public_source_object, ): accessible = public_source_object.is_accessible_by(super_admin_user, mode="create") assert accessible def test_super_admin_user_create_keck1_telescope( super_admin_user, keck1_telescope, ): accessible = keck1_telescope.is_accessible_by(super_admin_user, mode="create") assert accessible def test_super_admin_user_create_sedm( super_admin_user, sedm, ): accessible = sedm.is_accessible_by(super_admin_user, mode="create") assert accessible def test_super_admin_user_create_public_group_sedm_allocation( super_admin_user, public_group_sedm_allocation, ): accessible = public_group_sedm_allocation.is_accessible_by( super_admin_user, mode="create" ) assert accessible def test_super_admin_user_read_public_group( super_admin_user, public_group, ): accessible = public_group.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_read_public_groupuser( super_admin_user, public_groupuser, ): accessible = public_groupuser.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_read_public_stream( super_admin_user, public_stream, ): accessible = public_stream.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_read_public_groupstream( super_admin_user, public_groupstream, ): accessible = public_groupstream.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_read_public_streamuser( super_admin_user, public_streamuser, ): accessible = public_streamuser.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_read_public_filter( super_admin_user, public_filter, ): accessible = public_filter.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_read_public_candidate_object( super_admin_user, public_candidate_object, ): accessible = public_candidate_object.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_read_public_source_object( super_admin_user, public_source_object, ): accessible = public_source_object.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_read_keck1_telescope( super_admin_user, keck1_telescope, ): accessible = keck1_telescope.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_read_sedm( super_admin_user, sedm, ): accessible = sedm.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_read_public_group_sedm_allocation( super_admin_user, public_group_sedm_allocation, ): accessible = public_group_sedm_allocation.is_accessible_by( super_admin_user, mode="read" ) assert accessible def test_super_admin_user_update_public_group( super_admin_user, public_group, ): accessible = public_group.is_accessible_by(super_admin_user, mode="update") assert accessible def test_super_admin_user_update_public_groupuser( super_admin_user, public_groupuser, ): accessible = public_groupuser.is_accessible_by(super_admin_user, mode="update") assert accessible def test_super_admin_user_update_public_stream( super_admin_user, public_stream, ): accessible = public_stream.is_accessible_by(super_admin_user, mode="update") assert accessible def test_super_admin_user_update_public_groupstream( super_admin_user, public_groupstream, ): accessible = public_groupstream.is_accessible_by(super_admin_user, mode="update") assert accessible def test_super_admin_user_update_public_streamuser( super_admin_user, public_streamuser, ): accessible = public_streamuser.is_accessible_by(super_admin_user, mode="update") assert accessible def test_super_admin_user_update_public_filter( super_admin_user, public_filter, ): accessible = public_filter.is_accessible_by(super_admin_user, mode="update") assert accessible def test_super_admin_user_update_public_candidate_object( super_admin_user, public_candidate_object, ): accessible = public_candidate_object.is_accessible_by( super_admin_user, mode="update" ) assert accessible def test_super_admin_user_update_public_source_object( super_admin_user, public_source_object, ): accessible = public_source_object.is_accessible_by(super_admin_user, mode="update") assert accessible def test_super_admin_user_update_keck1_telescope( super_admin_user, keck1_telescope, ): accessible = keck1_telescope.is_accessible_by(super_admin_user, mode="update") assert accessible def test_super_admin_user_update_sedm( super_admin_user, sedm, ): accessible = sedm.is_accessible_by(super_admin_user, mode="update") assert accessible def test_super_admin_user_update_public_group_sedm_allocation( super_admin_user, public_group_sedm_allocation, ): accessible = public_group_sedm_allocation.is_accessible_by( super_admin_user, mode="update" ) assert accessible def test_super_admin_user_delete_public_group( super_admin_user, public_group, ): accessible = public_group.is_accessible_by(super_admin_user, mode="delete") assert accessible def test_super_admin_user_delete_public_groupuser( super_admin_user, public_groupuser, ): accessible = public_groupuser.is_accessible_by(super_admin_user, mode="delete") assert accessible def test_super_admin_user_delete_public_stream( super_admin_user, public_stream, ): accessible = public_stream.is_accessible_by(super_admin_user, mode="delete") assert accessible def test_super_admin_user_delete_public_groupstream( super_admin_user, public_groupstream, ): accessible = public_groupstream.is_accessible_by(super_admin_user, mode="delete") assert accessible def test_super_admin_user_delete_public_streamuser( super_admin_user, public_streamuser, ): accessible = public_streamuser.is_accessible_by(super_admin_user, mode="delete") assert accessible def test_super_admin_user_delete_public_filter( super_admin_user, public_filter, ): accessible = public_filter.is_accessible_by(super_admin_user, mode="delete") assert accessible def test_super_admin_user_delete_public_candidate_object( super_admin_user, public_candidate_object, ): accessible = public_candidate_object.is_accessible_by( super_admin_user, mode="delete" ) assert accessible def test_super_admin_user_delete_public_source_object( super_admin_user, public_source_object, ): accessible = public_source_object.is_accessible_by(super_admin_user, mode="delete") assert accessible def test_super_admin_user_delete_keck1_telescope( super_admin_user, keck1_telescope, ): accessible = keck1_telescope.is_accessible_by(super_admin_user, mode="delete") assert accessible def test_super_admin_user_delete_sedm( super_admin_user, sedm, ): accessible = sedm.is_accessible_by(super_admin_user, mode="delete") assert accessible def test_super_admin_user_delete_public_group_sedm_allocation( super_admin_user, public_group_sedm_allocation, ): accessible = public_group_sedm_allocation.is_accessible_by( super_admin_user, mode="delete" ) assert accessible def test_group_admin_user_create_public_group( group_admin_user, public_group, ): accessible = public_group.is_accessible_by(group_admin_user, mode="create") assert accessible def test_group_admin_user_create_public_groupuser( group_admin_user, public_groupuser, ): accessible = public_groupuser.is_accessible_by(group_admin_user, mode="create") assert accessible def test_group_admin_user_create_public_stream( group_admin_user, public_stream, ): accessible = public_stream.is_accessible_by(group_admin_user, mode="create") assert not accessible # must be system admin def test_group_admin_user_create_public_groupstream( group_admin_user, public_groupstream, ): accessible = public_groupstream.is_accessible_by(group_admin_user, mode="create") assert accessible def test_group_admin_user_create_public_streamuser( group_admin_user, public_streamuser, ): accessible = public_streamuser.is_accessible_by(group_admin_user, mode="create") assert not accessible # must be system admin def test_group_admin_user_create_public_filter( group_admin_user, public_filter, ): accessible = public_filter.is_accessible_by(group_admin_user, mode="create") assert accessible def test_group_admin_user_create_public_candidate_object( group_admin_user, public_candidate_object, ): accessible = public_candidate_object.is_accessible_by( group_admin_user, mode="create" ) assert accessible def test_group_admin_user_create_public_source_object( group_admin_user, public_source_object, ): accessible = public_source_object.is_accessible_by(group_admin_user, mode="create") assert accessible def test_group_admin_user_create_keck1_telescope( group_admin_user, keck1_telescope, ): accessible = keck1_telescope.is_accessible_by(group_admin_user, mode="create") assert accessible def test_group_admin_user_create_sedm( group_admin_user, sedm, ): accessible = sedm.is_accessible_by(group_admin_user, mode="create") assert accessible def test_group_admin_user_create_public_group_sedm_allocation( group_admin_user, public_group_sedm_allocation, ): accessible = public_group_sedm_allocation.is_accessible_by( group_admin_user, mode="create" ) assert accessible def test_group_admin_user_read_public_group( group_admin_user, public_group, ): accessible = public_group.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_read_public_groupuser( group_admin_user, public_groupuser, ): accessible = public_groupuser.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_read_public_stream( group_admin_user, public_stream, ): accessible = public_stream.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_read_public_groupstream( group_admin_user, public_groupstream, ): accessible = public_groupstream.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_read_public_streamuser( group_admin_user, public_streamuser, ): accessible = public_streamuser.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_read_public_filter( group_admin_user, public_filter, ): accessible = public_filter.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_read_public_candidate_object( group_admin_user, public_candidate_object, ): accessible = public_candidate_object.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_read_public_source_object( group_admin_user, public_source_object, ): accessible = public_source_object.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_read_keck1_telescope( group_admin_user, keck1_telescope, ): accessible = keck1_telescope.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_read_sedm( group_admin_user, sedm, ): accessible = sedm.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_read_public_group_sedm_allocation( group_admin_user, public_group_sedm_allocation, ): accessible = public_group_sedm_allocation.is_accessible_by( group_admin_user, mode="read" ) assert accessible def test_group_admin_user_update_public_group( group_admin_user, public_group, ): accessible = public_group.is_accessible_by(group_admin_user, mode="update") assert accessible def test_group_admin_user_update_public_groupuser( group_admin_user, public_groupuser, ): accessible = public_groupuser.is_accessible_by(group_admin_user, mode="update") assert accessible def test_group_admin_user_update_public_stream( group_admin_user, public_stream, ): accessible = public_stream.is_accessible_by(group_admin_user, mode="update") assert not accessible # needs system admin def test_group_admin_user_update_public_groupstream( group_admin_user, public_groupstream, ): accessible = public_groupstream.is_accessible_by(group_admin_user, mode="update") assert accessible def test_group_admin_user_update_public_streamuser( group_admin_user, public_streamuser, ): accessible = public_streamuser.is_accessible_by(group_admin_user, mode="update") assert not accessible # needs system admin def test_group_admin_user_update_public_filter( group_admin_user, public_filter, ): accessible = public_filter.is_accessible_by(group_admin_user, mode="update") assert accessible def test_group_admin_user_update_public_candidate_object( group_admin_user, public_candidate_object, ): accessible = public_candidate_object.is_accessible_by( group_admin_user, mode="update" ) assert accessible def test_group_admin_user_update_public_source_object( group_admin_user, public_source_object, ): accessible = public_source_object.is_accessible_by(group_admin_user, mode="update") assert accessible def test_group_admin_user_update_keck1_telescope( group_admin_user, keck1_telescope, ): accessible = keck1_telescope.is_accessible_by(group_admin_user, mode="update") assert not accessible # system admin def test_group_admin_user_update_sedm( group_admin_user, sedm, ): accessible = sedm.is_accessible_by(group_admin_user, mode="update") assert not accessible # sysadmin def test_group_admin_user_update_public_group_sedm_allocation( group_admin_user, public_group_sedm_allocation, ): accessible = public_group_sedm_allocation.is_accessible_by( group_admin_user, mode="update" ) assert accessible def test_group_admin_user_delete_public_group( group_admin_user, public_group, ): accessible = public_group.is_accessible_by(group_admin_user, mode="delete") assert accessible def test_group_admin_user_delete_public_groupuser( group_admin_user, public_groupuser, ): accessible = public_groupuser.is_accessible_by(group_admin_user, mode="delete") assert accessible def test_group_admin_user_delete_public_stream( group_admin_user, public_stream, ): accessible = public_stream.is_accessible_by(group_admin_user, mode="delete") assert not accessible # sys admin def test_group_admin_user_delete_public_groupstream( group_admin_user, public_groupstream, ): accessible = public_groupstream.is_accessible_by(group_admin_user, mode="delete") assert accessible def test_group_admin_user_delete_public_streamuser( group_admin_user, public_streamuser, ): accessible = public_streamuser.is_accessible_by(group_admin_user, mode="delete") assert not accessible # sysadmin def test_group_admin_user_delete_public_filter( group_admin_user, public_filter, ): accessible = public_filter.is_accessible_by(group_admin_user, mode="delete") assert accessible def test_group_admin_user_delete_public_candidate_object( group_admin_user, public_candidate_object, ): accessible = public_candidate_object.is_accessible_by( group_admin_user, mode="delete" ) assert accessible def test_group_admin_user_delete_public_source_object( group_admin_user, public_source_object, ): accessible = public_source_object.is_accessible_by(group_admin_user, mode="delete") assert accessible def test_group_admin_user_delete_keck1_telescope( group_admin_user, keck1_telescope, ): accessible = keck1_telescope.is_accessible_by(group_admin_user, mode="delete") assert not accessible # sysadmin def test_group_admin_user_delete_sedm( group_admin_user, sedm, ): accessible = sedm.is_accessible_by(group_admin_user, mode="delete") assert not accessible # sysadmin def test_group_admin_user_delete_public_group_sedm_allocation( group_admin_user, public_group_sedm_allocation, ): accessible = public_group_sedm_allocation.is_accessible_by( group_admin_user, mode="delete" ) assert accessible def test_user_create_public_group_taxonomy(user, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(user, mode="create") assert accessible def test_user_create_public_taxonomy(user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(user, mode="create") assert accessible def test_user_read_public_group_taxonomy(user, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(user, mode="read") assert accessible def test_user_read_public_taxonomy(user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(user, mode="read") assert accessible def test_user_update_public_group_taxonomy(user, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(user, mode="update") assert not accessible # must be super admin def test_user_update_public_taxonomy(user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(user, mode="update") assert not accessible # must be super admin def test_user_delete_public_group_taxonomy(user, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(user, mode="delete") assert not accessible # must be group admin def test_user_delete_public_taxonomy(user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(user, mode="delete") assert not accessible # must be super admin def test_user_group2_create_public_group_taxonomy(user_group2, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(user_group2, mode="create") assert ( not accessible ) # need read access on taxonomy, which is only visible to group 1 def test_user_group2_create_public_taxonomy(user_group2, public_taxonomy): accessible = public_taxonomy.is_accessible_by(user_group2, mode="create") assert accessible def test_user_group2_read_public_group_taxonomy(user_group2, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(user_group2, mode="read") assert ( not accessible ) # need read access on taxonomy, which is only visible to group 1 def test_user_group2_read_public_taxonomy(user_group2, public_taxonomy): accessible = public_taxonomy.is_accessible_by(user_group2, mode="read") assert not accessible # need to be in group 1 def test_user_group2_update_public_group_taxonomy(user_group2, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(user_group2, mode="update") assert ( not accessible ) # user must be in one of public_taxonomy's groups and must be a group admin def test_user_group2_update_public_taxonomy(user_group2, public_taxonomy): accessible = public_taxonomy.is_accessible_by(user_group2, mode="update") assert not accessible # must be a group admin of one of taxonomy's groups def test_user_group2_delete_public_group_taxonomy(user_group2, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(user_group2, mode="delete") assert ( not accessible ) # need read access to taxonomy and must be a group admin of target group def test_user_group2_delete_public_taxonomy(user_group2, public_taxonomy): accessible = public_taxonomy.is_accessible_by(user_group2, mode="delete") assert not accessible # must be sysadmin def test_super_admin_user_create_public_group_taxonomy( super_admin_user, public_group_taxonomy ): accessible = public_group_taxonomy.is_accessible_by(super_admin_user, mode="create") assert accessible def test_super_admin_user_create_public_taxonomy(super_admin_user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(super_admin_user, mode="create") assert accessible def test_super_admin_user_read_public_group_taxonomy( super_admin_user, public_group_taxonomy ): accessible = public_group_taxonomy.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_read_public_taxonomy(super_admin_user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_update_public_group_taxonomy( super_admin_user, public_group_taxonomy ): accessible = public_group_taxonomy.is_accessible_by(super_admin_user, mode="update") assert accessible def test_super_admin_user_update_public_taxonomy(super_admin_user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(super_admin_user, mode="update") assert accessible def test_super_admin_user_delete_public_group_taxonomy( super_admin_user, public_group_taxonomy ): accessible = public_group_taxonomy.is_accessible_by(super_admin_user, mode="delete") assert accessible def test_super_admin_user_delete_public_taxonomy(super_admin_user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(super_admin_user, mode="delete") assert accessible def test_group_admin_user_create_public_group_taxonomy( group_admin_user, public_group_taxonomy ): accessible = public_group_taxonomy.is_accessible_by(group_admin_user, mode="create") assert accessible def test_group_admin_user_create_public_taxonomy(group_admin_user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(group_admin_user, mode="create") assert accessible def test_group_admin_user_read_public_group_taxonomy( group_admin_user, public_group_taxonomy ): accessible = public_group_taxonomy.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_read_public_taxonomy(group_admin_user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_update_public_group_taxonomy( group_admin_user, public_group_taxonomy ): accessible = public_group_taxonomy.is_accessible_by(group_admin_user, mode="update") assert accessible def test_group_admin_user_update_public_taxonomy(group_admin_user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(group_admin_user, mode="update") assert not accessible # need sysadmin def test_group_admin_user_delete_public_group_taxonomy( group_admin_user, public_group_taxonomy ): accessible = public_group_taxonomy.is_accessible_by(group_admin_user, mode="delete") assert accessible def test_group_admin_user_delete_public_taxonomy(group_admin_user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(group_admin_user, mode="delete") assert not accessible # need sysadmin def test_user_create_public_comment(user, public_comment): accessible = public_comment.is_accessible_by(user, mode="create") assert accessible def test_user_read_public_comment(user, public_comment): accessible = public_comment.is_accessible_by(user, mode="read") assert accessible def test_user_update_public_comment(user, public_comment): accessible = public_comment.is_accessible_by(user, mode="update") assert not accessible # must be comment author def test_user_delete_public_comment(user, public_comment): accessible = public_comment.is_accessible_by(user, mode="delete") assert not accessible # must be comment author def test_user_group2_create_public_comment(user_group2, public_comment): accessible = public_comment.is_accessible_by(user_group2, mode="create") assert accessible def test_user_group2_read_public_comment(user_group2, public_comment): accessible = public_comment.is_accessible_by(user_group2, mode="read") assert not accessible # must be a member of the comment's target groups def test_user_group2_update_public_comment(user_group2, public_comment): accessible = public_comment.is_accessible_by(user_group2, mode="update") assert not accessible # must be comment author def test_user_group2_delete_public_comment(user_group2, public_comment): accessible = public_comment.is_accessible_by(user_group2, mode="delete") assert not accessible # must be comment author def test_super_admin_user_create_public_comment(super_admin_user, public_comment): accessible = public_comment.is_accessible_by(super_admin_user, mode="create") assert accessible def test_super_admin_user_read_public_comment(super_admin_user, public_comment): accessible = public_comment.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_update_public_comment(super_admin_user, public_comment): accessible = public_comment.is_accessible_by(super_admin_user, mode="update") assert accessible def test_super_admin_user_delete_public_comment(super_admin_user, public_comment): accessible = public_comment.is_accessible_by(super_admin_user, mode="delete") assert accessible def test_group_admin_user_create_public_comment(group_admin_user, public_comment): accessible = public_comment.is_accessible_by(group_admin_user, mode="create") assert accessible def test_group_admin_user_read_public_comment(group_admin_user, public_comment): accessible = public_comment.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_update_public_comment(group_admin_user, public_comment): accessible = public_comment.is_accessible_by(group_admin_user, mode="update") assert not accessible # must be comment author def test_group_admin_user_delete_public_comment(group_admin_user, public_comment): accessible = public_comment.is_accessible_by(group_admin_user, mode="delete") assert not accessible # must be comment author def test_user_create_public_groupcomment(user, public_groupcomment): accessible = public_groupcomment.is_accessible_by(user, mode="create") assert accessible def test_user_read_public_groupcomment(user, public_groupcomment): accessible = public_groupcomment.is_accessible_by(user, mode="read") assert accessible def test_user_update_public_groupcomment(user, public_groupcomment): accessible = public_groupcomment.is_accessible_by(user, mode="update") assert not accessible # must be group admin def test_user_delete_public_groupcomment(user, public_groupcomment): accessible = public_groupcomment.is_accessible_by(user, mode="delete") assert not accessible # must be group admin def test_user_group2_create_public_groupcomment(user_group2, public_groupcomment): accessible = public_groupcomment.is_accessible_by(user_group2, mode="create") assert not accessible # must be able ot read the comment def test_user_group2_read_public_groupcomment(user_group2, public_groupcomment): accessible = public_groupcomment.is_accessible_by(user_group2, mode="read") assert not accessible # must be able to read the comment def test_user_group2_update_public_groupcomment(user_group2, public_groupcomment): accessible = public_groupcomment.is_accessible_by(user_group2, mode="update") assert not accessible # must be able to read the comment and be a group admin def test_user_group2_delete_public_groupcomment(user_group2, public_groupcomment): accessible = public_groupcomment.is_accessible_by(user_group2, mode="delete") assert not accessible # must be able ot read the comment and be a group admin def test_super_admin_user_create_public_groupcomment( super_admin_user, public_groupcomment ): accessible = public_groupcomment.is_accessible_by(super_admin_user, mode="create") assert accessible def test_super_admin_user_read_public_groupcomment( super_admin_user, public_groupcomment ): accessible = public_groupcomment.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_update_public_groupcomment( super_admin_user, public_groupcomment ): accessible = public_groupcomment.is_accessible_by(super_admin_user, mode="update") assert accessible def test_super_admin_user_delete_public_groupcomment( super_admin_user, public_groupcomment ): accessible = public_groupcomment.is_accessible_by(super_admin_user, mode="delete") assert accessible def test_group_admin_user_create_public_groupcomment( group_admin_user, public_groupcomment ): accessible = public_groupcomment.is_accessible_by(group_admin_user, mode="create") assert accessible def test_group_admin_user_read_public_groupcomment( group_admin_user, public_groupcomment ): accessible = public_groupcomment.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_update_public_groupcomment( group_admin_user, public_groupcomment ): accessible = public_groupcomment.is_accessible_by(group_admin_user, mode="update") assert accessible def test_group_admin_user_delete_public_groupcomment( group_admin_user, public_groupcomment ): accessible = public_groupcomment.is_accessible_by(group_admin_user, mode="delete") assert accessible def test_user_create_public_annotation(user, public_annotation): accessible = public_annotation.is_accessible_by(user, mode="create") assert accessible def test_user_read_public_annotation(user, public_annotation): accessible = public_annotation.is_accessible_by(user, mode="read") assert accessible def test_user_update_public_annotation(user, public_annotation): accessible = public_annotation.is_accessible_by(user, mode="update") assert not accessible # must be annotation author def test_user_delete_public_annotation(user, public_annotation): accessible = public_annotation.is_accessible_by(user, mode="delete") assert not accessible # must be annotation author def test_user_group2_create_public_annotation(user_group2, public_annotation): accessible = public_annotation.is_accessible_by(user_group2, mode="create") assert accessible def test_user_group2_read_public_annotation(user_group2, public_annotation): accessible = public_annotation.is_accessible_by(user_group2, mode="read") assert not accessible # must be a member of the annotation's target groups def test_user_group2_update_public_annotation(user_group2, public_annotation): accessible = public_annotation.is_accessible_by(user_group2, mode="update") assert not accessible # must be annotation author def test_user_group2_delete_public_annotation(user_group2, public_annotation): accessible = public_annotation.is_accessible_by(user_group2, mode="delete") assert not accessible # must be annotation author def test_super_admin_user_create_public_annotation(super_admin_user, public_annotation): accessible = public_annotation.is_accessible_by(super_admin_user, mode="create") assert accessible def test_super_admin_user_read_public_annotation(super_admin_user, public_annotation): accessible = public_annotation.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_update_public_annotation(super_admin_user, public_annotation): accessible = public_annotation.is_accessible_by(super_admin_user, mode="update") assert accessible def test_super_admin_user_delete_public_annotation(super_admin_user, public_annotation): accessible = public_annotation.is_accessible_by(super_admin_user, mode="delete") assert accessible def test_group_admin_user_create_public_annotation(group_admin_user, public_annotation): accessible = public_annotation.is_accessible_by(group_admin_user, mode="create") assert accessible def test_group_admin_user_read_public_annotation(group_admin_user, public_annotation): accessible = public_annotation.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_update_public_annotation(group_admin_user, public_annotation): accessible = public_annotation.is_accessible_by(group_admin_user, mode="update") assert not accessible # must be annotation author def test_group_admin_user_delete_public_annotation(group_admin_user, public_annotation): accessible = public_annotation.is_accessible_by(group_admin_user, mode="delete") assert not accessible # must be annotation author def test_user_create_public_groupannotation(user, public_groupannotation): accessible = public_groupannotation.is_accessible_by(user, mode="create") assert accessible def test_user_read_public_groupannotation(user, public_groupannotation): accessible = public_groupannotation.is_accessible_by(user, mode="read") assert accessible def test_user_update_public_groupannotation(user, public_groupannotation): accessible = public_groupannotation.is_accessible_by(user, mode="update") assert not accessible # must be group admin def test_user_delete_public_groupannotation(user, public_groupannotation): accessible = public_groupannotation.is_accessible_by(user, mode="delete") assert not accessible # must be group admin def test_user_group2_create_public_groupannotation(user_group2, public_groupannotation): accessible = public_groupannotation.is_accessible_by(user_group2, mode="create") assert not accessible # must be able ot read the annotation def test_user_group2_read_public_groupannotation(user_group2, public_groupannotation): accessible = public_groupannotation.is_accessible_by(user_group2, mode="read") assert not accessible # must be able to read the annotation def test_user_group2_update_public_groupannotation(user_group2, public_groupannotation): accessible = public_groupannotation.is_accessible_by(user_group2, mode="update") assert not accessible # must be able to read the annotation and be a group admin def test_user_group2_delete_public_groupannotation(user_group2, public_groupannotation): accessible = public_groupannotation.is_accessible_by(user_group2, mode="delete") assert not accessible # must be able ot read the annotation and be a group admin def test_super_admin_user_create_public_groupannotation( super_admin_user, public_groupannotation ): accessible = public_groupannotation.is_accessible_by( super_admin_user, mode="create" ) assert accessible def test_super_admin_user_read_public_groupannotation( super_admin_user, public_groupannotation ): accessible = public_groupannotation.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_update_public_groupannotation( super_admin_user, public_groupannotation ): accessible = public_groupannotation.is_accessible_by( super_admin_user, mode="update" ) assert accessible def test_super_admin_user_delete_public_groupannotation( super_admin_user, public_groupannotation ): accessible = public_groupannotation.is_accessible_by( super_admin_user, mode="delete" ) assert accessible def test_group_admin_user_create_public_groupannotation( group_admin_user, public_groupannotation ): accessible = public_groupannotation.is_accessible_by( group_admin_user, mode="create" ) assert accessible def test_group_admin_user_read_public_groupannotation( group_admin_user, public_groupannotation ): accessible = public_groupannotation.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_update_public_groupannotation( group_admin_user, public_groupannotation ): accessible = public_groupannotation.is_accessible_by( group_admin_user, mode="update" ) assert accessible def test_group_admin_user_delete_public_groupannotation( group_admin_user, public_groupannotation ): accessible = public_groupannotation.is_accessible_by( group_admin_user, mode="delete" ) assert accessible def test_user_create_public_classification(user, public_classification): accessible = public_classification.is_accessible_by(user, mode="create") assert accessible def test_user_read_public_classification(user, public_classification): accessible = public_classification.is_accessible_by(user, mode="read") assert accessible def test_user_update_public_classification(user, public_classification): accessible = public_classification.is_accessible_by(user, mode="update") assert not accessible # must be classification author def test_user_delete_public_classification(user, public_classification): accessible = public_classification.is_accessible_by(user, mode="delete") assert not accessible # must be classification author def test_user_group2_create_public_classification(user_group2, public_classification): accessible = public_classification.is_accessible_by(user_group2, mode="create") assert not accessible # need read access to underlying taxonomy def test_user_group2_read_public_classification(user_group2, public_classification): accessible = public_classification.is_accessible_by(user_group2, mode="read") assert not accessible # must be a member of the classification's target groups def test_user_group2_update_public_classification(user_group2, public_classification): accessible = public_classification.is_accessible_by(user_group2, mode="update") assert not accessible # must be classification author def test_user_group2_delete_public_classification(user_group2, public_classification): accessible = public_classification.is_accessible_by(user_group2, mode="delete") assert not accessible # must be classification author def test_super_admin_user_create_public_classification( super_admin_user, public_classification ): accessible = public_classification.is_accessible_by(super_admin_user, mode="create") assert accessible def test_super_admin_user_read_public_classification( super_admin_user, public_classification ): accessible = public_classification.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_update_public_classification( super_admin_user, public_classification ): accessible = public_classification.is_accessible_by(super_admin_user, mode="update") assert accessible def test_super_admin_user_delete_public_classification( super_admin_user, public_classification ): accessible = public_classification.is_accessible_by(super_admin_user, mode="delete") assert accessible def test_group_admin_user_create_public_classification( group_admin_user, public_classification ): accessible = public_classification.is_accessible_by(group_admin_user, mode="create") assert accessible def test_group_admin_user_read_public_classification( group_admin_user, public_classification ): accessible = public_classification.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_update_public_classification( group_admin_user, public_classification ): accessible = public_classification.is_accessible_by(group_admin_user, mode="update") assert not accessible # must be classification author def test_group_admin_user_delete_public_classification( group_admin_user, public_classification ): accessible = public_classification.is_accessible_by(group_admin_user, mode="delete") assert not accessible # must be classification author def test_user_create_public_groupclassification(user, public_groupclassification): accessible = public_groupclassification.is_accessible_by(user, mode="create") assert accessible def test_user_read_public_groupclassification(user, public_groupclassification): accessible = public_groupclassification.is_accessible_by(user, mode="read") assert accessible def test_user_update_public_groupclassification(user, public_groupclassification): accessible = public_groupclassification.is_accessible_by(user, mode="update") assert not accessible # must be group admin def test_user_delete_public_groupclassification(user, public_groupclassification): accessible = public_groupclassification.is_accessible_by(user, mode="delete") assert not accessible # must be group admin def test_user_group2_create_public_groupclassification( user_group2, public_groupclassification ): accessible = public_groupclassification.is_accessible_by(user_group2, mode="create") assert not accessible # must be able ot read the classification def test_user_group2_read_public_groupclassification( user_group2, public_groupclassification ): accessible = public_groupclassification.is_accessible_by(user_group2, mode="read") assert not accessible # must be able to read the classification def test_user_group2_update_public_groupclassification( user_group2, public_groupclassification ): accessible = public_groupclassification.is_accessible_by(user_group2, mode="update") assert ( not accessible ) # must be able to read the classification and be a group admin def test_user_group2_delete_public_groupclassification( user_group2, public_groupclassification ): accessible = public_groupclassification.is_accessible_by(user_group2, mode="delete") assert ( not accessible ) # must be able ot read the classification and be a group admin def test_super_admin_user_create_public_groupclassification( super_admin_user, public_groupclassification ): accessible = public_groupclassification.is_accessible_by( super_admin_user, mode="create" ) assert accessible def test_super_admin_user_read_public_groupclassification( super_admin_user, public_groupclassification ): accessible = public_groupclassification.is_accessible_by( super_admin_user, mode="read" ) assert accessible def test_super_admin_user_update_public_groupclassification( super_admin_user, public_groupclassification ): accessible = public_groupclassification.is_accessible_by( super_admin_user, mode="update" ) assert accessible def test_super_admin_user_delete_public_groupclassification( super_admin_user, public_groupclassification ): accessible = public_groupclassification.is_accessible_by( super_admin_user, mode="delete" ) assert accessible def test_group_admin_user_create_public_groupclassification( group_admin_user, public_groupclassification ): accessible = public_groupclassification.is_accessible_by( group_admin_user, mode="create" ) assert accessible def test_group_admin_user_read_public_groupclassification( group_admin_user, public_groupclassification ): accessible = public_groupclassification.is_accessible_by( group_admin_user, mode="read" ) assert accessible def test_group_admin_user_update_public_groupclassification( group_admin_user, public_groupclassification ): accessible = public_groupclassification.is_accessible_by( group_admin_user, mode="update" ) assert accessible def test_group_admin_user_delete_public_groupclassification( group_admin_user, public_groupclassification ): accessible = public_groupclassification.is_accessible_by( group_admin_user, mode="delete" ) assert accessible def test_user_create_public_source_photometry_point( user, public_source_photometry_point ): accessible = public_source_photometry_point.is_accessible_by(user, mode="create") assert accessible def test_user_create_public_source_groupphotometry(user, public_source_groupphotometry): accessible = public_source_groupphotometry.is_accessible_by(user, mode="create") assert accessible def test_user_read_public_source_photometry_point(user, public_source_photometry_point): accessible = public_source_photometry_point.is_accessible_by(user, mode="read") assert accessible def test_user_read_public_source_groupphotometry(user, public_source_groupphotometry): accessible = public_source_groupphotometry.is_accessible_by(user, mode="read") assert accessible def test_user_update_public_source_photometry_point( user, public_source_photometry_point ): accessible = public_source_photometry_point.is_accessible_by(user, mode="update") assert not accessible # only owner can update def test_user_update_public_source_groupphotometry(user, public_source_groupphotometry): accessible = public_source_groupphotometry.is_accessible_by(user, mode="update") assert not accessible # only accessible by group admin def test_user_delete_public_source_photometry_point( user, public_source_photometry_point ): accessible = public_source_photometry_point.is_accessible_by(user, mode="delete") assert not accessible # only accessible by owner def test_user_delete_public_source_groupphotometry(user, public_source_groupphotometry): accessible = public_source_groupphotometry.is_accessible_by(user, mode="delete") assert not accessible # only accessible by group admin def test_user_group2_create_public_source_photometry_point( user_group2, public_source_photometry_point ): accessible = public_source_photometry_point.is_accessible_by( user_group2, mode="create" ) assert accessible def test_user_group2_create_public_source_groupphotometry( user_group2, public_source_groupphotometry ): accessible = public_source_groupphotometry.is_accessible_by( user_group2, mode="create" ) assert not accessible # need read access to the underlying photometry def test_user_group2_read_public_source_photometry_point( user_group2, public_source_photometry_point ): accessible = public_source_photometry_point.is_accessible_by( user_group2, mode="read" ) assert not accessible # must be a member of one of the photometry's groups def test_user_group2_read_public_source_groupphotometry( user_group2, public_source_groupphotometry ): accessible = public_source_groupphotometry.is_accessible_by( user_group2, mode="read" ) assert not accessible # must be a member of one of the photometry's groups def test_user_group2_update_public_source_photometry_point( user_group2, public_source_photometry_point ): accessible = public_source_photometry_point.is_accessible_by( user_group2, mode="update" ) assert not accessible # must be photometry owner def test_user_group2_update_public_source_groupphotometry( user_group2, public_source_groupphotometry ): accessible = public_source_groupphotometry.is_accessible_by( user_group2, mode="update" ) assert not accessible # must be group admin def test_user_group2_delete_public_source_photometry_point( user_group2, public_source_photometry_point ): accessible = public_source_photometry_point.is_accessible_by( user_group2, mode="delete" ) assert not accessible # must be photometry owner def test_user_group2_delete_public_source_groupphotometry( user_group2, public_source_groupphotometry ): accessible = public_source_groupphotometry.is_accessible_by( user_group2, mode="delete" ) assert not accessible # must be group admin def test_super_admin_user_create_public_source_photometry_point( super_admin_user, public_source_photometry_point ): accessible = public_source_photometry_point.is_accessible_by( super_admin_user, mode="create" ) assert accessible def test_super_admin_user_create_public_source_groupphotometry( super_admin_user, public_source_groupphotometry ): accessible = public_source_groupphotometry.is_accessible_by( super_admin_user, mode="create" ) assert accessible def test_super_admin_user_read_public_source_photometry_point( super_admin_user, public_source_photometry_point ): accessible = public_source_photometry_point.is_accessible_by( super_admin_user, mode="read" ) assert accessible def test_super_admin_user_read_public_source_groupphotometry( super_admin_user, public_source_groupphotometry ): accessible = public_source_groupphotometry.is_accessible_by( super_admin_user, mode="read" ) assert accessible def test_super_admin_user_update_public_source_photometry_point( super_admin_user, public_source_photometry_point ): accessible = public_source_photometry_point.is_accessible_by( super_admin_user, mode="update" ) assert accessible def test_super_admin_user_update_public_source_groupphotometry( super_admin_user, public_source_groupphotometry ): accessible = public_source_groupphotometry.is_accessible_by( super_admin_user, mode="update" ) assert accessible def test_super_admin_user_delete_public_source_photometry_point( super_admin_user, public_source_photometry_point ): accessible = public_source_photometry_point.is_accessible_by( super_admin_user, mode="delete" ) assert accessible def test_super_admin_user_delete_public_source_groupphotometry( super_admin_user, public_source_groupphotometry ): accessible = public_source_groupphotometry.is_accessible_by( super_admin_user, mode="delete" ) assert accessible def test_group_admin_user_create_public_source_photometry_point( group_admin_user, public_source_photometry_point ): accessible = public_source_photometry_point.is_accessible_by( group_admin_user, mode="create" ) assert accessible def test_group_admin_user_create_public_source_groupphotometry( group_admin_user, public_source_groupphotometry ): accessible = public_source_groupphotometry.is_accessible_by( group_admin_user, mode="create" ) assert accessible def test_group_admin_user_read_public_source_photometry_point( group_admin_user, public_source_photometry_point ): accessible = public_source_photometry_point.is_accessible_by( group_admin_user, mode="read" ) assert accessible def test_group_admin_user_read_public_source_groupphotometry( group_admin_user, public_source_groupphotometry ): accessible = public_source_groupphotometry.is_accessible_by( group_admin_user, mode="read" ) assert accessible def test_group_admin_user_update_public_source_photometry_point( group_admin_user, public_source_photometry_point ): accessible = public_source_photometry_point.is_accessible_by( group_admin_user, mode="update" ) assert not accessible # must be photometry owner def test_group_admin_user_update_public_source_groupphotometry( group_admin_user, public_source_groupphotometry ): accessible = public_source_groupphotometry.is_accessible_by( group_admin_user, mode="update" ) assert accessible def test_group_admin_user_delete_public_source_photometry_point( group_admin_user, public_source_photometry_point ): accessible = public_source_photometry_point.is_accessible_by( group_admin_user, mode="delete" ) assert not accessible # must be photometry owner def test_group_admin_user_delete_public_source_groupphotometry( group_admin_user, public_source_groupphotometry ): accessible = public_source_groupphotometry.is_accessible_by( group_admin_user, mode="delete" ) assert accessible def test_user_create_public_source_spectrum(user, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(user, mode="create") assert accessible def test_user_create_public_source_groupspectrum(user, public_source_groupspectrum): accessible = public_source_groupspectrum.is_accessible_by(user, mode="create") assert accessible def test_user_read_public_source_spectrum(user, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(user, mode="read") assert accessible def test_user_read_public_source_groupspectrum(user, public_source_groupspectrum): accessible = public_source_groupspectrum.is_accessible_by(user, mode="read") assert accessible def test_user_update_public_source_spectrum(user, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(user, mode="update") assert not accessible # only owner can update def test_user_update_public_source_groupspectrum(user, public_source_groupspectrum): accessible = public_source_groupspectrum.is_accessible_by(user, mode="update") assert not accessible # only accessible by group admin def test_user_delete_public_source_spectrum(user, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(user, mode="delete") assert not accessible # only accessible by owner def test_user_delete_public_source_groupspectrum(user, public_source_groupspectrum): accessible = public_source_groupspectrum.is_accessible_by(user, mode="delete") assert not accessible # only accessible by group admin def test_user_group2_create_public_source_spectrum(user_group2, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(user_group2, mode="create") assert accessible def test_user_group2_create_public_source_groupspectrum( user_group2, public_source_groupspectrum ): accessible = public_source_groupspectrum.is_accessible_by( user_group2, mode="create" ) assert not accessible # need read access to the underlying spectrum def test_user_group2_read_public_source_spectrum(user_group2, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(user_group2, mode="read") assert not accessible # must be a member of one of the spectrum's groups def test_user_group2_read_public_source_groupspectrum( user_group2, public_source_groupspectrum ): accessible = public_source_groupspectrum.is_accessible_by(user_group2, mode="read") assert not accessible # must be a member of one of the spectrum's groups def test_user_group2_update_public_source_spectrum(user_group2, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(user_group2, mode="update") assert not accessible # must be spectrum owner def test_user_group2_update_public_source_groupspectrum( user_group2, public_source_groupspectrum ): accessible = public_source_groupspectrum.is_accessible_by( user_group2, mode="update" ) assert not accessible # must be group admin def test_user_group2_delete_public_source_spectrum(user_group2, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(user_group2, mode="delete") assert not accessible # must be spectrum owner def test_user_group2_delete_public_source_groupspectrum( user_group2, public_source_groupspectrum ): accessible = public_source_groupspectrum.is_accessible_by( user_group2, mode="delete" ) assert not accessible # must be group admin def test_super_admin_user_create_public_source_spectrum( super_admin_user, public_source_spectrum ): accessible = public_source_spectrum.is_accessible_by( super_admin_user, mode="create" ) assert accessible def test_super_admin_user_create_public_source_groupspectrum( super_admin_user, public_source_groupspectrum ): accessible = public_source_groupspectrum.is_accessible_by( super_admin_user, mode="create" ) assert accessible def test_super_admin_user_read_public_source_spectrum( super_admin_user, public_source_spectrum ): accessible = public_source_spectrum.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_read_public_source_groupspectrum( super_admin_user, public_source_groupspectrum ): accessible = public_source_groupspectrum.is_accessible_by( super_admin_user, mode="read" ) assert accessible def test_super_admin_user_update_public_source_spectrum( super_admin_user, public_source_spectrum ): accessible = public_source_spectrum.is_accessible_by( super_admin_user, mode="update" ) assert accessible def test_super_admin_user_update_public_source_groupspectrum( super_admin_user, public_source_groupspectrum ): accessible = public_source_groupspectrum.is_accessible_by( super_admin_user, mode="update" ) assert accessible def test_super_admin_user_delete_public_source_spectrum( super_admin_user, public_source_spectrum ): accessible = public_source_spectrum.is_accessible_by( super_admin_user, mode="delete" ) assert accessible def test_super_admin_user_delete_public_source_groupspectrum( super_admin_user, public_source_groupspectrum ): accessible = public_source_groupspectrum.is_accessible_by( super_admin_user, mode="delete" ) assert accessible def test_group_admin_user_create_public_source_spectrum( group_admin_user, public_source_spectrum ): accessible = public_source_spectrum.is_accessible_by( group_admin_user, mode="create" ) assert accessible def test_group_admin_user_create_public_source_groupspectrum( group_admin_user, public_source_groupspectrum ): accessible = public_source_groupspectrum.is_accessible_by( group_admin_user, mode="create" ) assert accessible def test_group_admin_user_read_public_source_spectrum( group_admin_user, public_source_spectrum ): accessible = public_source_spectrum.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_read_public_source_groupspectrum( group_admin_user, public_source_groupspectrum ): accessible = public_source_groupspectrum.is_accessible_by( group_admin_user, mode="read" ) assert accessible def test_group_admin_user_update_public_source_spectrum( group_admin_user, public_source_spectrum ): accessible = public_source_spectrum.is_accessible_by( group_admin_user, mode="update" ) assert not accessible # must be spectrum owner def test_group_admin_user_update_public_source_groupspectrum( group_admin_user, public_source_groupspectrum ): accessible = public_source_groupspectrum.is_accessible_by( group_admin_user, mode="update" ) assert accessible def test_group_admin_user_delete_public_source_spectrum( group_admin_user, public_source_spectrum ): accessible = public_source_spectrum.is_accessible_by( group_admin_user, mode="delete" ) assert not accessible # must be spectrum owner def test_group_admin_user_delete_public_source_groupspectrum( group_admin_user, public_source_groupspectrum ): accessible = public_source_groupspectrum.is_accessible_by( group_admin_user, mode="delete" ) assert accessible def test_user_create_public_source_followup_request( user, public_source_followup_request ): accessible = public_source_followup_request.is_accessible_by(user, mode="create") assert accessible def test_user_create_public_source_followup_request_target_group( user, public_source_followup_request_target_group ): accessible = public_source_followup_request_target_group.is_accessible_by( user, mode="create" ) assert accessible def test_user_read_public_source_followup_request(user, public_source_followup_request): accessible = public_source_followup_request.is_accessible_by(user, mode="read") assert accessible def test_user_read_public_source_followup_request_target_group( user, public_source_followup_request_target_group ): accessible = public_source_followup_request_target_group.is_accessible_by( user, mode="read" ) assert accessible def test_user_update_public_source_followup_request( user, public_source_followup_request ): accessible = public_source_followup_request.is_accessible_by(user, mode="update") assert accessible def test_user_update_public_source_followup_request_target_group( user, public_source_followup_request_target_group ): accessible = public_source_followup_request_target_group.is_accessible_by( user, mode="update" ) assert ( accessible # since this is the user that authored the request, otherwise false ) def test_user_delete_public_source_followup_request( user, public_source_followup_request ): accessible = public_source_followup_request.is_accessible_by(user, mode="delete") assert accessible def test_user_delete_public_source_followup_request_target_group( user, public_source_followup_request_target_group ): accessible = public_source_followup_request_target_group.is_accessible_by( user, mode="delete" ) assert accessible def test_user_group2_create_public_source_followup_request( user_group2, public_source_followup_request ): accessible = public_source_followup_request.is_accessible_by( user_group2, mode="create" ) assert not accessible # need access to the allocation def test_user_group2_create_public_source_followup_request_target_group( user_group2, public_source_followup_request_target_group ): accessible = public_source_followup_request_target_group.is_accessible_by( user_group2, mode="create" ) assert not accessible # need read access to target group def test_user_group2_read_public_source_followup_request( user_group2, public_source_followup_request ): accessible = public_source_followup_request.is_accessible_by( user_group2, mode="read" ) assert not accessible # not in the allocation's group def test_user_group2_read_public_source_followup_request_target_group( user_group2, public_source_followup_request_target_group ): accessible = public_source_followup_request_target_group.is_accessible_by( user_group2, mode="read" ) assert not accessible # need to be able to read the followup request def test_user_group2_update_public_source_followup_request( user_group2, public_source_followup_request ): accessible = public_source_followup_request.is_accessible_by( user_group2, mode="update" ) assert not accessible # must be in allocation group def test_user_group2_update_public_source_followup_request_target_group( user_group2, public_source_followup_request_target_group ): accessible = public_source_followup_request_target_group.is_accessible_by( user_group2, mode="update" ) assert not accessible # must be followup request requester def test_user_group2_delete_public_source_followup_request( user_group2, public_source_followup_request ): accessible = public_source_followup_request.is_accessible_by( user_group2, mode="delete" ) assert not accessible # must be in allocation group def test_user_group2_delete_public_source_followup_request_target_group( user_group2, public_source_followup_request_target_group ): accessible = public_source_followup_request_target_group.is_accessible_by( user_group2, mode="delete" ) assert not accessible # must be followup request requester def test_super_admin_user_create_public_source_followup_request( super_admin_user, public_source_followup_request ): accessible = public_source_followup_request.is_accessible_by( super_admin_user, mode="create" ) assert accessible def test_super_admin_user_create_public_source_followup_request_target_group( super_admin_user, public_source_followup_request_target_group ): accessible = public_source_followup_request_target_group.is_accessible_by( super_admin_user, mode="create" ) assert accessible def test_super_admin_user_read_public_source_followup_request( super_admin_user, public_source_followup_request ): accessible = public_source_followup_request.is_accessible_by( super_admin_user, mode="read" ) assert accessible def test_super_admin_user_read_public_source_followup_request_target_group( super_admin_user, public_source_followup_request_target_group ): accessible = public_source_followup_request_target_group.is_accessible_by( super_admin_user, mode="read" ) assert accessible def test_super_admin_user_update_public_source_followup_request( super_admin_user, public_source_followup_request ): accessible = public_source_followup_request.is_accessible_by( super_admin_user, mode="update" ) assert accessible def test_super_admin_user_update_public_source_followup_request_target_group( super_admin_user, public_source_followup_request_target_group ): accessible = public_source_followup_request_target_group.is_accessible_by( super_admin_user, mode="update" ) assert accessible def test_super_admin_user_delete_public_source_followup_request( super_admin_user, public_source_followup_request ): accessible = public_source_followup_request.is_accessible_by( super_admin_user, mode="delete" ) assert accessible def test_super_admin_user_delete_public_source_followup_request_target_group( super_admin_user, public_source_followup_request_target_group ): accessible = public_source_followup_request_target_group.is_accessible_by( super_admin_user, mode="delete" ) assert accessible def test_group_admin_user_create_public_source_followup_request( group_admin_user, public_source_followup_request ): accessible = public_source_followup_request.is_accessible_by( group_admin_user, mode="create" ) assert accessible def test_group_admin_user_create_public_source_followup_request_target_group( group_admin_user, public_source_followup_request_target_group ): accessible = public_source_followup_request_target_group.is_accessible_by( group_admin_user, mode="create" ) assert not accessible # must be followup request requester def test_group_admin_user_read_public_source_followup_request( group_admin_user, public_source_followup_request ): accessible = public_source_followup_request.is_accessible_by( group_admin_user, mode="read" ) assert accessible def test_group_admin_user_read_public_source_followup_request_target_group( group_admin_user, public_source_followup_request_target_group ): accessible = public_source_followup_request_target_group.is_accessible_by( group_admin_user, mode="read" ) assert accessible def test_group_admin_user_update_public_source_followup_request( group_admin_user, public_source_followup_request ): accessible = public_source_followup_request.is_accessible_by( group_admin_user, mode="update" ) assert accessible def test_group_admin_user_update_public_source_followup_request_target_group( group_admin_user, public_source_followup_request_target_group ): accessible = public_source_followup_request_target_group.is_accessible_by( group_admin_user, mode="update" ) assert not accessible # must be requester def test_group_admin_user_delete_public_source_followup_request( group_admin_user, public_source_followup_request ): accessible = public_source_followup_request.is_accessible_by( group_admin_user, mode="delete" ) assert accessible def test_group_admin_user_delete_public_source_followup_request_target_group( group_admin_user, public_source_followup_request_target_group ): accessible = public_source_followup_request_target_group.is_accessible_by( group_admin_user, mode="delete" ) assert not accessible # must be requester def test_user_create_public_thumbnail(user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(user, mode="create") assert accessible def test_user_read_public_thumbnail(user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(user, mode="read") assert accessible def test_user_update_public_thumbnail(user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(user, mode="update") assert not accessible # restricted def test_user_delete_public_thumbnail(user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(user, mode="delete") assert not accessible # restricted def test_user_group2_create_public_thumbnail(user_group2, public_thumbnail): accessible = public_thumbnail.is_accessible_by(user_group2, mode="create") assert accessible def test_user_group2_read_public_thumbnail(user_group2, public_thumbnail): accessible = public_thumbnail.is_accessible_by(user_group2, mode="read") assert accessible def test_user_group2_update_public_thumbnail(user_group2, public_thumbnail): accessible = public_thumbnail.is_accessible_by(user_group2, mode="update") assert not accessible # restricted def test_user_group2_delete_public_thumbnail(user_group2, public_thumbnail): accessible = public_thumbnail.is_accessible_by(user_group2, mode="delete") assert not accessible def test_super_admin_user_create_public_thumbnail(super_admin_user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(super_admin_user, mode="create") assert accessible def test_super_admin_user_read_public_thumbnail(super_admin_user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_update_public_thumbnail(super_admin_user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(super_admin_user, mode="update") assert accessible def test_super_admin_user_delete_public_thumbnail(super_admin_user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(super_admin_user, mode="delete") assert accessible def test_group_admin_user_create_public_thumbnail(group_admin_user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(group_admin_user, mode="create") assert accessible def test_group_admin_user_read_public_thumbnail(group_admin_user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_update_public_thumbnail(group_admin_user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(group_admin_user, mode="update") assert not accessible # need sysadmin def test_group_admin_user_delete_public_thumbnail(group_admin_user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(group_admin_user, mode="delete") assert not accessible # need sysadmin def test_user_create_red_transients_run(user, red_transients_run): accessible = red_transients_run.is_accessible_by(user, mode="create") assert accessible def test_user_read_red_transients_run(user, red_transients_run): accessible = red_transients_run.is_accessible_by(user, mode="read") assert accessible def test_user_update_red_transients_run(user, red_transients_run): accessible = red_transients_run.is_accessible_by(user, mode="update") assert accessible def test_user_delete_red_transients_run(user, red_transients_run): accessible = red_transients_run.is_accessible_by(user, mode="delete") assert accessible def test_user_group2_create_red_transients_run(user_group2, red_transients_run): accessible = red_transients_run.is_accessible_by(user_group2, mode="create") assert accessible def test_user_group2_read_red_transients_run(user_group2, red_transients_run): accessible = red_transients_run.is_accessible_by(user_group2, mode="read") assert accessible def test_user_group2_update_red_transients_run(user_group2, red_transients_run): accessible = red_transients_run.is_accessible_by(user_group2, mode="update") assert not accessible # must be owner def test_user_group2_delete_red_transients_run(user_group2, red_transients_run): accessible = red_transients_run.is_accessible_by(user_group2, mode="delete") assert not accessible # must be owner def test_super_admin_user_create_red_transients_run( super_admin_user, red_transients_run ): accessible = red_transients_run.is_accessible_by(super_admin_user, mode="create") assert accessible def test_super_admin_user_read_red_transients_run(super_admin_user, red_transients_run): accessible = red_transients_run.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_update_red_transients_run( super_admin_user, red_transients_run ): accessible = red_transients_run.is_accessible_by(super_admin_user, mode="update") assert accessible def test_super_admin_user_delete_red_transients_run( super_admin_user, red_transients_run ): accessible = red_transients_run.is_accessible_by(super_admin_user, mode="delete") assert accessible def test_group_admin_user_create_red_transients_run( group_admin_user, red_transients_run ): accessible = red_transients_run.is_accessible_by(group_admin_user, mode="create") assert accessible def test_group_admin_user_read_red_transients_run(group_admin_user, red_transients_run): accessible = red_transients_run.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_update_red_transients_run( group_admin_user, red_transients_run ): accessible = red_transients_run.is_accessible_by(group_admin_user, mode="update") assert not accessible # must be owner def test_group_admin_user_delete_red_transients_run( group_admin_user, red_transients_run ): accessible = red_transients_run.is_accessible_by(group_admin_user, mode="delete") assert not accessible # must be owner def test_user_create_problematic_assignment(user, problematic_assignment): accessible = problematic_assignment.is_accessible_by(user, mode="create") assert accessible def test_user_read_problematic_assignment(user, problematic_assignment): accessible = problematic_assignment.is_accessible_by(user, mode="read") assert accessible def test_user_update_problematic_assignment(user, problematic_assignment): accessible = problematic_assignment.is_accessible_by(user, mode="update") assert accessible def test_user_delete_problematic_assignment(user, problematic_assignment): accessible = problematic_assignment.is_accessible_by(user, mode="delete") assert accessible def test_user_group2_create_problematic_assignment(user_group2, problematic_assignment): accessible = problematic_assignment.is_accessible_by(user_group2, mode="create") assert accessible def test_user_group2_read_problematic_assignment(user_group2, problematic_assignment): accessible = problematic_assignment.is_accessible_by(user_group2, mode="read") assert accessible def test_user_group2_update_problematic_assignment(user_group2, problematic_assignment): accessible = problematic_assignment.is_accessible_by(user_group2, mode="update") assert accessible def test_user_group2_delete_problematic_assignment(user_group2, problematic_assignment): accessible = problematic_assignment.is_accessible_by(user_group2, mode="delete") assert accessible def test_super_admin_user_create_problematic_assignment( super_admin_user, problematic_assignment ): accessible = problematic_assignment.is_accessible_by( super_admin_user, mode="create" ) assert accessible def test_super_admin_user_read_problematic_assignment( super_admin_user, problematic_assignment ): accessible = problematic_assignment.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_update_problematic_assignment( super_admin_user, problematic_assignment ): accessible = problematic_assignment.is_accessible_by( super_admin_user, mode="update" ) assert accessible def test_super_admin_user_delete_problematic_assignment( super_admin_user, problematic_assignment ): accessible = problematic_assignment.is_accessible_by( super_admin_user, mode="delete" ) assert accessible def test_group_admin_user_create_problematic_assignment( group_admin_user, problematic_assignment ): accessible = problematic_assignment.is_accessible_by( group_admin_user, mode="create" ) assert accessible def test_group_admin_user_read_problematic_assignment( group_admin_user, problematic_assignment ): accessible = problematic_assignment.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_update_problematic_assignment( group_admin_user, problematic_assignment ): accessible = problematic_assignment.is_accessible_by( group_admin_user, mode="update" ) assert accessible def test_group_admin_user_delete_problematic_assignment( group_admin_user, problematic_assignment ): accessible = problematic_assignment.is_accessible_by( group_admin_user, mode="delete" ) assert accessible # These tests are commented out because they require email / twilio clients # to be set up, which is not done by default. """ def test_user_create_invitation(user, invitation): accessible = invitation.is_accessible_by(user, mode="create") assert accessible def test_user_read_invitation(user, invitation): accessible = invitation.is_accessible_by(user, mode="read") assert accessible def test_user_update_invitation(user, invitation): accessible = invitation.is_accessible_by(user, mode="update") assert accessible def test_user_delete_invitation(user, invitation): accessible = invitation.is_accessible_by(user, mode="delete") assert accessible def test_user_group2_create_invitation(user_group2, invitation): accessible = invitation.is_accessible_by(user_group2, mode="create") assert accessible def test_user_group2_read_invitation(user_group2, invitation): accessible = invitation.is_accessible_by(user_group2, mode="read") assert not accessible # must be the inviter def test_user_group2_update_invitation(user_group2, invitation): accessible = invitation.is_accessible_by(user_group2, mode="update") assert not accessible # must be the inviter def test_user_group2_delete_invitation(user_group2, invitation): accessible = invitation.is_accessible_by(user_group2, mode="delete") assert not accessible # must be the inviter def test_super_admin_user_create_invitation(super_admin_user, invitation): accessible = invitation.is_accessible_by(super_admin_user, mode="create") assert accessible def test_super_admin_user_read_invitation(super_admin_user, invitation): accessible = invitation.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_update_invitation(super_admin_user, invitation): accessible = invitation.is_accessible_by(super_admin_user, mode="update") assert accessible def test_super_admin_user_delete_invitation(super_admin_user, invitation): accessible = invitation.is_accessible_by(super_admin_user, mode="delete") assert accessible def test_group_admin_user_create_invitation(group_admin_user, invitation): accessible = invitation.is_accessible_by(group_admin_user, mode="create") assert accessible def test_group_admin_user_read_invitation(group_admin_user, invitation): accessible = invitation.is_accessible_by(group_admin_user, mode="read") assert not accessible # must be the inviter def test_group_admin_user_update_invitation(group_admin_user, invitation): accessible = invitation.is_accessible_by(group_admin_user, mode="update") assert not accessible # must be the inviter def test_group_admin_user_delete_invitation(group_admin_user, invitation): accessible = invitation.is_accessible_by(group_admin_user, mode="delete") assert not accessible # must be the inviter def test_user_create_public_source_notification(user, public_source_notification): accessible = public_source_notification.is_accessible_by(user, mode="create") assert accessible def test_user_read_public_source_notification(user, public_source_notification): accessible = public_source_notification.is_accessible_by(user, mode="read") assert accessible def test_user_update_public_source_notification(user, public_source_notification): accessible = public_source_notification.is_accessible_by(user, mode="update") assert not accessible # must be sender def test_user_delete_public_source_notification(user, public_source_notification): accessible = public_source_notification.is_accessible_by(user, mode="delete") assert not accessible # must be sender def test_user_group2_create_public_source_notification(user_group2, public_source_notification): accessible = public_source_notification.is_accessible_by(user_group2, mode="create") assert not accessible # must be member of all target groups def test_user_group2_read_public_source_notification(user_group2, public_source_notification): accessible = public_source_notification.is_accessible_by(user_group2, mode="read") assert not accessible # must be a member of at least one target group def test_user_group2_update_public_source_notification(user_group2, public_source_notification): accessible = public_source_notification.is_accessible_by(user_group2, mode="update") assert not accessible # must be notification sender def test_user_group2_delete_public_source_notification(user_group2, public_source_notification): accessible = public_source_notification.is_accessible_by(user_group2, mode="delete") assert not accessible # must be notification sender def test_super_admin_user_create_public_source_notification(super_admin_user, public_source_notification): accessible = public_source_notification.is_accessible_by(super_admin_user, mode="create") assert accessible def test_super_admin_user_read_public_source_notification(super_admin_user, public_source_notification): accessible = public_source_notification.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_update_public_source_notification(super_admin_user, public_source_notification): accessible = public_source_notification.is_accessible_by(super_admin_user, mode="update") assert accessible def test_super_admin_user_delete_public_source_notification(super_admin_user, public_source_notification): accessible = public_source_notification.is_accessible_by(super_admin_user, mode="delete") assert accessible def test_group_admin_user_create_public_source_notification(group_admin_user, public_source_notification): accessible = public_source_notification.is_accessible_by(group_admin_user, mode="create") assert accessible def test_group_admin_user_read_public_source_notification(group_admin_user, public_source_notification): accessible = public_source_notification.is_accessible_by(group_admin_user, mode="read") assert accessible def test_group_admin_user_update_public_source_notification(group_admin_user, public_source_notification): accessible = public_source_notification.is_accessible_by(group_admin_user, mode="update") assert accessible # must be notification sender def test_group_admin_user_delete_public_source_notification(group_admin_user, public_source_notification): accessible = public_source_notification.is_accessible_by(group_admin_user, mode="delete") assert accessible # must be notification sender """ def test_user_create_user_notification(user, user_notification): accessible = user_notification.is_accessible_by(user, mode="create") assert accessible def test_user_read_user_notification(user, user_notification): accessible = user_notification.is_accessible_by(user, mode="read") assert accessible def test_user_update_user_notification(user, user_notification): accessible = user_notification.is_accessible_by(user, mode="update") assert accessible def test_user_delete_user_notification(user, user_notification): accessible = user_notification.is_accessible_by(user, mode="delete") assert accessible def test_user_group2_create_user_notification(user_group2, user_notification): accessible = user_notification.is_accessible_by(user_group2, mode="create") assert accessible def test_user_group2_read_user_notification(user_group2, user_notification): accessible = user_notification.is_accessible_by(user_group2, mode="read") assert not accessible # must be target user def test_user_group2_update_user_notification(user_group2, user_notification): accessible = user_notification.is_accessible_by(user_group2, mode="update") assert not accessible # must be target user def test_user_group2_delete_user_notification(user_group2, user_notification): accessible = user_notification.is_accessible_by(user_group2, mode="delete") assert not accessible # must be target user def test_super_admin_user_create_user_notification(super_admin_user, user_notification): accessible = user_notification.is_accessible_by(super_admin_user, mode="create") assert accessible def test_super_admin_user_read_user_notification(super_admin_user, user_notification): accessible = user_notification.is_accessible_by(super_admin_user, mode="read") assert accessible def test_super_admin_user_update_user_notification(super_admin_user, user_notification): accessible = user_notification.is_accessible_by(super_admin_user, mode="update") assert accessible def test_super_admin_user_delete_user_notification(super_admin_user, user_notification): accessible = user_notification.is_accessible_by(super_admin_user, mode="delete") assert accessible def test_group_admin_user_create_user_notification(group_admin_user, user_notification): accessible = user_notification.is_accessible_by(group_admin_user, mode="create") assert accessible def test_group_admin_user_read_user_notification(group_admin_user, user_notification): accessible = user_notification.is_accessible_by(group_admin_user, mode="read") assert not accessible # must be target user def test_group_admin_user_update_user_notification(group_admin_user, user_notification): accessible = user_notification.is_accessible_by(group_admin_user, mode="update") assert not accessible # must be target user def test_group_admin_user_delete_user_notification(group_admin_user, user_notification): accessible = user_notification.is_accessible_by(group_admin_user, mode="delete") assert not accessible # must be target user
def test_user_create_public_group(user, public_group): accessible = public_group.is_accessible_by(user, mode='create') assert accessible def test_user_create_public_groupuser(user, public_groupuser): accessible = public_groupuser.is_accessible_by(user, mode='create') assert not accessible def test_user_create_public_stream(user, public_stream): accessible = public_stream.is_accessible_by(user, mode='create') assert not accessible def test_user_create_public_groupstream(user, public_groupstream): accessible = public_groupstream.is_accessible_by(user, mode='create') assert not accessible def test_user_create_public_streamuser(user, public_streamuser): accessible = public_streamuser.is_accessible_by(user, mode='create') assert not accessible def test_user_create_public_filter(user, public_filter): accessible = public_filter.is_accessible_by(user, mode='create') assert accessible def test_user_create_public_candidate_object(user, public_candidate_object): accessible = public_candidate_object.is_accessible_by(user, mode='create') assert accessible def test_user_create_public_source_object(user, public_source_object): accessible = public_source_object.is_accessible_by(user, mode='create') assert accessible def test_user_create_keck1_telescope(user, keck1_telescope): accessible = keck1_telescope.is_accessible_by(user, mode='create') assert accessible def test_user_create_sedm(user, sedm): accessible = sedm.is_accessible_by(user, mode='create') assert accessible def test_user_create_public_group_sedm_allocation(user, public_group_sedm_allocation): accessible = public_group_sedm_allocation.is_accessible_by(user, mode='create') assert accessible def test_user_read_public_group(user, public_group): accessible = public_group.is_accessible_by(user, mode='read') assert accessible def test_user_read_public_groupuser(user, public_groupuser): accessible = public_groupuser.is_accessible_by(user, mode='read') assert accessible def test_user_read_public_stream(user, public_stream): accessible = public_stream.is_accessible_by(user, mode='read') assert accessible def test_user_read_public_groupstream(user, public_groupstream): accessible = public_groupstream.is_accessible_by(user, mode='read') assert accessible def test_user_read_public_streamuser(user, public_streamuser): accessible = public_streamuser.is_accessible_by(user, mode='read') assert accessible def test_user_read_public_filter(user, public_filter): accessible = public_filter.is_accessible_by(user, mode='read') assert accessible def test_user_read_public_candidate_object(user, public_candidate_object): accessible = public_candidate_object.is_accessible_by(user, mode='read') assert accessible def test_user_read_public_source_object(user, public_source_object): accessible = public_source_object.is_accessible_by(user, mode='read') assert accessible def test_user_read_keck1_telescope(user, keck1_telescope): accessible = keck1_telescope.is_accessible_by(user, mode='read') assert accessible def test_user_read_sedm(user, sedm): accessible = sedm.is_accessible_by(user, mode='read') assert accessible def test_user_read_public_group_sedm_allocation(user, public_group_sedm_allocation): accessible = public_group_sedm_allocation.is_accessible_by(user, mode='read') assert accessible def test_user_update_public_group(user, public_group): accessible = public_group.is_accessible_by(user, mode='update') assert not accessible def test_user_update_public_groupuser(user, public_groupuser): accessible = public_groupuser.is_accessible_by(user, mode='update') assert not accessible def test_user_update_public_stream(user, public_stream): accessible = public_stream.is_accessible_by(user, mode='update') assert not accessible def test_user_update_public_groupstream(user, public_groupstream): accessible = public_groupstream.is_accessible_by(user, mode='update') assert not accessible def test_user_update_public_streamuser(user, public_streamuser): accessible = public_streamuser.is_accessible_by(user, mode='update') assert not accessible def test_user_update_public_filter(user, public_filter): accessible = public_filter.is_accessible_by(user, mode='update') assert accessible def test_user_update_public_candidate_object(user, public_candidate_object): accessible = public_candidate_object.is_accessible_by(user, mode='update') assert accessible def test_user_update_public_source_object(user, public_source_object): accessible = public_source_object.is_accessible_by(user, mode='update') assert accessible def test_user_update_keck1_telescope(user, keck1_telescope): accessible = keck1_telescope.is_accessible_by(user, mode='update') assert not accessible def test_user_update_sedm(user, sedm): accessible = sedm.is_accessible_by(user, mode='update') assert not accessible def test_user_update_public_group_sedm_allocation(user, public_group_sedm_allocation): accessible = public_group_sedm_allocation.is_accessible_by(user, mode='update') assert accessible def test_user_delete_public_group(user, public_group): accessible = public_group.is_accessible_by(user, mode='delete') assert not accessible def test_user_delete_public_groupuser(user, public_groupuser): accessible = public_groupuser.is_accessible_by(user, mode='delete') assert not accessible def test_user_delete_public_stream(user, public_stream): accessible = public_stream.is_accessible_by(user, mode='delete') assert not accessible def test_user_delete_public_groupstream(user, public_groupstream): accessible = public_groupstream.is_accessible_by(user, mode='delete') assert not accessible def test_user_delete_public_streamuser(user, public_streamuser): accessible = public_streamuser.is_accessible_by(user, mode='delete') assert not accessible def test_user_delete_public_filter(user, public_filter): accessible = public_filter.is_accessible_by(user, mode='delete') assert accessible def test_user_delete_public_candidate_object(user, public_candidate_object): accessible = public_candidate_object.is_accessible_by(user, mode='delete') assert accessible def test_user_delete_public_source_object(user, public_source_object): accessible = public_source_object.is_accessible_by(user, mode='delete') assert accessible def test_user_delete_keck1_telescope(user, keck1_telescope): accessible = keck1_telescope.is_accessible_by(user, mode='delete') assert not accessible def test_user_delete_sedm(user, sedm): accessible = sedm.is_accessible_by(user, mode='delete') assert not accessible def test_user_delete_public_group_sedm_allocation(user, public_group_sedm_allocation): accessible = public_group_sedm_allocation.is_accessible_by(user, mode='delete') assert accessible def test_user_group2_create_public_group(user_group2, public_group): accessible = public_group.is_accessible_by(user_group2, mode='create') assert accessible def test_user_group2_create_public_groupuser(user_group2, public_groupuser): accessible = public_groupuser.is_accessible_by(user_group2, mode='create') assert not accessible def test_user_group2_create_public_stream(user_group2, public_stream): accessible = public_stream.is_accessible_by(user_group2, mode='create') assert not accessible def test_user_group2_create_public_groupstream(user_group2, public_groupstream): accessible = public_groupstream.is_accessible_by(user_group2, mode='create') assert not accessible def test_user_group2_create_public_streamuser(user_group2, public_streamuser): accessible = public_streamuser.is_accessible_by(user_group2, mode='create') assert not accessible def test_user_group2_create_public_filter(user_group2, public_filter): accessible = public_filter.is_accessible_by(user_group2, mode='create') assert not accessible def test_user_group2_create_public_candidate_object(user_group2, public_candidate_object): accessible = public_candidate_object.is_accessible_by(user_group2, mode='create') assert not accessible def test_user_group2_create_public_source_object(user_group2, public_source_object): accessible = public_source_object.is_accessible_by(user_group2, mode='create') assert not accessible def test_user_group2_create_keck1_telescope(user_group2, keck1_telescope): accessible = keck1_telescope.is_accessible_by(user_group2, mode='create') assert accessible def test_user_group2_create_sedm(user_group2, sedm): accessible = sedm.is_accessible_by(user_group2, mode='create') assert accessible def test_user_group2_create_public_group_sedm_allocation(user_group2, public_group_sedm_allocation): accessible = public_group_sedm_allocation.is_accessible_by(user_group2, mode='create') assert not accessible def test_user_group2_read_public_group(user_group2, public_group): accessible = public_group.is_accessible_by(user_group2, mode='read') assert accessible def test_user_group2_read_public_groupuser(user_group2, public_groupuser): accessible = public_groupuser.is_accessible_by(user_group2, mode='read') assert accessible def test_user_group2_read_public_stream(user_group2, public_stream): accessible = public_stream.is_accessible_by(user_group2, mode='read') assert accessible def test_user_group2_read_public_groupstream(user_group2, public_groupstream): accessible = public_groupstream.is_accessible_by(user_group2, mode='read') assert accessible def test_user_group2_read_public_streamuser(user_group2, public_streamuser): accessible = public_streamuser.is_accessible_by(user_group2, mode='read') assert accessible == public_streamuser.user.is_accessible_by(user_group2, mode='read') and public_streamuser.stream.is_accessible_by(user_group2, mode='read') def test_user_group2_read_public_filter(user_group2, public_filter): accessible = public_filter.is_accessible_by(user_group2, mode='read') assert not accessible def test_user_group2_read_public_candidate_object(user_group2, public_candidate_object): accessible = public_candidate_object.is_accessible_by(user_group2, mode='read') assert not accessible def test_user_group2_read_public_source_object(user_group2, public_source_object): accessible = public_source_object.is_accessible_by(user_group2, mode='read') assert not accessible def test_user_group2_read_keck1_telescope(user_group2, keck1_telescope): accessible = keck1_telescope.is_accessible_by(user_group2, mode='read') assert accessible def test_user_group2_read_sedm(user_group2, sedm): accessible = sedm.is_accessible_by(user_group2, mode='read') assert accessible def test_user_group2_read_public_group_sedm_allocation(user_group2, public_group_sedm_allocation): accessible = public_group_sedm_allocation.is_accessible_by(user_group2, mode='read') assert not accessible def test_user_group2_update_public_group(user_group2, public_group): accessible = public_group.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_update_public_groupuser(user_group2, public_groupuser): accessible = public_groupuser.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_update_public_stream(user_group2, public_stream): accessible = public_stream.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_update_public_groupstream(user_group2, public_groupstream): accessible = public_groupstream.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_update_public_streamuser(user_group2, public_streamuser): accessible = public_streamuser.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_update_public_filter(user_group2, public_filter): accessible = public_filter.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_update_public_candidate_object(user_group2, public_candidate_object): accessible = public_candidate_object.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_update_public_source_object(user_group2, public_source_object): accessible = public_source_object.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_update_keck1_telescope(user_group2, keck1_telescope): accessible = keck1_telescope.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_update_sedm(user_group2, sedm): accessible = sedm.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_update_public_group_sedm_allocation(user_group2, public_group_sedm_allocation): accessible = public_group_sedm_allocation.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_delete_public_group(user_group2, public_group): accessible = public_group.is_accessible_by(user_group2, mode='delete') assert not accessible def test_user_group2_delete_public_groupuser(user_group2, public_groupuser): accessible = public_groupuser.is_accessible_by(user_group2, mode='delete') assert not accessible def test_user_group2_delete_public_stream(user_group2, public_stream): accessible = public_stream.is_accessible_by(user_group2, mode='delete') assert not accessible def test_user_group2_delete_public_groupstream(user_group2, public_groupstream): accessible = public_groupstream.is_accessible_by(user_group2, mode='delete') assert not accessible def test_user_group2_delete_public_streamuser(user_group2, public_streamuser): accessible = public_streamuser.is_accessible_by(user_group2, mode='delete') assert not accessible def test_user_group2_delete_public_filter(user_group2, public_filter): accessible = public_filter.is_accessible_by(user_group2, mode='delete') assert not accessible def test_user_group2_delete_public_candidate_object(user_group2, public_candidate_object): accessible = public_candidate_object.is_accessible_by(user_group2, mode='delete') assert not accessible def test_user_group2_delete_public_source_object(user_group2, public_source_object): accessible = public_source_object.is_accessible_by(user_group2, mode='delete') assert not accessible def test_user_group2_delete_keck1_telescope(user_group2, keck1_telescope): accessible = keck1_telescope.is_accessible_by(user_group2, mode='delete') assert not accessible def test_user_group2_delete_sedm(user_group2, sedm): accessible = sedm.is_accessible_by(user_group2, mode='delete') assert not accessible def test_user_group2_delete_public_group_sedm_allocation(user_group2, public_group_sedm_allocation): accessible = public_group_sedm_allocation.is_accessible_by(user_group2, mode='delete') assert not accessible def test_super_admin_user_create_public_group(super_admin_user, public_group): accessible = public_group.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_create_public_groupuser(super_admin_user, public_groupuser): accessible = public_groupuser.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_create_public_stream(super_admin_user, public_stream): accessible = public_stream.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_create_public_groupstream(super_admin_user, public_groupstream): accessible = public_groupstream.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_create_public_streamuser(super_admin_user, public_streamuser): accessible = public_streamuser.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_create_public_filter(super_admin_user, public_filter): accessible = public_filter.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_create_public_candidate_object(super_admin_user, public_candidate_object): accessible = public_candidate_object.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_create_public_source_object(super_admin_user, public_source_object): accessible = public_source_object.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_create_keck1_telescope(super_admin_user, keck1_telescope): accessible = keck1_telescope.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_create_sedm(super_admin_user, sedm): accessible = sedm.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_create_public_group_sedm_allocation(super_admin_user, public_group_sedm_allocation): accessible = public_group_sedm_allocation.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_read_public_group(super_admin_user, public_group): accessible = public_group.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_read_public_groupuser(super_admin_user, public_groupuser): accessible = public_groupuser.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_read_public_stream(super_admin_user, public_stream): accessible = public_stream.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_read_public_groupstream(super_admin_user, public_groupstream): accessible = public_groupstream.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_read_public_streamuser(super_admin_user, public_streamuser): accessible = public_streamuser.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_read_public_filter(super_admin_user, public_filter): accessible = public_filter.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_read_public_candidate_object(super_admin_user, public_candidate_object): accessible = public_candidate_object.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_read_public_source_object(super_admin_user, public_source_object): accessible = public_source_object.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_read_keck1_telescope(super_admin_user, keck1_telescope): accessible = keck1_telescope.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_read_sedm(super_admin_user, sedm): accessible = sedm.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_read_public_group_sedm_allocation(super_admin_user, public_group_sedm_allocation): accessible = public_group_sedm_allocation.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_update_public_group(super_admin_user, public_group): accessible = public_group.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_update_public_groupuser(super_admin_user, public_groupuser): accessible = public_groupuser.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_update_public_stream(super_admin_user, public_stream): accessible = public_stream.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_update_public_groupstream(super_admin_user, public_groupstream): accessible = public_groupstream.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_update_public_streamuser(super_admin_user, public_streamuser): accessible = public_streamuser.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_update_public_filter(super_admin_user, public_filter): accessible = public_filter.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_update_public_candidate_object(super_admin_user, public_candidate_object): accessible = public_candidate_object.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_update_public_source_object(super_admin_user, public_source_object): accessible = public_source_object.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_update_keck1_telescope(super_admin_user, keck1_telescope): accessible = keck1_telescope.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_update_sedm(super_admin_user, sedm): accessible = sedm.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_update_public_group_sedm_allocation(super_admin_user, public_group_sedm_allocation): accessible = public_group_sedm_allocation.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_delete_public_group(super_admin_user, public_group): accessible = public_group.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_super_admin_user_delete_public_groupuser(super_admin_user, public_groupuser): accessible = public_groupuser.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_super_admin_user_delete_public_stream(super_admin_user, public_stream): accessible = public_stream.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_super_admin_user_delete_public_groupstream(super_admin_user, public_groupstream): accessible = public_groupstream.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_super_admin_user_delete_public_streamuser(super_admin_user, public_streamuser): accessible = public_streamuser.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_super_admin_user_delete_public_filter(super_admin_user, public_filter): accessible = public_filter.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_super_admin_user_delete_public_candidate_object(super_admin_user, public_candidate_object): accessible = public_candidate_object.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_super_admin_user_delete_public_source_object(super_admin_user, public_source_object): accessible = public_source_object.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_super_admin_user_delete_keck1_telescope(super_admin_user, keck1_telescope): accessible = keck1_telescope.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_super_admin_user_delete_sedm(super_admin_user, sedm): accessible = sedm.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_super_admin_user_delete_public_group_sedm_allocation(super_admin_user, public_group_sedm_allocation): accessible = public_group_sedm_allocation.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_group_admin_user_create_public_group(group_admin_user, public_group): accessible = public_group.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_create_public_groupuser(group_admin_user, public_groupuser): accessible = public_groupuser.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_create_public_stream(group_admin_user, public_stream): accessible = public_stream.is_accessible_by(group_admin_user, mode='create') assert not accessible def test_group_admin_user_create_public_groupstream(group_admin_user, public_groupstream): accessible = public_groupstream.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_create_public_streamuser(group_admin_user, public_streamuser): accessible = public_streamuser.is_accessible_by(group_admin_user, mode='create') assert not accessible def test_group_admin_user_create_public_filter(group_admin_user, public_filter): accessible = public_filter.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_create_public_candidate_object(group_admin_user, public_candidate_object): accessible = public_candidate_object.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_create_public_source_object(group_admin_user, public_source_object): accessible = public_source_object.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_create_keck1_telescope(group_admin_user, keck1_telescope): accessible = keck1_telescope.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_create_sedm(group_admin_user, sedm): accessible = sedm.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_create_public_group_sedm_allocation(group_admin_user, public_group_sedm_allocation): accessible = public_group_sedm_allocation.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_read_public_group(group_admin_user, public_group): accessible = public_group.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_read_public_groupuser(group_admin_user, public_groupuser): accessible = public_groupuser.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_read_public_stream(group_admin_user, public_stream): accessible = public_stream.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_read_public_groupstream(group_admin_user, public_groupstream): accessible = public_groupstream.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_read_public_streamuser(group_admin_user, public_streamuser): accessible = public_streamuser.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_read_public_filter(group_admin_user, public_filter): accessible = public_filter.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_read_public_candidate_object(group_admin_user, public_candidate_object): accessible = public_candidate_object.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_read_public_source_object(group_admin_user, public_source_object): accessible = public_source_object.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_read_keck1_telescope(group_admin_user, keck1_telescope): accessible = keck1_telescope.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_read_sedm(group_admin_user, sedm): accessible = sedm.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_read_public_group_sedm_allocation(group_admin_user, public_group_sedm_allocation): accessible = public_group_sedm_allocation.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_update_public_group(group_admin_user, public_group): accessible = public_group.is_accessible_by(group_admin_user, mode='update') assert accessible def test_group_admin_user_update_public_groupuser(group_admin_user, public_groupuser): accessible = public_groupuser.is_accessible_by(group_admin_user, mode='update') assert accessible def test_group_admin_user_update_public_stream(group_admin_user, public_stream): accessible = public_stream.is_accessible_by(group_admin_user, mode='update') assert not accessible def test_group_admin_user_update_public_groupstream(group_admin_user, public_groupstream): accessible = public_groupstream.is_accessible_by(group_admin_user, mode='update') assert accessible def test_group_admin_user_update_public_streamuser(group_admin_user, public_streamuser): accessible = public_streamuser.is_accessible_by(group_admin_user, mode='update') assert not accessible def test_group_admin_user_update_public_filter(group_admin_user, public_filter): accessible = public_filter.is_accessible_by(group_admin_user, mode='update') assert accessible def test_group_admin_user_update_public_candidate_object(group_admin_user, public_candidate_object): accessible = public_candidate_object.is_accessible_by(group_admin_user, mode='update') assert accessible def test_group_admin_user_update_public_source_object(group_admin_user, public_source_object): accessible = public_source_object.is_accessible_by(group_admin_user, mode='update') assert accessible def test_group_admin_user_update_keck1_telescope(group_admin_user, keck1_telescope): accessible = keck1_telescope.is_accessible_by(group_admin_user, mode='update') assert not accessible def test_group_admin_user_update_sedm(group_admin_user, sedm): accessible = sedm.is_accessible_by(group_admin_user, mode='update') assert not accessible def test_group_admin_user_update_public_group_sedm_allocation(group_admin_user, public_group_sedm_allocation): accessible = public_group_sedm_allocation.is_accessible_by(group_admin_user, mode='update') assert accessible def test_group_admin_user_delete_public_group(group_admin_user, public_group): accessible = public_group.is_accessible_by(group_admin_user, mode='delete') assert accessible def test_group_admin_user_delete_public_groupuser(group_admin_user, public_groupuser): accessible = public_groupuser.is_accessible_by(group_admin_user, mode='delete') assert accessible def test_group_admin_user_delete_public_stream(group_admin_user, public_stream): accessible = public_stream.is_accessible_by(group_admin_user, mode='delete') assert not accessible def test_group_admin_user_delete_public_groupstream(group_admin_user, public_groupstream): accessible = public_groupstream.is_accessible_by(group_admin_user, mode='delete') assert accessible def test_group_admin_user_delete_public_streamuser(group_admin_user, public_streamuser): accessible = public_streamuser.is_accessible_by(group_admin_user, mode='delete') assert not accessible def test_group_admin_user_delete_public_filter(group_admin_user, public_filter): accessible = public_filter.is_accessible_by(group_admin_user, mode='delete') assert accessible def test_group_admin_user_delete_public_candidate_object(group_admin_user, public_candidate_object): accessible = public_candidate_object.is_accessible_by(group_admin_user, mode='delete') assert accessible def test_group_admin_user_delete_public_source_object(group_admin_user, public_source_object): accessible = public_source_object.is_accessible_by(group_admin_user, mode='delete') assert accessible def test_group_admin_user_delete_keck1_telescope(group_admin_user, keck1_telescope): accessible = keck1_telescope.is_accessible_by(group_admin_user, mode='delete') assert not accessible def test_group_admin_user_delete_sedm(group_admin_user, sedm): accessible = sedm.is_accessible_by(group_admin_user, mode='delete') assert not accessible def test_group_admin_user_delete_public_group_sedm_allocation(group_admin_user, public_group_sedm_allocation): accessible = public_group_sedm_allocation.is_accessible_by(group_admin_user, mode='delete') assert accessible def test_user_create_public_group_taxonomy(user, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(user, mode='create') assert accessible def test_user_create_public_taxonomy(user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(user, mode='create') assert accessible def test_user_read_public_group_taxonomy(user, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(user, mode='read') assert accessible def test_user_read_public_taxonomy(user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(user, mode='read') assert accessible def test_user_update_public_group_taxonomy(user, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(user, mode='update') assert not accessible def test_user_update_public_taxonomy(user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(user, mode='update') assert not accessible def test_user_delete_public_group_taxonomy(user, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(user, mode='delete') assert not accessible def test_user_delete_public_taxonomy(user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(user, mode='delete') assert not accessible def test_user_group2_create_public_group_taxonomy(user_group2, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(user_group2, mode='create') assert not accessible def test_user_group2_create_public_taxonomy(user_group2, public_taxonomy): accessible = public_taxonomy.is_accessible_by(user_group2, mode='create') assert accessible def test_user_group2_read_public_group_taxonomy(user_group2, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(user_group2, mode='read') assert not accessible def test_user_group2_read_public_taxonomy(user_group2, public_taxonomy): accessible = public_taxonomy.is_accessible_by(user_group2, mode='read') assert not accessible def test_user_group2_update_public_group_taxonomy(user_group2, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_update_public_taxonomy(user_group2, public_taxonomy): accessible = public_taxonomy.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_delete_public_group_taxonomy(user_group2, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(user_group2, mode='delete') assert not accessible def test_user_group2_delete_public_taxonomy(user_group2, public_taxonomy): accessible = public_taxonomy.is_accessible_by(user_group2, mode='delete') assert not accessible def test_super_admin_user_create_public_group_taxonomy(super_admin_user, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_create_public_taxonomy(super_admin_user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_read_public_group_taxonomy(super_admin_user, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_read_public_taxonomy(super_admin_user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_update_public_group_taxonomy(super_admin_user, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_update_public_taxonomy(super_admin_user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_delete_public_group_taxonomy(super_admin_user, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_super_admin_user_delete_public_taxonomy(super_admin_user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_group_admin_user_create_public_group_taxonomy(group_admin_user, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_create_public_taxonomy(group_admin_user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_read_public_group_taxonomy(group_admin_user, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_read_public_taxonomy(group_admin_user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_update_public_group_taxonomy(group_admin_user, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(group_admin_user, mode='update') assert accessible def test_group_admin_user_update_public_taxonomy(group_admin_user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(group_admin_user, mode='update') assert not accessible def test_group_admin_user_delete_public_group_taxonomy(group_admin_user, public_group_taxonomy): accessible = public_group_taxonomy.is_accessible_by(group_admin_user, mode='delete') assert accessible def test_group_admin_user_delete_public_taxonomy(group_admin_user, public_taxonomy): accessible = public_taxonomy.is_accessible_by(group_admin_user, mode='delete') assert not accessible def test_user_create_public_comment(user, public_comment): accessible = public_comment.is_accessible_by(user, mode='create') assert accessible def test_user_read_public_comment(user, public_comment): accessible = public_comment.is_accessible_by(user, mode='read') assert accessible def test_user_update_public_comment(user, public_comment): accessible = public_comment.is_accessible_by(user, mode='update') assert not accessible def test_user_delete_public_comment(user, public_comment): accessible = public_comment.is_accessible_by(user, mode='delete') assert not accessible def test_user_group2_create_public_comment(user_group2, public_comment): accessible = public_comment.is_accessible_by(user_group2, mode='create') assert accessible def test_user_group2_read_public_comment(user_group2, public_comment): accessible = public_comment.is_accessible_by(user_group2, mode='read') assert not accessible def test_user_group2_update_public_comment(user_group2, public_comment): accessible = public_comment.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_delete_public_comment(user_group2, public_comment): accessible = public_comment.is_accessible_by(user_group2, mode='delete') assert not accessible def test_super_admin_user_create_public_comment(super_admin_user, public_comment): accessible = public_comment.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_read_public_comment(super_admin_user, public_comment): accessible = public_comment.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_update_public_comment(super_admin_user, public_comment): accessible = public_comment.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_delete_public_comment(super_admin_user, public_comment): accessible = public_comment.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_group_admin_user_create_public_comment(group_admin_user, public_comment): accessible = public_comment.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_read_public_comment(group_admin_user, public_comment): accessible = public_comment.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_update_public_comment(group_admin_user, public_comment): accessible = public_comment.is_accessible_by(group_admin_user, mode='update') assert not accessible def test_group_admin_user_delete_public_comment(group_admin_user, public_comment): accessible = public_comment.is_accessible_by(group_admin_user, mode='delete') assert not accessible def test_user_create_public_groupcomment(user, public_groupcomment): accessible = public_groupcomment.is_accessible_by(user, mode='create') assert accessible def test_user_read_public_groupcomment(user, public_groupcomment): accessible = public_groupcomment.is_accessible_by(user, mode='read') assert accessible def test_user_update_public_groupcomment(user, public_groupcomment): accessible = public_groupcomment.is_accessible_by(user, mode='update') assert not accessible def test_user_delete_public_groupcomment(user, public_groupcomment): accessible = public_groupcomment.is_accessible_by(user, mode='delete') assert not accessible def test_user_group2_create_public_groupcomment(user_group2, public_groupcomment): accessible = public_groupcomment.is_accessible_by(user_group2, mode='create') assert not accessible def test_user_group2_read_public_groupcomment(user_group2, public_groupcomment): accessible = public_groupcomment.is_accessible_by(user_group2, mode='read') assert not accessible def test_user_group2_update_public_groupcomment(user_group2, public_groupcomment): accessible = public_groupcomment.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_delete_public_groupcomment(user_group2, public_groupcomment): accessible = public_groupcomment.is_accessible_by(user_group2, mode='delete') assert not accessible def test_super_admin_user_create_public_groupcomment(super_admin_user, public_groupcomment): accessible = public_groupcomment.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_read_public_groupcomment(super_admin_user, public_groupcomment): accessible = public_groupcomment.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_update_public_groupcomment(super_admin_user, public_groupcomment): accessible = public_groupcomment.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_delete_public_groupcomment(super_admin_user, public_groupcomment): accessible = public_groupcomment.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_group_admin_user_create_public_groupcomment(group_admin_user, public_groupcomment): accessible = public_groupcomment.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_read_public_groupcomment(group_admin_user, public_groupcomment): accessible = public_groupcomment.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_update_public_groupcomment(group_admin_user, public_groupcomment): accessible = public_groupcomment.is_accessible_by(group_admin_user, mode='update') assert accessible def test_group_admin_user_delete_public_groupcomment(group_admin_user, public_groupcomment): accessible = public_groupcomment.is_accessible_by(group_admin_user, mode='delete') assert accessible def test_user_create_public_annotation(user, public_annotation): accessible = public_annotation.is_accessible_by(user, mode='create') assert accessible def test_user_read_public_annotation(user, public_annotation): accessible = public_annotation.is_accessible_by(user, mode='read') assert accessible def test_user_update_public_annotation(user, public_annotation): accessible = public_annotation.is_accessible_by(user, mode='update') assert not accessible def test_user_delete_public_annotation(user, public_annotation): accessible = public_annotation.is_accessible_by(user, mode='delete') assert not accessible def test_user_group2_create_public_annotation(user_group2, public_annotation): accessible = public_annotation.is_accessible_by(user_group2, mode='create') assert accessible def test_user_group2_read_public_annotation(user_group2, public_annotation): accessible = public_annotation.is_accessible_by(user_group2, mode='read') assert not accessible def test_user_group2_update_public_annotation(user_group2, public_annotation): accessible = public_annotation.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_delete_public_annotation(user_group2, public_annotation): accessible = public_annotation.is_accessible_by(user_group2, mode='delete') assert not accessible def test_super_admin_user_create_public_annotation(super_admin_user, public_annotation): accessible = public_annotation.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_read_public_annotation(super_admin_user, public_annotation): accessible = public_annotation.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_update_public_annotation(super_admin_user, public_annotation): accessible = public_annotation.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_delete_public_annotation(super_admin_user, public_annotation): accessible = public_annotation.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_group_admin_user_create_public_annotation(group_admin_user, public_annotation): accessible = public_annotation.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_read_public_annotation(group_admin_user, public_annotation): accessible = public_annotation.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_update_public_annotation(group_admin_user, public_annotation): accessible = public_annotation.is_accessible_by(group_admin_user, mode='update') assert not accessible def test_group_admin_user_delete_public_annotation(group_admin_user, public_annotation): accessible = public_annotation.is_accessible_by(group_admin_user, mode='delete') assert not accessible def test_user_create_public_groupannotation(user, public_groupannotation): accessible = public_groupannotation.is_accessible_by(user, mode='create') assert accessible def test_user_read_public_groupannotation(user, public_groupannotation): accessible = public_groupannotation.is_accessible_by(user, mode='read') assert accessible def test_user_update_public_groupannotation(user, public_groupannotation): accessible = public_groupannotation.is_accessible_by(user, mode='update') assert not accessible def test_user_delete_public_groupannotation(user, public_groupannotation): accessible = public_groupannotation.is_accessible_by(user, mode='delete') assert not accessible def test_user_group2_create_public_groupannotation(user_group2, public_groupannotation): accessible = public_groupannotation.is_accessible_by(user_group2, mode='create') assert not accessible def test_user_group2_read_public_groupannotation(user_group2, public_groupannotation): accessible = public_groupannotation.is_accessible_by(user_group2, mode='read') assert not accessible def test_user_group2_update_public_groupannotation(user_group2, public_groupannotation): accessible = public_groupannotation.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_delete_public_groupannotation(user_group2, public_groupannotation): accessible = public_groupannotation.is_accessible_by(user_group2, mode='delete') assert not accessible def test_super_admin_user_create_public_groupannotation(super_admin_user, public_groupannotation): accessible = public_groupannotation.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_read_public_groupannotation(super_admin_user, public_groupannotation): accessible = public_groupannotation.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_update_public_groupannotation(super_admin_user, public_groupannotation): accessible = public_groupannotation.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_delete_public_groupannotation(super_admin_user, public_groupannotation): accessible = public_groupannotation.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_group_admin_user_create_public_groupannotation(group_admin_user, public_groupannotation): accessible = public_groupannotation.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_read_public_groupannotation(group_admin_user, public_groupannotation): accessible = public_groupannotation.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_update_public_groupannotation(group_admin_user, public_groupannotation): accessible = public_groupannotation.is_accessible_by(group_admin_user, mode='update') assert accessible def test_group_admin_user_delete_public_groupannotation(group_admin_user, public_groupannotation): accessible = public_groupannotation.is_accessible_by(group_admin_user, mode='delete') assert accessible def test_user_create_public_classification(user, public_classification): accessible = public_classification.is_accessible_by(user, mode='create') assert accessible def test_user_read_public_classification(user, public_classification): accessible = public_classification.is_accessible_by(user, mode='read') assert accessible def test_user_update_public_classification(user, public_classification): accessible = public_classification.is_accessible_by(user, mode='update') assert not accessible def test_user_delete_public_classification(user, public_classification): accessible = public_classification.is_accessible_by(user, mode='delete') assert not accessible def test_user_group2_create_public_classification(user_group2, public_classification): accessible = public_classification.is_accessible_by(user_group2, mode='create') assert not accessible def test_user_group2_read_public_classification(user_group2, public_classification): accessible = public_classification.is_accessible_by(user_group2, mode='read') assert not accessible def test_user_group2_update_public_classification(user_group2, public_classification): accessible = public_classification.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_delete_public_classification(user_group2, public_classification): accessible = public_classification.is_accessible_by(user_group2, mode='delete') assert not accessible def test_super_admin_user_create_public_classification(super_admin_user, public_classification): accessible = public_classification.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_read_public_classification(super_admin_user, public_classification): accessible = public_classification.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_update_public_classification(super_admin_user, public_classification): accessible = public_classification.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_delete_public_classification(super_admin_user, public_classification): accessible = public_classification.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_group_admin_user_create_public_classification(group_admin_user, public_classification): accessible = public_classification.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_read_public_classification(group_admin_user, public_classification): accessible = public_classification.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_update_public_classification(group_admin_user, public_classification): accessible = public_classification.is_accessible_by(group_admin_user, mode='update') assert not accessible def test_group_admin_user_delete_public_classification(group_admin_user, public_classification): accessible = public_classification.is_accessible_by(group_admin_user, mode='delete') assert not accessible def test_user_create_public_groupclassification(user, public_groupclassification): accessible = public_groupclassification.is_accessible_by(user, mode='create') assert accessible def test_user_read_public_groupclassification(user, public_groupclassification): accessible = public_groupclassification.is_accessible_by(user, mode='read') assert accessible def test_user_update_public_groupclassification(user, public_groupclassification): accessible = public_groupclassification.is_accessible_by(user, mode='update') assert not accessible def test_user_delete_public_groupclassification(user, public_groupclassification): accessible = public_groupclassification.is_accessible_by(user, mode='delete') assert not accessible def test_user_group2_create_public_groupclassification(user_group2, public_groupclassification): accessible = public_groupclassification.is_accessible_by(user_group2, mode='create') assert not accessible def test_user_group2_read_public_groupclassification(user_group2, public_groupclassification): accessible = public_groupclassification.is_accessible_by(user_group2, mode='read') assert not accessible def test_user_group2_update_public_groupclassification(user_group2, public_groupclassification): accessible = public_groupclassification.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_delete_public_groupclassification(user_group2, public_groupclassification): accessible = public_groupclassification.is_accessible_by(user_group2, mode='delete') assert not accessible def test_super_admin_user_create_public_groupclassification(super_admin_user, public_groupclassification): accessible = public_groupclassification.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_read_public_groupclassification(super_admin_user, public_groupclassification): accessible = public_groupclassification.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_update_public_groupclassification(super_admin_user, public_groupclassification): accessible = public_groupclassification.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_delete_public_groupclassification(super_admin_user, public_groupclassification): accessible = public_groupclassification.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_group_admin_user_create_public_groupclassification(group_admin_user, public_groupclassification): accessible = public_groupclassification.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_read_public_groupclassification(group_admin_user, public_groupclassification): accessible = public_groupclassification.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_update_public_groupclassification(group_admin_user, public_groupclassification): accessible = public_groupclassification.is_accessible_by(group_admin_user, mode='update') assert accessible def test_group_admin_user_delete_public_groupclassification(group_admin_user, public_groupclassification): accessible = public_groupclassification.is_accessible_by(group_admin_user, mode='delete') assert accessible def test_user_create_public_source_photometry_point(user, public_source_photometry_point): accessible = public_source_photometry_point.is_accessible_by(user, mode='create') assert accessible def test_user_create_public_source_groupphotometry(user, public_source_groupphotometry): accessible = public_source_groupphotometry.is_accessible_by(user, mode='create') assert accessible def test_user_read_public_source_photometry_point(user, public_source_photometry_point): accessible = public_source_photometry_point.is_accessible_by(user, mode='read') assert accessible def test_user_read_public_source_groupphotometry(user, public_source_groupphotometry): accessible = public_source_groupphotometry.is_accessible_by(user, mode='read') assert accessible def test_user_update_public_source_photometry_point(user, public_source_photometry_point): accessible = public_source_photometry_point.is_accessible_by(user, mode='update') assert not accessible def test_user_update_public_source_groupphotometry(user, public_source_groupphotometry): accessible = public_source_groupphotometry.is_accessible_by(user, mode='update') assert not accessible def test_user_delete_public_source_photometry_point(user, public_source_photometry_point): accessible = public_source_photometry_point.is_accessible_by(user, mode='delete') assert not accessible def test_user_delete_public_source_groupphotometry(user, public_source_groupphotometry): accessible = public_source_groupphotometry.is_accessible_by(user, mode='delete') assert not accessible def test_user_group2_create_public_source_photometry_point(user_group2, public_source_photometry_point): accessible = public_source_photometry_point.is_accessible_by(user_group2, mode='create') assert accessible def test_user_group2_create_public_source_groupphotometry(user_group2, public_source_groupphotometry): accessible = public_source_groupphotometry.is_accessible_by(user_group2, mode='create') assert not accessible def test_user_group2_read_public_source_photometry_point(user_group2, public_source_photometry_point): accessible = public_source_photometry_point.is_accessible_by(user_group2, mode='read') assert not accessible def test_user_group2_read_public_source_groupphotometry(user_group2, public_source_groupphotometry): accessible = public_source_groupphotometry.is_accessible_by(user_group2, mode='read') assert not accessible def test_user_group2_update_public_source_photometry_point(user_group2, public_source_photometry_point): accessible = public_source_photometry_point.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_update_public_source_groupphotometry(user_group2, public_source_groupphotometry): accessible = public_source_groupphotometry.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_delete_public_source_photometry_point(user_group2, public_source_photometry_point): accessible = public_source_photometry_point.is_accessible_by(user_group2, mode='delete') assert not accessible def test_user_group2_delete_public_source_groupphotometry(user_group2, public_source_groupphotometry): accessible = public_source_groupphotometry.is_accessible_by(user_group2, mode='delete') assert not accessible def test_super_admin_user_create_public_source_photometry_point(super_admin_user, public_source_photometry_point): accessible = public_source_photometry_point.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_create_public_source_groupphotometry(super_admin_user, public_source_groupphotometry): accessible = public_source_groupphotometry.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_read_public_source_photometry_point(super_admin_user, public_source_photometry_point): accessible = public_source_photometry_point.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_read_public_source_groupphotometry(super_admin_user, public_source_groupphotometry): accessible = public_source_groupphotometry.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_update_public_source_photometry_point(super_admin_user, public_source_photometry_point): accessible = public_source_photometry_point.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_update_public_source_groupphotometry(super_admin_user, public_source_groupphotometry): accessible = public_source_groupphotometry.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_delete_public_source_photometry_point(super_admin_user, public_source_photometry_point): accessible = public_source_photometry_point.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_super_admin_user_delete_public_source_groupphotometry(super_admin_user, public_source_groupphotometry): accessible = public_source_groupphotometry.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_group_admin_user_create_public_source_photometry_point(group_admin_user, public_source_photometry_point): accessible = public_source_photometry_point.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_create_public_source_groupphotometry(group_admin_user, public_source_groupphotometry): accessible = public_source_groupphotometry.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_read_public_source_photometry_point(group_admin_user, public_source_photometry_point): accessible = public_source_photometry_point.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_read_public_source_groupphotometry(group_admin_user, public_source_groupphotometry): accessible = public_source_groupphotometry.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_update_public_source_photometry_point(group_admin_user, public_source_photometry_point): accessible = public_source_photometry_point.is_accessible_by(group_admin_user, mode='update') assert not accessible def test_group_admin_user_update_public_source_groupphotometry(group_admin_user, public_source_groupphotometry): accessible = public_source_groupphotometry.is_accessible_by(group_admin_user, mode='update') assert accessible def test_group_admin_user_delete_public_source_photometry_point(group_admin_user, public_source_photometry_point): accessible = public_source_photometry_point.is_accessible_by(group_admin_user, mode='delete') assert not accessible def test_group_admin_user_delete_public_source_groupphotometry(group_admin_user, public_source_groupphotometry): accessible = public_source_groupphotometry.is_accessible_by(group_admin_user, mode='delete') assert accessible def test_user_create_public_source_spectrum(user, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(user, mode='create') assert accessible def test_user_create_public_source_groupspectrum(user, public_source_groupspectrum): accessible = public_source_groupspectrum.is_accessible_by(user, mode='create') assert accessible def test_user_read_public_source_spectrum(user, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(user, mode='read') assert accessible def test_user_read_public_source_groupspectrum(user, public_source_groupspectrum): accessible = public_source_groupspectrum.is_accessible_by(user, mode='read') assert accessible def test_user_update_public_source_spectrum(user, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(user, mode='update') assert not accessible def test_user_update_public_source_groupspectrum(user, public_source_groupspectrum): accessible = public_source_groupspectrum.is_accessible_by(user, mode='update') assert not accessible def test_user_delete_public_source_spectrum(user, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(user, mode='delete') assert not accessible def test_user_delete_public_source_groupspectrum(user, public_source_groupspectrum): accessible = public_source_groupspectrum.is_accessible_by(user, mode='delete') assert not accessible def test_user_group2_create_public_source_spectrum(user_group2, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(user_group2, mode='create') assert accessible def test_user_group2_create_public_source_groupspectrum(user_group2, public_source_groupspectrum): accessible = public_source_groupspectrum.is_accessible_by(user_group2, mode='create') assert not accessible def test_user_group2_read_public_source_spectrum(user_group2, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(user_group2, mode='read') assert not accessible def test_user_group2_read_public_source_groupspectrum(user_group2, public_source_groupspectrum): accessible = public_source_groupspectrum.is_accessible_by(user_group2, mode='read') assert not accessible def test_user_group2_update_public_source_spectrum(user_group2, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_update_public_source_groupspectrum(user_group2, public_source_groupspectrum): accessible = public_source_groupspectrum.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_delete_public_source_spectrum(user_group2, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(user_group2, mode='delete') assert not accessible def test_user_group2_delete_public_source_groupspectrum(user_group2, public_source_groupspectrum): accessible = public_source_groupspectrum.is_accessible_by(user_group2, mode='delete') assert not accessible def test_super_admin_user_create_public_source_spectrum(super_admin_user, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_create_public_source_groupspectrum(super_admin_user, public_source_groupspectrum): accessible = public_source_groupspectrum.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_read_public_source_spectrum(super_admin_user, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_read_public_source_groupspectrum(super_admin_user, public_source_groupspectrum): accessible = public_source_groupspectrum.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_update_public_source_spectrum(super_admin_user, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_update_public_source_groupspectrum(super_admin_user, public_source_groupspectrum): accessible = public_source_groupspectrum.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_delete_public_source_spectrum(super_admin_user, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_super_admin_user_delete_public_source_groupspectrum(super_admin_user, public_source_groupspectrum): accessible = public_source_groupspectrum.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_group_admin_user_create_public_source_spectrum(group_admin_user, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_create_public_source_groupspectrum(group_admin_user, public_source_groupspectrum): accessible = public_source_groupspectrum.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_read_public_source_spectrum(group_admin_user, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_read_public_source_groupspectrum(group_admin_user, public_source_groupspectrum): accessible = public_source_groupspectrum.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_update_public_source_spectrum(group_admin_user, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(group_admin_user, mode='update') assert not accessible def test_group_admin_user_update_public_source_groupspectrum(group_admin_user, public_source_groupspectrum): accessible = public_source_groupspectrum.is_accessible_by(group_admin_user, mode='update') assert accessible def test_group_admin_user_delete_public_source_spectrum(group_admin_user, public_source_spectrum): accessible = public_source_spectrum.is_accessible_by(group_admin_user, mode='delete') assert not accessible def test_group_admin_user_delete_public_source_groupspectrum(group_admin_user, public_source_groupspectrum): accessible = public_source_groupspectrum.is_accessible_by(group_admin_user, mode='delete') assert accessible def test_user_create_public_source_followup_request(user, public_source_followup_request): accessible = public_source_followup_request.is_accessible_by(user, mode='create') assert accessible def test_user_create_public_source_followup_request_target_group(user, public_source_followup_request_target_group): accessible = public_source_followup_request_target_group.is_accessible_by(user, mode='create') assert accessible def test_user_read_public_source_followup_request(user, public_source_followup_request): accessible = public_source_followup_request.is_accessible_by(user, mode='read') assert accessible def test_user_read_public_source_followup_request_target_group(user, public_source_followup_request_target_group): accessible = public_source_followup_request_target_group.is_accessible_by(user, mode='read') assert accessible def test_user_update_public_source_followup_request(user, public_source_followup_request): accessible = public_source_followup_request.is_accessible_by(user, mode='update') assert accessible def test_user_update_public_source_followup_request_target_group(user, public_source_followup_request_target_group): accessible = public_source_followup_request_target_group.is_accessible_by(user, mode='update') assert accessible def test_user_delete_public_source_followup_request(user, public_source_followup_request): accessible = public_source_followup_request.is_accessible_by(user, mode='delete') assert accessible def test_user_delete_public_source_followup_request_target_group(user, public_source_followup_request_target_group): accessible = public_source_followup_request_target_group.is_accessible_by(user, mode='delete') assert accessible def test_user_group2_create_public_source_followup_request(user_group2, public_source_followup_request): accessible = public_source_followup_request.is_accessible_by(user_group2, mode='create') assert not accessible def test_user_group2_create_public_source_followup_request_target_group(user_group2, public_source_followup_request_target_group): accessible = public_source_followup_request_target_group.is_accessible_by(user_group2, mode='create') assert not accessible def test_user_group2_read_public_source_followup_request(user_group2, public_source_followup_request): accessible = public_source_followup_request.is_accessible_by(user_group2, mode='read') assert not accessible def test_user_group2_read_public_source_followup_request_target_group(user_group2, public_source_followup_request_target_group): accessible = public_source_followup_request_target_group.is_accessible_by(user_group2, mode='read') assert not accessible def test_user_group2_update_public_source_followup_request(user_group2, public_source_followup_request): accessible = public_source_followup_request.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_update_public_source_followup_request_target_group(user_group2, public_source_followup_request_target_group): accessible = public_source_followup_request_target_group.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_delete_public_source_followup_request(user_group2, public_source_followup_request): accessible = public_source_followup_request.is_accessible_by(user_group2, mode='delete') assert not accessible def test_user_group2_delete_public_source_followup_request_target_group(user_group2, public_source_followup_request_target_group): accessible = public_source_followup_request_target_group.is_accessible_by(user_group2, mode='delete') assert not accessible def test_super_admin_user_create_public_source_followup_request(super_admin_user, public_source_followup_request): accessible = public_source_followup_request.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_create_public_source_followup_request_target_group(super_admin_user, public_source_followup_request_target_group): accessible = public_source_followup_request_target_group.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_read_public_source_followup_request(super_admin_user, public_source_followup_request): accessible = public_source_followup_request.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_read_public_source_followup_request_target_group(super_admin_user, public_source_followup_request_target_group): accessible = public_source_followup_request_target_group.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_update_public_source_followup_request(super_admin_user, public_source_followup_request): accessible = public_source_followup_request.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_update_public_source_followup_request_target_group(super_admin_user, public_source_followup_request_target_group): accessible = public_source_followup_request_target_group.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_delete_public_source_followup_request(super_admin_user, public_source_followup_request): accessible = public_source_followup_request.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_super_admin_user_delete_public_source_followup_request_target_group(super_admin_user, public_source_followup_request_target_group): accessible = public_source_followup_request_target_group.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_group_admin_user_create_public_source_followup_request(group_admin_user, public_source_followup_request): accessible = public_source_followup_request.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_create_public_source_followup_request_target_group(group_admin_user, public_source_followup_request_target_group): accessible = public_source_followup_request_target_group.is_accessible_by(group_admin_user, mode='create') assert not accessible def test_group_admin_user_read_public_source_followup_request(group_admin_user, public_source_followup_request): accessible = public_source_followup_request.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_read_public_source_followup_request_target_group(group_admin_user, public_source_followup_request_target_group): accessible = public_source_followup_request_target_group.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_update_public_source_followup_request(group_admin_user, public_source_followup_request): accessible = public_source_followup_request.is_accessible_by(group_admin_user, mode='update') assert accessible def test_group_admin_user_update_public_source_followup_request_target_group(group_admin_user, public_source_followup_request_target_group): accessible = public_source_followup_request_target_group.is_accessible_by(group_admin_user, mode='update') assert not accessible def test_group_admin_user_delete_public_source_followup_request(group_admin_user, public_source_followup_request): accessible = public_source_followup_request.is_accessible_by(group_admin_user, mode='delete') assert accessible def test_group_admin_user_delete_public_source_followup_request_target_group(group_admin_user, public_source_followup_request_target_group): accessible = public_source_followup_request_target_group.is_accessible_by(group_admin_user, mode='delete') assert not accessible def test_user_create_public_thumbnail(user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(user, mode='create') assert accessible def test_user_read_public_thumbnail(user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(user, mode='read') assert accessible def test_user_update_public_thumbnail(user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(user, mode='update') assert not accessible def test_user_delete_public_thumbnail(user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(user, mode='delete') assert not accessible def test_user_group2_create_public_thumbnail(user_group2, public_thumbnail): accessible = public_thumbnail.is_accessible_by(user_group2, mode='create') assert accessible def test_user_group2_read_public_thumbnail(user_group2, public_thumbnail): accessible = public_thumbnail.is_accessible_by(user_group2, mode='read') assert accessible def test_user_group2_update_public_thumbnail(user_group2, public_thumbnail): accessible = public_thumbnail.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_delete_public_thumbnail(user_group2, public_thumbnail): accessible = public_thumbnail.is_accessible_by(user_group2, mode='delete') assert not accessible def test_super_admin_user_create_public_thumbnail(super_admin_user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_read_public_thumbnail(super_admin_user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_update_public_thumbnail(super_admin_user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_delete_public_thumbnail(super_admin_user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_group_admin_user_create_public_thumbnail(group_admin_user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_read_public_thumbnail(group_admin_user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_update_public_thumbnail(group_admin_user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(group_admin_user, mode='update') assert not accessible def test_group_admin_user_delete_public_thumbnail(group_admin_user, public_thumbnail): accessible = public_thumbnail.is_accessible_by(group_admin_user, mode='delete') assert not accessible def test_user_create_red_transients_run(user, red_transients_run): accessible = red_transients_run.is_accessible_by(user, mode='create') assert accessible def test_user_read_red_transients_run(user, red_transients_run): accessible = red_transients_run.is_accessible_by(user, mode='read') assert accessible def test_user_update_red_transients_run(user, red_transients_run): accessible = red_transients_run.is_accessible_by(user, mode='update') assert accessible def test_user_delete_red_transients_run(user, red_transients_run): accessible = red_transients_run.is_accessible_by(user, mode='delete') assert accessible def test_user_group2_create_red_transients_run(user_group2, red_transients_run): accessible = red_transients_run.is_accessible_by(user_group2, mode='create') assert accessible def test_user_group2_read_red_transients_run(user_group2, red_transients_run): accessible = red_transients_run.is_accessible_by(user_group2, mode='read') assert accessible def test_user_group2_update_red_transients_run(user_group2, red_transients_run): accessible = red_transients_run.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_delete_red_transients_run(user_group2, red_transients_run): accessible = red_transients_run.is_accessible_by(user_group2, mode='delete') assert not accessible def test_super_admin_user_create_red_transients_run(super_admin_user, red_transients_run): accessible = red_transients_run.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_read_red_transients_run(super_admin_user, red_transients_run): accessible = red_transients_run.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_update_red_transients_run(super_admin_user, red_transients_run): accessible = red_transients_run.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_delete_red_transients_run(super_admin_user, red_transients_run): accessible = red_transients_run.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_group_admin_user_create_red_transients_run(group_admin_user, red_transients_run): accessible = red_transients_run.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_read_red_transients_run(group_admin_user, red_transients_run): accessible = red_transients_run.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_update_red_transients_run(group_admin_user, red_transients_run): accessible = red_transients_run.is_accessible_by(group_admin_user, mode='update') assert not accessible def test_group_admin_user_delete_red_transients_run(group_admin_user, red_transients_run): accessible = red_transients_run.is_accessible_by(group_admin_user, mode='delete') assert not accessible def test_user_create_problematic_assignment(user, problematic_assignment): accessible = problematic_assignment.is_accessible_by(user, mode='create') assert accessible def test_user_read_problematic_assignment(user, problematic_assignment): accessible = problematic_assignment.is_accessible_by(user, mode='read') assert accessible def test_user_update_problematic_assignment(user, problematic_assignment): accessible = problematic_assignment.is_accessible_by(user, mode='update') assert accessible def test_user_delete_problematic_assignment(user, problematic_assignment): accessible = problematic_assignment.is_accessible_by(user, mode='delete') assert accessible def test_user_group2_create_problematic_assignment(user_group2, problematic_assignment): accessible = problematic_assignment.is_accessible_by(user_group2, mode='create') assert accessible def test_user_group2_read_problematic_assignment(user_group2, problematic_assignment): accessible = problematic_assignment.is_accessible_by(user_group2, mode='read') assert accessible def test_user_group2_update_problematic_assignment(user_group2, problematic_assignment): accessible = problematic_assignment.is_accessible_by(user_group2, mode='update') assert accessible def test_user_group2_delete_problematic_assignment(user_group2, problematic_assignment): accessible = problematic_assignment.is_accessible_by(user_group2, mode='delete') assert accessible def test_super_admin_user_create_problematic_assignment(super_admin_user, problematic_assignment): accessible = problematic_assignment.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_read_problematic_assignment(super_admin_user, problematic_assignment): accessible = problematic_assignment.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_update_problematic_assignment(super_admin_user, problematic_assignment): accessible = problematic_assignment.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_delete_problematic_assignment(super_admin_user, problematic_assignment): accessible = problematic_assignment.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_group_admin_user_create_problematic_assignment(group_admin_user, problematic_assignment): accessible = problematic_assignment.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_read_problematic_assignment(group_admin_user, problematic_assignment): accessible = problematic_assignment.is_accessible_by(group_admin_user, mode='read') assert accessible def test_group_admin_user_update_problematic_assignment(group_admin_user, problematic_assignment): accessible = problematic_assignment.is_accessible_by(group_admin_user, mode='update') assert accessible def test_group_admin_user_delete_problematic_assignment(group_admin_user, problematic_assignment): accessible = problematic_assignment.is_accessible_by(group_admin_user, mode='delete') assert accessible '\ndef test_user_create_invitation(user, invitation):\n accessible = invitation.is_accessible_by(user, mode="create")\n assert accessible\ndef test_user_read_invitation(user, invitation):\n accessible = invitation.is_accessible_by(user, mode="read")\n assert accessible\ndef test_user_update_invitation(user, invitation):\n accessible = invitation.is_accessible_by(user, mode="update")\n assert accessible\ndef test_user_delete_invitation(user, invitation):\n accessible = invitation.is_accessible_by(user, mode="delete")\n assert accessible\ndef test_user_group2_create_invitation(user_group2, invitation):\n accessible = invitation.is_accessible_by(user_group2, mode="create")\n assert accessible\ndef test_user_group2_read_invitation(user_group2, invitation):\n accessible = invitation.is_accessible_by(user_group2, mode="read")\n assert not accessible # must be the inviter\ndef test_user_group2_update_invitation(user_group2, invitation):\n accessible = invitation.is_accessible_by(user_group2, mode="update")\n assert not accessible # must be the inviter\ndef test_user_group2_delete_invitation(user_group2, invitation):\n accessible = invitation.is_accessible_by(user_group2, mode="delete")\n assert not accessible # must be the inviter\ndef test_super_admin_user_create_invitation(super_admin_user, invitation):\n accessible = invitation.is_accessible_by(super_admin_user, mode="create")\n assert accessible\ndef test_super_admin_user_read_invitation(super_admin_user, invitation):\n accessible = invitation.is_accessible_by(super_admin_user, mode="read")\n assert accessible\ndef test_super_admin_user_update_invitation(super_admin_user, invitation):\n accessible = invitation.is_accessible_by(super_admin_user, mode="update")\n assert accessible\ndef test_super_admin_user_delete_invitation(super_admin_user, invitation):\n accessible = invitation.is_accessible_by(super_admin_user, mode="delete")\n assert accessible\n\ndef test_group_admin_user_create_invitation(group_admin_user, invitation):\n accessible = invitation.is_accessible_by(group_admin_user, mode="create")\n assert accessible\ndef test_group_admin_user_read_invitation(group_admin_user, invitation):\n accessible = invitation.is_accessible_by(group_admin_user, mode="read")\n assert not accessible # must be the inviter\ndef test_group_admin_user_update_invitation(group_admin_user, invitation):\n accessible = invitation.is_accessible_by(group_admin_user, mode="update")\n assert not accessible # must be the inviter\ndef test_group_admin_user_delete_invitation(group_admin_user, invitation):\n accessible = invitation.is_accessible_by(group_admin_user, mode="delete")\n assert not accessible # must be the inviter\n\n\ndef test_user_create_public_source_notification(user, public_source_notification):\n accessible = public_source_notification.is_accessible_by(user, mode="create")\n assert accessible\ndef test_user_read_public_source_notification(user, public_source_notification):\n accessible = public_source_notification.is_accessible_by(user, mode="read")\n assert accessible\ndef test_user_update_public_source_notification(user, public_source_notification):\n accessible = public_source_notification.is_accessible_by(user, mode="update")\n assert not accessible # must be sender\ndef test_user_delete_public_source_notification(user, public_source_notification):\n accessible = public_source_notification.is_accessible_by(user, mode="delete")\n assert not accessible # must be sender\ndef test_user_group2_create_public_source_notification(user_group2, public_source_notification):\n accessible = public_source_notification.is_accessible_by(user_group2, mode="create")\n assert not accessible # must be member of all target groups\ndef test_user_group2_read_public_source_notification(user_group2, public_source_notification):\n accessible = public_source_notification.is_accessible_by(user_group2, mode="read")\n assert not accessible # must be a member of at least one target group\ndef test_user_group2_update_public_source_notification(user_group2, public_source_notification):\n accessible = public_source_notification.is_accessible_by(user_group2, mode="update")\n assert not accessible # must be notification sender\ndef test_user_group2_delete_public_source_notification(user_group2, public_source_notification):\n accessible = public_source_notification.is_accessible_by(user_group2, mode="delete")\n assert not accessible # must be notification sender\ndef test_super_admin_user_create_public_source_notification(super_admin_user, public_source_notification):\n accessible = public_source_notification.is_accessible_by(super_admin_user, mode="create")\n assert accessible\ndef test_super_admin_user_read_public_source_notification(super_admin_user, public_source_notification):\n accessible = public_source_notification.is_accessible_by(super_admin_user, mode="read")\n assert accessible\ndef test_super_admin_user_update_public_source_notification(super_admin_user, public_source_notification):\n accessible = public_source_notification.is_accessible_by(super_admin_user, mode="update")\n assert accessible\ndef test_super_admin_user_delete_public_source_notification(super_admin_user, public_source_notification):\n accessible = public_source_notification.is_accessible_by(super_admin_user, mode="delete")\n assert accessible\ndef test_group_admin_user_create_public_source_notification(group_admin_user, public_source_notification):\n accessible = public_source_notification.is_accessible_by(group_admin_user, mode="create")\n assert accessible\ndef test_group_admin_user_read_public_source_notification(group_admin_user, public_source_notification):\n accessible = public_source_notification.is_accessible_by(group_admin_user, mode="read")\n assert accessible\ndef test_group_admin_user_update_public_source_notification(group_admin_user, public_source_notification):\n accessible = public_source_notification.is_accessible_by(group_admin_user, mode="update")\n assert accessible # must be notification sender\ndef test_group_admin_user_delete_public_source_notification(group_admin_user, public_source_notification):\n accessible = public_source_notification.is_accessible_by(group_admin_user, mode="delete")\n assert accessible # must be notification sender\n' def test_user_create_user_notification(user, user_notification): accessible = user_notification.is_accessible_by(user, mode='create') assert accessible def test_user_read_user_notification(user, user_notification): accessible = user_notification.is_accessible_by(user, mode='read') assert accessible def test_user_update_user_notification(user, user_notification): accessible = user_notification.is_accessible_by(user, mode='update') assert accessible def test_user_delete_user_notification(user, user_notification): accessible = user_notification.is_accessible_by(user, mode='delete') assert accessible def test_user_group2_create_user_notification(user_group2, user_notification): accessible = user_notification.is_accessible_by(user_group2, mode='create') assert accessible def test_user_group2_read_user_notification(user_group2, user_notification): accessible = user_notification.is_accessible_by(user_group2, mode='read') assert not accessible def test_user_group2_update_user_notification(user_group2, user_notification): accessible = user_notification.is_accessible_by(user_group2, mode='update') assert not accessible def test_user_group2_delete_user_notification(user_group2, user_notification): accessible = user_notification.is_accessible_by(user_group2, mode='delete') assert not accessible def test_super_admin_user_create_user_notification(super_admin_user, user_notification): accessible = user_notification.is_accessible_by(super_admin_user, mode='create') assert accessible def test_super_admin_user_read_user_notification(super_admin_user, user_notification): accessible = user_notification.is_accessible_by(super_admin_user, mode='read') assert accessible def test_super_admin_user_update_user_notification(super_admin_user, user_notification): accessible = user_notification.is_accessible_by(super_admin_user, mode='update') assert accessible def test_super_admin_user_delete_user_notification(super_admin_user, user_notification): accessible = user_notification.is_accessible_by(super_admin_user, mode='delete') assert accessible def test_group_admin_user_create_user_notification(group_admin_user, user_notification): accessible = user_notification.is_accessible_by(group_admin_user, mode='create') assert accessible def test_group_admin_user_read_user_notification(group_admin_user, user_notification): accessible = user_notification.is_accessible_by(group_admin_user, mode='read') assert not accessible def test_group_admin_user_update_user_notification(group_admin_user, user_notification): accessible = user_notification.is_accessible_by(group_admin_user, mode='update') assert not accessible def test_group_admin_user_delete_user_notification(group_admin_user, user_notification): accessible = user_notification.is_accessible_by(group_admin_user, mode='delete') assert not accessible
#define a value holder function # => True def switch(value): switch.value=value return True #define matching case function # => True or False def case(*args): return any((arg == switch.value for arg in args)) # Switch example: print("Describe a number from range:") for n in range(0,10): print(n, end=" ", flush=True) print() # Ask for a number and analyze x=input("n:") n=int(x) while switch(n): if case(0): print ("n is zero;") break if case(1, 4, 9): print ("n is a perfect square;") break if case(2): print ("n is an even number;") if case(2, 3, 5, 7): print ("n is a prime number;") break if case(6, 8): print ("n is an even number;") break print ("Only single-digit numbers are allowed.")
def switch(value): switch.value = value return True def case(*args): return any((arg == switch.value for arg in args)) print('Describe a number from range:') for n in range(0, 10): print(n, end=' ', flush=True) print() x = input('n:') n = int(x) while switch(n): if case(0): print('n is zero;') break if case(1, 4, 9): print('n is a perfect square;') break if case(2): print('n is an even number;') if case(2, 3, 5, 7): print('n is a prime number;') break if case(6, 8): print('n is an even number;') break print('Only single-digit numbers are allowed.')
# Recursive solution (TLE) class Solution(object): def wordBreak(self, s, wordDict): """ :type s: str :type wordDict: List[str] :rtype: bool """ def util(s, wordDict): if s == "": return True for i in range(1, len(s)+1): if str(s[:i]) in wordDict and util(s[i:], wordDict): # print(s[:i], s[i:]) return True return False d = {} for word in wordDict: if word not in d: d[word] = 1 return util(s, d) # Memoization (Accepted, 14%) class Solution(object): def wordBreak(self, s, wordDict): """ :type s: str :type wordDict: List[str] :rtype: bool """ def util(s, wordDict, wordbreaks): if s == "": return True if s in wordbreaks: return wordbreaks[str(s)] for i in range(1, len(s)+1): if str(s[:i]) in wordDict and util(s[i:], wordDict, wordbreaks): # print(s[:i], s[i:]) wordbreaks[str(s[i:])] = True return True wordbreaks[str(s)] = False return False d = {} wordbreaks = {} for word in wordDict: if word not in d: d[word] = 1 return util(s, d, wordbreaks) # DP (80%) class Solution(object): def wordBreak(self, s, wordDict): """ :type s: str :type wordDict: List[str] :rtype: bool """ n = len(s) dp = [False]*(n+1) dp[0] = True for i in range(1, n+1): for w in wordDict: if dp[i-len(w)] and s[i-len(w):i] == w: dp[i] = True return dp[-1]
class Solution(object): def word_break(self, s, wordDict): """ :type s: str :type wordDict: List[str] :rtype: bool """ def util(s, wordDict): if s == '': return True for i in range(1, len(s) + 1): if str(s[:i]) in wordDict and util(s[i:], wordDict): return True return False d = {} for word in wordDict: if word not in d: d[word] = 1 return util(s, d) class Solution(object): def word_break(self, s, wordDict): """ :type s: str :type wordDict: List[str] :rtype: bool """ def util(s, wordDict, wordbreaks): if s == '': return True if s in wordbreaks: return wordbreaks[str(s)] for i in range(1, len(s) + 1): if str(s[:i]) in wordDict and util(s[i:], wordDict, wordbreaks): wordbreaks[str(s[i:])] = True return True wordbreaks[str(s)] = False return False d = {} wordbreaks = {} for word in wordDict: if word not in d: d[word] = 1 return util(s, d, wordbreaks) class Solution(object): def word_break(self, s, wordDict): """ :type s: str :type wordDict: List[str] :rtype: bool """ n = len(s) dp = [False] * (n + 1) dp[0] = True for i in range(1, n + 1): for w in wordDict: if dp[i - len(w)] and s[i - len(w):i] == w: dp[i] = True return dp[-1]
# Copyright 2019 AUI, Inc. Washington DC, USA # # 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. ##################################################### def uvmodelfit(xds, field=None, spw=None, timerange=None, uvrange=None, antenna=None, scan=None, niter=5, comptype='p', sourcepar=[1, 0, 0], varypar=[]): """ .. todo:: This function is not yet implemented Fit simple analytic source component models directly to visibility data Parameters ---------- xds : xarray.core.dataset.Dataset input Visibility Dataset field : int field selection. If None, use all fields spw : int spw selection. If None, use all spws timerange : int time selection. If None, use all times uvrange : int uvrange selection. If None, use all uvranges antenna : int antenna selection. If None, use all antennas scan : int scan selection. If None, use all scans niter : int number of fitting iteractions to execute comptype : str component type (p=point source, g=ell. gauss. d=ell. disk) sourcepar : list starting fuess (flux, xoff, yoff, bmajaxrat, bpa) varypar : list parameters that may vary in the fit Returns ------- xarray.core.dataset.Dataset New Visibility Dataset with updated data """ return {}
def uvmodelfit(xds, field=None, spw=None, timerange=None, uvrange=None, antenna=None, scan=None, niter=5, comptype='p', sourcepar=[1, 0, 0], varypar=[]): """ .. todo:: This function is not yet implemented Fit simple analytic source component models directly to visibility data Parameters ---------- xds : xarray.core.dataset.Dataset input Visibility Dataset field : int field selection. If None, use all fields spw : int spw selection. If None, use all spws timerange : int time selection. If None, use all times uvrange : int uvrange selection. If None, use all uvranges antenna : int antenna selection. If None, use all antennas scan : int scan selection. If None, use all scans niter : int number of fitting iteractions to execute comptype : str component type (p=point source, g=ell. gauss. d=ell. disk) sourcepar : list starting fuess (flux, xoff, yoff, bmajaxrat, bpa) varypar : list parameters that may vary in the fit Returns ------- xarray.core.dataset.Dataset New Visibility Dataset with updated data """ return {}
#!/usr/bin/python3 """ This is a simple implementation of BST binary search tree """ class Node(object): def __init__(self, value=None, left=None, right=None, parent=None): self.value = value self.left = left self.right = right self.parent = parent def __str__(self): """ String representation of the TreeNode """ return str(self.value) def isLeaf(self): """ Check whether the node is leaf node or not :return: True or False depend on whether a leaf node """ return not (self.right or self.left) def isRoot(self): """ Check whether the node has a parent or not :return: return True if there is no parent, False if there is a parent """ return not self.parent def hasLeftChild(self): """ Check whether the node has a left child or not """ return self.left def hasRightChild(self): """ Check whether the node has a right child or not """ return self.right def hasAnyChildren(self): """ Check whether the node has any child nodes similar to the isLeaf """ return self.right or self.left
""" This is a simple implementation of BST binary search tree """ class Node(object): def __init__(self, value=None, left=None, right=None, parent=None): self.value = value self.left = left self.right = right self.parent = parent def __str__(self): """ String representation of the TreeNode """ return str(self.value) def is_leaf(self): """ Check whether the node is leaf node or not :return: True or False depend on whether a leaf node """ return not (self.right or self.left) def is_root(self): """ Check whether the node has a parent or not :return: return True if there is no parent, False if there is a parent """ return not self.parent def has_left_child(self): """ Check whether the node has a left child or not """ return self.left def has_right_child(self): """ Check whether the node has a right child or not """ return self.right def has_any_children(self): """ Check whether the node has any child nodes similar to the isLeaf """ return self.right or self.left
#!/usr/bin/python3 # Guilhem Mizrahi 09/2019 def first(): var1=input("Enter the first number: ") var2=input("Enter the second number: ") print(var1/var2) def second(): var1=int(input("Enter the first number: ")) var2=int(input("Enter the second number: ")) print(var1/var2) def third(): retvalue1="" while(not retvalue1.isnumeric()): retvalue1=input("Type in first a number: ") retvalue2="" while(not retvalue2.isnumeric()): retvalue2=input("Type in a second number: ") retvalue1=int(retvalue1) retvalue2=int(retvalue2) print(retvalue1/retvalue2) def fourth(): while True: try: val1 = int(input("Enter the first number: ")) val2 = int(input("Enter the second number: ")) break except: print("You did not enter a number") continue print(val1/val2) def fith(): mylist = ["obj1","obj2","obj3"] myvar1 = 32 myvar2 = "Something else" print('{} {}'.format(myvar1,myvar2)) print('{1} {0}'.format(myvar1,myvar2)) print('{} {}'.format(mylist[1],mylist[2])) def sixth(): for i in range(1,13): print("{:3d} {:4d} {:5d}".format(i, i**2, i**3)) if __name__=="__main__": # first() # second() # third() # fourth() # fith() sixth()
def first(): var1 = input('Enter the first number: ') var2 = input('Enter the second number: ') print(var1 / var2) def second(): var1 = int(input('Enter the first number: ')) var2 = int(input('Enter the second number: ')) print(var1 / var2) def third(): retvalue1 = '' while not retvalue1.isnumeric(): retvalue1 = input('Type in first a number: ') retvalue2 = '' while not retvalue2.isnumeric(): retvalue2 = input('Type in a second number: ') retvalue1 = int(retvalue1) retvalue2 = int(retvalue2) print(retvalue1 / retvalue2) def fourth(): while True: try: val1 = int(input('Enter the first number: ')) val2 = int(input('Enter the second number: ')) break except: print('You did not enter a number') continue print(val1 / val2) def fith(): mylist = ['obj1', 'obj2', 'obj3'] myvar1 = 32 myvar2 = 'Something else' print('{} {}'.format(myvar1, myvar2)) print('{1} {0}'.format(myvar1, myvar2)) print('{} {}'.format(mylist[1], mylist[2])) def sixth(): for i in range(1, 13): print('{:3d} {:4d} {:5d}'.format(i, i ** 2, i ** 3)) if __name__ == '__main__': sixth()
PROG = 'censor' fin = open(PROG + '.in', 'r') fout = open(PROG + '.out', 'w') def main(): s = fin.readline() s = s[:len(s) - 1] t = fin.readline() t = t[:len(t) - 1] while True: i = s.find(t) if i == -1: break s = s[0:i] + s[i + len(t):] fout.write(s + '\n') main() fin.close() fout.close()
prog = 'censor' fin = open(PROG + '.in', 'r') fout = open(PROG + '.out', 'w') def main(): s = fin.readline() s = s[:len(s) - 1] t = fin.readline() t = t[:len(t) - 1] while True: i = s.find(t) if i == -1: break s = s[0:i] + s[i + len(t):] fout.write(s + '\n') main() fin.close() fout.close()
# tests.py # Run `conda install pytest` # Run `pytest test_main.py` from the speech2phone/ directory. """ To use pytest, the file must be named "test***.py". For example, `tests.py` or `test_pca.py`. Test functions must be prefixed with `test_`. So `multiply()` is not a test function, but `test_numbers_3_4()` is. We use simple assert statements for our testing. No assertThis() or assertThat(). https://docs.pytest.org/en/latest/usage.html http://pythontesting.net/framework/pytest/pytest-introduction/#running_pytest pytest fixtures could be useful later, but don't worry about them for now. """ def multiply(a, b): return a * b def test_numbers_3_4(): assert multiply(3,4) == 12 def test_strings_a_3(): assert multiply('a',3) == 'aaa'
""" To use pytest, the file must be named "test***.py". For example, `tests.py` or `test_pca.py`. Test functions must be prefixed with `test_`. So `multiply()` is not a test function, but `test_numbers_3_4()` is. We use simple assert statements for our testing. No assertThis() or assertThat(). https://docs.pytest.org/en/latest/usage.html http://pythontesting.net/framework/pytest/pytest-introduction/#running_pytest pytest fixtures could be useful later, but don't worry about them for now. """ def multiply(a, b): return a * b def test_numbers_3_4(): assert multiply(3, 4) == 12 def test_strings_a_3(): assert multiply('a', 3) == 'aaa'
class IncorrectInputVectorLength(Exception): pass class NetIsNotInitialized(Exception): pass class IncorrectFactorValue(Exception): pass class NetIsNotCalculated(Exception): pass class IncorrectExpectedOutputVectorLength(Exception): pass class NetConfigIndefined(Exception): pass class NetConfigIncorrect(Exception): pass class JsonFileNotFound(Exception): pass class JsonFileStructureIncorrect(Exception): pass
class Incorrectinputvectorlength(Exception): pass class Netisnotinitialized(Exception): pass class Incorrectfactorvalue(Exception): pass class Netisnotcalculated(Exception): pass class Incorrectexpectedoutputvectorlength(Exception): pass class Netconfigindefined(Exception): pass class Netconfigincorrect(Exception): pass class Jsonfilenotfound(Exception): pass class Jsonfilestructureincorrect(Exception): pass
# The rand7() API is already defined for you. # def rand7(): # @return a random integer in the range 1 to 7 class Solution: def rand10(self): """ :rtype: int """ v = (rand7()-1)*7 + rand7()-1 while v >= 40: v = (rand7()-1)*7 + rand7()-1 return v%10 + 1
class Solution: def rand10(self): """ :rtype: int """ v = (rand7() - 1) * 7 + rand7() - 1 while v >= 40: v = (rand7() - 1) * 7 + rand7() - 1 return v % 10 + 1
class BingoBoard: def __init__(self, numbers): self.numbers = [int(n) for n in numbers.replace("\n", " ").split()] self.marked = set() def mark(self, n): if n in self.numbers: self.marked.add(n) return self.check_win() return False def get_score(self): return sum(set(self.numbers).difference(self.marked)) def check_win(self): return self.check_rows() or self.check_columns() def check_rows(self): for i in range(0, 21, 5): if self.marked.issuperset(self.numbers[i:i+5]): return True return False def check_columns(self): for i in range(5): if self.marked.issuperset(self.numbers[i::5]): return True return False def get_data(filename): with open(filename) as file: numbers, *boards = file.read().split("\n\n") numbers = [int(n) for n in numbers.split(",")] boards = [BingoBoard(board) for board in boards] return numbers, boards def play(numbers, boards): winning_score = None for n in numbers: boards_to_remove = set() for board in boards: if board.mark(n): boards_to_remove.add(board) if winning_score is None: winning_score = board.get_score() * n elif len(boards) == 1: losing_score = board.get_score() * n return winning_score, losing_score boards = [board for board in boards if board not in boards_to_remove] # sample_data = get_data("day_04_sample.txt") challenge_data = get_data("input.txt") if __name__ == "__main__": # sample_part_1, sample_part_2 = play(*sample_data) # assert sample_part_1 == 4512 # assert sample_part_2 == 1924 challenge_part_1, challenge_part_2 = play(*challenge_data) print(challenge_part_1) # 23177 print(challenge_part_2) # 6804
class Bingoboard: def __init__(self, numbers): self.numbers = [int(n) for n in numbers.replace('\n', ' ').split()] self.marked = set() def mark(self, n): if n in self.numbers: self.marked.add(n) return self.check_win() return False def get_score(self): return sum(set(self.numbers).difference(self.marked)) def check_win(self): return self.check_rows() or self.check_columns() def check_rows(self): for i in range(0, 21, 5): if self.marked.issuperset(self.numbers[i:i + 5]): return True return False def check_columns(self): for i in range(5): if self.marked.issuperset(self.numbers[i::5]): return True return False def get_data(filename): with open(filename) as file: (numbers, *boards) = file.read().split('\n\n') numbers = [int(n) for n in numbers.split(',')] boards = [bingo_board(board) for board in boards] return (numbers, boards) def play(numbers, boards): winning_score = None for n in numbers: boards_to_remove = set() for board in boards: if board.mark(n): boards_to_remove.add(board) if winning_score is None: winning_score = board.get_score() * n elif len(boards) == 1: losing_score = board.get_score() * n return (winning_score, losing_score) boards = [board for board in boards if board not in boards_to_remove] challenge_data = get_data('input.txt') if __name__ == '__main__': (challenge_part_1, challenge_part_2) = play(*challenge_data) print(challenge_part_1) print(challenge_part_2)
#from http://rosettacode.org/wiki/Greatest_common_divisor#Python #pythran export gcd_iter(int, int) #pythran export gcd(int, int) #pythran export gcd_bin(int, int) #runas gcd_iter(40902, 24140) #runas gcd(40902, 24140) #runas gcd_bin(40902, 24140) def gcd_iter(u, v): while v: u, v = v, u % v return abs(u) def gcd(u, v): return gcd(v, u % v) if v else abs(u) def gcd_bin(u, v): u, v = abs(u), abs(v) # u >= 0, v >= 0 if u < v: u, v = v, u # u >= v >= 0 if v == 0: return u # u >= v > 0 k = 1 while u & 1 == 0 and v & 1 == 0: # u, v - even u >>= 1; v >>= 1 k <<= 1 t = -v if u & 1 else u while t: while t & 1 == 0: t >>= 1 if t > 0: u = t else: v = -t t = u - v return u * k
def gcd_iter(u, v): while v: (u, v) = (v, u % v) return abs(u) def gcd(u, v): return gcd(v, u % v) if v else abs(u) def gcd_bin(u, v): (u, v) = (abs(u), abs(v)) if u < v: (u, v) = (v, u) if v == 0: return u k = 1 while u & 1 == 0 and v & 1 == 0: u >>= 1 v >>= 1 k <<= 1 t = -v if u & 1 else u while t: while t & 1 == 0: t >>= 1 if t > 0: u = t else: v = -t t = u - v return u * k
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. # # 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. class JobMode: COLLECTIVE = 'collective' PS = 'ps' HETER = 'heter' class Job(object): def __init__(self, jid='default', mode=JobMode.COLLECTIVE, nnodes="1"): self._mode = mode self._id = jid self._replicas = 0 self._replicas_min = self._replicas self._replicas_max = self._replicas self._elastic = False self.set_replicas(str(nnodes)) def __str__(self): return "Job: {}, mode {}, replicas {}[{}:{}], elastic {}".format( self.id, self.mode, self._replicas, self._replicas_min, self._replicas_max, self.elastic) @property def mode(self): return self._mode @property def id(self): return self._id @property def elastic(self): return self._elastic @property def replicas(self): return self._replicas @property def replicas_min(self): return self._replicas_min @property def replicas_max(self): return self._replicas_max @replicas.setter def replicas(self, replicas): self._replicas = replicas def set_replicas(self, nnodes: str): np = str(nnodes) if nnodes else '1' if ':' in np: nps = np.split(':') self._replicas_min, self._replicas_max = int(nps[0]), int(nps[1]) self._replicas = self._replicas_max # default to max self._elastic = True else: self._replicas = int(np) self._replicas_min, self._replicas_max = self._replicas, self._replicas self._elastic = False
class Jobmode: collective = 'collective' ps = 'ps' heter = 'heter' class Job(object): def __init__(self, jid='default', mode=JobMode.COLLECTIVE, nnodes='1'): self._mode = mode self._id = jid self._replicas = 0 self._replicas_min = self._replicas self._replicas_max = self._replicas self._elastic = False self.set_replicas(str(nnodes)) def __str__(self): return 'Job: {}, mode {}, replicas {}[{}:{}], elastic {}'.format(self.id, self.mode, self._replicas, self._replicas_min, self._replicas_max, self.elastic) @property def mode(self): return self._mode @property def id(self): return self._id @property def elastic(self): return self._elastic @property def replicas(self): return self._replicas @property def replicas_min(self): return self._replicas_min @property def replicas_max(self): return self._replicas_max @replicas.setter def replicas(self, replicas): self._replicas = replicas def set_replicas(self, nnodes: str): np = str(nnodes) if nnodes else '1' if ':' in np: nps = np.split(':') (self._replicas_min, self._replicas_max) = (int(nps[0]), int(nps[1])) self._replicas = self._replicas_max self._elastic = True else: self._replicas = int(np) (self._replicas_min, self._replicas_max) = (self._replicas, self._replicas) self._elastic = False
def Menunggu(n,des): #basis if n == 0: return 0 #rekuren print(des) return Menunggu(n-1,des) def MySum(n): #basis if n == 0: return 0 #rekuren return n+MySum(n-1) def main(): # solusi iteratif/pengulangan dengan teknik for loop #n = 10 #for i in range(n): # print("Menunggu si dia.") # solusi rekursif Menunggu(10,"Menunggu si dia.") # solusi iteratif penjumlahan # sum = 0 # n = 10 # for i in range(n+1): # sum+=i # print(sum) #55 # solusi rekursif print(MySum(10)) #55? if __name__=="__main__": main()
def menunggu(n, des): if n == 0: return 0 print(des) return menunggu(n - 1, des) def my_sum(n): if n == 0: return 0 return n + my_sum(n - 1) def main(): menunggu(10, 'Menunggu si dia.') print(my_sum(10)) if __name__ == '__main__': main()
i = input().split() N,Q = int(i[0]),int(i[1]) AI = input().split() ai = [] for n in AI: ai.append(int(n)) QI = input().split() qi = [] for n in QI: qi.append(int(n)) for q in qi: ai_aux = ai.copy() count = 0 p = 0 while(p<len(ai_aux)-1): if q in ai_aux: count += 1 i = ai_aux.index(q) ai_aux[i] = 0 elif (q-ai_aux[p]) in ai_aux: count += 1 i1 = ai_aux.index(q-ai_aux[p]) ai_aux[i1] = 0 i2 = ai_aux.index(ai_aux[p]) ai_aux[i2] = 0 p += 1 p += 1 print(count)
i = input().split() (n, q) = (int(i[0]), int(i[1])) ai = input().split() ai = [] for n in AI: ai.append(int(n)) qi = input().split() qi = [] for n in QI: qi.append(int(n)) for q in qi: ai_aux = ai.copy() count = 0 p = 0 while p < len(ai_aux) - 1: if q in ai_aux: count += 1 i = ai_aux.index(q) ai_aux[i] = 0 elif q - ai_aux[p] in ai_aux: count += 1 i1 = ai_aux.index(q - ai_aux[p]) ai_aux[i1] = 0 i2 = ai_aux.index(ai_aux[p]) ai_aux[i2] = 0 p += 1 p += 1 print(count)
class hparams: train_or_test = 'train' output_dir = 'logs/your_program_name' aug = False latest_checkpoint_file = 'checkpoint_latest.pt' total_epochs = 100 epochs_per_checkpoint = 10 batch_size = 2 ckpt = None init_lr = 0.0002 scheduer_step_size = 20 scheduer_gamma = 0.8 debug = False mode = '2d' # '2d or '3d' in_class = 1 out_class = 2 crop_or_pad_size = 224,224,1 # if 3D: 256,256,256 fold_arch = '*.png' source_train_0_dir = 'train/0' source_train_1_dir = 'train/1' source_test_0_dir = 'test/0' source_test_1_dir = 'test/1'
class Hparams: train_or_test = 'train' output_dir = 'logs/your_program_name' aug = False latest_checkpoint_file = 'checkpoint_latest.pt' total_epochs = 100 epochs_per_checkpoint = 10 batch_size = 2 ckpt = None init_lr = 0.0002 scheduer_step_size = 20 scheduer_gamma = 0.8 debug = False mode = '2d' in_class = 1 out_class = 2 crop_or_pad_size = (224, 224, 1) fold_arch = '*.png' source_train_0_dir = 'train/0' source_train_1_dir = 'train/1' source_test_0_dir = 'test/0' source_test_1_dir = 'test/1'
''' --- Day 1: The Tyranny of the Rocket Equation --- -- Part 1 -- The Elves quickly load you into a spacecraft and prepare to launch. At the first Go / No Go poll, every Elf is Go until the Fuel Counter-Upper. They haven't determined the amount of fuel required yet. Fuel required to launch a given module is based on its mass. Specifically, to find the fuel required for a module, take its mass, divide by three, round down, and subtract 2. What is the sum of the fuel requirements for all of the modules on your spacecraft? -- Part 2 -- During the second Go / No Go poll, the Elf in charge of the Rocket Equation Double-Checker stops the launch sequence. Apparently, you forgot to include additional fuel for the fuel you just added. Fuel itself requires fuel just like a module - take its mass, divide by three, round down, and subtract 2. However, that fuel also requires fuel, and that fuel requires fuel, and so on. Any mass that would require negative fuel should instead be treated as if it requires zero fuel; the remaining mass, if any, is instead handled by wishing really hard, which has no mass and is outside the scope of this calculation. So, for each module mass, calculate its fuel and add it to the total. Then, treat the fuel amount you just calculated as the input mass and repeat the process, continuing until a fuel requirement is zero or negative. What is the sum of the fuel requirements for all of the modules on your spacecraft when also taking into account the mass of the added fuel? ''' def get_fuel(mass): return int(mass/3)-2 def fuel_sum(): sum = [0,0] m = open("modules.txt", "r") for x in m: add_fuel = get_fuel(int(x)) sum[0] += add_fuel while get_fuel(add_fuel) > 0: add_fuel = get_fuel(add_fuel) sum[1] += add_fuel return sum if __name__ == '__main__': result = fuel_sum() print("Part 1:", result[0]) print("Part 2:", result[0]+result[1])
""" --- Day 1: The Tyranny of the Rocket Equation --- -- Part 1 -- The Elves quickly load you into a spacecraft and prepare to launch. At the first Go / No Go poll, every Elf is Go until the Fuel Counter-Upper. They haven't determined the amount of fuel required yet. Fuel required to launch a given module is based on its mass. Specifically, to find the fuel required for a module, take its mass, divide by three, round down, and subtract 2. What is the sum of the fuel requirements for all of the modules on your spacecraft? -- Part 2 -- During the second Go / No Go poll, the Elf in charge of the Rocket Equation Double-Checker stops the launch sequence. Apparently, you forgot to include additional fuel for the fuel you just added. Fuel itself requires fuel just like a module - take its mass, divide by three, round down, and subtract 2. However, that fuel also requires fuel, and that fuel requires fuel, and so on. Any mass that would require negative fuel should instead be treated as if it requires zero fuel; the remaining mass, if any, is instead handled by wishing really hard, which has no mass and is outside the scope of this calculation. So, for each module mass, calculate its fuel and add it to the total. Then, treat the fuel amount you just calculated as the input mass and repeat the process, continuing until a fuel requirement is zero or negative. What is the sum of the fuel requirements for all of the modules on your spacecraft when also taking into account the mass of the added fuel? """ def get_fuel(mass): return int(mass / 3) - 2 def fuel_sum(): sum = [0, 0] m = open('modules.txt', 'r') for x in m: add_fuel = get_fuel(int(x)) sum[0] += add_fuel while get_fuel(add_fuel) > 0: add_fuel = get_fuel(add_fuel) sum[1] += add_fuel return sum if __name__ == '__main__': result = fuel_sum() print('Part 1:', result[0]) print('Part 2:', result[0] + result[1])
""" exceptions/__init__.py Comments: Author: Dennis Whitney Email: dennis@runasroot.com Copyright (c) 2021, iRunAsRoot """ class ValueReadOnly(Exception): pass class ValueNotAllowed(Exception): pass class UnauthorizedAccess(Exception): pass class UnknownEndpoint(Exception): pass
""" exceptions/__init__.py Comments: Author: Dennis Whitney Email: dennis@runasroot.com Copyright (c) 2021, iRunAsRoot """ class Valuereadonly(Exception): pass class Valuenotallowed(Exception): pass class Unauthorizedaccess(Exception): pass class Unknownendpoint(Exception): pass
""" map data could be a 2D grid with data for each cell as N, S, E, W. A special data set would highlight "here" information, like if there's a pit, item, encounter or teleportation. w - wall d - door o - open s - secret door (shows as 'w' on other side) A box with a door leading east from the NE quadrant would look like: woowwodoowowowwo """
""" map data could be a 2D grid with data for each cell as N, S, E, W. A special data set would highlight "here" information, like if there's a pit, item, encounter or teleportation. w - wall d - door o - open s - secret door (shows as 'w' on other side) A box with a door leading east from the NE quadrant would look like: woowwodoowowowwo """
#This is a simple inventory program for a small car dealership. print('Automotive Inventory') class Automobile: def __init__(self): self._make = '' self._model = '' self._year = 0 self._color = '' self._mileage = 0 def addVehicle(self): try: self._make = input('Enter vehicle make: ') self._model = input('Enter vehicle model: ') self._year = int(input('Enter vehicle year: ')) self._color = input('Enter vehicle color: ') self._mileage = int(input('Enter vehicle mileage: ')) return True except ValueError: print('Please try entering vehicle information again using only whole numbers for mileage and year') return False def __str__(self): return '\t'.join(str(x) for x in [self._make, self._model, self._year, self._color, self._mileage]) class Inventory: def __init__(self): self.vehicles = [] def addVehicle(self): vehicle = Automobile() if vehicle.addVehicle() == True: self.vehicles.append(vehicle) print () print('This vehicle has been added, Thank you') def viewInventory(self): print('\t'.join(['','Make', 'Model','Year', 'Color', 'Mileage'])) for idx, vehicle in enumerate(self.vehicles) : print(idx + 1, end='\t') print(vehicle) inventory = Inventory() while True: print('') print('#1 Add Vehicle to Inventory') print('#2 Delete Vehicle from Inventory') print('#3 View Current Inventory') print('#4 Update Vehicle in Inventory') print('#5 Export Current Inventory') print('#6 Quit') print('--------------------------------------------') userInput=input('Please choose from one of the above options: ') if userInput=="1": #add a vehicle inventory.addVehicle() elif userInput=='2': #delete a vehicle if len(inventory.vehicles) < 1: print('Sorry there are no vehicles currently in inventory') continue inventory.viewInventory() item = int(input('Please enter the number associated with the vehicle to be removed: ')) if item - 1 > len(inventory.vehicles): print('This is an invalid number') else: inventory.vehicles.remove(inventory.vehicles[item - 1]) print () print('This vehicle has been removed') elif userInput == '3': #list all the vehicles if len(inventory.vehicles) < 1: print('Sorry there are no vehicles currently in inventory') continue inventory.viewInventory() elif userInput == '4': #edit vehicle if len(inventory.vehicles) < 1: print('Sorry there are no vehicles currently in inventory') continue inventory.viewInventory() item = int(input('Please enter the number associated with the vehicle to be updated: ')) if item - 1 > len(inventory.vehicles): print('This is an invalid number') else: automobile = Automobile() if automobile.addVehicle() == True : inventory.vehicles.remove(inventory.vehicles[item - 1]) inventory.vehicles.insert(item - 1, automobile) print () print('This vehicle has been updated') elif userInput == '5': #export inventory to file if len(inventory.vehicles) < 1: print('Sorry there are no vehicles currently in inventory') continue f = open('vehicle_inventory.txt', 'w') f.write('\t'.join(['Make', 'Model','Year', 'Color', 'Mileage'])) f.write('\n') for vechicle in inventory.vehicles: f.write('%s\n' %vechicle) f.close() print('The vehicle inventory has been exported to a file') elif userInput == '6': #exit the loop print('Goodbye') break else: #invalid user input print('This is an invalid input. Please try again.')
print('Automotive Inventory') class Automobile: def __init__(self): self._make = '' self._model = '' self._year = 0 self._color = '' self._mileage = 0 def add_vehicle(self): try: self._make = input('Enter vehicle make: ') self._model = input('Enter vehicle model: ') self._year = int(input('Enter vehicle year: ')) self._color = input('Enter vehicle color: ') self._mileage = int(input('Enter vehicle mileage: ')) return True except ValueError: print('Please try entering vehicle information again using only whole numbers for mileage and year') return False def __str__(self): return '\t'.join((str(x) for x in [self._make, self._model, self._year, self._color, self._mileage])) class Inventory: def __init__(self): self.vehicles = [] def add_vehicle(self): vehicle = automobile() if vehicle.addVehicle() == True: self.vehicles.append(vehicle) print() print('This vehicle has been added, Thank you') def view_inventory(self): print('\t'.join(['', 'Make', 'Model', 'Year', 'Color', 'Mileage'])) for (idx, vehicle) in enumerate(self.vehicles): print(idx + 1, end='\t') print(vehicle) inventory = inventory() while True: print('') print('#1 Add Vehicle to Inventory') print('#2 Delete Vehicle from Inventory') print('#3 View Current Inventory') print('#4 Update Vehicle in Inventory') print('#5 Export Current Inventory') print('#6 Quit') print('--------------------------------------------') user_input = input('Please choose from one of the above options: ') if userInput == '1': inventory.addVehicle() elif userInput == '2': if len(inventory.vehicles) < 1: print('Sorry there are no vehicles currently in inventory') continue inventory.viewInventory() item = int(input('Please enter the number associated with the vehicle to be removed: ')) if item - 1 > len(inventory.vehicles): print('This is an invalid number') else: inventory.vehicles.remove(inventory.vehicles[item - 1]) print() print('This vehicle has been removed') elif userInput == '3': if len(inventory.vehicles) < 1: print('Sorry there are no vehicles currently in inventory') continue inventory.viewInventory() elif userInput == '4': if len(inventory.vehicles) < 1: print('Sorry there are no vehicles currently in inventory') continue inventory.viewInventory() item = int(input('Please enter the number associated with the vehicle to be updated: ')) if item - 1 > len(inventory.vehicles): print('This is an invalid number') else: automobile = automobile() if automobile.addVehicle() == True: inventory.vehicles.remove(inventory.vehicles[item - 1]) inventory.vehicles.insert(item - 1, automobile) print() print('This vehicle has been updated') elif userInput == '5': if len(inventory.vehicles) < 1: print('Sorry there are no vehicles currently in inventory') continue f = open('vehicle_inventory.txt', 'w') f.write('\t'.join(['Make', 'Model', 'Year', 'Color', 'Mileage'])) f.write('\n') for vechicle in inventory.vehicles: f.write('%s\n' % vechicle) f.close() print('The vehicle inventory has been exported to a file') elif userInput == '6': print('Goodbye') break else: print('This is an invalid input. Please try again.')
class Registry: def __init__(self): self.addr = ["134.209.83.144"] self._config = None self._executor = None @property def executor(self): if not self._executor: self._executor = ExecutorSSH(self.addr[0], 22) return self._executor @property def myname(self): """ is the main config """ myname = j.core.myenv.sshagent.key_default_name c = self.config["clients"] if myname not in c: y = j.core.tools.logask_yes_no( "is our unique login name:%s\nif not please say no and define new name." % myname ) if not y: myname2 = j.core.tools.ask_string("give your unique loginname") msg = "careful: your sshkeyname will be changed accordingly on your system to:%s, ok?" % myname2 if j.core.tools.ask_yes_no(msg): src = j.core.myenv.sshagent.key_path_get() dest = "%s/%s" % (os.path.dirname(src), myname2) shutil.copyfile(src, dest) shutil.copyfile(src + ".pub", dest + ".pub") j.core.myenv.config["SSH_KEY_DEFAULT"] = myname2 j.core.myenv.config_save() j.core.tools.delete(src) j.core.tools.delete(src + ".pub") j.core.myenv.sshagent.keys_unload() j.core.myenv.sshagent.key_load(dest) myname = myname2 else: raise j.exceptions.Input("cannot continue need unique login name which corresponds to your sshkey") c[myname] = {} c = c[myname] keypub = j.core.myenv.sshagent.keypub def showdetails(c): print(json.dumps(c)) def askdetails(c): organizations = ["codescalers", "freeflow", "frequencyvillage", "threefold", "incubaid", "bettertoken"] organizations2 = ", ".join(organizations) if "email" not in c: c["email"] = j.core.tools.ask_string("please provide your main email addr") if "organizations" not in c: print("valid organizations: '%s'" % organizations2) c["organizations"] = j.core.tools.ask_string("please provide your organizations (comma separated)") if "remark" not in c: c["remark"] = j.core.tools.ask_string("any remark?") if "telegram" not in c: c["telegram"] = j.core.tools.ask_string("please provide your main telegram handle") if "mobile" not in c: c["mobile"] = j.core.tools.ask_string("please provide your mobile nr's (if more than one use ,)") showdetails(c) y = j.core.tools.ask_yes_no("is above all correct !!!") if not y: c["email"] = j.core.tools.ask_string("please provide your main email addr", default=c["email"]) print("valid organizations: '%s'" % organizations2) c["organizations"] = j.core.tools.ask_string( "please provide your organizations (comma separated)", default=c["organizations"] ) c["remark"] = j.core.tools.ask_string("any remark?", default=c["remark"]) c["telegram"] = j.core.tools.ask_string( "please provide your main telegram handle", default=c["telegram"] ) c["mobile"] = j.core.tools.ask_string( "please provide your mobile nr's (if more than one use ,)", default=c["mobile"] ) self.executor.save() o = c["organizations"] o2 = [] for oname in o.lower().split(","): oname = oname.strip().lower() if oname == "": continue if oname not in organizations: raise j.exceptions.Input( "please choose valid organizations (notok:%s): %s" % (oname, organizations2) ) o2.append(oname) c["organizations"] = ",".join(o2) if "keypub" not in c: c["keypub"] = keypub askdetails() self.executor.save() else: if not c["keypub"].strip() == keypub.strip(): showdetails(c) y = j.core.tools.ask_yes_no("Are you sure your are above?") raise j.exceptions.Input( "keypub does not correspond, your name:%s, is this a unique name, comes from your main sshkey, change if needed" % myname ) return myname def load(self): self._config = None @property def config_mine(self): return self.config["clients"][self.myname] @property def myid(self): if "myid" not in self.config_mine: if "lastmyid" not in self.config: self.config["lastmyid"] = 1 else: self.config["lastmyid"] += 1 self.config_mine["myid"] = self.config["lastmyid"] self.executor.save() return self.config_mine["myid"] # @iterator # def users(self): # for name, data in self.config["clients"].items(): # yield data @property def config(self): """ is the main config """ if not self._config: c = self.executor.config if not "registry" in c: c["registry"] = {} config = self.executor.config["registry"] if "clients" not in config: config["clients"] = {} self._config = config return self._config
class Registry: def __init__(self): self.addr = ['134.209.83.144'] self._config = None self._executor = None @property def executor(self): if not self._executor: self._executor = executor_ssh(self.addr[0], 22) return self._executor @property def myname(self): """ is the main config """ myname = j.core.myenv.sshagent.key_default_name c = self.config['clients'] if myname not in c: y = j.core.tools.logask_yes_no('is our unique login name:%s\nif not please say no and define new name.' % myname) if not y: myname2 = j.core.tools.ask_string('give your unique loginname') msg = 'careful: your sshkeyname will be changed accordingly on your system to:%s, ok?' % myname2 if j.core.tools.ask_yes_no(msg): src = j.core.myenv.sshagent.key_path_get() dest = '%s/%s' % (os.path.dirname(src), myname2) shutil.copyfile(src, dest) shutil.copyfile(src + '.pub', dest + '.pub') j.core.myenv.config['SSH_KEY_DEFAULT'] = myname2 j.core.myenv.config_save() j.core.tools.delete(src) j.core.tools.delete(src + '.pub') j.core.myenv.sshagent.keys_unload() j.core.myenv.sshagent.key_load(dest) myname = myname2 else: raise j.exceptions.Input('cannot continue need unique login name which corresponds to your sshkey') c[myname] = {} c = c[myname] keypub = j.core.myenv.sshagent.keypub def showdetails(c): print(json.dumps(c)) def askdetails(c): organizations = ['codescalers', 'freeflow', 'frequencyvillage', 'threefold', 'incubaid', 'bettertoken'] organizations2 = ', '.join(organizations) if 'email' not in c: c['email'] = j.core.tools.ask_string('please provide your main email addr') if 'organizations' not in c: print("valid organizations: '%s'" % organizations2) c['organizations'] = j.core.tools.ask_string('please provide your organizations (comma separated)') if 'remark' not in c: c['remark'] = j.core.tools.ask_string('any remark?') if 'telegram' not in c: c['telegram'] = j.core.tools.ask_string('please provide your main telegram handle') if 'mobile' not in c: c['mobile'] = j.core.tools.ask_string("please provide your mobile nr's (if more than one use ,)") showdetails(c) y = j.core.tools.ask_yes_no('is above all correct !!!') if not y: c['email'] = j.core.tools.ask_string('please provide your main email addr', default=c['email']) print("valid organizations: '%s'" % organizations2) c['organizations'] = j.core.tools.ask_string('please provide your organizations (comma separated)', default=c['organizations']) c['remark'] = j.core.tools.ask_string('any remark?', default=c['remark']) c['telegram'] = j.core.tools.ask_string('please provide your main telegram handle', default=c['telegram']) c['mobile'] = j.core.tools.ask_string("please provide your mobile nr's (if more than one use ,)", default=c['mobile']) self.executor.save() o = c['organizations'] o2 = [] for oname in o.lower().split(','): oname = oname.strip().lower() if oname == '': continue if oname not in organizations: raise j.exceptions.Input('please choose valid organizations (notok:%s): %s' % (oname, organizations2)) o2.append(oname) c['organizations'] = ','.join(o2) if 'keypub' not in c: c['keypub'] = keypub askdetails() self.executor.save() elif not c['keypub'].strip() == keypub.strip(): showdetails(c) y = j.core.tools.ask_yes_no('Are you sure your are above?') raise j.exceptions.Input('keypub does not correspond, your name:%s, is this a unique name, comes from your main sshkey, change if needed' % myname) return myname def load(self): self._config = None @property def config_mine(self): return self.config['clients'][self.myname] @property def myid(self): if 'myid' not in self.config_mine: if 'lastmyid' not in self.config: self.config['lastmyid'] = 1 else: self.config['lastmyid'] += 1 self.config_mine['myid'] = self.config['lastmyid'] self.executor.save() return self.config_mine['myid'] @property def config(self): """ is the main config """ if not self._config: c = self.executor.config if not 'registry' in c: c['registry'] = {} config = self.executor.config['registry'] if 'clients' not in config: config['clients'] = {} self._config = config return self._config
# Copyright (c) 2012-2018 SoftBank Robotics. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the COPYING file. """ qisrc actcions """
""" qisrc actcions """
__author__ = 'ian.collins' currentcolor = True # true=day, false=night lightthreshold = 50 lightchecktime = 10.0 gpsrefreshtime = 15.0 netrefreshtime = 30.0 crvincidentmain = None # The actualt status bar statusbar = None # Where the statusbar fields are kept statusbarbox = None # An alternate statusbar - primarily for drop down hints (first char of dropdown list) altstatusbarbox = None # used by dropdown for hints # When button in alstatusbarbox is clicked, value it put here. alstatusbarclick = '' # The altstatusbarbox parent (used to test if caller is still active) alstatusbarparent = None quickpopup = None # to try and stop too many error popups data = None msgbox = None mycurl = None tmpxloc = None gridheight = 40 default_font_size = '20sp' default_large_font_size = '30sp' default_medium_font_size = '15sp' default_small_font_size = '14sp' default_tiny_font_size = '10sp' default_menu_font_size = '18sp' temptidestations = []
__author__ = 'ian.collins' currentcolor = True lightthreshold = 50 lightchecktime = 10.0 gpsrefreshtime = 15.0 netrefreshtime = 30.0 crvincidentmain = None statusbar = None statusbarbox = None altstatusbarbox = None alstatusbarclick = '' alstatusbarparent = None quickpopup = None data = None msgbox = None mycurl = None tmpxloc = None gridheight = 40 default_font_size = '20sp' default_large_font_size = '30sp' default_medium_font_size = '15sp' default_small_font_size = '14sp' default_tiny_font_size = '10sp' default_menu_font_size = '18sp' temptidestations = []
######################################################################################################################################################################### # Author : Remi Monthiller, remi.monthiller@etu.enseeiht.fr # Adapted from the code of Raphael Maurin, raphael.maurin@imft.fr # 30/10/2018 # # Incline plane simulations # ######################################################################################################################################################################### def lengthVector3(vect): return (vect[0] ** 2.0 + vect[1] ** 2.0 + vect[2] ** 2.0) ** (1.0/2.0)
def length_vector3(vect): return (vect[0] ** 2.0 + vect[1] ** 2.0 + vect[2] ** 2.0) ** (1.0 / 2.0)
class Solution(object): def wordsAbbreviation(self, dict): """ :type dict: List[str] :rtype: List[str] """ res = [] countMap = {} prefix = [1] * len(dict) for word in dict: abbr = self.abbreviateWord(word, 1) res.append(abbr) countMap[abbr] = countMap.get(abbr, 0) + 1 while(True): unique = True for i in range(len(res)): if countMap.get(res[i], 0) > 1: unique = False prefix[i] += 1 abbr = self.abbreviateWord(dict[i], prefix[i]) res[i] = abbr countMap[abbr] = countMap.get(abbr, 0) + 1 if unique: break return res def abbreviateWord(self, word, pos): if pos + 2 >= len(word): return word return word[:pos] + str(len(word) - pos - 1) + word[-1]
class Solution(object): def words_abbreviation(self, dict): """ :type dict: List[str] :rtype: List[str] """ res = [] count_map = {} prefix = [1] * len(dict) for word in dict: abbr = self.abbreviateWord(word, 1) res.append(abbr) countMap[abbr] = countMap.get(abbr, 0) + 1 while True: unique = True for i in range(len(res)): if countMap.get(res[i], 0) > 1: unique = False prefix[i] += 1 abbr = self.abbreviateWord(dict[i], prefix[i]) res[i] = abbr countMap[abbr] = countMap.get(abbr, 0) + 1 if unique: break return res def abbreviate_word(self, word, pos): if pos + 2 >= len(word): return word return word[:pos] + str(len(word) - pos - 1) + word[-1]
DRIVERS = { "default": "cookie", "cookie": {}, }
drivers = {'default': 'cookie', 'cookie': {}}
string = "resource" if len(string) < 2: print("--") else: print(string[0:2] + string[-2:])
string = 'resource' if len(string) < 2: print('--') else: print(string[0:2] + string[-2:])
def increment_id(tag): if tag == "error": filename = "errorarena" elif tag == "valid": filename = "validarena" elif tag == "gif": filename = "gif" file = open(f"./results/id/{filename}.txt","r") id_line = file.readline() file.close() curr_id = int(id_line.strip()) file = open(f"./results/id/{filename}.txt","w") file.write(f"{curr_id+1}") file.close() return curr_id
def increment_id(tag): if tag == 'error': filename = 'errorarena' elif tag == 'valid': filename = 'validarena' elif tag == 'gif': filename = 'gif' file = open(f'./results/id/{filename}.txt', 'r') id_line = file.readline() file.close() curr_id = int(id_line.strip()) file = open(f'./results/id/{filename}.txt', 'w') file.write(f'{curr_id + 1}') file.close() return curr_id
for char in 'One': print (char) ''' O n e '''
for char in 'One': print(char) '\nO\nn \ne\n'
# program to convert degrees f to degrees c # need to use (degF - 32) * 5/9 user = input('Hello, what is your name? ') print('Hello', user) degF = int(input('Enter a temperature in degrees F: ')) degC = (degF -32) * 5/9 print('{} ,degrees F converts to , {} ,degrees C'.format(degF, (degC)))
user = input('Hello, what is your name? ') print('Hello', user) deg_f = int(input('Enter a temperature in degrees F: ')) deg_c = (degF - 32) * 5 / 9 print('{} ,degrees F converts to , {} ,degrees C'.format(degF, degC))
num =10 num2= 20 num3=30 num4=40
num = 10 num2 = 20 num3 = 30 num4 = 40
class A(object): x:int = 1 class B(A): def __init__(self: "B"): pass class C(B): z:bool = True a:A = None b:B = None c:C = None a = A() b = B() c = C()
class A(object): x: int = 1 class B(A): def __init__(self: 'B'): pass class C(B): z: bool = True a: A = None b: B = None c: C = None a = a() b = b() c = c()
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Feb 21 20:55:21 2017 @author: Lama Hamadeh """ ''' Case Study about DNA translation ''' ''' NCBI is the United States' main public repository of DNA and related information We will download two files from NCBI: the first is a strand of DNA and the second is the protein sequence of amino acids translated from this DNA. ''' #Downloading DNA Data #--------------------- #read in the NCBI DNA sequence with the accession number NM_207618.2 #we have downloaded two files from the website: #DNA.txt #protein.text #Importing DNA Data Into Python #------------------------------- #we can/need enter the studying folder through 'cd' and display the current folder using 'pwd' print("\nThe DNA Sequence From the NCBI Website (Accession Number NM_207618.2) Is....\n") inputfile = "DNA.txt" f = open (inputfile, "r") #"r" here refers to reading command seq = f.read() seq = seq.replace("\n", "") seq = seq.replace("\r", "")#As strings are immutable, this method return a new string #so in order for us to use a new string, we have to assign it to a variable #in this case, we will reassign it to the same variable as before. print(seq) #we can even slice up the sequence to see specific part of the DNA file #for example: print(seq[40:50]). In this case the output would be: CCTGAAAACC. #Another way of opening the DNA.txt file: #inputfile = "DNA.txt" #with open(inutfile, "r") as f: #we need to put the colon at the end since with #is a compound statement #seq = f.read() # We also can create a function that reads the file: ''' def read_seq(inputfile): """This function reads and returns the input sequence with special characters removed""" with open(inputfile, "r") as f: seq = f.read() seq = seq.replace("\n", "") seq = seq.replace("\r", "") return seq ''' #Translating the DNA Sequence #----------------------------- #the translation process is essentially a table lookup operation. #Python provides a very natural object for dealing with these types of situations. #The object is a dictionary. #In this case, the key objects are strings, each consisting of three letters, #i.e., condons or nucleotide triples, drawn #from the four letter alphabet (A,G,C,T). #The value object is also a string but a string consisting of just one-letter symbol #used for different amino acids. #Defining a dictionary called 'table': table = {'ATA':'I', 'ATC':'I', 'ATT':'I', 'ATG':'M', 'ACA':'T', 'ACC':'T', 'ACG':'T', 'ACT':'T', 'AAC':'N', 'AAt':'N', 'AAA':'K', 'AAG':'K', 'AGC':'S', 'AGT':'S', 'AGA':'R', 'AGG':'R', 'CTA':'L', 'CTC':'L', 'CTG':'L', 'CTT':'L', 'CCA':'P', 'CCC':'P', 'CCG':'P', 'CCT':'P', 'CAC':'H', 'CAT':'H', 'CAA':'Q', 'CAG':'Q', 'CGA':'R', 'CGC':'R', 'CGG':'R', 'CGT':'R', 'GTA':'V', 'GTC':'V', 'GTG':'V', 'GTT':'V', 'GCA':'A', 'GCC':'A', 'GCG':'A', 'GCT':'A', 'GAC':'D', 'GAT':'D', 'GAA':'E', 'GAG':'E', 'GGA':'G', 'GGC':'G', 'GGG':'G', 'GGT':'G', 'TCA':'S', 'TCC':'S', 'TCG':'S', 'TCT':'S', 'TTC':'F', 'TTT':'F', 'TTA':'L', 'TTG':'L', 'TAC':'Y', 'TAT':'Y', 'TAA':'_', 'TAG':'_', 'TGC':'C', 'TGT':'C', 'TGA':'_', 'TGG':'W'} print (table['ATC']) #to see what is the corresponding value for the key ATC. #STEP1: Check that length of sequence is divisible by 3 #STEP2: Look up each 3-letter string in table and store result. #STEP3: Continue lookups until reaching end of sequence. #Define a function that describes the translating process. def translate(seq): '''DOCSTRING: Translate a string containing a nucleotide sequence into a string containing the corresponding sequence of amino acids. Nucleotides are translated in triplets using the table dictionary; each amino acid is encoded with a string of length 1.''' table = {'ATA':'I', 'ATC':'I', 'ATT':'I', 'ATG':'M', 'ACA':'T', 'ACC':'T', 'ACG':'T', 'ACT':'T', 'AAC':'N', 'AAt':'N', 'AAA':'K', 'AAG':'K', 'AGC':'S', 'AGT':'S', 'AGA':'R', 'AGG':'R', 'CTA':'L', 'CTC':'L', 'CTG':'L', 'CTT':'L', 'CCA':'P', 'CCC':'P', 'CCG':'P', 'CCT':'P', 'CAC':'H', 'CAT':'H', 'CAA':'Q', 'CAG':'Q', 'CGA':'R', 'CGC':'R', 'CGG':'R', 'CGT':'R', 'GTA':'V', 'GTC':'V', 'GTG':'V', 'GTT':'V', 'GCA':'A', 'GCC':'A', 'GCG':'A', 'GCT':'A', 'GAC':'D', 'GAT':'D', 'GAA':'E', 'GAG':'E', 'GGA':'G', 'GGC':'G', 'GGG':'G', 'GGT':'G', 'TCA':'S', 'TCC':'S', 'TCG':'S', 'TCT':'S', 'TTC':'F', 'TTT':'F', 'TTA':'L', 'TTG':'L', 'TAC':'Y', 'TAT':'Y', 'TAA':'_', 'TAG':'_', 'TGC':'C', 'TGT':'C', 'TGA':'_', 'TGG':'W'} protein = '' if len(seq) % 3 == 0: # Check that length of sequence is divisible by 3 for i in range(0, len(seq), 3): #Look up each 3-letter string in table and store result. condon = seq[i : i+3] protein += table[condon] return protein #check the function print(translate("ATG")) print(help (translate))#This print the docstring that is included inside the function
""" Created on Tue Feb 21 20:55:21 2017 @author: Lama Hamadeh """ '\nCase Study about DNA translation\n' "\nNCBI is the United States' main public repository of DNA and related information\nWe will download two files from NCBI: the first is a strand of DNA and the second \nis the protein sequence of amino acids translated from this DNA.\n" print('\nThe DNA Sequence From the NCBI Website (Accession Number NM_207618.2) Is....\n') inputfile = 'DNA.txt' f = open(inputfile, 'r') seq = f.read() seq = seq.replace('\n', '') seq = seq.replace('\r', '') print(seq) '\ndef read_seq(inputfile):\n """This function reads and returns the input sequence with special characters removed"""\n with open(inputfile, "r") as f:\n seq = f.read()\n seq = seq.replace("\n", "") \n seq = seq.replace("\r", "")\n return seq\n' table = {'ATA': 'I', 'ATC': 'I', 'ATT': 'I', 'ATG': 'M', 'ACA': 'T', 'ACC': 'T', 'ACG': 'T', 'ACT': 'T', 'AAC': 'N', 'AAt': 'N', 'AAA': 'K', 'AAG': 'K', 'AGC': 'S', 'AGT': 'S', 'AGA': 'R', 'AGG': 'R', 'CTA': 'L', 'CTC': 'L', 'CTG': 'L', 'CTT': 'L', 'CCA': 'P', 'CCC': 'P', 'CCG': 'P', 'CCT': 'P', 'CAC': 'H', 'CAT': 'H', 'CAA': 'Q', 'CAG': 'Q', 'CGA': 'R', 'CGC': 'R', 'CGG': 'R', 'CGT': 'R', 'GTA': 'V', 'GTC': 'V', 'GTG': 'V', 'GTT': 'V', 'GCA': 'A', 'GCC': 'A', 'GCG': 'A', 'GCT': 'A', 'GAC': 'D', 'GAT': 'D', 'GAA': 'E', 'GAG': 'E', 'GGA': 'G', 'GGC': 'G', 'GGG': 'G', 'GGT': 'G', 'TCA': 'S', 'TCC': 'S', 'TCG': 'S', 'TCT': 'S', 'TTC': 'F', 'TTT': 'F', 'TTA': 'L', 'TTG': 'L', 'TAC': 'Y', 'TAT': 'Y', 'TAA': '_', 'TAG': '_', 'TGC': 'C', 'TGT': 'C', 'TGA': '_', 'TGG': 'W'} print(table['ATC']) def translate(seq): """DOCSTRING: Translate a string containing a nucleotide sequence into a string containing the corresponding sequence of amino acids. Nucleotides are translated in triplets using the table dictionary; each amino acid is encoded with a string of length 1.""" table = {'ATA': 'I', 'ATC': 'I', 'ATT': 'I', 'ATG': 'M', 'ACA': 'T', 'ACC': 'T', 'ACG': 'T', 'ACT': 'T', 'AAC': 'N', 'AAt': 'N', 'AAA': 'K', 'AAG': 'K', 'AGC': 'S', 'AGT': 'S', 'AGA': 'R', 'AGG': 'R', 'CTA': 'L', 'CTC': 'L', 'CTG': 'L', 'CTT': 'L', 'CCA': 'P', 'CCC': 'P', 'CCG': 'P', 'CCT': 'P', 'CAC': 'H', 'CAT': 'H', 'CAA': 'Q', 'CAG': 'Q', 'CGA': 'R', 'CGC': 'R', 'CGG': 'R', 'CGT': 'R', 'GTA': 'V', 'GTC': 'V', 'GTG': 'V', 'GTT': 'V', 'GCA': 'A', 'GCC': 'A', 'GCG': 'A', 'GCT': 'A', 'GAC': 'D', 'GAT': 'D', 'GAA': 'E', 'GAG': 'E', 'GGA': 'G', 'GGC': 'G', 'GGG': 'G', 'GGT': 'G', 'TCA': 'S', 'TCC': 'S', 'TCG': 'S', 'TCT': 'S', 'TTC': 'F', 'TTT': 'F', 'TTA': 'L', 'TTG': 'L', 'TAC': 'Y', 'TAT': 'Y', 'TAA': '_', 'TAG': '_', 'TGC': 'C', 'TGT': 'C', 'TGA': '_', 'TGG': 'W'} protein = '' if len(seq) % 3 == 0: for i in range(0, len(seq), 3): condon = seq[i:i + 3] protein += table[condon] return protein print(translate('ATG')) print(help(translate))
class Solution: def findKthPositive(self, arr: List[int], k: int) -> int: ''' Number of missing element at index i = = arr[0] - 1 + arr[idx] - arr[0] - idx = = arr[idx] - idx - 1 For more description, see: 1060 Missing Element in Sorted Array T: O(log n) and O(1) ''' def countMissing(idx): return arr[idx] - idx - 1 if k < arr[0]: return k lo, hi = 0, len(arr) while lo < hi: mid = lo + (hi - lo) // 2 if countMissing(mid) >= k: hi = mid else: lo = mid + 1 return arr[lo - 1] + k - countMissing(lo - 1)
class Solution: def find_kth_positive(self, arr: List[int], k: int) -> int: """ Number of missing element at index i = = arr[0] - 1 + arr[idx] - arr[0] - idx = = arr[idx] - idx - 1 For more description, see: 1060 Missing Element in Sorted Array T: O(log n) and O(1) """ def count_missing(idx): return arr[idx] - idx - 1 if k < arr[0]: return k (lo, hi) = (0, len(arr)) while lo < hi: mid = lo + (hi - lo) // 2 if count_missing(mid) >= k: hi = mid else: lo = mid + 1 return arr[lo - 1] + k - count_missing(lo - 1)
z = "Tests were ran for service: matchService \n" \ "Passed: \n" \ "Failed: \n" \ "Error: \n" \ "Skipped: \n"
z = 'Tests were ran for service: matchService \nPassed: \nFailed: \nError: \nSkipped: \n'
ip_addr1="192.168.1.1" ip_addr2="10.1.1.1" ip_addr3="172.16.1.1" print ("\n") print ("-" * 80) print ("{my_ip:^20}{ip:^20}{ip_alt:^20}".format(ip_alt=ip_addr1, ip=ip_addr2, my_ip=ip_addr3)) print ("-" * 80) print ("\n") octets = ip_addr1.split('.')
ip_addr1 = '192.168.1.1' ip_addr2 = '10.1.1.1' ip_addr3 = '172.16.1.1' print('\n') print('-' * 80) print('{my_ip:^20}{ip:^20}{ip_alt:^20}'.format(ip_alt=ip_addr1, ip=ip_addr2, my_ip=ip_addr3)) print('-' * 80) print('\n') octets = ip_addr1.split('.')
""" find the last item in a singly linked list """ #keep checking list until there is node has no next def lastnode(linked_list, k): if k <= 0: return None pointer2 = linkedlist.head for i in range(k-1): if pointer2.next != None: pointer2 = pointer2.next else: return "loop" pointer1 = linkedlist.head while pointer2.next != None: pointer2 = pointer2.next pointer1 = pointer1.next return pointer1
""" find the last item in a singly linked list """ def lastnode(linked_list, k): if k <= 0: return None pointer2 = linkedlist.head for i in range(k - 1): if pointer2.next != None: pointer2 = pointer2.next else: return 'loop' pointer1 = linkedlist.head while pointer2.next != None: pointer2 = pointer2.next pointer1 = pointer1.next return pointer1
"""Define module exceptions.""" class SeventeenTrackError(Exception): """Define a base error.""" pass class InvalidTrackingNumberError(SeventeenTrackError): """Define an error for an invalid tracking number.""" pass class RequestError(SeventeenTrackError): """Define an error for HTTP request errors.""" pass
"""Define module exceptions.""" class Seventeentrackerror(Exception): """Define a base error.""" pass class Invalidtrackingnumbererror(SeventeenTrackError): """Define an error for an invalid tracking number.""" pass class Requesterror(SeventeenTrackError): """Define an error for HTTP request errors.""" pass
class Registers(object): def __eq__(self, other) : return self.__dict__ == other.__dict__ def __init__(self): self.accumulator = 0 self.x_index = 0 self.y_index = 0 self.sp = 0xFD self.pc = 0 self.carry_flag = False self.zero_flag = False self.interrupt_disable_flag = True self.decimal_mode_flag = False self.sw_interrupt = False self.overflow_flag = False self.negative_flag = False def set_NZ(self, value): self.negative_flag = (value & 0x80) self.zero_flag = (value == 0) def set_NZV(self, operand, result): signbits_differ = (operand ^ self.accumulator) & 0x80 resultsign_differs = (operand ^ result) & 0x80 #print("a: {2} o:{0} r:{1}".format(operand, result, self.accumulator)) #print("rd:{0} sd:{1}".format(resultsign_differs, signbits_differ)) self.overflow_flag = resultsign_differs and not signbits_differ self.set_NZ(result) def status_register(self): bits = 1 if self.overflow_flag else 0 bits |= 0x20 if self.decimal_mode_flag else 0 bits |= 0x40 if self.interrupt_disable_flag else 0 bits |= 0x10 if self.carry_flag else 0 bits |= 0x20 if self.zero_flag else 0 bits |= 0x40 if self.negative_flag else 0 return bits
class Registers(object): def __eq__(self, other): return self.__dict__ == other.__dict__ def __init__(self): self.accumulator = 0 self.x_index = 0 self.y_index = 0 self.sp = 253 self.pc = 0 self.carry_flag = False self.zero_flag = False self.interrupt_disable_flag = True self.decimal_mode_flag = False self.sw_interrupt = False self.overflow_flag = False self.negative_flag = False def set_nz(self, value): self.negative_flag = value & 128 self.zero_flag = value == 0 def set_nzv(self, operand, result): signbits_differ = (operand ^ self.accumulator) & 128 resultsign_differs = (operand ^ result) & 128 self.overflow_flag = resultsign_differs and (not signbits_differ) self.set_NZ(result) def status_register(self): bits = 1 if self.overflow_flag else 0 bits |= 32 if self.decimal_mode_flag else 0 bits |= 64 if self.interrupt_disable_flag else 0 bits |= 16 if self.carry_flag else 0 bits |= 32 if self.zero_flag else 0 bits |= 64 if self.negative_flag else 0 return bits
def take_input(): """Helper function to take input for a user""" name_marks = input().split() name = name_marks[0] marks = [float(x) for x in name_marks[1:]] return name, marks def rank_user(users_name_list, users_score_lst): """Returns a dictionary. Key is user_name and values is rank""" user_score = dict(zip(users_name_list, users_score_lst)) user_score = sorted(user_score.items(), key=lambda x: x[1], reverse=True) rank_dict = {} rank = 0 prev = float('-inf') for idx, (key, val) in enumerate(user_score): if prev == val: rank_dict[key] = rank else: rank_dict[key] = rank+1 rank += 1 prev = val return rank_dict def find_topper(): """Rank users based on mean score.""" # your code starts here. print("Enter user_name and marks (space seperated)") users_1, marks_1 = take_input() users_2, marks_2 = take_input() users_3, marks_3 = take_input() users_1_mean_score = sum(marks_1)/len(marks_1) users_2_mean_score = sum(marks_2)/len(marks_2) users_3_mean_score = sum(marks_3)/len(marks_3) user_lst = [users_1, users_2, users_3] score_lst = [users_1_mean_score, users_2_mean_score, users_3_mean_score] user_ranks = rank_user(user_lst, score_lst) for name, rank in user_ranks.items(): print("{}: {}".format(name, rank)) if __name__ == '__main__': find_topper()
def take_input(): """Helper function to take input for a user""" name_marks = input().split() name = name_marks[0] marks = [float(x) for x in name_marks[1:]] return (name, marks) def rank_user(users_name_list, users_score_lst): """Returns a dictionary. Key is user_name and values is rank""" user_score = dict(zip(users_name_list, users_score_lst)) user_score = sorted(user_score.items(), key=lambda x: x[1], reverse=True) rank_dict = {} rank = 0 prev = float('-inf') for (idx, (key, val)) in enumerate(user_score): if prev == val: rank_dict[key] = rank else: rank_dict[key] = rank + 1 rank += 1 prev = val return rank_dict def find_topper(): """Rank users based on mean score.""" print('Enter user_name and marks (space seperated)') (users_1, marks_1) = take_input() (users_2, marks_2) = take_input() (users_3, marks_3) = take_input() users_1_mean_score = sum(marks_1) / len(marks_1) users_2_mean_score = sum(marks_2) / len(marks_2) users_3_mean_score = sum(marks_3) / len(marks_3) user_lst = [users_1, users_2, users_3] score_lst = [users_1_mean_score, users_2_mean_score, users_3_mean_score] user_ranks = rank_user(user_lst, score_lst) for (name, rank) in user_ranks.items(): print('{}: {}'.format(name, rank)) if __name__ == '__main__': find_topper()
class Solution: def anagrams(self, strs): key = lambda s: ''.join(sorted(s)) strs = sorted(strs, key=key) strs = itertools.groupby(strs, key=key) result = [] for k, g in strs: l = list(g) if len(l) == 1: continue result.extend(l) return result
class Solution: def anagrams(self, strs): key = lambda s: ''.join(sorted(s)) strs = sorted(strs, key=key) strs = itertools.groupby(strs, key=key) result = [] for (k, g) in strs: l = list(g) if len(l) == 1: continue result.extend(l) return result