hexsha string | size int64 | ext string | lang string | max_stars_repo_path string | max_stars_repo_name string | max_stars_repo_head_hexsha string | max_stars_repo_licenses list | max_stars_count int64 | max_stars_repo_stars_event_min_datetime string | max_stars_repo_stars_event_max_datetime string | max_issues_repo_path string | max_issues_repo_name string | max_issues_repo_head_hexsha string | max_issues_repo_licenses list | max_issues_count int64 | max_issues_repo_issues_event_min_datetime string | max_issues_repo_issues_event_max_datetime string | max_forks_repo_path string | max_forks_repo_name string | max_forks_repo_head_hexsha string | max_forks_repo_licenses list | max_forks_count int64 | max_forks_repo_forks_event_min_datetime string | max_forks_repo_forks_event_max_datetime string | content string | avg_line_length float64 | max_line_length int64 | alphanum_fraction float64 | qsc_code_num_words_quality_signal int64 | qsc_code_num_chars_quality_signal float64 | qsc_code_mean_word_length_quality_signal float64 | qsc_code_frac_words_unique_quality_signal float64 | qsc_code_frac_chars_top_2grams_quality_signal float64 | qsc_code_frac_chars_top_3grams_quality_signal float64 | qsc_code_frac_chars_top_4grams_quality_signal float64 | qsc_code_frac_chars_dupe_5grams_quality_signal float64 | qsc_code_frac_chars_dupe_6grams_quality_signal float64 | qsc_code_frac_chars_dupe_7grams_quality_signal float64 | qsc_code_frac_chars_dupe_8grams_quality_signal float64 | qsc_code_frac_chars_dupe_9grams_quality_signal float64 | qsc_code_frac_chars_dupe_10grams_quality_signal float64 | qsc_code_frac_chars_replacement_symbols_quality_signal float64 | qsc_code_frac_chars_digital_quality_signal float64 | qsc_code_frac_chars_whitespace_quality_signal float64 | qsc_code_size_file_byte_quality_signal float64 | qsc_code_num_lines_quality_signal float64 | qsc_code_num_chars_line_max_quality_signal float64 | qsc_code_num_chars_line_mean_quality_signal float64 | qsc_code_frac_chars_alphabet_quality_signal float64 | qsc_code_frac_chars_comments_quality_signal float64 | qsc_code_cate_xml_start_quality_signal float64 | qsc_code_frac_lines_dupe_lines_quality_signal float64 | qsc_code_cate_autogen_quality_signal float64 | qsc_code_frac_lines_long_string_quality_signal float64 | qsc_code_frac_chars_string_length_quality_signal float64 | qsc_code_frac_chars_long_word_length_quality_signal float64 | qsc_code_frac_lines_string_concat_quality_signal float64 | qsc_code_cate_encoded_data_quality_signal float64 | qsc_code_frac_chars_hex_words_quality_signal float64 | qsc_code_frac_lines_prompt_comments_quality_signal float64 | qsc_code_frac_lines_assert_quality_signal float64 | qsc_codepython_cate_ast_quality_signal float64 | qsc_codepython_frac_lines_func_ratio_quality_signal float64 | qsc_codepython_cate_var_zero_quality_signal bool | qsc_codepython_frac_lines_pass_quality_signal float64 | qsc_codepython_frac_lines_import_quality_signal float64 | qsc_codepython_frac_lines_simplefunc_quality_signal float64 | qsc_codepython_score_lines_no_logic_quality_signal float64 | qsc_codepython_frac_lines_print_quality_signal float64 | qsc_code_num_words int64 | qsc_code_num_chars int64 | qsc_code_mean_word_length int64 | qsc_code_frac_words_unique null | qsc_code_frac_chars_top_2grams int64 | qsc_code_frac_chars_top_3grams int64 | qsc_code_frac_chars_top_4grams int64 | qsc_code_frac_chars_dupe_5grams int64 | qsc_code_frac_chars_dupe_6grams int64 | qsc_code_frac_chars_dupe_7grams int64 | qsc_code_frac_chars_dupe_8grams int64 | qsc_code_frac_chars_dupe_9grams int64 | qsc_code_frac_chars_dupe_10grams int64 | qsc_code_frac_chars_replacement_symbols int64 | qsc_code_frac_chars_digital int64 | qsc_code_frac_chars_whitespace int64 | qsc_code_size_file_byte int64 | qsc_code_num_lines int64 | qsc_code_num_chars_line_max int64 | qsc_code_num_chars_line_mean int64 | qsc_code_frac_chars_alphabet int64 | qsc_code_frac_chars_comments int64 | qsc_code_cate_xml_start int64 | qsc_code_frac_lines_dupe_lines int64 | qsc_code_cate_autogen int64 | qsc_code_frac_lines_long_string int64 | qsc_code_frac_chars_string_length int64 | qsc_code_frac_chars_long_word_length int64 | qsc_code_frac_lines_string_concat null | qsc_code_cate_encoded_data int64 | qsc_code_frac_chars_hex_words int64 | qsc_code_frac_lines_prompt_comments int64 | qsc_code_frac_lines_assert int64 | qsc_codepython_cate_ast int64 | qsc_codepython_frac_lines_func_ratio int64 | qsc_codepython_cate_var_zero int64 | qsc_codepython_frac_lines_pass int64 | qsc_codepython_frac_lines_import int64 | qsc_codepython_frac_lines_simplefunc int64 | qsc_codepython_score_lines_no_logic int64 | qsc_codepython_frac_lines_print int64 | effective string | hits int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
241917b9f7f7358d578b3f46ded3d76d3d53ac33 | 317 | py | Python | guillotina/addons.py | onna/guillotina | e4b05d97a1a8e4c211c6b97b2770ced1d97c4569 | [
"BSD-2-Clause"
] | null | null | null | guillotina/addons.py | onna/guillotina | e4b05d97a1a8e4c211c6b97b2770ced1d97c4569 | [
"BSD-2-Clause"
] | null | null | null | guillotina/addons.py | onna/guillotina | e4b05d97a1a8e4c211c6b97b2770ced1d97c4569 | [
"BSD-2-Clause"
] | null | null | null | from guillotina.interfaces import IAddOn
from zope.interface import implementer
@implementer(IAddOn)
class Addon(object):
""" Prototype of an Addon plugin
"""
@classmethod
def install(cls, container, request):
pass
@classmethod
def uninstall(cls, container, request):
pass
| 18.647059 | 43 | 0.684543 | 34 | 317 | 6.382353 | 0.676471 | 0.129032 | 0.175115 | 0.211982 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.233438 | 317 | 16 | 44 | 19.8125 | 0.893004 | 0.088328 | 0 | 0.4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0.2 | 0.2 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
24221b8a73a0a95ef4ba6b74bb424e4aeb60172f | 662 | py | Python | test/test_dnf.py | gburca/ccs-py | c69b6c7f8a899f6747b8632541ef1a4159a2baab | [
"MIT"
] | 1 | 2019-09-26T17:15:47.000Z | 2019-09-26T17:15:47.000Z | test/test_dnf.py | gburca/ccs-py | c69b6c7f8a899f6747b8632541ef1a4159a2baab | [
"MIT"
] | null | null | null | test/test_dnf.py | gburca/ccs-py | c69b6c7f8a899f6747b8632541ef1a4159a2baab | [
"MIT"
] | 1 | 2021-11-29T18:34:17.000Z | 2021-11-29T18:34:17.000Z | import io
from ccs.ast import flatten
from ccs.dnf import to_dnf
from ccs.parser import Parser
def dnfify(string: str):
expr = Parser().parse_selector(io.StringIO(string))
return to_dnf(flatten(expr))
def test_dnf():
assert str(dnfify("a b, c d")) == "a b, c d"
def test_cnf():
assert str(dnfify("(a, b) (c, d)")) == "a c, a d, b c, b d"
def test_nested_and():
assert str(dnfify("(a b) (c d)")) == "a b c d"
def test_sharing():
assert str(dnfify("(a f (b, e)) (c d)")) == "a b c d f, a c d e f"
def test_flatten_single_key_leaf_disjunctions():
sel = "(a.x, a.y, a.z) b"
assert str(dnfify(sel)) == "(a.x, a.y, a.z) b"
| 20.6875 | 70 | 0.599698 | 129 | 662 | 2.976744 | 0.294574 | 0.041667 | 0.046875 | 0.0625 | 0.276042 | 0.276042 | 0.260417 | 0.260417 | 0.15625 | 0.15625 | 0 | 0 | 0.214502 | 662 | 31 | 71 | 21.354839 | 0.738462 | 0 | 0 | 0 | 0 | 0 | 0.206949 | 0 | 0 | 0 | 0 | 0 | 0.277778 | 1 | 0.333333 | false | 0 | 0.222222 | 0 | 0.611111 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
242aa1b4332ee419dad2d7a777f468c52ef48829 | 2,169 | py | Python | application/pages/training_analysis/models/performance_curve.py | Jhsmit/awesome-panel | 53f7754f7c505a2666f6724df26c851ae942ec40 | [
"Apache-2.0"
] | 1 | 2020-05-08T21:44:37.000Z | 2020-05-08T21:44:37.000Z | application/pages/training_analysis/models/performance_curve.py | Jhsmit/awesome-panel | 53f7754f7c505a2666f6724df26c851ae942ec40 | [
"Apache-2.0"
] | null | null | null | application/pages/training_analysis/models/performance_curve.py | Jhsmit/awesome-panel | 53f7754f7c505a2666f6724df26c851ae942ec40 | [
"Apache-2.0"
] | null | null | null | """This module contains functionality to model a Performance Curve
An example is a Power Curve
"""
import datetime
import param
DATE_BOUNDS = (
datetime.date(1980, 1, 1,),
datetime.datetime.now().date(),
)
class PerformanceCurve(param.Parameterized):
"""A Model of a Performance Curve
The default values are from the Power Curve of Marc Skov Madsen as of 2020-01-05
"""
one_sec = param.Number(2582)
one_sec_date = param.Date(datetime.date(2017, 11, 23,), bounds=DATE_BOUNDS,)
two_sec = param.Number(2582)
two_sec_date = param.Date(datetime.date(2017, 11, 23,), bounds=DATE_BOUNDS,)
five_sec = param.Number(1707)
five_sec_date = param.Date(datetime.date(2017, 11, 23,), bounds=DATE_BOUNDS,)
ten_sec = param.Number(1079)
ten_sec_date = param.Date(datetime.date(2018, 8, 21,), bounds=DATE_BOUNDS,)
twenty_sec = param.Number(892)
twenty_sec_date = param.Date(datetime.date(2018, 7, 29,), bounds=DATE_BOUNDS,)
thirty_sec = param.Number(811)
thirty_sec_date = param.Date(datetime.date(2017, 8, 31,), bounds=DATE_BOUNDS,)
one_min = param.Number(684)
one_min_date = param.Date(datetime.date(2017, 8, 31,), bounds=DATE_BOUNDS,)
two_min = param.Number(511)
two_min_date = param.Date(datetime.date(2017, 7, 27,), bounds=DATE_BOUNDS,)
five_min = param.Number(424)
five_min_date = param.Date(datetime.date(2017, 9, 22,), bounds=DATE_BOUNDS,)
ten_min = param.Number(419)
ten_min_date = param.Date(datetime.date(2017, 9, 22,), bounds=DATE_BOUNDS,)
twenty_min = param.Number(398)
twenty_min_date = param.Date(datetime.date(2017, 9, 22,), bounds=DATE_BOUNDS,)
thirty_min = param.Number(362)
thirty_min_date = param.Date(datetime.date(2017, 9, 22,), bounds=DATE_BOUNDS,)
one_hour = param.Number(319)
one_hour_date = param.Date(datetime.date(2017, 8, 6,), bounds=DATE_BOUNDS,)
two_hour = param.Number(281)
two_hour_date = param.Date(datetime.date(2018, 10, 28,), bounds=DATE_BOUNDS,)
five_hour = param.Number(251)
five_hour_date = param.Date(datetime.date(2017, 6, 5,), bounds=DATE_BOUNDS,)
| 42.529412 | 85 | 0.688797 | 327 | 2,169 | 4.382263 | 0.235474 | 0.100488 | 0.136078 | 0.219819 | 0.459177 | 0.459177 | 0.436148 | 0.318214 | 0.318214 | 0.318214 | 0 | 0.095238 | 0.17704 | 2,169 | 50 | 86 | 43.38 | 0.707563 | 0.094514 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.054054 | 0 | 0.891892 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
242aa377a65320f1a5db35c6ca6b4e487643ce7b | 19,387 | py | Python | camera_module.py | RoboQYD/cobblr-camera | 21195fda4c6fd8edd62e5d32d893945d669c5c29 | [
"MIT"
] | 1 | 2020-08-08T07:39:14.000Z | 2020-08-08T07:39:14.000Z | camera_module.py | RoboQYD/cobblr-camera | 21195fda4c6fd8edd62e5d32d893945d669c5c29 | [
"MIT"
] | null | null | null | camera_module.py | RoboQYD/cobblr-camera | 21195fda4c6fd8edd62e5d32d893945d669c5c29 | [
"MIT"
] | null | null | null | """camera_module.py: Cobblr module that uses PiTFT and RPi camera to take pictures."""
__author__ = 'Qasim Dove'
__credit__ = ['Cliff Dove', '<name of persons>']
__license__ = "GPL"
__version__ = "1.0.1"
__email__ = "emailqasim@gmail.com"
from engine import Screen
from engine import Utilities
from engine import TextWriter
from engine import SystemState
from engine import Menu
from engine import Events
import RPi.GPIO
import io
import os
import signal
import picamera
import time
import threading
signal.signal(signal.SIGINT, Utilities.GracefulExit)
class CameraState(object):
pass
def Init():
"""Sets up the class and variables needed in order to run the camera app."""
RPi.GPIO.setup(7, RPi.GPIO.OUT) #Flash RPi.GPIO
RPi.GPIO.setup(8, RPi.GPIO.IN, pull_up_down=RPi.GPIO.PUD_UP) #Button RPi.GPIO
SystemState.CameraState = CameraState
RPi.GPIO.output(7, False)
SystemState.CameraState.current_photo = ""
SystemState.CameraState.photo_file_name = None
SystemState.CameraState.photo_path = 'media/photos/'
SystemState.CameraState.preview_path = SystemState.CameraState.photo_path + '.preview/'
preview_path = SystemState.CameraState.preview_path
SystemState.CameraState.image_effect = 0
SystemState.CameraState.photo_tally = None
SystemState.CameraState.flash_enabled = True
SystemState.CameraState.exit_camera = False
SystemState.CameraState.camera_stream = False
SystemState.CameraState.album = False
SystemState.CameraState.setting = 'none'
MakePhotoPath()
SystemState.CameraState.photo_archive = os.listdir(preview_path)
SystemState.CameraState.photo_archive = [os.path.join(preview_path, pic) for pic in SystemState.CameraState.photo_archive]
SystemState.CameraState.photo_archive = sorted(SystemState.CameraState.photo_archive)
SystemState.CameraState.photo_count = len(SystemState.CameraState.photo_archive)
SystemState.CameraState.image_effect = 0
SystemState.CameraState.iso = 0
SystemState.CameraState.rotation = 0
SystemState.CameraState.brightness = 5
SystemState.CameraState.saturation = 10
SystemState.CameraState.contrast = 10
SystemState.CameraState.sharpness = 10
SystemState.CameraState.zoom = 0
SystemState.CameraState.meter_mode = 0
SystemState.CameraState.awb_mode = 0
SystemState.CameraState.exposure_mode = 0
SystemState.CameraState.shutter_speed = 0
SystemState.CameraState.iso_values = [0, 100, 200, 320, 400, 500, 640, 800]
SystemState.CameraState.image_effect_values = [
'none', 'negative', 'solarize', 'sketch', 'denoise', 'emboss', 'oilpaint',
'hatch','gpen', 'pastel', 'watercolor', 'film', 'blur', 'saturation',
'colorswap', 'washedout', 'posterise', 'colorpoint', 'colorbalance',
'cartoon', 'deinterlace1', 'deinterlace2'
]
SystemState.CameraState.awb_mode_values = [
'auto', 'sunlight', 'cloudy', 'shade', 'tungsten', 'fluorescent',
'incandescent', 'flash', 'horizon', 'off'
]
SystemState.CameraState.rotation_values = [0, 90, 180, 270]
SystemState.CameraState.brightness_values = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
hundred_container = [-100, -90, -80, -70, -60, -50, -40, -30, -20, -10, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
SystemState.CameraState.saturation_values = hundred_container
SystemState.CameraState.contrast_values = hundred_container
SystemState.CameraState.sharpness_values = hundred_container
SystemState.CameraState.zoom_values = [
(0.0, 0.0, 1.0, 1.0),
(0.1, 0.1, 0.9, 0.9),
(0.225, 0.225, 0.8, 0.8),
(0.25, 0.25, 0.7, 0.7),
(0.275, 0.275, 0.6, 0.6),
(0.3, 0.3, 0.5, 0.5),
(0.325, 0.325, 0.4, 0.4),
(0.35, 0.25, 0.3, 0.3),
(0.375, 0.375, 0.2, 0.2),
(0.4, 0.4, 0.1, 0.1),
]
SystemState.CameraState.meter_mode_values = [
'average', 'spot', 'backlit', 'matrix'
]
SystemState.CameraState.exposure_mode_values = [
'auto', 'night', 'nightpreview', 'backlight', 'spotlight',
'sports', 'snow', 'beach', 'verylong', 'fixedfps', 'antishake',
'fireworks', 'off'
]
SystemState.CameraState.shutter_speed_values = [1000000, 100000, 10000, 1000, 100]
def MakePhotoPath():
"""Creates the folder that stores the highres and preview photo."""
if os.path.exists(SystemState.CameraState.preview_path) == False:
os.makedirs(SystemState.CameraState.preview_path)
os.chown(SystemState.CameraState.preview_path, SystemState.uid, SystemState.gid)
def Process():
"""Determines what buttons were pressed with each screen touch."""
button = str(SystemState.pressed_button)
pygame = SystemState.pygame
screen = SystemState.screen
screen_mode = SystemState.screen_mode
if button == 'flash_on':
Menu.JumpTo(screen_mode=2, toggle=True)
SystemState.CameraState.flash_enabled = False
elif button == 'flash_off':
Menu.JumpTo(screen_mode=1, toggle=True)
SystemState.CameraState.flash_enabled = True
elif button == 'go_back':
Menu.Back()
SystemState.CameraState.setting = 'none'
SystemState.CameraState.album = False
elif button == 'gallery':
Menu.JumpTo(screen_mode=3)
OpenAlbum()
elif button == 'right_arrow':
__ProcessRightArrow()
elif button == 'left_arrow':
__ProcessLeftArrow()
elif button == 'capture':
CallTakePhoto()
elif button == 'delete' and SystemState.CameraState.photo_count > 0:
Menu.JumpTo(screen_mode=4)
BlitImage(SystemState.CameraState.current_photo, SystemState.pygame, SystemState.screen)
TextWriter.Write(state=SystemState, text='Delete?', position=(125, 75), size=20)
elif button == 'iso':
Menu.JumpTo(screen_mode=6)
SystemState.CameraState.setting = 'iso'
elif button == 'image_effect':
Menu.JumpTo(screen_mode=6)
SystemState.CameraState.setting = 'image_effect'
elif button == 'rotation':
Menu.JumpTo(screen_mode=6)
SystemState.CameraState.setting = 'rotation'
elif button == 'brightness':
Menu.JumpTo(screen_mode=6)
SystemState.CameraState.setting = 'brightness'
elif button == 'saturation':
Menu.JumpTo(screen_mode=6)
SystemState.CameraState.setting = 'saturation'
elif button == 'contrast':
Menu.JumpTo(screen_mode=6)
SystemState.CameraState.setting = 'contrast'
elif button == 'sharpness':
Menu.JumpTo(screen_mode=6)
SystemState.CameraState.setting = 'sharpness'
elif button == 'zoom':
Menu.JumpTo(screen_mode=6)
SystemState.CameraState.setting = 'zoom'
elif button == 'meter_mode':
Menu.JumpTo(screen_mode=6)
SystemState.CameraState.setting = 'meter_mode'
elif button == 'awb':
Menu.JumpTo(screen_mode=6)
SystemState.CameraState.setting = 'awb_mode'
elif button == 'shutter_speed':
Menu.JumpTo(screen_mode=6)
SystemState.CameraState.setting = 'shutter_speed'
elif button == 'exposure_mode':
Menu.JumpTo(screen_mode=6)
SystemState.CameraState.setting = 'exposure_mode'
elif button == 'settings':
Menu.JumpTo(screen_mode=5)
elif button == 'accept':
DeletePhoto()
Menu.Back()
OpenAlbum()
elif button == 'decline':
Menu.Back()
OpenAlbum()
if SystemState.screen_mode == 5 and SystemState.next_screen_mode == 6:
setting = SystemState.CameraState.setting
setting_values = setting + '_values'
__CurrentSetting(setting_values, setting)
SystemState.CameraState.camera_stream = False
def __PreviousSetting(property_list, property_name):
properties = getattr(SystemState.CameraState, property_list)
index = getattr(SystemState.CameraState, property_name)
if index > 0:
index -= 1
else:
index = len(properties) - 1
__ProcessSettingsValues(property_name, properties, index)
def __NextSetting(property_list, property_name):
properties = getattr(SystemState.CameraState, property_list)
index = getattr(SystemState.CameraState, property_name)
if index < len(properties) - 1:
index += 1
else:
index = 0
__ProcessSettingsValues(property_name, properties, index)
def __CurrentSetting(property_list, property_name):
# Shortens code.
properties = getattr(SystemState.CameraState, property_list)
index = getattr(SystemState.CameraState, property_name)
__ProcessSettingsValues(property_name, properties, index)
def __ProcessSettingsValues(property_name, properties, index):
"""Corrects settings values to auto if they equal zero."""
property_value = properties[index]
setattr(SystemState.camera, property_name, property_value)
setattr(SystemState.CameraState, property_name, index)
property_type = type(property_value)
# Defaults all values of zero to the word auto.
if property_value == 0 and property_type is not bool:
property_value = 'Auto'
# Makes 'zoom' human readable.
if property_type is tuple:
if index == 0:
index = None
property_value = str(index)
property_name = ' '.join(property_name.split('_'))
__WriteSettingsTitle(property_name)
__WriteSettingsValue(property_value)
def __WriteSettingsValue(text):
"""Writes the current value of the setting being manipulated."""
TextWriter.Write(
state=SystemState,
text=str(text).title(),
position=(160, 110),
centered=True,
size=20,
permatext=True,
color=(57, 255, 20)
)
def __WriteSettingsTitle(text):
"""Writes the name of the setting being manipulated."""
TextWriter.Write(
state=SystemState,
text=str(text).title(),
position=(160, 10),
centered=True,
size=25,
permatext=True,
color=(57, 255, 20)
)
def __ProcessLeftArrow():
"""Processes the left arrow button while in a setting."""
if SystemState.CameraState.setting == 'image_effect':
__PreviousSetting('image_effect_values', 'image_effect')
elif SystemState.CameraState.setting == 'iso':
__PreviousSetting('iso_values', 'iso')
elif SystemState.CameraState.setting == 'rotation':
__PreviousSetting('rotation_values', 'rotation')
elif SystemState.CameraState.setting == 'brightness':
__PreviousSetting('brightness_values', 'brightness')
elif SystemState.CameraState.setting == 'saturation':
__PreviousSetting('saturation_values', 'saturation')
elif SystemState.CameraState.setting == 'contrast':
__PreviousSetting('contrast_values', 'contrast')
elif SystemState.CameraState.setting == 'sharpness':
__PreviousSetting('sharpness_values', 'sharpness')
elif SystemState.CameraState.setting == 'zoom':
__PreviousSetting('zoom_values', 'zoom')
elif SystemState.CameraState.setting == 'meter_mode':
__PreviousSetting('meter_mode_values', 'meter_mode')
elif SystemState.CameraState.setting == 'awb_mode':
__PreviousSetting('awb_mode_values', 'awb_mode')
elif SystemState.CameraState.setting == 'shutter_speed':
__PreviousSetting('shutter_speed_values', 'shutter_speed')
elif SystemState.CameraState.setting == 'exposure_mode':
__PreviousSetting('exposure_mode_values', 'exposure_mode')
elif SystemState.screen_mode == 3:
if SystemState.CameraState.photo_count > 0:
PreviousPhoto()
def __ProcessRightArrow():
"""Processes the right arrow button while in a setting."""
if SystemState.CameraState.setting == 'image_effect':
__NextSetting('image_effect_values', 'image_effect')
elif SystemState.CameraState.setting == 'iso':
__NextSetting('iso_values', 'iso')
elif SystemState.CameraState.setting == 'rotation':
__NextSetting('rotation_values', 'rotation')
elif SystemState.CameraState.setting == 'brightness':
__NextSetting('brightness_values', 'brightness')
elif SystemState.CameraState.setting == 'saturation':
__NextSetting('saturation_values', 'saturation')
elif SystemState.CameraState.setting == 'contrast':
__NextSetting('contrast_values', 'contrast')
elif SystemState.CameraState.setting == 'sharpness':
__NextSetting('sharpness_values', 'sharpness')
elif SystemState.CameraState.setting == 'zoom':
__NextSetting('zoom_values', 'zoom')
elif SystemState.CameraState.setting == 'meter_mode':
__NextSetting('meter_mode_values', 'meter_mode')
elif SystemState.CameraState.setting == 'awb_mode':
__NextSetting('awb_mode_values', 'awb_mode')
elif SystemState.CameraState.setting == 'shutter_speed':
__NextSetting('shutter_speed_values', 'shutter_speed')
elif SystemState.CameraState.setting == 'exposure_mode':
__NextSetting('exposure_mode_values', 'exposure_mode')
elif SystemState.screen_mode == 3:
if SystemState.CameraState.photo_count > 0:
NextPhoto()
def CallTakePhoto():
"""Takes a preview photo with the camera. """
# Only if the flash is enabled will the flash turn on.
if SystemState.CameraState.flash_enabled == True:
CallFlash()
# Grabs the timestamp of when the photo was taken.
SystemState.CameraState.photo_time = str(int(time.time()))
file_name = SystemState.CameraState.preview_path + 'PREVIEW-' + SystemState.CameraState.photo_time + '.jpeg'
SystemState.camera.capture(file_name, use_video_port=True, splitter_port=1, format='jpeg')
thread = threading.Thread(target=TakePhoto)
thread.start()
ShowPhoto(file_name)
thread.join()
def TakePhoto():
"""Takes a high res photo with the camera."""
file_name = SystemState.CameraState.photo_path + SystemState.CameraState.photo_time + '.jpeg'
SystemState.camera.resolution = (2592, 1944)
SystemState.camera.capture(file_name, use_video_port=False, format='jpeg')
SystemState.camera.resolution = (320, 240)
def Flash():
"""Turns on the flash light on the front of the camera."""
time.sleep(0)
RPi.GPIO.output(7, True)
time.sleep(0.150)
RPi.GPIO.output(7, False)
def CallFlash():
"""Calls the flash function in a thread."""
thread = threading.Thread(target=Flash)
thread.setDaemon(True)
thread.start()
def OpenAlbum():
"""Opens the photos folder."""
path = SystemState.CameraState.preview_path
SystemState.CameraState.photo_archive = os.listdir(path)
SystemState.CameraState.photo_archive = [os.path.join(path, pic) for pic in SystemState.CameraState.photo_archive]
SystemState.CameraState.photo_archive = sorted(SystemState.CameraState.photo_archive)
SystemState.CameraState.photo_count = len(SystemState.CameraState.photo_archive)
SystemState.CameraState.album = True
#If there is a picture in there.
if SystemState.CameraState.photo_count > 0:
#If that photo is in the list, go to that photo. If not, go to the last photo.
if SystemState.CameraState.current_photo in SystemState.CameraState.photo_archive:
SystemState.CameraState.photo_index = SystemState.CameraState.photo_archive.index(SystemState.CameraState.current_photo)
else:
SystemState.CameraState.photo_index = SystemState.CameraState.photo_count - 1
ShowPhoto(file_index=SystemState.CameraState.photo_index)
else:
TextWriter.Write(
state=SystemState,
text='No Pictures',
position=(95, 100),
permatext=True,
size=20
)
def NextPhoto():
"""Switches to the next photo in the photo archive."""
if SystemState.CameraState.photo_index < SystemState.CameraState.photo_count - 1:
SystemState.CameraState.photo_index += 1
else:
SystemState.CameraState.photo_index = 0
file_name = SystemState.CameraState.photo_archive[SystemState.CameraState.photo_index]
SystemState.CameraState.photo_tally = str(SystemState.CameraState.photo_index + 1) + '/' + str(SystemState.CameraState.photo_count)
ShowPhoto(file_name)
def PreviousPhoto():
"""Switches to the previous photo in the photo archive."""
if SystemState.CameraState.photo_index > 0:
SystemState.CameraState.photo_index -= 1
else:
SystemState.CameraState.photo_index = SystemState.CameraState.photo_count - 1
file_name = SystemState.CameraState.photo_archive[SystemState.CameraState.photo_index]
SystemState.CameraState.photo_tally = str(SystemState.CameraState.photo_index + 1) + '/' + str(SystemState.CameraState.photo_count)
ShowPhoto(file_name)
def BlitImage(file_name, pygame, screen):
"""Stamps the photo on the screen object."""
try:
raw_image = pygame.image.load(file_name)
scaled_image = pygame.transform.scale(raw_image, (320, 240))
scaled_x = (320 - scaled_image.get_width()) / 2
scaled_y = (240 - scaled_image.get_height()) / 2
screen.blit(scaled_image, (scaled_x, scaled_y))
except:
screen.fill(0)
TextWriter.Write(
state=SystemState,
text='Unsupported Format',
color=(255, 0, 0),
position=(70, 100),
size=20
)
def DeletePhoto():
"""Deletes a selected photo."""
preview_image = SystemState.CameraState.current_photo
full_image = ''.join(preview_image.split('.preview/PREVIEW-'))
try:
os.remove(preview_image)
except: # TODO:print that preview couldn't be removed.
print "Couldn't remove preview image"
try:
SystemState.CameraState.photo_archive.remove(preview_image)
except: # TODO: print that file was not removed from library.
print "Couldn't remove from library"
try:
os.remove(full_image)
except: # TODO: print that image not removed.
print "Image not removed"
def ShowPhoto(file_name=None, file_index=None):
"""Displays a photo onscreen."""
if file_name == None:
SystemState.CameraState.current_photo = SystemState.CameraState.photo_archive[file_index]
file_name = SystemState.CameraState.current_photo
else:
SystemState.CameraState.current_photo = file_name
pygame = SystemState.pygame
screen = SystemState.screen
BlitImage(file_name, pygame, screen)
if SystemState.CameraState.photo_archive != None:
if SystemState.screen_mode == 3:
# Remove 'PREVIEW-' and path leaving just unix time.
utime_string = os.path.basename(file_name).split('-')[-1].split('.')[0]
timestamp = time.ctime(int(utime_string))
# Writing the time and position of the photo on the screen.
TextWriter.Write(
state=SystemState,
text=timestamp,
position=(90, 225),
size=12
)
TextWriter.Write(
state=SystemState,
text=SystemState.CameraState.photo_tally,
position=(135, 18),
size=20
)
elif SystemState.screen_mode != 3 and SystemState.CameraState.album == False:
pygame.display.update()
time.sleep(2)
def Main():
"""Runs once the user has entered the application."""
pygame = SystemState.pygame
while SystemState.application == 'camera':
Events.CheckEvents()
if SystemState.screen_mode in (1, 2, 5, 6):
SystemState.CameraState.camera_stream = True
else:
SystemState.CameraState.camera_stream = False
if SystemState.CameraState.camera_stream == True:
# Button on RPi.GPIO 8
if not RPi.GPIO.input(8):
CallTakePhoto()
SystemState.CameraState.stream = io.BytesIO() # Capture into in-memory stream
SystemState.camera.capture(SystemState.CameraState.stream, use_video_port=True, splitter_port=0, format='rgb')
SystemState.CameraState.stream.seek(0)
SystemState.CameraState.stream.readinto(SystemState.rgb) # stream -> YUV buffer
SystemState.CameraState.stream.close()
SystemState.img = SystemState.pygame.image.frombuffer(SystemState.rgb[0: (320 * 240 * 3)], (320, 240), 'RGB' )
xa = (320 - SystemState.img.get_width() ) / 2
ya = (240 - SystemState.img.get_height()) / 2
Screen.RefreshScreen(image=SystemState.img, wx=xa, wy=ya)
| 37.865234 | 133 | 0.724558 | 2,304 | 19,387 | 5.925347 | 0.174479 | 0.257838 | 0.106798 | 0.053179 | 0.487401 | 0.413273 | 0.372619 | 0.321345 | 0.215573 | 0.197041 | 0 | 0.026184 | 0.156858 | 19,387 | 511 | 134 | 37.939335 | 0.809005 | 0.03327 | 0 | 0.308235 | 0 | 0 | 0.098838 | 0 | 0 | 0 | 0 | 0.001957 | 0 | 0 | null | null | 0.002353 | 0.030588 | null | null | 0.007059 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
244d554457d0ca56f046aa4593dd5c61e2327aed | 1,514 | py | Python | Pipeline/tokens.py | wcex1994/EssAI | 968f07d06f4d49a1538fb56fe505f13ff5f6fa8e | [
"MIT"
] | null | null | null | Pipeline/tokens.py | wcex1994/EssAI | 968f07d06f4d49a1538fb56fe505f13ff5f6fa8e | [
"MIT"
] | null | null | null | Pipeline/tokens.py | wcex1994/EssAI | 968f07d06f4d49a1538fb56fe505f13ff5f6fa8e | [
"MIT"
] | 1 | 2021-05-06T21:55:33.000Z | 2021-05-06T21:55:33.000Z | #=================================================================
# Libraries
#=================================================================
from pipeline.utils import *
from scipy import stats as s
import pandas as pd
# This language model will be used for tokenizing and pos tagging
import spacy
nlp = spacy.load("en_core_web_sm")
#=================================================================
# Tokens
#=================================================================
def textToTokens(text):
"Generates a column of Spacy tokens."
return nlp(text)
def partOfSpeech(row):
'''
For each row, assigns a POS for
each word in the text.
'''
return [token.pos_ for token in row]
def posEntropy(pos):
'''Returns the POS for each unit.'''
counts = pd.Series(pos).value_counts()
return s.entropy(counts)
def posCounts(pos):
"Returns the part of speech counts for each unit."
return pd.Series(pos).value_counts()
#=================================================================
# Run Transformation Pipeline
#=================================================================
def tokenPipeline(df, textCol = "Text"):
transforms = [
(textToTokens,"token", textCol),
(partOfSpeech, "partOfSpeech", "token"),
(posEntropy, "posEntropy","partOfSpeech"),
(posCounts, "AppendCounts", "partOfSpeech")
]
return applyTransforms(df, transforms)
| 27.527273 | 69 | 0.463672 | 132 | 1,514 | 5.272727 | 0.484848 | 0.04023 | 0.028736 | 0.045977 | 0.063218 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.200793 | 1,514 | 55 | 70 | 27.527273 | 0.575207 | 0.446499 | 0 | 0 | 0 | 0 | 0.190101 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.208333 | false | 0 | 0.166667 | 0 | 0.583333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
245e1b6622cdee6011e085cb77dbb85c6c0b9048 | 701 | py | Python | setup.py | SeoJeongYeop/kakaopy | a9865b56ab19abed5443d5558f9b979b36dd594a | [
"MIT"
] | null | null | null | setup.py | SeoJeongYeop/kakaopy | a9865b56ab19abed5443d5558f9b979b36dd594a | [
"MIT"
] | null | null | null | setup.py | SeoJeongYeop/kakaopy | a9865b56ab19abed5443d5558f9b979b36dd594a | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
# the setup script
setup(
name="kakaopy",
version = "0.2.0",
description = "kakao search API customizing",
long_description = open('README.md').read(),
long_description_content_type = "text/markdown",
url = "https://github.com/SeoJeongYeop/kakaopy",
author = "Jeongyeop Seo",
author_email="sjyswe99@gmail.com",
license ="MIT",
packages = find_packages(exclude=['tests']),
zip_safe=False,
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
) | 30.478261 | 52 | 0.633381 | 77 | 701 | 5.662338 | 0.701299 | 0.130734 | 0.172018 | 0.178899 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018315 | 0.221113 | 701 | 23 | 53 | 30.478261 | 0.78022 | 0.022825 | 0 | 0 | 0 | 0 | 0.419591 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.05 | 0 | 0.05 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
24646c642cf3b216437970f6a8055f313680560d | 525 | py | Python | src/lib/trains/train_factory.py | whklwhkl/CenterNet | a87f1e972528081505f89c9ede4d3bdd9aadb2ce | [
"MIT"
] | null | null | null | src/lib/trains/train_factory.py | whklwhkl/CenterNet | a87f1e972528081505f89c9ede4d3bdd9aadb2ce | [
"MIT"
] | null | null | null | src/lib/trains/train_factory.py | whklwhkl/CenterNet | a87f1e972528081505f89c9ede4d3bdd9aadb2ce | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .ctdet import CtdetTrainer
from .ddd import DddTrainer
from .exdet import ExdetTrainer
from .multi_pose import MultiPoseTrainer
from .pdet import PdetTrainer
from .no_gt_hm import Trainer
from .logwh import Trainer2
train_factory = {
'exdet': ExdetTrainer,
'ddd': DddTrainer,
'ctdet': CtdetTrainer,
'multi_pose': MultiPoseTrainer,
'pdet': PdetTrainer,
'pdet_logwh': Trainer2,
'haus': Trainer
}
| 23.863636 | 40 | 0.786667 | 63 | 525 | 6.238095 | 0.428571 | 0.076336 | 0.122137 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004444 | 0.142857 | 525 | 21 | 41 | 25 | 0.868889 | 0 | 0 | 0 | 0 | 0 | 0.078095 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.526316 | 0 | 0.526316 | 0.052632 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
246c2af4a4ae2f416a3da6f092fea66a6c835abc | 606 | py | Python | x_rebirth_station_calculator/station_data/modules/spice_tubes.py | Phipsz/XRebirthStationCalculator | ac31c2f5816be34a7df2d7c4eb4bd5e01f7ff835 | [
"MIT"
] | 1 | 2016-04-17T11:00:22.000Z | 2016-04-17T11:00:22.000Z | x_rebirth_station_calculator/station_data/modules/spice_tubes.py | Phipsz/XRebirthStationCalculator | ac31c2f5816be34a7df2d7c4eb4bd5e01f7ff835 | [
"MIT"
] | null | null | null | x_rebirth_station_calculator/station_data/modules/spice_tubes.py | Phipsz/XRebirthStationCalculator | ac31c2f5816be34a7df2d7c4eb4bd5e01f7ff835 | [
"MIT"
] | null | null | null | from x_rebirth_station_calculator.station_data.station_base import Module
from x_rebirth_station_calculator.station_data.station_base import Production
from x_rebirth_station_calculator.station_data.station_base import Consumption
from x_rebirth_station_calculator.station_data import wares
names = {'L044': 'Spice Tubes',
'L049': 'Gewürzröhren'}
productions = {'universal': [Production(wares.Spices, 3200)]}
consumptions = {'universal': [Consumption(wares.EnergyCells, 800),
Consumption(wares.Water, 3600)]}
SpiceTubes = Module(names, productions, consumptions)
| 40.4 | 78 | 0.772277 | 69 | 606 | 6.507246 | 0.405797 | 0.044543 | 0.106904 | 0.169265 | 0.469933 | 0.469933 | 0.469933 | 0.380846 | 0.380846 | 0.380846 | 0 | 0.032505 | 0.136964 | 606 | 14 | 79 | 43.285714 | 0.826004 | 0 | 0 | 0 | 0 | 0 | 0.080858 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
79e661dd9cf84e62462770be9ed60dad3dbcfc41 | 473 | py | Python | ex041.py | carlosvcerqueira/Projetos-Python | 2fb91a0be8abf436af6a1d57fb2a1eafd0d30394 | [
"MIT"
] | null | null | null | ex041.py | carlosvcerqueira/Projetos-Python | 2fb91a0be8abf436af6a1d57fb2a1eafd0d30394 | [
"MIT"
] | null | null | null | ex041.py | carlosvcerqueira/Projetos-Python | 2fb91a0be8abf436af6a1d57fb2a1eafd0d30394 | [
"MIT"
] | null | null | null | from datetime import date
ano = int(input('Ano de nascimento: '))
atual = date.today().year
idade = atual - ano
print('Atletas nascidos em {} tem {} anos em {}.'.format(ano, idade, atual))
if idade <= 9:
print('Sua categoria é a MIRIM.')
elif idade <= 14:
print('Sua categoria é a INFANTIL.')
elif idade <= 19:
print('Sua categoria é a JÚNIOR.')
elif idade <= 25:
print('Sua categoria é a SENIOR.')
else:
print('Sua categoria é a MASTER.') | 31.533333 | 77 | 0.634249 | 71 | 473 | 4.225352 | 0.507042 | 0.133333 | 0.283333 | 0.3 | 0.316667 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01897 | 0.219873 | 473 | 15 | 78 | 31.533333 | 0.794038 | 0 | 0 | 0 | 0 | 0 | 0.404348 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.066667 | 0 | 0.066667 | 0.4 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
79ed0150e2975215bacda31f634a8cc0d5af3519 | 1,721 | py | Python | stac/catalog.py | raphaelrpl/stac.py | 5d63930e2921d6b161f46b66b36fc06ac7d66b45 | [
"MIT"
] | null | null | null | stac/catalog.py | raphaelrpl/stac.py | 5d63930e2921d6b161f46b66b36fc06ac7d66b45 | [
"MIT"
] | null | null | null | stac/catalog.py | raphaelrpl/stac.py | 5d63930e2921d6b161f46b66b36fc06ac7d66b45 | [
"MIT"
] | null | null | null | #
# This file is part of Python Client Library for STAC.
# Copyright (C) 2019 INPE.
#
# Python Client Library for STAC is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
#
"""STAC Catalog module."""
import json
from pkg_resources import resource_string
from .common import Link
from .utils import Utils
class Catalog(dict):
"""The STAC Catalog."""
def __init__(self, data, validate=False):
"""Initialize instance with dictionary data.
:param data: Dict with catalog metadata.
:param validate: true if the Catalog should be validate using its jsonschema. Default is False.
"""
self._validate = validate
super(Catalog, self).__init__(data or {})
if self._validate:
Utils.validate(self)
@property
def stac_version(self):
""":return: the STAC version."""
return self['stac_version']
@property
def id(self):
""":return: the catalog identifier."""
return self['id']
@property
def title(self):
""":return: the catalog title."""
return self['title'] if 'title' in self else None
@property
def description(self):
""":return: the catalog description."""
return self['description']
@property
def links(self):
""":return: a list of resources in the catalog."""
return [Link(link) for link in self['links']]
@property
def _schema(self):
""":return: the Catalog jsonschema."""
schema = resource_string(__name__, f'jsonschemas/{self.stac_version}/catalog.json')
_schema = json.loads(schema)
return _schema
| 27.31746 | 103 | 0.636839 | 212 | 1,721 | 5.061321 | 0.396226 | 0.055918 | 0.060578 | 0.074557 | 0.048462 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003113 | 0.253341 | 1,721 | 62 | 104 | 27.758065 | 0.831907 | 0.382336 | 0 | 0.2 | 0 | 0 | 0.085193 | 0.044625 | 0 | 0 | 0 | 0 | 0 | 1 | 0.233333 | false | 0 | 0.133333 | 0 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
0305af5db9f726aaa64cc75a60e2763ed54c1551 | 1,351 | py | Python | wikimetrics/models/mediawiki/user.py | wikimedia/analytics-wikimetrics | 1d2036657b06ccd16ecfc76edd3f9a6119ff75f4 | [
"MIT"
] | 6 | 2015-01-28T05:59:08.000Z | 2018-01-09T07:48:57.000Z | wikimetrics/models/mediawiki/user.py | wikimedia/analytics-wikimetrics | 1d2036657b06ccd16ecfc76edd3f9a6119ff75f4 | [
"MIT"
] | 2 | 2020-05-09T16:36:43.000Z | 2020-05-09T16:52:35.000Z | wikimetrics/models/mediawiki/user.py | wikimedia/analytics-wikimetrics | 1d2036657b06ccd16ecfc76edd3f9a6119ff75f4 | [
"MIT"
] | 1 | 2016-01-13T07:19:44.000Z | 2016-01-13T07:19:44.000Z | from sqlalchemy import Column, Integer, String
from wikimetrics.configurables import db
from custom_columns import MediawikiTimestamp
from sqlalchemy.dialects.mysql import TINYBLOB, VARBINARY
from wikimetrics.utils import UNICODE_NULL
__all__ = ['MediawikiUser']
class MediawikiUser(db.MediawikiBase):
__tablename__ = 'user'
# defaults are for user generating data methods
# VARBINARY bindings are needed so the table user we create
# in the mediawiki testing database resembles the table in production
user_id = Column(Integer, primary_key=True)
user_name = Column(VARBINARY(255))
user_real_name = Column(VARBINARY(255), nullable=False, default='')
user_password = Column(TINYBLOB, nullable=False, default='')
user_newpassword = Column(TINYBLOB, nullable=False, default='')
user_newpass_time = Column(MediawikiTimestamp)
user_email = Column(String(255), nullable=False, default='')
user_touched = Column(MediawikiTimestamp, nullable=False, default=UNICODE_NULL * 14)
user_token = Column(String(255), nullable=False, default=UNICODE_NULL * 32)
user_email_authenticated = Column(MediawikiTimestamp)
user_email_token = Column(String(255))
user_email_token_expires = Column(MediawikiTimestamp)
user_registration = Column(MediawikiTimestamp)
user_editcount = Column(Integer)
| 45.033333 | 88 | 0.77054 | 158 | 1,351 | 6.379747 | 0.424051 | 0.077381 | 0.119048 | 0.095238 | 0.217262 | 0.144841 | 0 | 0 | 0 | 0 | 0 | 0.016507 | 0.148038 | 1,351 | 29 | 89 | 46.586207 | 0.859253 | 0.126573 | 0 | 0 | 0 | 0 | 0.014456 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.136364 | 0.227273 | 0 | 0.954545 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
03065ba630a6d136eb37f39bb20a9d93bbd61d07 | 204 | py | Python | testes/aprender.py | robertoweller/python | b01939810f7eb388f4b79bfad00abc5fb293d8dd | [
"MIT"
] | null | null | null | testes/aprender.py | robertoweller/python | b01939810f7eb388f4b79bfad00abc5fb293d8dd | [
"MIT"
] | null | null | null | testes/aprender.py | robertoweller/python | b01939810f7eb388f4b79bfad00abc5fb293d8dd | [
"MIT"
] | null | null | null | import unittest
# unittest.TestCase.assertEqual(20, 20)
class SomaOperador(unittest.TestCase):
def principal(self):
self.assertEqual(21, 20)
if __name__ == '__name__':
unittest.main()
| 17 | 39 | 0.70098 | 23 | 204 | 5.869565 | 0.608696 | 0.237037 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.047619 | 0.176471 | 204 | 11 | 40 | 18.545455 | 0.755952 | 0.181373 | 0 | 0 | 0 | 0 | 0.048485 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 1 | 0.166667 | false | 0 | 0.166667 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
03158b99989b37071196a199c3aa53a09ed2f621 | 701 | py | Python | src/stack_exchange_graph_data/helpers/__init__.py | Peilonrayz/stack_exchange_graph_data | d2d8d9f80dba727509f98b31d25e20e1e3824bb3 | [
"MIT"
] | null | null | null | src/stack_exchange_graph_data/helpers/__init__.py | Peilonrayz/stack_exchange_graph_data | d2d8d9f80dba727509f98b31d25e20e1e3824bb3 | [
"MIT"
] | null | null | null | src/stack_exchange_graph_data/helpers/__init__.py | Peilonrayz/stack_exchange_graph_data | d2d8d9f80dba727509f98b31d25e20e1e3824bb3 | [
"MIT"
] | null | null | null | """
Helper modules.
These should be stand alone modules that could reasonably be their own
PyPI package. This comes with two benefits:
1. The library is void of any business data, which makes it easier to
understand.
2. It means that it is decoupled making it easy to reuse the code in
different sections of the code. An example is the
:mod:`stack_exchange_graph_data.helpers.progress` module. Which is
easily used in both :func:`stack_exchange_graph_data.helpers.curl.curl`
and :func:`stack_exchange_graph_data.driver.load_xml_stream`. Since
it wraps a stream it's easily transferable to any Python loop, and
due to lacking business logic means there's no monkey patching.
"""
| 41.235294 | 74 | 0.774608 | 117 | 701 | 4.547009 | 0.65812 | 0.073308 | 0.101504 | 0.12406 | 0.165414 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003436 | 0.169757 | 701 | 16 | 75 | 43.8125 | 0.910653 | 0.987161 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
031c361baf63684c24ca6b6f4a46e6a84603e677 | 616 | py | Python | tests/providers/spotify/test_spotify_playlist_provider.py | yawks/music_explorer_backend | 26ec17234a542f86d9c03b0256c22dbbef1f827f | [
"MIT"
] | null | null | null | tests/providers/spotify/test_spotify_playlist_provider.py | yawks/music_explorer_backend | 26ec17234a542f86d9c03b0256c22dbbef1f827f | [
"MIT"
] | null | null | null | tests/providers/spotify/test_spotify_playlist_provider.py | yawks/music_explorer_backend | 26ec17234a542f86d9c03b0256c22dbbef1f827f | [
"MIT"
] | null | null | null | from providers.spotify.spotify_id import SpotifyId
from providers.entities.playlist import Playlist
from typing import List
from providers.entities.song import Song
from providers.spotify.spotify_playlist_provider import SpotifyPlaylistProvider
def test_search():
spotify_playlist_provider: SpotifyPlaylistProvider = SpotifyPlaylistProvider(
playlist=Playlist(
playlist_id=SpotifyId("37i9dQZF1DXc4xFsxShkAv"),
name="Led Zeppelin"))
result: List[Song] = spotify_playlist_provider.get_songs()
if len(result) == 0:
raise AssertionError("result must not be empty")
| 36.235294 | 81 | 0.769481 | 67 | 616 | 6.925373 | 0.477612 | 0.112069 | 0.148707 | 0.116379 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011605 | 0.160714 | 616 | 16 | 82 | 38.5 | 0.88588 | 0 | 0 | 0 | 0 | 0 | 0.094156 | 0.035714 | 0 | 0 | 0 | 0 | 0.076923 | 1 | 0.076923 | true | 0 | 0.384615 | 0 | 0.461538 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
031e1cea2fa30cd64ab64f1e49b216656619d84a | 1,620 | py | Python | script.py | abhi20161997/Apogee-2017 | e4ae1b379bd5111a3bd7d3399d081dda897a8566 | [
"BSD-3-Clause"
] | null | null | null | script.py | abhi20161997/Apogee-2017 | e4ae1b379bd5111a3bd7d3399d081dda897a8566 | [
"BSD-3-Clause"
] | null | null | null | script.py | abhi20161997/Apogee-2017 | e4ae1b379bd5111a3bd7d3399d081dda897a8566 | [
"BSD-3-Clause"
] | null | null | null | from registration.models import Participant, College, verificationEmail
from intro.models import IntroReg
from registration.views import generate_password
from django.db.models.signals import post_save
from django.contrib.auth.models import User
from django.template.loader import render_to_string, get_template
from django.core.mail.backends.smtp import EmailBackend
from django.core.mail import EmailMessage, EmailMultiAlternatives
from apogee17.settings import *
from aarohan.models import *
from Event.models import Event
def MassMail(email_list, attachments):
import csv, time
error_log = open('mail_error.log', 'w')
message = render_to_string('portal/mail.html')
email_list = list(set(email_list))
while len(email_list) != 0:
email = EmailMultiAlternatives(subject="APOGEE Workshops | APOGEE 2017", body="...", to=["noreply@bits-apogee.org"], bcc=email_list[:45])
email.attach_alternative(message, "text/html")
for att in attachments:
email.attach_file(att)
try:
email.send()
except:
error_log.write(str(email_list[:45]))
email_list = email_list[45:]
time.sleep(1)
from portal.models import Participant as PP
def portPortalParticipants():
post_save.disconnect(sender=Participant, receiver=verificationEmail)
for pp in PP.objects.all():
try:
Participant.objects.get(email=pp.email)
except:
try:
college = College.objects.get(name=pp.college.name)
except:
college = College.objects.create(name=pp.college.name, is_displayed=False)
part = Participant(name=pp.name, email=pp.email, phone=pp.phone, college=college, gender='N', pcr_approval=True)
part.save() | 36.818182 | 139 | 0.772222 | 225 | 1,620 | 5.457778 | 0.44 | 0.058632 | 0.026873 | 0.029316 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009777 | 0.116049 | 1,620 | 44 | 140 | 36.818182 | 0.847765 | 0 | 0 | 0.15 | 1 | 0 | 0.05984 | 0.014189 | 0 | 0 | 0 | 0 | 0 | 1 | 0.05 | false | 0.025 | 0.325 | 0 | 0.375 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
03372d9d2923a65bb5565216b82e4aff815a471e | 1,873 | py | Python | test/test_files/pylops/pylops/basicoperators/LinearRegression.py | SoftwareUnderstanding/inspect4py | 9c4d7252535082ad938b26baf281d93f3a27285e | [
"BSD-3-Clause"
] | 2 | 2022-02-15T20:30:57.000Z | 2022-03-17T00:50:37.000Z | test/test_files/pylops/pylops/basicoperators/LinearRegression.py | SoftwareUnderstanding/code_inspector | a820b5a7bb18f5df9c3e79346108d8280b20c39a | [
"BSD-3-Clause"
] | 101 | 2021-06-09T14:19:59.000Z | 2022-01-24T13:24:39.000Z | test/test_files/pylops/pylops/basicoperators/LinearRegression.py | SoftwareUnderstanding/inspect4py | 9c4d7252535082ad938b26baf281d93f3a27285e | [
"BSD-3-Clause"
] | 1 | 2021-09-22T06:59:32.000Z | 2021-09-22T06:59:32.000Z | import logging
from pylops.basicoperators import Regression
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.WARNING)
def LinearRegression(taxis, dtype='float64'):
r"""Linear regression.
Creates an operator that applies linear regression to a set of points.
Values along the t-axis must be provided while initializing the operator.
Intercept and gradient form the model vector to be provided in forward
mode, while the values of the regression line curve shall be provided
in adjoint mode.
Parameters
----------
taxis : :obj:`numpy.ndarray`
Elements along the t-axis.
dtype : :obj:`str`, optional
Type of elements in input array.
Attributes
----------
shape : :obj:`tuple`
Operator shape
explicit : :obj:`bool`
Operator contains a matrix that can be solved explicitly
(``True``) or not (``False``)
Raises
------
TypeError
If ``t`` is not :obj:`numpy.ndarray`.
See Also
--------
Regression: Polynomial regression
Notes
-----
The LinearRegression operator solves the following problem:
.. math::
y_i = x_0 + x_1 t_i \qquad \forall i=1,2,...,N
We can express this problem in a matrix form
.. math::
\mathbf{y}= \mathbf{A} \mathbf{x}
where
.. math::
\mathbf{y}= [y_1, y_2,...,y_N]^T, \qquad \mathbf{x}= [x_0, x_1]^T
and
.. math::
\mathbf{A}
= \begin{bmatrix}
1 & t_{1} \\
1 & t_{2} \\
.. & .. \\
1 & t_{N}
\end{bmatrix}
Note that this is a particular case of the :py:class:`pylops.Regression`
operator and it is in fact just a lazy call of that operator with
``order=1``.
"""
return Regression(taxis, order=1, dtype=dtype)
| 26.013889 | 79 | 0.583556 | 243 | 1,873 | 4.44856 | 0.489712 | 0.009251 | 0.016651 | 0.024052 | 0.009251 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01283 | 0.292579 | 1,873 | 71 | 80 | 26.380282 | 0.803019 | 0.760812 | 0 | 0 | 0 | 0 | 0.134694 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
033b77ead3426e690ffefe9c97e39f3c5c44d0b5 | 1,079 | py | Python | test/test_bonddatabase.py | jag1g13/pdb2lmp | d0cf344f0a71297a09e6bd589bd3dc727a159d98 | [
"MIT"
] | 8 | 2016-06-25T13:09:32.000Z | 2020-09-11T08:17:29.000Z | test/test_bonddatabase.py | jag1g13/pdb2lmp | d0cf344f0a71297a09e6bd589bd3dc727a159d98 | [
"MIT"
] | 4 | 2016-12-07T16:13:43.000Z | 2017-10-13T14:44:06.000Z | test/test_bonddatabase.py | jag1g13/pdb2lmp | d0cf344f0a71297a09e6bd589bd3dc727a159d98 | [
"MIT"
] | 1 | 2018-06-10T01:09:58.000Z | 2018-06-10T01:09:58.000Z | import unittest
from lib.bonddatabase import BondDatabase
class TestBondDatabase(unittest.TestCase):
def test_open_database(self):
db = BondDatabase()
def test_read_database(self):
db = BondDatabase()
self.assertTrue("sugar-ring" in db.length)
self.assertEqual(db.length["sugar-ring"].style, "harmonic")
self.assertEqual(db.length["sugar-ring"].params, "200 1.520")
self.assertTrue("sugar-ring" in db.angle)
self.assertEqual(db.angle["sugar-ring"].style, "cosine/squared")
self.assertEqual(db.angle["sugar-ring"].params, "120 110.0")
self.assertTrue("sugar-dih-1" in db.dihedral)
self.assertEqual(db.dihedral["sugar-dih-1"].style, "fourier")
self.assertEqual(db.dihedral["sugar-dih-1"].params, "2 1.00 3 0 0.25 1 -120")
self.assertTrue("dipole-cone-1" in db.improper)
self.assertEqual(db.improper["dipole-cone-1"].style, "dipole/cone")
self.assertEqual(db.improper["dipole-cone-1"].params, "200 120 60")
if __name__ == '__main__':
unittest.main()
| 35.966667 | 85 | 0.663577 | 144 | 1,079 | 4.888889 | 0.326389 | 0.170455 | 0.193182 | 0.073864 | 0.454545 | 0.454545 | 0.198864 | 0 | 0 | 0 | 0 | 0.046275 | 0.178869 | 1,079 | 29 | 86 | 37.206897 | 0.748307 | 0 | 0 | 0.095238 | 0 | 0 | 0.21316 | 0 | 0 | 0 | 0 | 0 | 0.571429 | 1 | 0.095238 | false | 0 | 0.095238 | 0 | 0.238095 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
033edb96705c66668b782fccefda5d7e19ae6219 | 189 | py | Python | JuHPLC/apps.py | FZJ-INM5/JuHPLC | efaf9b8f5d7f0c9a8ad687d0f143e161f523db7c | [
"Unlicense"
] | 1 | 2018-09-24T06:59:11.000Z | 2018-09-24T06:59:11.000Z | JuHPLC/apps.py | FZJ-INM5/JuHPLC | efaf9b8f5d7f0c9a8ad687d0f143e161f523db7c | [
"Unlicense"
] | 1 | 2021-02-05T22:23:57.000Z | 2021-02-05T22:23:57.000Z | JuHPLC/apps.py | FZJ-INM5/JuHPLC | efaf9b8f5d7f0c9a8ad687d0f143e161f523db7c | [
"Unlicense"
] | null | null | null | from __future__ import unicode_literals
from django.apps import AppConfig
class JuhplcConfig(AppConfig):
name = 'JuHPLC'
verbose_name = name
def ready(self):
pass | 13.5 | 39 | 0.703704 | 22 | 189 | 5.772727 | 0.772727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.238095 | 189 | 14 | 40 | 13.5 | 0.881944 | 0 | 0 | 0 | 0 | 0 | 0.031579 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0.142857 | 0.285714 | 0 | 0.857143 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
0340b41915ed791801c666ee509ed6857af24fb9 | 885 | py | Python | code/pyorg/scripts/syn/reduce_tomo_tilts.py | anmartinezs/pyseg_system | 5bb07c7901062452a34b73f376057cabc15a13c3 | [
"Apache-2.0"
] | 12 | 2020-01-08T01:33:02.000Z | 2022-03-16T00:25:34.000Z | code/pyorg/scripts/syn/reduce_tomo_tilts.py | anmartinezs/pyseg_system | 5bb07c7901062452a34b73f376057cabc15a13c3 | [
"Apache-2.0"
] | 8 | 2019-12-19T19:34:56.000Z | 2022-03-10T10:11:28.000Z | code/pyorg/scripts/syn/reduce_tomo_tilts.py | anmartinezs/pyseg_system | 5bb07c7901062452a34b73f376057cabc15a13c3 | [
"Apache-2.0"
] | 2 | 2022-03-30T13:12:22.000Z | 2022-03-30T18:12:10.000Z | """
Reduce the tilt series or micrographs within a stack
Input: - Micrographs stack
- *.order file with two columns; tilt angle, dose in e-/A**2
- Range of valid angles
Output: - Stack with some micrograph extracted
- *.order file with only the tilt angles selected
- *.tlt file with only the tilt angles selected
"""
################# Package import
import os
import copy
import csv
import numpy as np
import sys
import time
import pyseg as ps
###### Global variables
__author__ = 'Antonio Martinez-Sanchez'
########################################################################################
# PARAMETERS
########################################################################################
ROOT_PATH = '/fs/pool/pool-lucic2/antonio/workspace/psd_an/in/rln/tomos'
in_stack = ROOT_PATH + '/syn_11_2_bin2/' | 25.285714 | 88 | 0.529944 | 98 | 885 | 4.673469 | 0.642857 | 0.045852 | 0.056769 | 0.065502 | 0.144105 | 0.144105 | 0.144105 | 0 | 0 | 0 | 0 | 0.008357 | 0.188701 | 885 | 35 | 89 | 25.285714 | 0.629526 | 0.438418 | 0 | 0 | 0 | 0 | 0.371648 | 0.222222 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.7 | 0 | 0.7 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
034f3ce858c03d199f1b5c0ce47e0e35a84dabba | 1,766 | py | Python | pyqode/core/managers/decorations.py | SunChuquin/pyqode.core | edf29204446e3679701e74343288cf692eb07d86 | [
"MIT"
] | 42 | 2018-05-02T07:07:27.000Z | 2022-02-01T19:49:49.000Z | pyqode/core/managers/decorations.py | SunChuquin/pyqode.core | edf29204446e3679701e74343288cf692eb07d86 | [
"MIT"
] | 65 | 2018-03-08T11:53:13.000Z | 2018-09-17T09:00:09.000Z | Lib/site-packages/hackedit/vendor/pyqode/core/managers/decorations.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | 24 | 2015-01-09T14:16:41.000Z | 2021-12-06T15:11:22.000Z | """
Contains the text decorations manager
"""
import logging
from pyqode.core.api.manager import Manager
def _logger():
return logging.getLogger(__name__)
class TextDecorationsManager(Manager):
"""
Manages the collection of TextDecoration that have been set on the editor
widget.
"""
def __init__(self, editor):
super(TextDecorationsManager, self).__init__(editor)
self._decorations = []
def append(self, decoration):
"""
Adds a text decoration on a CodeEdit instance
:param decoration: Text decoration to add
:type decoration: pyqode.core.api.TextDecoration
"""
if decoration not in self._decorations:
self._decorations.append(decoration)
self._decorations = sorted(
self._decorations, key=lambda sel: sel.draw_order)
self.editor.setExtraSelections(self._decorations)
return True
return False
def remove(self, decoration):
"""
Removes a text decoration from the editor.
:param decoration: Text decoration to remove
:type decoration: pyqode.core.api.TextDecoration
"""
try:
self._decorations.remove(decoration)
self.editor.setExtraSelections(self._decorations)
return True
except ValueError:
return False
def clear(self):
"""
Removes all text decoration from the editor.
"""
self._decorations[:] = []
try:
self.editor.setExtraSelections(self._decorations)
except RuntimeError:
pass
def __iter__(self):
return iter(self._decorations)
def __len__(self):
return len(self._decorations)
| 26.757576 | 77 | 0.624009 | 175 | 1,766 | 6.102857 | 0.371429 | 0.168539 | 0.036517 | 0.089888 | 0.324906 | 0.17603 | 0.099251 | 0 | 0 | 0 | 0 | 0 | 0.296149 | 1,766 | 65 | 78 | 27.169231 | 0.859212 | 0.249151 | 0 | 0.272727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.212121 | false | 0.030303 | 0.060606 | 0.090909 | 0.515152 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
037a7d0d9ae521bdbd2075c88854badbf66328e6 | 493 | py | Python | test_sniffer.py | lanfis/Spider | c66f1d134733318a8714c544050ca42e08b9fe0e | [
"MIT"
] | null | null | null | test_sniffer.py | lanfis/Spider | c66f1d134733318a8714c544050ca42e08b9fe0e | [
"MIT"
] | null | null | null | test_sniffer.py | lanfis/Spider | c66f1d134733318a8714c544050ca42e08b9fe0e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# license removed for brevity
import requests
from scapy.all import *
import sys
import os
current_folder = os.path.dirname(os.path.realpath(__file__))
sys.path.append(current_folder)
from modules.IPParser import IPParser
from modules.Sniffer import Sniffer
print("sniffer starting ...")
sniffer = Sniffer(count=-1, filter="arp", use_show=True, use_logger=False)#, filter="arp")#, filter="tcp and ( port 80 or port 443 )")
pkts = sniffer.run()
| 23.47619 | 135 | 0.718053 | 70 | 493 | 4.942857 | 0.628571 | 0.075145 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014458 | 0.158215 | 493 | 20 | 136 | 24.65 | 0.819277 | 0.21501 | 0 | 0 | 0 | 0 | 0.063536 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.545455 | 0 | 0.545455 | 0.090909 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
cee82efcb8841d1cf048637bc603d708c9c3237a | 68 | py | Python | rest_framework_json_schema/__init__.py | greenroxana/drf-json-schema | 7525a3f54d14ca0ac15efc6fad7a06cc6a05aced | [
"MIT"
] | 15 | 2017-01-31T22:58:59.000Z | 2021-07-02T14:19:38.000Z | rest_framework_json_schema/__init__.py | greenroxana/drf-json-schema | 7525a3f54d14ca0ac15efc6fad7a06cc6a05aced | [
"MIT"
] | 13 | 2017-04-05T17:53:10.000Z | 2021-06-02T22:21:55.000Z | rest_framework_json_schema/__init__.py | greenroxana/drf-json-schema | 7525a3f54d14ca0ac15efc6fad7a06cc6a05aced | [
"MIT"
] | 4 | 2021-04-17T18:46:23.000Z | 2021-05-18T08:35:15.000Z | """Top-level package for drf-json-schema."""
__version__ = "0.4.1"
| 17 | 44 | 0.661765 | 11 | 68 | 3.727273 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 0.117647 | 68 | 3 | 45 | 22.666667 | 0.633333 | 0.558824 | 0 | 0 | 0 | 0 | 0.208333 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
301a30b5257d73e6779d5dd6fa7f27d89a6ac738 | 515 | py | Python | msgboard/tests.py | Yarboa/beyond-tutorial | 12f9c2c2ed8def396042bda51084d9697378b95a | [
"MIT"
] | null | null | null | msgboard/tests.py | Yarboa/beyond-tutorial | 12f9c2c2ed8def396042bda51084d9697378b95a | [
"MIT"
] | 1 | 2020-11-15T16:07:00.000Z | 2020-11-15T16:07:23.000Z | msgboard/tests.py | Yarboa/beyond-tutorial | 12f9c2c2ed8def396042bda51084d9697378b95a | [
"MIT"
] | 1 | 2022-03-27T09:55:26.000Z | 2022-03-27T09:55:26.000Z | # import pytest
def test_with_authenticated_client(client, django_user_model):
username = "admin"
password = "123456"
django_user_model.objects.create_user(username=username, password=password)
# Use this:
# client.login(username=username, password=password)
response = client.get('/')
assert response.status_code == 302
response = client.get(response.url)
assert response.status_code == 200
response = client.get('/accounts/logout')
assert response.status_code == 301
| 32.1875 | 79 | 0.72233 | 61 | 515 | 5.918033 | 0.491803 | 0.116343 | 0.141274 | 0.199446 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.035047 | 0.168932 | 515 | 15 | 80 | 34.333333 | 0.808411 | 0.143689 | 0 | 0 | 0 | 0 | 0.064073 | 0 | 0 | 0 | 0 | 0 | 0.3 | 1 | 0.1 | false | 0.2 | 0 | 0 | 0.1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
302d70f0d066771793fc733e45f3e69d6c2e34b1 | 707 | py | Python | base_import_map/__manifest__.py | ShaheenHossain/itpp-labs-misc-addons13 | bf62dc5bc1abdc18d78e9560a286babbe1d0e082 | [
"MIT"
] | null | null | null | base_import_map/__manifest__.py | ShaheenHossain/itpp-labs-misc-addons13 | bf62dc5bc1abdc18d78e9560a286babbe1d0e082 | [
"MIT"
] | null | null | null | base_import_map/__manifest__.py | ShaheenHossain/itpp-labs-misc-addons13 | bf62dc5bc1abdc18d78e9560a286babbe1d0e082 | [
"MIT"
] | 3 | 2020-08-25T01:57:59.000Z | 2021-09-11T15:38:02.000Z | # -*- coding: utf-8 -*-
{
"name": "Import Settings",
"vesion": "10.0.1.0.0",
"summary": "Allows to save import settings to don't specify columns to fields mapping each time.",
"category": "Extra Tools",
"images": ["images/icon.png"],
"author": "IT-Projects LLC, Dinar Gabbasov",
"website": "https://www.twitter.com/gabbasov_dinar",
"license": "Other OSI approved licence", # MIT
"price": 90.00,
"currency": "EUR",
"depends": ["base_import"],
"data": [
"security/ir.model.access.csv",
"views/base_import_map_templates.xml",
"views/base_import_map_view.xml",
],
"demo": [],
"installable": True,
"auto_install": False,
}
| 30.73913 | 102 | 0.594059 | 86 | 707 | 4.77907 | 0.802326 | 0.072993 | 0.072993 | 0.087591 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019856 | 0.216407 | 707 | 22 | 103 | 32.136364 | 0.722022 | 0.035361 | 0 | 0 | 0 | 0 | 0.646539 | 0.136966 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.238095 | 0 | 0.238095 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
303231e21f7a682e11dc5117a1d01c4b60a2563d | 201 | py | Python | consumer_assign_partition.py | mario21ic/python-kafka-demo | 99f6b5f21759f51e81ac5364774ecdf3211be052 | [
"MIT"
] | null | null | null | consumer_assign_partition.py | mario21ic/python-kafka-demo | 99f6b5f21759f51e81ac5364774ecdf3211be052 | [
"MIT"
] | null | null | null | consumer_assign_partition.py | mario21ic/python-kafka-demo | 99f6b5f21759f51e81ac5364774ecdf3211be052 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from kafka import KafkaConsumer, TopicPartition
consumer = KafkaConsumer(bootstrap_servers='localhost:9092')
consumer.assign([TopicPartition('foobar', 2)])
msg = next(consumer)
| 25.125 | 60 | 0.78607 | 23 | 201 | 6.826087 | 0.826087 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.027174 | 0.084577 | 201 | 7 | 61 | 28.714286 | 0.826087 | 0.099502 | 0 | 0 | 0 | 0 | 0.111111 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
3035ab8eeb71094ab56022fcf251985f3b343c61 | 315 | py | Python | src/cookbook/__init__.py | Vidreven/cookbook | 6b1e058b6c5aaa5a829172935a0bb8bbb23a1a50 | [
"MIT"
] | null | null | null | src/cookbook/__init__.py | Vidreven/cookbook | 6b1e058b6c5aaa5a829172935a0bb8bbb23a1a50 | [
"MIT"
] | null | null | null | src/cookbook/__init__.py | Vidreven/cookbook | 6b1e058b6c5aaa5a829172935a0bb8bbb23a1a50 | [
"MIT"
] | null | null | null | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from . import config
URL = (
f"{config.DB_DRIVER}://{config.DB_USER}:{config.DB_PWD}"
f"@{config.DB_HOST}:{config.DB_PORT}/{config.DB_NAME}"
)
engine = create_engine(URL, pool_pre_ping=True)
Session = sessionmaker(bind=engine)
| 24.230769 | 60 | 0.749206 | 46 | 315 | 4.913043 | 0.5 | 0.212389 | 0.079646 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.114286 | 315 | 12 | 61 | 26.25 | 0.810036 | 0 | 0 | 0 | 0 | 0 | 0.330159 | 0.330159 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
303d1e8ad32842d926b29449c1f9342505289f7d | 310 | py | Python | dedis_cluster/exceptions.py | feiwenchaoyes/dedis-cluster | 88ff3dc0446581207a16bc7038790c45354b3aad | [
"MIT"
] | 1 | 2021-11-17T03:37:43.000Z | 2021-11-17T03:37:43.000Z | dedis_cluster/exceptions.py | hifeiwenchao/dedis-cluster | 88ff3dc0446581207a16bc7038790c45354b3aad | [
"MIT"
] | 1 | 2019-12-02T06:50:51.000Z | 2019-12-02T06:52:00.000Z | dedis_cluster/exceptions.py | hifeiwenchao/dedis-cluster | 88ff3dc0446581207a16bc7038790c45354b3aad | [
"MIT"
] | null | null | null |
class ConnectionInterrupted(Exception):
"""连接中断异常"""
def __str__(self):
error_type = self.__class__.__name__
error_msg = "An error occurred while connecting to redis cluster"
return "Redis Cluster %s: %s" % (error_type, error_msg)
class CompressorError(Exception):
pass
| 23.846154 | 73 | 0.680645 | 35 | 310 | 5.571429 | 0.628571 | 0.092308 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.222581 | 310 | 12 | 74 | 25.833333 | 0.809129 | 0.019355 | 0 | 0 | 0 | 0 | 0.239057 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0.142857 | 0 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
30576fbd745221661d0dda26c9fe4927e43113c1 | 527 | py | Python | optimizer/util/timeutil.py | lgasyou/spark-scheduler-configuration-optimizer | 05c0ea9411db642c7c7e675a6949ffcc6814947a | [
"MIT"
] | 1 | 2019-11-26T08:10:52.000Z | 2019-11-26T08:10:52.000Z | optimizer/util/timeutil.py | lgasyou/spark-scheduler-configuration-optimizer | 05c0ea9411db642c7c7e675a6949ffcc6814947a | [
"MIT"
] | 1 | 2019-12-24T06:40:07.000Z | 2019-12-24T06:40:07.000Z | optimizer/util/timeutil.py | lgasyou/spark-scheduler-configuration-optimizer | 05c0ea9411db642c7c7e675a6949ffcc6814947a | [
"MIT"
] | 2 | 2019-08-28T15:10:10.000Z | 2019-11-26T08:10:36.000Z | import time
GMT_FORMAT = '%Y-%m-%dT%H:%M:%S.%fGMT'
TIME_ADDITION = 8 * 3600 * 1000
def convert_str_to_timestamp(time_str: str) -> int:
ms = int(time_str.split('.')[1][:3])
return int(time.mktime(time.strptime(time_str, GMT_FORMAT))) * 1000 + TIME_ADDITION + ms
def convert_timestamp_to_str(timestamp: int, fmt: str = None) -> str:
time_array = time.localtime(timestamp / 1000)
return time.strftime(fmt or '%Y-%m-%d %H:%M:%S', time_array)
def current_time_ms() -> int:
return int(time.time() * 1000)
| 26.35 | 92 | 0.666034 | 86 | 527 | 3.883721 | 0.406977 | 0.062874 | 0.017964 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.052036 | 0.16129 | 527 | 19 | 93 | 27.736842 | 0.70362 | 0 | 0 | 0 | 0 | 0 | 0.077799 | 0.043643 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0 | 0.090909 | 0.090909 | 0.636364 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
305b609c4945188bed3a21cdafdd5cb70de803c0 | 3,171 | py | Python | src/Setup.py | Playerz21/Game-Jam | 47df54b7dfc8d3e1bbada314103841d19a036b98 | [
"Apache-2.0"
] | null | null | null | src/Setup.py | Playerz21/Game-Jam | 47df54b7dfc8d3e1bbada314103841d19a036b98 | [
"Apache-2.0"
] | null | null | null | src/Setup.py | Playerz21/Game-Jam | 47df54b7dfc8d3e1bbada314103841d19a036b98 | [
"Apache-2.0"
] | null | null | null | '''Imports'''
import pygame
pygame.init()
'''Vars'''
WIDTH=1000
HEIGHT=600
FPS=60
i=0
wn=pygame.display.set_mode((WIDTH,HEIGHT))
pygame.display.set_caption("Game Jam Project")
'''Images'''
#Background Images
bg=pygame.image.load('../Assets/background.jpg')
bg=pygame.transform.scale(bg, (WIDTH, HEIGHT))
cave=pygame.image.load('../Assets/cave.jpg')
cave=pygame.transform.scale(cave,(WIDTH,HEIGHT))
rip_bg=pygame.image.load('../Assets/bg.jpg')
rip_bg=pygame.transform.scale(rip_bg, (WIDTH, HEIGHT))
rip=pygame.image.load('../Assets/rip.png')
rip=pygame.transform.scale(rip,(300,300))
na_bg=pygame.transform.scale(pygame.image.load('../Assets/nationalpark.png'), (WIDTH, HEIGHT))
#Player
tiger_scene_2=pygame.image.load('../Assets/tiger.png')
tiger=pygame.transform.flip(pygame.transform.scale(tiger_scene_2,(200,100)),True,False)
tiger_scene_2=pygame.transform.scale(tiger_scene_2,(200,100))
smiling_tiger=pygame.transform.scale(pygame.image.load('../Assets/smiling tiger.png'),(200,200))
#Enemies
helicopter=pygame.image.load('../Assets/enemy.png')
helicopter=pygame.transform.scale(helicopter,(170,120))
helicopter_scene_2=pygame.image.load('../Assets/enemy.png')
helicopter_scene_2=pygame.transform.scale(helicopter,(170,120))
helicopter_scene_2=pygame.transform.flip(helicopter_scene_2,True,False)
hunter=pygame.image.load('../Assets/hunter.png')
hunter=pygame.transform.scale(pygame.transform.flip(hunter,True,False),(100,100))
hunter=pygame.transform.rotate(hunter,20)
#Obj
bullet=pygame.image.load('../Assets/bullet.png')
bullet=pygame.transform.scale(pygame.transform.rotate(bullet,-90),(10,30))
missile=pygame.image.load('../Assets/missile.png')
missile=pygame.transform.scale(missile,(80,80))
rock=pygame.image.load('../Assets/rock.png')
rock=pygame.transform.scale(rock,(80,80))
#Additional Background
badge=pygame.transform.scale(pygame.image.load('../Assets/badge.png'),(300,300))
tower=pygame.image.load('../Assets/tower.png')
tower=pygame.transform.scale(tower,(200,400))
#Btn
btn=pygame.transform.scale(pygame.image.load('../Assets/return.png'),(100,100))
btn_rect=btn.get_rect()
play = pygame.transform.scale(pygame.image.load('../Assets/play.png'), (200, 200))
play_rect = play.get_rect()
about = pygame.transform.scale(pygame.image.load('../Assets/about.png'), (300, 200))
about_rect = about.get_rect()
#TxtHolder
header_img=pygame.transform.scale(pygame.image.load('../Assets/txtholder2.png'),(600,200))
about_holder=pygame.transform.scale(pygame.image.load('../Assets/txtholder3.png'),(2000,650))
'''Text'''
calibri=pygame.font.SysFont('Verdana', 40,bold=True,italic=True)
'''Audio'''
shoot=pygame.mixer.Sound('../Assets/shoot.mp3')
grenade=pygame.mixer.Sound('../Assets/Grenade+1.mp3')
hit=pygame.mixer.Sound('../Assets/hit.wav')
'''Functions'''
def collide(laser,player):
offset_x=int(player.x-laser.x)
offset_y=int(player.y-laser.y)
return laser.mask.overlap(player.mask,(offset_x,offset_y))!=None
def pygame_quit():
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
pygame.quit() | 37.75 | 97 | 0.725323 | 457 | 3,171 | 4.954048 | 0.251641 | 0.172261 | 0.185512 | 0.185512 | 0.333039 | 0.272527 | 0.260601 | 0.083922 | 0.051237 | 0.051237 | 0 | 0.043136 | 0.078839 | 3,171 | 84 | 98 | 37.75 | 0.731941 | 0.023336 | 0 | 0 | 0 | 0 | 0.166044 | 0.048217 | 0 | 0 | 0 | 0 | 0 | 1 | 0.033898 | false | 0 | 0.016949 | 0 | 0.067797 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
306c9917bc50c69a59dcdfa61075dc6a4deec8b7 | 333 | py | Python | src/notelist/schemas/search.py | jajimenez/notelist | 5c4259126f40379cc31af6cde8713409e77c1d0b | [
"MIT"
] | 1 | 2021-06-01T14:04:08.000Z | 2021-06-01T14:04:08.000Z | src/notelist/schemas/search.py | jajimenez/notelist | 5c4259126f40379cc31af6cde8713409e77c1d0b | [
"MIT"
] | null | null | null | src/notelist/schemas/search.py | jajimenez/notelist | 5c4259126f40379cc31af6cde8713409e77c1d0b | [
"MIT"
] | null | null | null | """Search schemas module."""
from marshmallow import Schema
from marshmallow.fields import Str
from marshmallow.validate import Length
class SearchSchema(Schema):
"""Search schema."""
search = Str(
validate=Length(min=2, max=200),
required=True,
error_messages={"required": "Field is required."})
| 22.2 | 58 | 0.684685 | 38 | 333 | 5.973684 | 0.605263 | 0.198238 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014925 | 0.195195 | 333 | 14 | 59 | 23.785714 | 0.83209 | 0.111111 | 0 | 0 | 0 | 0 | 0.091228 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.375 | 0 | 0.625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
061d77206e3f81e9bbb52f0f84675935bedc7464 | 210 | py | Python | utils_spell.py | MangoMoe/dnd-spell-generator | 8df416c2eef03fb1d1a4bd20c3f1d155dbf6b16a | [
"Apache-2.0"
] | null | null | null | utils_spell.py | MangoMoe/dnd-spell-generator | 8df416c2eef03fb1d1a4bd20c3f1d155dbf6b16a | [
"Apache-2.0"
] | null | null | null | utils_spell.py | MangoMoe/dnd-spell-generator | 8df416c2eef03fb1d1a4bd20c3f1d155dbf6b16a | [
"Apache-2.0"
] | null | null | null | import glob
def load_spells_list():
spells_list = []
for fil in glob.glob("spells/*.txt"):
with open(fil) as spell_file:
spells_list.append(spell_file.read())
return spells_list | 26.25 | 49 | 0.647619 | 30 | 210 | 4.3 | 0.6 | 0.310078 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.238095 | 210 | 8 | 50 | 26.25 | 0.80625 | 0 | 0 | 0 | 0 | 0 | 0.056872 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.142857 | 0 | 0.428571 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
061ec6c76816f23d9cc40d47fa829e6df2b3bf4f | 505 | py | Python | src/utils/optim.py | yetongxin/math_algo | ae8797e02f113c6e26165c5fe1ec68503da63009 | [
"MIT"
] | 15 | 2019-08-11T07:08:40.000Z | 2021-07-15T02:42:42.000Z | src/utils/optim.py | yetongxin/math_algo | ae8797e02f113c6e26165c5fe1ec68503da63009 | [
"MIT"
] | 1 | 2019-10-22T08:18:36.000Z | 2020-09-22T17:12:37.000Z | src/utils/optim.py | yetongxin/math_algo | ae8797e02f113c6e26165c5fe1ec68503da63009 | [
"MIT"
] | 7 | 2019-08-05T06:46:51.000Z | 2021-11-11T06:52:51.000Z | import itertools
import torch
class Optimizer(object):
_ARG_MAX_GRAD_NORM = 'max_grad_norm'
def __init__(self, optim, max_grad_norm=0):
self.optimizer = optim
self.max_grad_norm = max_grad_norm
def step(self):
if self.max_grad_norm>0:
params = itertools.chain.from_iterable(\
[group['params'] for group in self.optimizer.param_groups])
torch.nn.utils.clip_grad_norm(params, self.max_grad_norm)
self.optimizer.step()
| 26.578947 | 75 | 0.663366 | 69 | 505 | 4.507246 | 0.42029 | 0.205788 | 0.247588 | 0.144695 | 0.160772 | 0.160772 | 0.160772 | 0 | 0 | 0 | 0 | 0.005236 | 0.243564 | 505 | 18 | 76 | 28.055556 | 0.808901 | 0 | 0 | 0 | 0 | 0 | 0.037698 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.153846 | false | 0 | 0.153846 | 0 | 0.461538 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
0637472a8705fb219fa83287a3db6d02e2ac18b8 | 14,975 | py | Python | pysnmp-with-texts/HP-ICF-CHAIN.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/HP-ICF-CHAIN.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/HP-ICF-CHAIN.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module HP-ICF-CHAIN (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HP-ICF-CHAIN
# Produced by pysmi-0.3.4 at Wed May 1 13:33:33 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsIntersection", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsUnion")
hpicfCommonTrapsPrefix, hpicfCommon, hpicfObjectModules = mibBuilder.importSymbols("HP-ICF-OID", "hpicfCommonTrapsPrefix", "hpicfCommon", "hpicfObjectModules")
ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup")
IpAddress, MibIdentifier, Bits, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, Gauge32, Counter64, Unsigned32, NotificationType, ModuleIdentity, iso, ObjectIdentity, Counter32, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "IpAddress", "MibIdentifier", "Bits", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Gauge32", "Counter64", "Unsigned32", "NotificationType", "ModuleIdentity", "iso", "ObjectIdentity", "Counter32", "TimeTicks")
DisplayString, TimeStamp, TextualConvention, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TimeStamp", "TextualConvention", "TruthValue")
hpicfChainMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 11, 2, 14, 10, 2, 2))
hpicfChainMib.setRevisions(('2000-11-03 22:16', '1997-03-06 03:33', '1996-09-10 02:08', '1994-02-25 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: hpicfChainMib.setRevisionsDescriptions(('Updated division name.', 'Added NOTIFICATION-GROUP information.', 'Split this MIB module from the former monolithic hp-icf MIB.', 'Initial version of this MIB module.',))
if mibBuilder.loadTexts: hpicfChainMib.setLastUpdated('200011032216Z')
if mibBuilder.loadTexts: hpicfChainMib.setOrganization('HP Networking')
if mibBuilder.loadTexts: hpicfChainMib.setContactInfo('Hewlett Packard Company 8000 Foothills Blvd. Roseville, CA 95747')
if mibBuilder.loadTexts: hpicfChainMib.setDescription('This MIB module describes management of the Distributed Management Chain for devices in the HP AdvanceStack product line.')
hpicfChain = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 1, 1))
hpicfChainMaxMembers = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpicfChainMaxMembers.setStatus('current')
if mibBuilder.loadTexts: hpicfChainMaxMembers.setDescription('The maximum number of devices that can be supported on the Distributed Management Chain from this agent.')
hpicfChainCurMembers = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpicfChainCurMembers.setStatus('current')
if mibBuilder.loadTexts: hpicfChainCurMembers.setDescription('The number of devices currently on the Distributed Management Chain connected to this agent.')
hpicfChainLastChange = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 1, 1, 3), TimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpicfChainLastChange.setStatus('current')
if mibBuilder.loadTexts: hpicfChainLastChange.setDescription('The value of sysUpTime on this agent the last time a device was added to or removed from the Distributed Management Chain connected to this agent.')
hpicfChainChanges = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 1, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpicfChainChanges.setStatus('current')
if mibBuilder.loadTexts: hpicfChainChanges.setDescription('A count of the number of times devices have been added to or removed from the Distributed Management Chain connected to this agent.')
hpicfChainTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 1, 1, 5), )
if mibBuilder.loadTexts: hpicfChainTable.setStatus('current')
if mibBuilder.loadTexts: hpicfChainTable.setDescription('A table of boxes currently connected to the same Distributed Management Chain as this agent.')
hpicfChainEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 1, 1, 5, 1), ).setIndexNames((0, "HP-ICF-CHAIN", "hpicfChainId"))
if mibBuilder.loadTexts: hpicfChainEntry.setStatus('current')
if mibBuilder.loadTexts: hpicfChainEntry.setDescription('An entry in the table describing a single box on the Distributed Management Chain connected to this device.')
hpicfChainId = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 1, 1, 5, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(6, 6)).setFixedLength(6)).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpicfChainId.setStatus('current')
if mibBuilder.loadTexts: hpicfChainId.setDescription('An identifier which uniquely identifies this particular box. In practice, this will be a box serial number or MAC address.')
hpicfChainObjectId = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 1, 1, 5, 1, 2), ObjectIdentifier()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpicfChainObjectId.setStatus('current')
if mibBuilder.loadTexts: hpicfChainObjectId.setDescription('The authoritative identification of the box which provides an easy and unambiguous means for determining the type of box.')
hpicfChainTimestamp = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 1, 1, 5, 1, 3), TimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpicfChainTimestamp.setStatus('current')
if mibBuilder.loadTexts: hpicfChainTimestamp.setDescription("The value of the agent's sysUpTime at which this box was last initialized. If the box has not been initialized since the last reinitialization of the agent, then this object has a zero value.")
hpicfChainHasAgent = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 1, 1, 5, 1, 4), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpicfChainHasAgent.setStatus('current')
if mibBuilder.loadTexts: hpicfChainHasAgent.setDescription("This object will contain the value 'true' if this box contains at least one network management agent capable of responding to SNMP requests, and will contain the value 'false' otherwise.")
hpicfChainThisBox = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 1, 1, 5, 1, 5), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpicfChainThisBox.setStatus('current')
if mibBuilder.loadTexts: hpicfChainThisBox.setDescription("This object will contain the value 'true' if this entry in the chain table corresponds to the box which contains the agent which is responding to this SNMP request, and will contain the value 'false' otherwise.")
hpicfChainLocation = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 1, 1, 5, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpicfChainLocation.setStatus('current')
if mibBuilder.loadTexts: hpicfChainLocation.setDescription('This byte is settable by a management station and is not interpreted by the agent. The intent is that a management station can use it to assign an ordering to boxes on the chain that can later be used when displaying the chain.')
hpicfChainViewTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 1, 1, 6), )
if mibBuilder.loadTexts: hpicfChainViewTable.setStatus('current')
if mibBuilder.loadTexts: hpicfChainViewTable.setDescription('This table contains one entry for each box on the Distributed Management Chain for which this agent is able to act as a proxy.')
hpicfChainViewEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 1, 1, 6, 1), ).setIndexNames((0, "HP-ICF-CHAIN", "hpicfChainViewId"))
if mibBuilder.loadTexts: hpicfChainViewEntry.setStatus('current')
if mibBuilder.loadTexts: hpicfChainViewEntry.setDescription('An entry in the hpicfChainViewTable containing information about how to proxy to a single box.')
hpicfChainViewId = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 1, 1, 6, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(6, 6)).setFixedLength(6)).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpicfChainViewId.setStatus('current')
if mibBuilder.loadTexts: hpicfChainViewId.setDescription('An identifier which uniquely identifies this particular box. In practice, this will be a box serial number or MAC address.')
hpicfChainViewName = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 1, 1, 6, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 15))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpicfChainViewName.setStatus('current')
if mibBuilder.loadTexts: hpicfChainViewName.setDescription("The local name of this box. This is used by the proxy agent for the box to determine which box on the Distributed Management Chain is being addressed. If an agent does not use this method to distinguish proxy destinations, it should return a zero length octet string for this object. For SNMPv1, the destination box is specified by appending this name to the proxy agent's community name. For example, if this agent has a community with a community name of 'public', and the value of this object is 'repeater1', the community 'public/repeater1' will specify that the agent should proxy to the public community of the 'repeater1' box. The default value for this object for box-level repeaters is an ASCII hex representation of the low-order three bytes of the device MAC address.")
hpicfChainAddition = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 12, 1, 0, 1)).setObjects(("HP-ICF-CHAIN", "hpicfChainId"))
if mibBuilder.loadTexts: hpicfChainAddition.setStatus('deprecated')
if mibBuilder.loadTexts: hpicfChainAddition.setDescription('********* THIS NOTIFICATION IS DEPRECATED ********* An hpicfChainAddition trap indicates that a new node has been added to the Distributed Management Chain connected to this agent. The hpicfChainId returned is the identifier for the new node. Replaced by Cold Start')
hpicfChainRemoval = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 12, 1, 0, 2)).setObjects(("HP-ICF-CHAIN", "hpicfChainId"))
if mibBuilder.loadTexts: hpicfChainRemoval.setStatus('current')
if mibBuilder.loadTexts: hpicfChainRemoval.setDescription('An hpicfChainRemoval trap indicates that a node has been removed from the Distributed Management Chain connected to this agent. The hpicfChainId returned is the identifier for the node that was removed.')
hpicfChainConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 10, 2, 2, 1))
hpicfChainCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 10, 2, 2, 1, 1))
hpicfChainGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 10, 2, 2, 1, 2))
hpicfChainingCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 11, 2, 14, 10, 2, 2, 1, 1, 1)).setObjects(("HP-ICF-CHAIN", "hpicfChainingGroup"), ("HP-ICF-CHAIN", "hpicfChainTrapGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hpicfChainingCompliance = hpicfChainingCompliance.setStatus('obsolete')
if mibBuilder.loadTexts: hpicfChainingCompliance.setDescription('The compliance statement for HP ICF devices with a Distributed Management Chain connection.')
hpicfChainingCompliance2 = ModuleCompliance((1, 3, 6, 1, 4, 1, 11, 2, 14, 10, 2, 2, 1, 1, 2)).setObjects(("HP-ICF-CHAIN", "hpicfChainingGroup"), ("HP-ICF-CHAIN", "hpicfChainNotifyGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hpicfChainingCompliance2 = hpicfChainingCompliance2.setStatus('current')
if mibBuilder.loadTexts: hpicfChainingCompliance2.setDescription('The compliance statement for HP ICF devices with a Distributed Management Chain connection.')
hpicfChainingGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 10, 2, 2, 1, 2, 1)).setObjects(("HP-ICF-CHAIN", "hpicfChainMaxMembers"), ("HP-ICF-CHAIN", "hpicfChainCurMembers"), ("HP-ICF-CHAIN", "hpicfChainLastChange"), ("HP-ICF-CHAIN", "hpicfChainChanges"), ("HP-ICF-CHAIN", "hpicfChainId"), ("HP-ICF-CHAIN", "hpicfChainObjectId"), ("HP-ICF-CHAIN", "hpicfChainTimestamp"), ("HP-ICF-CHAIN", "hpicfChainHasAgent"), ("HP-ICF-CHAIN", "hpicfChainThisBox"), ("HP-ICF-CHAIN", "hpicfChainLocation"), ("HP-ICF-CHAIN", "hpicfChainViewId"), ("HP-ICF-CHAIN", "hpicfChainViewName"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hpicfChainingGroup = hpicfChainingGroup.setStatus('current')
if mibBuilder.loadTexts: hpicfChainingGroup.setDescription('A collection of objects for managing devices on the HP Distributed Management Bus.')
hpicfChainTrapGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 10, 2, 2, 1, 2, 2)).setObjects(("HP-ICF-CHAIN", "hpicfChainAddition"), ("HP-ICF-CHAIN", "hpicfChainRemoval"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hpicfChainTrapGroup = hpicfChainTrapGroup.setStatus('obsolete')
if mibBuilder.loadTexts: hpicfChainTrapGroup.setDescription('********* THIS GROUP IS OBSOLETE ********* A collection of notifications used to indicate a changes in membership on a Distributed Management Chain.')
hpicfChainNotifyGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 10, 2, 2, 1, 2, 3)).setObjects(("HP-ICF-CHAIN", "hpicfChainRemoval"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
hpicfChainNotifyGroup = hpicfChainNotifyGroup.setStatus('current')
if mibBuilder.loadTexts: hpicfChainNotifyGroup.setDescription('A collection of notifications used to indicate a changes in membership on a Distributed Management Chain.')
mibBuilder.exportSymbols("HP-ICF-CHAIN", hpicfChainHasAgent=hpicfChainHasAgent, PYSNMP_MODULE_ID=hpicfChainMib, hpicfChainingCompliance2=hpicfChainingCompliance2, hpicfChainViewId=hpicfChainViewId, hpicfChainingGroup=hpicfChainingGroup, hpicfChainMaxMembers=hpicfChainMaxMembers, hpicfChainNotifyGroup=hpicfChainNotifyGroup, hpicfChainTable=hpicfChainTable, hpicfChainEntry=hpicfChainEntry, hpicfChainCompliances=hpicfChainCompliances, hpicfChainCurMembers=hpicfChainCurMembers, hpicfChain=hpicfChain, hpicfChainGroups=hpicfChainGroups, hpicfChainThisBox=hpicfChainThisBox, hpicfChainRemoval=hpicfChainRemoval, hpicfChainViewEntry=hpicfChainViewEntry, hpicfChainConformance=hpicfChainConformance, hpicfChainId=hpicfChainId, hpicfChainAddition=hpicfChainAddition, hpicfChainLastChange=hpicfChainLastChange, hpicfChainTrapGroup=hpicfChainTrapGroup, hpicfChainChanges=hpicfChainChanges, hpicfChainMib=hpicfChainMib, hpicfChainLocation=hpicfChainLocation, hpicfChainViewName=hpicfChainViewName, hpicfChainTimestamp=hpicfChainTimestamp, hpicfChainObjectId=hpicfChainObjectId, hpicfChainingCompliance=hpicfChainingCompliance, hpicfChainViewTable=hpicfChainViewTable)
| 142.619048 | 1,160 | 0.774558 | 1,890 | 14,975 | 6.135979 | 0.18254 | 0.047599 | 0.083297 | 0.009658 | 0.416487 | 0.304303 | 0.286108 | 0.276192 | 0.241614 | 0.241614 | 0 | 0.051347 | 0.105242 | 14,975 | 104 | 1,161 | 143.990385 | 0.814165 | 0.021235 | 0 | 0.06383 | 0 | 0.138298 | 0.394525 | 0.005939 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.074468 | 0 | 0.074468 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
063fddd86e70d2d550ef2ae69e972591243cef7c | 216 | py | Python | project/Python/other/0621dmo.py | lcscim/python-demo | c312b53f9a0f845051e6b9966d030753505d6c56 | [
"Apache-2.0"
] | null | null | null | project/Python/other/0621dmo.py | lcscim/python-demo | c312b53f9a0f845051e6b9966d030753505d6c56 | [
"Apache-2.0"
] | null | null | null | project/Python/other/0621dmo.py | lcscim/python-demo | c312b53f9a0f845051e6b9966d030753505d6c56 | [
"Apache-2.0"
] | null | null | null | import urllib.request
req = urllib.request.Request('http://placekitten.com/g/500/600')
response = urllib.request.urlopen(req)
cat_img = response.read()
with open('cat_500_600.jpg','wb') as f:
f.write(cat_img)
| 21.6 | 64 | 0.726852 | 35 | 216 | 4.371429 | 0.628571 | 0.254902 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.062176 | 0.106481 | 216 | 9 | 65 | 24 | 0.73057 | 0 | 0 | 0 | 0 | 0 | 0.226852 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.166667 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
0640f75abe28cb1fc123d7d87059d0a46f5cbcd1 | 3,101 | py | Python | pglet/slider.py | pglet/pglet-python | 31f65083d68888661d4780322c26bfc57c091e1c | [
"MIT"
] | 12 | 2021-05-01T17:49:57.000Z | 2022-02-12T21:20:56.000Z | pglet/slider.py | pglet/pglet-python | 31f65083d68888661d4780322c26bfc57c091e1c | [
"MIT"
] | 47 | 2021-01-22T18:31:22.000Z | 2022-03-24T00:17:03.000Z | pglet/slider.py | pglet/pglet-python | 31f65083d68888661d4780322c26bfc57c091e1c | [
"MIT"
] | 10 | 2021-02-08T19:13:42.000Z | 2022-03-26T10:40:20.000Z | from .utils import encode_attr
from .control import Control
class Slider(Control):
def __init__(self, label=None, id=None, value=None, min=None, max=None, step=None,
show_value=None, value_format=None, vertical=None, data=None, on_change=None,
width=None, height=None, padding=None, margin=None,
visible=None, disabled=None):
Control.__init__(self, id=id,
width=width, height=height, padding=padding, margin=margin,
visible=visible, disabled=disabled, data=data)
self.value = value
self.label = label
self.min = min
self.max = max
self.step = step
self.show_value = show_value
self.value_format = value_format
self.vertical = vertical
self.on_change = on_change
def _get_control_name(self):
return "slider"
# on_change
@property
def on_change(self):
return self._get_event_handler("change")
@on_change.setter
def on_change(self, handler):
self._add_event_handler("change", handler)
# value
@property
def value(self):
return self._get_attr("value", data_type="float")
@value.setter
def value(self, value):
assert value == None or isinstance(value, float) or isinstance(value, int), "value must be a float"
self._set_attr("value", value)
# label
@property
def label(self):
return self._get_attr("label")
@label.setter
def label(self, value):
self._set_attr("label", value)
# min
@property
def min(self):
return self._get_attr("min")
@min.setter
def min(self, value):
assert value == None or isinstance(value, float) or isinstance(value, int), "min must be a float"
self._set_attr("min", value)
# max
@property
def max(self):
return self._get_attr("max")
@max.setter
def max(self, value):
assert value == None or isinstance(value, float) or isinstance(value, int), "max must be a float"
self._set_attr("max", value)
# step
@property
def step(self):
return self._get_attr("step")
@step.setter
def step(self, value):
assert value == None or isinstance(value, float) or isinstance(value, int), "step must be a float"
self._set_attr("step", value)
# show_value
@property
def show_value(self):
return self._get_attr("showValue")
@show_value.setter
def show_value(self, value):
assert value == None or isinstance(value, bool), "show_value must be a boolean"
self._set_attr("showValue", value)
# value_format
@property
def value_format(self):
return self._get_attr("valueFormat")
@value_format.setter
def value_format(self, value):
self._set_attr("valueFormat", value)
# vertical
@property
def vertical(self):
return self._get_attr("vertical")
@vertical.setter
def vertical(self, value):
assert value == None or isinstance(value, bool), "vertical must be a boolean"
self._set_attr("vertical", value) | 28.190909 | 107 | 0.636246 | 406 | 3,101 | 4.679803 | 0.128079 | 0.047368 | 0.089474 | 0.080526 | 0.381053 | 0.293684 | 0.266316 | 0.191579 | 0.191579 | 0.138947 | 0 | 0 | 0.252177 | 3,101 | 110 | 108 | 28.190909 | 0.819319 | 0.021606 | 0 | 0.111111 | 0 | 0 | 0.083306 | 0 | 0 | 0 | 0 | 0 | 0.074074 | 1 | 0.246914 | false | 0 | 0.024691 | 0.123457 | 0.407407 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
064d1eb99599867db25d0335c34c6914e23225cf | 897 | py | Python | hypothesis/util/data/simulator_dataset.py | boyali/hypothesis-sre | f44d25eb281d49663d49d134ee73ad542849714b | [
"BSD-3-Clause"
] | 45 | 2019-02-13T14:16:35.000Z | 2022-02-23T21:30:02.000Z | hypothesis/util/data/simulator_dataset.py | boyali/hypothesis-sre | f44d25eb281d49663d49d134ee73ad542849714b | [
"BSD-3-Clause"
] | 1 | 2020-01-13T08:29:50.000Z | 2020-01-22T10:28:02.000Z | hypothesis/util/data/simulator_dataset.py | boyali/hypothesis-sre | f44d25eb281d49663d49d134ee73ad542849714b | [
"BSD-3-Clause"
] | 8 | 2019-04-23T14:25:08.000Z | 2021-07-28T15:05:31.000Z | import torch
from hypothesis.simulation import Simulator
from torch.utils.data import Dataset
class SimulatorDataset(Dataset):
r"""
Todo:
Write docs.
"""
def __init__(self, simulator, prior, size=1000000):
super(SimulatorDataset, self).__init__()
self.prior = prior
self.simulator = simulator
self.size = int(size)
def __getitem__(self, index):
r"""
Todo:
Write docs.
"""
passed = False
while not passed:
try:
inputs = self.prior.sample(torch.Size([1])).unsqueeze(0)
outputs = self.simulator(inputs)
passed = True
except Exception as e:
print(e)
return inputs, outputs
def __len__(self):
r"""
Todo:
Write docs.
"""
return self.size
| 20.860465 | 72 | 0.528428 | 89 | 897 | 5.146067 | 0.494382 | 0.032751 | 0.065502 | 0.091703 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016129 | 0.377926 | 897 | 42 | 73 | 21.357143 | 0.80466 | 0.072464 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.071429 | 0 | 1 | 0.125 | false | 0.125 | 0.125 | 0 | 0.375 | 0.041667 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
065381428280141aabcb3e0bf1ad93db900b0af7 | 314 | py | Python | conanfile.py | bincrafters/conan-boost_timer | 2df7fd6e9f9e161b8bf55c1bab0c8e4584a9df3d | [
"MIT"
] | null | null | null | conanfile.py | bincrafters/conan-boost_timer | 2df7fd6e9f9e161b8bf55c1bab0c8e4584a9df3d | [
"MIT"
] | null | null | null | conanfile.py | bincrafters/conan-boost_timer | 2df7fd6e9f9e161b8bf55c1bab0c8e4584a9df3d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import python_requires
base = python_requires("boost_base/2.0.0@bincrafters/testing")
class BoostTimerConan(base.BoostBaseConan):
name = "boost_timer"
version = "1.70.0"
@property
def boost_build_requires(self):
return ["io"]
| 18.470588 | 62 | 0.678344 | 41 | 314 | 5.04878 | 0.756098 | 0.135266 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031128 | 0.181529 | 314 | 16 | 63 | 19.625 | 0.774319 | 0.133758 | 0 | 0 | 0 | 0 | 0.203704 | 0.133333 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.125 | 0.125 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 2 |
066c25c11eeb961cef5e58eb4d608795e0a54472 | 905 | py | Python | apps/api/views/__init__.py | LizanLycan/CertsGen | 2e18d8ddea6adf90805face16cbb8f8fa06989c3 | [
"MIT"
] | null | null | null | apps/api/views/__init__.py | LizanLycan/CertsGen | 2e18d8ddea6adf90805face16cbb8f8fa06989c3 | [
"MIT"
] | 1 | 2020-02-04T01:56:42.000Z | 2020-02-04T01:56:42.000Z | apps/api/views/__init__.py | LizanLycan/CertsGen | 2e18d8ddea6adf90805face16cbb8f8fa06989c3 | [
"MIT"
] | null | null | null | from .auth import (
AccreditationAuthorityCustomAuthToken,
CertificationAuthorityCustomAuthToken,
CertifierCustomAuthToken,
RecipientCustomAuthToken
)
from .signup import (
AccreditationAuthorityRegisterView,
CertificationAuthorityRegisterView,
CertifierRegisterView,
RecipientRegisterView
)
from .certificate import (
CertificateRegisterView,
CertifierDependencyView,
GetCertificateView
)
from .signature import SignatureRegisterView
from .certifiers import CertifiersView
AccreditationAuthorityCustomAuthToken, AccreditationAuthorityRegisterView, \
CertificationAuthorityRegisterView, \
CertificationAuthorityCustomAuthToken, CertifierRegisterView, \
RecipientRegisterView, CertifierCustomAuthToken, RecipientCustomAuthToken, \
CertificateRegisterView, CertifierDependencyView, SignatureRegisterView, \
CertifiersView, GetCertificateView
| 33.518519 | 80 | 0.830939 | 41 | 905 | 18.341463 | 0.487805 | 0.12766 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.129282 | 905 | 26 | 81 | 34.807692 | 0.954315 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.2 | 0 | 0.2 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
066f3ad3f9c30a8968067a757e405bcecd53c382 | 3,568 | py | Python | src/Classes/MSDS400/Module 6/practice/practice_2.py | bmoretz/Python-Playground | a367ec7659b85c24363c21b5c0ac25db08ffa1f6 | [
"MIT"
] | null | null | null | src/Classes/MSDS400/Module 6/practice/practice_2.py | bmoretz/Python-Playground | a367ec7659b85c24363c21b5c0ac25db08ffa1f6 | [
"MIT"
] | null | null | null | src/Classes/MSDS400/Module 6/practice/practice_2.py | bmoretz/Python-Playground | a367ec7659b85c24363c21b5c0ac25db08ffa1f6 | [
"MIT"
] | null | null | null |
# MSDS 400 Module 6 Practice 2
import matplotlib.pyplot as plt
from numpy import poly1d, linspace
'''
The first example shows how to generate and print a second degree
polynomial with coefficients, 1, -2 and 4. The software is not limited
to second degree polynomials. Higher order can be generated. The critical
thing is to have all the coefficients in the right sequence.
'''
p = poly1d([5, -3, 2])
print('Second Degree Polynomial')
print(p)
# Now a fourth degree polynomial will be generated and printed.
q = poly1d([2, 1, 4, -2, 3])
print('\nFourth Degree Polynomial')
print(q)
# It is possible to combine p and q algebraically.
print('\nCombination')
g = p + p*q
print(g)
# Derivatives of different orders may be calculated. This next section will
# show determination of the first and second derivatives of p.
print('\nFirst Derivative')
h = p.deriv(m=1) # First derivative with m=1.
print(h)
print(h.roots)
print('\nSecond Derivative')
t = p.deriv(m=2) # Second derivative with m=2.
print(t)
print(t.roots)
'''
Using t, the original function p can be restored if the missing
coefficients -2 and 4 are supplied. Different coefficients would result
in a different function instead of the original p.
'''
print('\nIntegrated Derivative')
w = t.integ(m=2, k=[-3, 2])
print(w)
print(w.coeffs)
print('\nrandom stuff below')
new = t.integ(m=2, k=[-2, 4])
print(new)
print(new.deriv(m=1))
# Roots may also be found. This is useful when locating the maxima, minima
# and inflection points of a function from the first and second derivatives.
print('\nRoots of polynomial')
print(w.roots)
'''
Plotting requires defining a domain for the polynomial. The linspace
function is used to set boundaries and define the number of points
used for calculation. A new polynomial p will be defined.
'''
p = poly1d([.3333, 0, -1, 5])
# As a final example, we will find the first and second derivatives of the
# polynomial p, find the roots of the derivatives and plot the functions.
g = p.deriv(m=1)
print('\nRoots of First Derivative')
print(g.roots)
print('\nRoots of Second Derivative')
q = p.deriv(m=2)
print(q.roots)
x = linspace(-4, 4, 101)
y = p(x)
yg = g(x) # These statements define points for plotting.
yq = q(x)
y0 = 0*x # This statement defines the y axis for plotting.
# What is shown below is a different way to legends using a label. Python
# will pick the colors to assign to the labels and the plotted points.
plt.plot(x, y, label='y=p(x)')
plt.plot(x, yg, label='First Derivative')
plt.plot(x, yq, label='Second Derivative')
plt.legend(loc='best')
plt.plot(x, y0)
plt.xlabel('x-axis')
plt.ylabel('y-axis')
plt.title('Plot Showing Function, First and Second Derivatives')
plt.show()
# Exercise: Refer to Lial Section 14.1 Example 2. Duplicate the results
# showing plots of the function and derivatives. Compare to the answer sheet.
plt.figure()
p = poly1d([3, -4, -12, 0, 2])
print('\nFourth Degree Polynomial')
print(p)
print('\nFirst Derivative')
g = p.deriv(m=1) # First derivative with m=1.
print(g)
print('\nSecond Derivative')
q = p.deriv(m=2) # Second derivative with m=2.
print(q)
x = linspace(-2, 3, 101)
y = p(x)
yg = g(x) # These statements define points for plotting.
yq = q(x)
y0 = 0*x # This statement defines the y axis for plotting.
plt.plot(x, y, label='y=p(x)')
plt.plot(x, yg, label='First Derivative')
plt.plot(x, yq, label='Second Derivative')
plt.legend(loc='best')
plt.plot(x, y0)
plt.xlabel('x-axis')
plt.ylabel('y-axis')
plt.title('Plot Showing Function, First and Second Derivatives')
plt.show() | 27.658915 | 78 | 0.716648 | 614 | 3,568 | 4.164495 | 0.281759 | 0.021901 | 0.025029 | 0.048885 | 0.360579 | 0.312867 | 0.277669 | 0.277669 | 0.277669 | 0.277669 | 0 | 0.024366 | 0.160314 | 3,568 | 129 | 79 | 27.658915 | 0.829105 | 0.323711 | 0 | 0.567568 | 1 | 0 | 0.288551 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.027027 | 0 | 0.027027 | 0.405405 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
0670d15a9a656edd90aa39f84f5e0bf55472a4d9 | 81,228 | py | Python | pysnmp-with-texts/CADANT-HW-MEAS-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/CADANT-HW-MEAS-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/CADANT-HW-MEAS-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CADANT-HW-MEAS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CADANT-HW-MEAS-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:45:55 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")
ValueSizeConstraint, ValueRangeConstraint, ConstraintsUnion, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ConstraintsIntersection", "SingleValueConstraint")
cadIf3CmtsCmUsStatusChIfIndex, = mibBuilder.importSymbols("CADANT-CMTS-IF3-MIB", "cadIf3CmtsCmUsStatusChIfIndex")
cadIfMacDomainIfIndex, = mibBuilder.importSymbols("CADANT-CMTS-LAYER2CMTS-MIB", "cadIfMacDomainIfIndex")
cadIfCmtsCmStatusMacAddress, = mibBuilder.importSymbols("CADANT-CMTS-MAC-MIB", "cadIfCmtsCmStatusMacAddress")
cadEquipment, = mibBuilder.importSymbols("CADANT-PRODUCTS-MIB", "cadEquipment")
PortId, CardId, CadIfDirection = mibBuilder.importSymbols("CADANT-TC", "PortId", "CardId", "CadIfDirection")
TenthdB, = mibBuilder.importSymbols("DOCS-IF-MIB", "TenthdB")
IfDirection, = mibBuilder.importSymbols("DOCS-QOS3-MIB", "IfDirection")
docsSubmgt3FilterGrpEntry, = mibBuilder.importSymbols("DOCS-SUBMGT3-MIB", "docsSubmgt3FilterGrpEntry")
InterfaceIndex, ifIndex = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex", "ifIndex")
pktcEScTapStreamIndex, pktcEScTapMediationContentId = mibBuilder.importSymbols("PKTC-ES-TAP-MIB", "pktcEScTapStreamIndex", "pktcEScTapMediationContentId")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
Counter32, ObjectIdentity, Gauge32, NotificationType, Counter64, Bits, MibScalar, MibTable, MibTableRow, MibTableColumn, ModuleIdentity, MibIdentifier, TimeTicks, Unsigned32, iso, Integer32, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "ObjectIdentity", "Gauge32", "NotificationType", "Counter64", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ModuleIdentity", "MibIdentifier", "TimeTicks", "Unsigned32", "iso", "Integer32", "IpAddress")
MacAddress, TimeStamp, TextualConvention, DisplayString, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "MacAddress", "TimeStamp", "TextualConvention", "DisplayString", "TruthValue")
cadHardwareMeasMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2))
cadHardwareMeasMib.setRevisions(('2015-08-27 00:00', '2015-07-13 00:00', '2015-06-03 00:00', '2014-10-14 00:00', '2014-06-13 00:00', '2014-06-04 00:00', '2013-11-22 00:00', '2012-10-30 00:00', '2012-05-09 00:00', '2011-08-31 00:00', '2011-06-29 00:00', '2011-02-28 00:00', '2011-02-24 00:00', '2011-02-18 00:00', '2010-11-22 00:00', '2010-03-09 00:00', '2008-11-24 00:00', '2008-11-21 00:00', '2008-11-05 00:00', '2008-04-24 00:00', '2006-09-14 00:00', '2006-04-14 00:00', '2005-07-13 00:00', '2004-12-10 00:00', '2004-08-31 00:00', '2004-04-09 00:00', '2004-03-09 00:00', '2004-02-23 00:00', '2004-02-18 00:00', '2004-02-15 00:00', '2004-01-24 00:00', '2003-12-18 00:00', '2003-12-10 00:00', '2003-09-19 00:00', '2003-08-26 00:00', '2003-07-30 00:00', '2002-05-06 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: cadHardwareMeasMib.setRevisionsDescriptions(('Add cadantDPortMeasOfdmChanUtilization', 'Add cadInterfaceHighResUtilizationPercentage and cadInterfaceIntervalOctetsForwarded', 'Add cadantDPortMeasDfdmIfSpeed, cadantDPortMeasOfdmHighestAvgBitsPerSubc, and cadantDPortMeasOfdmNumDataSubc', 'Support 384 downstream channels per DCAM-B', 'Add back in cadFftUpstreamChannelTable', 'Add cadDCardIgmpThrottleDropPkts.', 'Remove cadFftUpstreamChannelTable', 'Add cadLaesCountTable', 'Remove cadHWCmUsMeasTable', 'Remove cadantUPortMeasMapFrms', 'Remove cadSFIDMeasEntry', 'Deprecate cadSFIDMeasEntry and add the following MIB objects to cadantUFIDMeasEntry cadantUFIDMeasCcfStatsSgmtValids, cadantUFIDMeasCcfStatsSgmtLost and cadantUFIDMeasCcfStatsSgmtDrop.', 'Remove cadSFIDToSIDEntry', 'Add cadantUFIDMeasSIDMacIfIndex and cadantUFIDMeasSIDBonded to cadantUFIDMeasEntry', 'Change indices of cadDFIDMeasEntry as ifIndex and SFID. Change indices of cadantUFIDMeasEntry as ifIndex and SID', 'Add cadDCardDhcpV6ThrottleDropPkts and cadDCardNdThrottleDropPkts.', 'Add cadHWCmUsMeasEntry', 'Restructure cadantHWUFIDMeasEntry, rename cadantUFIDMeasUFID to cadantUFIDMeasSID, and Add cadantHWMeasUFIDIndex', 'Restructure cadSFIDMeasEntry to support docsQosServiceFlowCcfStatsEntry', 'Use ifindex as key for sfid to sid lookup.', 'Remove fabric tables and add CPWRED tables to match implementation.', 'Added implementation per utilization interval for cadInterfaceUtilizationAvgContSlots.', 'Added cadDFIDMeasPolicedDelayPkts for Traffic Shaping feature.', 'Extended cadSubMgtPktFilterExtTable to allow for packet capturing.', 'Added cadSubMgtPktFilterExtTable to reset docsSubMgtPktFilterMatches.', 'Added cadFftUpstreamChannelTable for FFT counts.', 'Added cadInterfaceUtilizationTable', 'Added support for per-SID HCS and CRC errors.', 'Added cadantDPortMeasIfOutTotalOctets', 'Added support for per UFID microreflection/signalnoise.', 'Added cadantDPortMeasAppMcastPkts', 'Added 10 BCM3214 counts to the cadantUPortMeasTable', ' add more arp throttle counts. ', ' add more receive error counts to cadantEtherPhyMeasTable', ' add error drop and filter drop counts to UPortMeas table', ' Add support for DHCP packets dropped due to throttling. ', ' change cadantUFIDMeasBytsSGreedyDrop to cadantUFIDMeasPktsSGreedyDrop.',))
if mibBuilder.loadTexts: cadHardwareMeasMib.setLastUpdated('201508270000Z')
if mibBuilder.loadTexts: cadHardwareMeasMib.setOrganization('Arris International, Inc.')
if mibBuilder.loadTexts: cadHardwareMeasMib.setContactInfo('Arris Technical Support E-Mail: support@arrisi.com')
if mibBuilder.loadTexts: cadHardwareMeasMib.setDescription('This Mib Module contains all of the counts that are associated with hardware in the ARRIS C4 CMTS. Many of these MIB variables contain the same counts as found in the standard MIBs. However, the grouping of these variables is done for the convenience of the Cadant engineering team. These tables can be used to build value-added interfaces to the Cadant ARRIS C4 CMTS. ')
class DFIDIndex(TextualConvention, Unsigned32):
description = "The 1's-based SFID"
status = 'current'
subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(1, 4294967295)
class PktClassId(TextualConvention, Integer32):
description = 'Index assigned to packet classifier entry by the CMTS which is unique per service flow.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 65535)
class SFIDIndex(TextualConvention, Integer32):
description = "The 1's-based SFID"
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 2147483647)
class UFIDIndex(TextualConvention, Integer32):
description = "The 1's-based UFID"
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 32768)
class SIDValue(TextualConvention, Integer32):
description = "The 1's-based SID. 0 is used when there is no SID, such as for downstream flows."
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 16384)
class TMSide(TextualConvention, Integer32):
description = 'The Traffic Manager side no SID, such as for downstream flows.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2))
namedValues = NamedValues(("tma", 1), ("tmb", 2))
cadantHWMeasGeneral = MibIdentifier((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 1))
cadantFabActualDepth = MibScalar((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantFabActualDepth.setStatus('current')
if mibBuilder.loadTexts: cadantFabActualDepth.setDescription(' The current depth of the fabric.')
cadantFabAvgDepth = MibScalar((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantFabAvgDepth.setStatus('current')
if mibBuilder.loadTexts: cadantFabAvgDepth.setDescription(' The average depth of the fabric.')
cadantUPortMeasTable = MibTable((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3), )
if mibBuilder.loadTexts: cadantUPortMeasTable.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasTable.setDescription(' This table contains information relevant to D Card upstream channels.')
cadantUPortMeasEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1), ).setIndexNames((0, "CADANT-HW-MEAS-MIB", "cadantUPortMeasCardId"), (0, "CADANT-HW-MEAS-MIB", "cadantUPortMeasPortId"))
if mibBuilder.loadTexts: cadantUPortMeasEntry.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasEntry.setDescription(' ')
cadantUPortMeasCardId = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 1), CardId())
if mibBuilder.loadTexts: cadantUPortMeasCardId.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasCardId.setDescription('')
cadantUPortMeasPortId = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 2), PortId())
if mibBuilder.loadTexts: cadantUPortMeasPortId.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasPortId.setDescription('')
cadantUPortMeasUcastFrms = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasUcastFrms.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasUcastFrms.setDescription(' The aggregrate number of unicast frames received on this U channel, whether dropped or passed. This includes MAC packets.')
cadantUPortMeasMcastFrms = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasMcastFrms.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasMcastFrms.setDescription(' The aggregrate number of multicast frames received on this U channel, whether dropped or passed. This includes MAC packets.')
cadantUPortMeasBcastFrms = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasBcastFrms.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasBcastFrms.setDescription(' The aggregrate number of broadcast frames received on this U channel, whether dropped or passed. This includes MAC packets.')
cadantUPortMeasUcastDataFrms = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasUcastDataFrms.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasUcastDataFrms.setDescription(' The aggregrate number of unicast frames received on this U channel, whether dropped or passed. This does not include MAC packets.')
cadantUPortMeasMcastDataFrms = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasMcastDataFrms.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasMcastDataFrms.setDescription(' The aggregrate number of multicast frames received on this U channel, whether dropped or passed. This does not include MAC packets.')
cadantUPortMeasBcastDataFrms = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasBcastDataFrms.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasBcastDataFrms.setDescription(' The aggregrate number of broadcast frames received on this U channel, whether dropped or passed. This does not include MAC packets.')
cadantUPortMeasDiscardFrms = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasDiscardFrms.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasDiscardFrms.setDescription(' The aggregrate number of frames received on this U channel that were dropped for reasons other than ErrorFrms or FilterFrms.')
cadantUPortMeasIfInOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasIfInOctets.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasIfInOctets.setDescription(' The aggregrate number of octets received on this U channel. This includes MAC packets and the length of the MAC header.')
cadantUPortMeasIfInDataOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 11), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasIfInDataOctets.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasIfInDataOctets.setDescription(' The aggregrate number of octets received on this U channel. This does not include MAC packets or the length of the MAC header.')
cadantUPortMeasIfInUnknownProtos = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 12), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasIfInUnknownProtos.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasIfInUnknownProtos.setDescription(' Aggregrate number of MAC frames with unknown protocol. This count is neither mutually exclusive with cadantUPortMeasErroredFrms nor cadantUPortMeasErroredFrms.')
cadantUPortMeasAppMinusBWReqFrms = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 13), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasAppMinusBWReqFrms.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasAppMinusBWReqFrms.setDescription(' The number of (unicast) frames received by the software application which are not bandwidth request frames. ')
cadantUPortMeasErroredFrms = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 15), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasErroredFrms.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasErroredFrms.setDescription(' The aggregrate number of packets received on this U channel that were received in error and dropped. This count is neither mutually exclusive with cadantUPortMeasIfInUnknownProtos nor cadantUPortMeasFilteredFrms.')
cadantUPortMeasFilteredFrms = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 16), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasFilteredFrms.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasFilteredFrms.setDescription(' The aggregrate number of packets received on this U channel that were dropped due to a filter rule match and discard. This count is neither mutually exclusive with cadantUPortMeasIfInUnknownProtos nor cadantUPortMeasErroredFrms.')
cadantUPortMeasBcastReqOpps = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 17), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasBcastReqOpps.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasBcastReqOpps.setDescription('Broadcast contention request opportunity count')
cadantUPortMeasBcastReqColls = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 18), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasBcastReqColls.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasBcastReqColls.setDescription('Broadcast contention request opportunities with possible collisions count')
cadantUPortMeasBcastReqNoEnergies = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 19), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasBcastReqNoEnergies.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasBcastReqNoEnergies.setDescription('Broadcast contention request opportunities with no energy condition detected')
cadantUPortMeasBcastReqRxPwr1s = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 20), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasBcastReqRxPwr1s.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasBcastReqRxPwr1s.setDescription('Broadcast contention request opportunities with received power level between power threshold 2 and power threshold 1')
cadantUPortMeasBcastReqRxPwr2s = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 21), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasBcastReqRxPwr2s.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasBcastReqRxPwr2s.setDescription('Broadcast contention request opportunities with received power level greater than power threshold 2')
cadantUPortMeasInitMaintOpps = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 22), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasInitMaintOpps.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasInitMaintOpps.setDescription('Initial maintenance opportunities')
cadantUPortMeasInitMaintColls = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 23), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasInitMaintColls.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasInitMaintColls.setDescription('Initial maintenance opportunities with possible collision')
cadantUPortMeasInitMaintNoEnergies = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 24), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasInitMaintNoEnergies.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasInitMaintNoEnergies.setDescription('Initial maintenance opportunities with no energy detected')
cadantUPortMeasInitMaintRxPwr1s = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 25), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasInitMaintRxPwr1s.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasInitMaintRxPwr1s.setDescription('Initial maintenance opportunities with received power level between power threshold 2 and power threshold 1')
cadantUPortMeasInitMaintRxPwr2s = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 3, 1, 26), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUPortMeasInitMaintRxPwr2s.setStatus('current')
if mibBuilder.loadTexts: cadantUPortMeasInitMaintRxPwr2s.setDescription('Initial maintenance opportunities with received power level greater than power threshold 2')
cadantDPortMeasTable = MibTable((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4), )
if mibBuilder.loadTexts: cadantDPortMeasTable.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasTable.setDescription(' This table contains information relevant to D Card downstream channels.')
cadantDPortMeasEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1), ).setIndexNames((0, "CADANT-HW-MEAS-MIB", "cadantDPortMeasCardId"), (0, "CADANT-HW-MEAS-MIB", "cadantDPortMeasPortId"))
if mibBuilder.loadTexts: cadantDPortMeasEntry.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasEntry.setDescription(' ')
cadantDPortMeasCardId = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1, 1), CardId())
if mibBuilder.loadTexts: cadantDPortMeasCardId.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasCardId.setDescription('')
cadantDPortMeasPortId = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1, 2), PortId())
if mibBuilder.loadTexts: cadantDPortMeasPortId.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasPortId.setDescription('')
cadantDPortMeasIfOutOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantDPortMeasIfOutOctets.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasIfOutOctets.setDescription(' Aggregrate number of data bytes sent on this D channel. This includes MAC mgmt messages and the length of the MAC header.')
cadantDPortMeasIfOutUcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantDPortMeasIfOutUcastPkts.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasIfOutUcastPkts.setDescription(' Aggregrate number of unicast data packets sent on this D channel. This includes MAC mgmt messages.')
cadantDPortMeasIfOutMcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantDPortMeasIfOutMcastPkts.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasIfOutMcastPkts.setDescription(' Aggregrate number of multicast data packets sent on this D channel. This includes MAC mgmt messages.')
cadantDPortMeasIfOutBcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantDPortMeasIfOutBcastPkts.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasIfOutBcastPkts.setDescription(' Aggregrate number of broadcast data packets sent on this D channel. This includes MAC mgmt messages.')
cadantDPortMeasIfOutDataOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantDPortMeasIfOutDataOctets.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasIfOutDataOctets.setDescription(' Aggregrate number of data bytes sent on this D channel. This does not include MAC mgmt bytes.')
cadantDPortMeasIfOutUcastDataPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantDPortMeasIfOutUcastDataPkts.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasIfOutUcastDataPkts.setDescription(' Aggregrate number of unicast data packets sent on this D channel. This does not include MAC mgmt messages.')
cadantDPortMeasIfOutMcastDataPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantDPortMeasIfOutMcastDataPkts.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasIfOutMcastDataPkts.setDescription(' Aggregrate number of multicast data packets sent on this D channel. This does not include MAC mgmt messages.')
cadantDPortMeasIfOutBcastDataPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantDPortMeasIfOutBcastDataPkts.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasIfOutBcastDataPkts.setDescription(' Aggregrate number of broadcast data packets sent on this D channel. This does not include MAC mgmt messages.')
cadantDPortMeasGotNoDMACs = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1, 11), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantDPortMeasGotNoDMACs.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasGotNoDMACs.setDescription(' Aggregrate number of ???')
cadantDPortMeasGotNoClasses = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1, 12), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantDPortMeasGotNoClasses.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasGotNoClasses.setDescription(' Aggregrate number of ???.')
cadantDPortMeasSyncPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1, 13), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantDPortMeasSyncPkts.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasSyncPkts.setDescription(' Aggregrate number of sync. frames sent on this D channel.')
cadantDPortMeasAppUcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1, 14), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantDPortMeasAppUcastPkts.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasAppUcastPkts.setDescription(' Aggregrate number of unicast DOCSIS Mac mgmt messages sent by application software. ')
cadantDPortMeasAppMcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1, 15), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantDPortMeasAppMcastPkts.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasAppMcastPkts.setDescription(' Aggregrate number of multicast DOCSIS Mac mgmt messages sent by application software. ')
cadantDPortMeasIfOutTotalOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1, 16), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantDPortMeasIfOutTotalOctets.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasIfOutTotalOctets.setDescription(' Aggregrate number of octets sent by application software. ')
cadantDPortMeasOfdmIfSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1, 17), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantDPortMeasOfdmIfSpeed.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasOfdmIfSpeed.setDescription('Downstream OFDM channel interface speed.')
cadantDPortMeasOfdmHighestAvgBitsPerSubc = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1, 18), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantDPortMeasOfdmHighestAvgBitsPerSubc.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasOfdmHighestAvgBitsPerSubc.setDescription('Highest average bits per subcarrier among all the data profiles of the downstream OFDM channel.')
cadantDPortMeasOfdmNumDataSubc = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1, 19), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantDPortMeasOfdmNumDataSubc.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasOfdmNumDataSubc.setDescription('The number of data subcarrier of the downstream OFDM channel.')
cadantDPortMeasOfdmChanUtilization = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 4, 1, 20), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setUnits('percent').setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantDPortMeasOfdmChanUtilization.setStatus('current')
if mibBuilder.loadTexts: cadantDPortMeasOfdmChanUtilization.setDescription('The utilization of the downstream OFDM channel.')
cadantUFIDMeasTable = MibTable((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6), )
if mibBuilder.loadTexts: cadantUFIDMeasTable.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasTable.setDescription(' ')
cadantUFIDMeasEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "CADANT-HW-MEAS-MIB", "cadantUFIDMeasSID"))
if mibBuilder.loadTexts: cadantUFIDMeasEntry.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasEntry.setDescription(' ')
cadantUFIDMeasSID = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 3), SIDValue())
if mibBuilder.loadTexts: cadantUFIDMeasSID.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasSID.setDescription(' The 14 bit (SID).')
cadantUFIDMeasPktsSGreedyDrop = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasPktsSGreedyDrop.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasPktsSGreedyDrop.setDescription(' The aggregrate number of Super Greedy pkts dropped for this UFID for this MAC layer.')
cadantUFIDMeasBytsOtherDrop = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasBytsOtherDrop.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasBytsOtherDrop.setDescription(' The aggregrate number of bytes dropped for this UFID for this MAC layer for any other reason than Super Greedy.')
cadantUFIDMeasBytsArrived = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasBytsArrived.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasBytsArrived.setDescription(' The aggregrate number of bytes that arrived for this UFID for this MAC layer.')
cadantUFIDMeasPktsArrived = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasPktsArrived.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasPktsArrived.setDescription(' The aggregrate number of packets that arrived for this UFID for this MAC layer.')
cadantUFIDMeasSIDCorrecteds = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasSIDCorrecteds.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasSIDCorrecteds.setDescription(' The aggregrate number of bytes that had errors and were corrected for this UFID for this MAC layer.')
cadantUFIDMeasSIDUnerroreds = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasSIDUnerroreds.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasSIDUnerroreds.setDescription(' The aggregrate number of bytes that had no errors for this UFID for this MAC layer.')
cadantUFIDMeasSIDUnCorrecteds = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasSIDUnCorrecteds.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasSIDUnCorrecteds.setDescription(' The aggregrate number of bytes that had errors and were not corrected for this UFID for this MAC layer.')
cadantUFIDMeasSIDNoUniqueWordDetecteds = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 11), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasSIDNoUniqueWordDetecteds.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasSIDNoUniqueWordDetecteds.setDescription(' The aggregrate number of bytes allocated for this UFID in which no unique code word was detected for this UFID for this MAC layer.')
cadantUFIDMeasSIDCollidedBursts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 12), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasSIDCollidedBursts.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasSIDCollidedBursts.setDescription(' The aggregrate number of bytes allocated for this UFID that had burst errors in their slots for this UFID for this MAC layer.')
cadantUFIDMeasSIDNoEnergyDetecteds = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 13), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasSIDNoEnergyDetecteds.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasSIDNoEnergyDetecteds.setDescription(' The aggregrate number of bytes allocated for this UFID that had no energy detected in their slots for this UFID for this MAC layer.')
cadantUFIDMeasSIDLengthErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 14), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasSIDLengthErrors.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasSIDLengthErrors.setDescription(' The aggregrate number of bytes allocated for this UFID that had no length errors in their slots for this UFID for this MAC layer.')
cadantUFIDMeasSIDMACErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 15), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasSIDMACErrors.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasSIDMACErrors.setDescription(' The aggregrate number of bytes allocated for this UFID that had MAC errors in their slots for this UFID for this MAC layer.')
cadantUFIDMeasMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 17), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasMacAddress.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasMacAddress.setDescription(' The MAC address of the CM this flow is associated with.')
cadantUFIDMeasSCN = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 18), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasSCN.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasSCN.setDescription(' The Service Class Name for this flow.')
cadantUFIDMeasSFID = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 19), SFIDIndex()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasSFID.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasSFID.setDescription(' The SFID this UFID(SID) is for.')
cadantUFIDMeasPHSUnknowns = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 20), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasPHSUnknowns.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasPHSUnknowns.setDescription('refer to docsQosServiceFlowPHSUnknowns')
cadantUFIDMeasFragPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 21), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasFragPkts.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasFragPkts.setDescription('refer to docsQosUpstreamFragPkts')
cadantUFIDMeasIncompletePkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 22), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasIncompletePkts.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasIncompletePkts.setDescription('refer to docsQosUpstreamIncompletePkts')
cadantUFIDMeasConcatBursts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 23), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasConcatBursts.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasConcatBursts.setDescription('refer to docsQosUpstreamConcatBursts')
cadantUFIDMeasSIDSignalNoise = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 24), TenthdB()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasSIDSignalNoise.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasSIDSignalNoise.setDescription('refer to docsIfCmtsCmStatusSignalNoise')
cadantUFIDMeasSIDMicroreflections = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 25), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasSIDMicroreflections.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasSIDMicroreflections.setDescription('refer to docsIfCmtsCmStatusMicroreflections')
cadantUFIDMeasSIDHCSErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 26), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasSIDHCSErrors.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasSIDHCSErrors.setDescription('The number of MAC HCS errors seen for this SID.')
cadantUFIDMeasSIDCRCErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 27), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasSIDCRCErrors.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasSIDCRCErrors.setDescription('The number of MAC CRC errors seen for this SID.')
cadantUFIDMeasUFIDIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 28), UFIDIndex()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasUFIDIndex.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasUFIDIndex.setDescription(' The 15 bit (UFID).')
cadantUFIDMeasGateID = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 29), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasGateID.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasGateID.setDescription(' The DQoS or PCMM gate ID corresponding to the flow, A zero in this field indicates no gate is associated with the flow.')
cadantUFIDMeasSIDMacIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 30), InterfaceIndex()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasSIDMacIfIndex.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasSIDMacIfIndex.setDescription(' The cable Mac domain ifIndex the SID is associated with.')
cadantUFIDMeasSIDBonded = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 31), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasSIDBonded.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasSIDBonded.setDescription(' This object indicates whether a SID is associated with a CCF service flow.')
cadantUFIDMeasCcfStatsSgmtValids = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 32), Counter32()).setUnits('segments').setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasCcfStatsSgmtValids.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasCcfStatsSgmtValids.setDescription('This attribute contains the number of segments counted on this service flow regardless of whether the fragment was correctly reassembled into valid packets. Discontinuities in the value of this counter can occur at reinitialization of the managed system.')
cadantUFIDMeasCcfStatsSgmtLost = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 33), Counter32()).setUnits('segments').setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasCcfStatsSgmtLost.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasCcfStatsSgmtLost.setDescription('This attribute counts the number of segments which the CMTS segment reassembly function determines were lost. Discontinuities in the value of this counter can occur at reinitialization of the managed system.')
cadantUFIDMeasCcfStatsSgmtDrop = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 6, 1, 34), Counter32()).setUnits('segments').setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantUFIDMeasCcfStatsSgmtDrop.setStatus('current')
if mibBuilder.loadTexts: cadantUFIDMeasCcfStatsSgmtDrop.setDescription('This attribute counts the number of segments which the CMTS segment reassembly function determines were dropped. Discontinuities in the value of this counter can occur at reinitialization of the managed system.')
cadantEtherPhyMeasTable = MibTable((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10), )
if mibBuilder.loadTexts: cadantEtherPhyMeasTable.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasTable.setDescription(' ')
cadantEtherPhyMeasEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1), ).setIndexNames((0, "CADANT-HW-MEAS-MIB", "cadantEtherPhyMeasCardId"), (0, "CADANT-HW-MEAS-MIB", "cadantEtherPhyMeasPortId"))
if mibBuilder.loadTexts: cadantEtherPhyMeasEntry.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasEntry.setDescription(' ')
cadantEtherPhyMeasCardId = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 1), CardId())
if mibBuilder.loadTexts: cadantEtherPhyMeasCardId.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasCardId.setDescription('')
cadantEtherPhyMeasPortId = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 2), PortId())
if mibBuilder.loadTexts: cadantEtherPhyMeasPortId.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasPortId.setDescription('')
cadantEtherPhyMeasRxOctOK = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasRxOctOK.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasRxOctOK.setDescription(' .')
cadantEtherPhyMeasRxUniOK = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasRxUniOK.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasRxUniOK.setDescription(' .')
cadantEtherPhyMeasRxMultiOK = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasRxMultiOK.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasRxMultiOK.setDescription(' .')
cadantEtherPhyMeasRxBroadOK = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasRxBroadOK.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasRxBroadOK.setDescription(' .')
cadantEtherPhyMeasRxOverflow = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasRxOverflow.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasRxOverflow.setDescription(' .')
cadantEtherPhyMeasRxNormAlign = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasRxNormAlign.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasRxNormAlign.setDescription(' .')
cadantEtherPhyMeasRxNormCRC = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasRxNormCRC.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasRxNormCRC.setDescription(' .')
cadantEtherPhyMeasRxLongOK = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasRxLongOK.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasRxLongOK.setDescription(' .')
cadantEtherPhyMeasRxLongCRC = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 11), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasRxLongCRC.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasRxLongCRC.setDescription(' .')
cadantEtherPhyMeasRxFalsCRS = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 12), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasRxFalsCRS.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasRxFalsCRS.setDescription(' .')
cadantEtherPhyMeasRxSymbolErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 13), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasRxSymbolErrors.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasRxSymbolErrors.setDescription(' .')
cadantEtherPhyMeasRxPause = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 14), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasRxPause.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasRxPause.setDescription(' .')
cadantEtherPhyMeasTxOctOK = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 15), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasTxOctOK.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasTxOctOK.setDescription(' .')
cadantEtherPhyMeasTxUniOK = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 16), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasTxUniOK.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasTxUniOK.setDescription(' .')
cadantEtherPhyMeasTxMultiOK = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 17), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasTxMultiOK.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasTxMultiOK.setDescription(' .')
cadantEtherPhyMeasTxBroadOK = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 18), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasTxBroadOK.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasTxBroadOK.setDescription(' .')
cadantEtherPhyMeasTxScol = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 19), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasTxScol.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasTxScol.setDescription(' .')
cadantEtherPhyMeasTxMcol = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 20), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasTxMcol.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasTxMcol.setDescription(' .')
cadantEtherPhyMeasTxDeferred = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 21), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasTxDeferred.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasTxDeferred.setDescription(' .')
cadantEtherPhyMeasTxLcol = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 22), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasTxLcol.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasTxLcol.setDescription(' .')
cadantEtherPhyMeasTxCcol = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 23), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasTxCcol.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasTxCcol.setDescription(' .')
cadantEtherPhyMeasTxErr = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 24), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasTxErr.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasTxErr.setDescription(' .')
cadantEtherPhyMeasTxPause = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 25), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasTxPause.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasTxPause.setDescription(' .')
cadantEtherPhyMeasRxShortOK = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 26), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasRxShortOK.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasRxShortOK.setDescription(' .')
cadantEtherPhyMeasRxShortCRC = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 27), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasRxShortCRC.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasRxShortCRC.setDescription(' .')
cadantEtherPhyMeasRxRunt = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 28), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasRxRunt.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasRxRunt.setDescription(' .')
cadantEtherPhyMeasRxOctBad = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 10, 1, 29), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadantEtherPhyMeasRxOctBad.setStatus('current')
if mibBuilder.loadTexts: cadantEtherPhyMeasRxOctBad.setDescription(' .')
cadDFIDMeasTable = MibTable((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 14), )
if mibBuilder.loadTexts: cadDFIDMeasTable.setStatus('current')
if mibBuilder.loadTexts: cadDFIDMeasTable.setDescription('This table contains DFID-specific counts.')
cadDFIDMeasEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 14, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "CADANT-HW-MEAS-MIB", "cadDFIDMeasIndex"))
if mibBuilder.loadTexts: cadDFIDMeasEntry.setStatus('current')
if mibBuilder.loadTexts: cadDFIDMeasEntry.setDescription(' ')
cadDFIDMeasIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 14, 1, 3), SFIDIndex())
if mibBuilder.loadTexts: cadDFIDMeasIndex.setStatus('current')
if mibBuilder.loadTexts: cadDFIDMeasIndex.setDescription(' The SFID these DFID counts are for.')
cadDFIDMeasBytsArrived = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 14, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadDFIDMeasBytsArrived.setStatus('current')
if mibBuilder.loadTexts: cadDFIDMeasBytsArrived.setDescription(' The aggregrate number of bytes arriving to go out, but not necessarily transmitted.')
cadDFIDMeasPktsArrived = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 14, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadDFIDMeasPktsArrived.setStatus('current')
if mibBuilder.loadTexts: cadDFIDMeasPktsArrived.setDescription(' The aggregrate number of packets arriving to go out, but not necessarily transmitted.')
cadDFIDMeasBytsDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 14, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadDFIDMeasBytsDropped.setStatus('current')
if mibBuilder.loadTexts: cadDFIDMeasBytsDropped.setDescription(' The aggregrate number of bytes dropped.')
cadDFIDMeasPktsDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 14, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadDFIDMeasPktsDropped.setStatus('current')
if mibBuilder.loadTexts: cadDFIDMeasPktsDropped.setDescription(' The aggregrate number of packets dropped.')
cadDFIDMeasBytsUnkDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 14, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadDFIDMeasBytsUnkDropped.setStatus('current')
if mibBuilder.loadTexts: cadDFIDMeasBytsUnkDropped.setDescription(' The aggregrate number of bytes dropped due to unknown DMAC.')
cadDFIDMeasDFID = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 14, 1, 9), DFIDIndex()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadDFIDMeasDFID.setStatus('current')
if mibBuilder.loadTexts: cadDFIDMeasDFID.setDescription(' The DFID.')
cadDFIDMeasPHSUnknowns = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 14, 1, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadDFIDMeasPHSUnknowns.setStatus('current')
if mibBuilder.loadTexts: cadDFIDMeasPHSUnknowns.setDescription('refer to docsQosServiceFlowPHSUnknowns')
cadDFIDMeasMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 14, 1, 11), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadDFIDMeasMacAddress.setStatus('current')
if mibBuilder.loadTexts: cadDFIDMeasMacAddress.setDescription(' The MAC address of the CM this flow is associated with.')
cadDFIDMeasSCN = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 14, 1, 12), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadDFIDMeasSCN.setStatus('current')
if mibBuilder.loadTexts: cadDFIDMeasSCN.setDescription(' The Service Class Name for this flow.')
cadDFIDMeasPolicedDelayPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 14, 1, 13), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadDFIDMeasPolicedDelayPkts.setStatus('current')
if mibBuilder.loadTexts: cadDFIDMeasPolicedDelayPkts.setDescription('refer to docsQosServiceFlowPolicedDelayPkts')
cadDFIDMeasGateID = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 14, 1, 14), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadDFIDMeasGateID.setStatus('current')
if mibBuilder.loadTexts: cadDFIDMeasGateID.setDescription(' The DQoS or PCMM gate ID corresponding to the flow, A zero in this field indicates no gate is associated with the flow.')
cadQosPktClassMeasTable = MibTable((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 16), )
if mibBuilder.loadTexts: cadQosPktClassMeasTable.setStatus('current')
if mibBuilder.loadTexts: cadQosPktClassMeasTable.setDescription(' This table contains just one data member: cadQosPktClassMeasPkts, which is equivalent to docsQosPktClassPkts in qos-draft-04.')
cadQosPktClassMeasEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 16, 1), ).setIndexNames((0, "CADANT-HW-MEAS-MIB", "cadQosPktClassMeasIfIndex"), (0, "CADANT-HW-MEAS-MIB", "cadQosPktClassMeasSFID"), (0, "CADANT-HW-MEAS-MIB", "cadQosPktClassMeasPktClassId"))
if mibBuilder.loadTexts: cadQosPktClassMeasEntry.setStatus('current')
if mibBuilder.loadTexts: cadQosPktClassMeasEntry.setDescription(' ')
cadQosPktClassMeasIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 16, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: cadQosPktClassMeasIfIndex.setStatus('current')
if mibBuilder.loadTexts: cadQosPktClassMeasIfIndex.setDescription(' The ifIndex of ifType 127 for this classifier.')
cadQosPktClassMeasSFID = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 16, 1, 2), SFIDIndex())
if mibBuilder.loadTexts: cadQosPktClassMeasSFID.setStatus('current')
if mibBuilder.loadTexts: cadQosPktClassMeasSFID.setDescription(' The Service Flow ID this classifier is for.')
cadQosPktClassMeasPktClassId = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 16, 1, 3), PktClassId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadQosPktClassMeasPktClassId.setStatus('current')
if mibBuilder.loadTexts: cadQosPktClassMeasPktClassId.setDescription(' The ID of this classifier, which only need be unique for a given Service Flow ID.')
cadQosPktClassMeasPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 16, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadQosPktClassMeasPkts.setStatus('current')
if mibBuilder.loadTexts: cadQosPktClassMeasPkts.setDescription(' The number of packets that have been classified using this classifier on this flow.')
cadIfMeasTable = MibTable((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 18), )
if mibBuilder.loadTexts: cadIfMeasTable.setStatus('current')
if mibBuilder.loadTexts: cadIfMeasTable.setDescription(' This table is designed to concurrently support the counters defined in the ifTable and the ifXTable. Every row that appears in this table should have a corresponding row in both the ifTable and the ifXTable. However, not every row in the ifTable and ifXTable will appear in this table.')
cadIfMeasEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 18, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: cadIfMeasEntry.setStatus('current')
if mibBuilder.loadTexts: cadIfMeasEntry.setDescription('')
cadIfInOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 18, 1, 1), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadIfInOctets.setStatus('current')
if mibBuilder.loadTexts: cadIfInOctets.setDescription(" See the IF-MIB's corresponding object's DESCRIPTION for a description of this object.")
cadIfInUcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 18, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadIfInUcastPkts.setStatus('current')
if mibBuilder.loadTexts: cadIfInUcastPkts.setDescription(" See the IF-MIB's corresponding object's DESCRIPTION for a description of this object.")
cadIfInMulticastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 18, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadIfInMulticastPkts.setStatus('current')
if mibBuilder.loadTexts: cadIfInMulticastPkts.setDescription(" See the IF-MIB's corresponding object's DESCRIPTION for a description of this object.")
cadIfInBroadcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 18, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadIfInBroadcastPkts.setStatus('current')
if mibBuilder.loadTexts: cadIfInBroadcastPkts.setDescription(" See the IF-MIB's corresponding object's DESCRIPTION for a description of this object.")
cadIfInDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 18, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadIfInDiscards.setStatus('current')
if mibBuilder.loadTexts: cadIfInDiscards.setDescription(" See the IF-MIB's corresponding object's DESCRIPTION for a description of this object.")
cadIfInErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 18, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadIfInErrors.setStatus('current')
if mibBuilder.loadTexts: cadIfInErrors.setDescription(" See the IF-MIB's corresponding object's DESCRIPTION for a description of this object.")
cadIfInUnknownProtos = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 18, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadIfInUnknownProtos.setStatus('current')
if mibBuilder.loadTexts: cadIfInUnknownProtos.setDescription(" See the IF-MIB's corresponding object's DESCRIPTION for a description of this object.")
cadIfOutOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 18, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadIfOutOctets.setStatus('current')
if mibBuilder.loadTexts: cadIfOutOctets.setDescription(" See the IF-MIB's corresponding object's DESCRIPTION for a description of this object.")
cadIfOutUcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 18, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadIfOutUcastPkts.setStatus('current')
if mibBuilder.loadTexts: cadIfOutUcastPkts.setDescription(" See the IF-MIB's corresponding object's DESCRIPTION for a description of this object.")
cadIfOutMulticastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 18, 1, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadIfOutMulticastPkts.setStatus('current')
if mibBuilder.loadTexts: cadIfOutMulticastPkts.setDescription(" See the IF-MIB's corresponding object's DESCRIPTION for a description of this object.")
cadIfOutBroadcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 18, 1, 11), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadIfOutBroadcastPkts.setStatus('current')
if mibBuilder.loadTexts: cadIfOutBroadcastPkts.setDescription(" See the IF-MIB's corresponding object's DESCRIPTION for a description of this object.")
cadIfOutDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 18, 1, 12), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadIfOutDiscards.setStatus('current')
if mibBuilder.loadTexts: cadIfOutDiscards.setDescription(" See the IF-MIB's corresponding object's DESCRIPTION for a description of this object.")
cadIfOutErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 18, 1, 13), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadIfOutErrors.setStatus('current')
if mibBuilder.loadTexts: cadIfOutErrors.setDescription(" See the IF-MIB's corresponding object's DESCRIPTION for a description of this object.")
cadDCardMeasTable = MibTable((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 20), )
if mibBuilder.loadTexts: cadDCardMeasTable.setStatus('current')
if mibBuilder.loadTexts: cadDCardMeasTable.setDescription(' This table contains information relevant to D Card counts.')
cadDCardMeasEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 20, 1), ).setIndexNames((0, "CADANT-HW-MEAS-MIB", "cadDCardMeasCardId"))
if mibBuilder.loadTexts: cadDCardMeasEntry.setStatus('current')
if mibBuilder.loadTexts: cadDCardMeasEntry.setDescription(' ')
cadDCardMeasCardId = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 20, 1, 1), CardId())
if mibBuilder.loadTexts: cadDCardMeasCardId.setStatus('current')
if mibBuilder.loadTexts: cadDCardMeasCardId.setDescription('')
cadDCardIpInReceives = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 20, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadDCardIpInReceives.setStatus('current')
if mibBuilder.loadTexts: cadDCardIpInReceives.setDescription('The contribution to ipInRecevies for this particular D Card.')
cadDCardIpInHdrErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 20, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadDCardIpInHdrErrors.setStatus('current')
if mibBuilder.loadTexts: cadDCardIpInHdrErrors.setDescription('The contribution to ipInHdrErrors for this particular D Card.')
cadDCardIpInAddrErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 20, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadDCardIpInAddrErrors.setStatus('current')
if mibBuilder.loadTexts: cadDCardIpInAddrErrors.setDescription('The contribution to ipInAddrErrors for this particular D Card.')
cadDCardDhcpThrottleDropPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 20, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadDCardDhcpThrottleDropPkts.setStatus('current')
if mibBuilder.loadTexts: cadDCardDhcpThrottleDropPkts.setDescription('The number of dropped DHCP requests for this D Card.')
cadDCardArpThrottleDropPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 20, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadDCardArpThrottleDropPkts.setStatus('current')
if mibBuilder.loadTexts: cadDCardArpThrottleDropPkts.setDescription('The number of dropped ARP requests for this D Card.')
cadDCardDhcpV6ThrottleDropPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 20, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadDCardDhcpV6ThrottleDropPkts.setStatus('current')
if mibBuilder.loadTexts: cadDCardDhcpV6ThrottleDropPkts.setDescription('The number of dropped IPV6 DHCP requests for this D Card.')
cadDCardNdThrottleDropPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 20, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadDCardNdThrottleDropPkts.setStatus('current')
if mibBuilder.loadTexts: cadDCardNdThrottleDropPkts.setDescription('The number of dropped IPV6 ND requests for this D Card.')
cadDCardIgmpThrottleDropPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 20, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadDCardIgmpThrottleDropPkts.setStatus('current')
if mibBuilder.loadTexts: cadDCardIgmpThrottleDropPkts.setDescription('The number of dropped IGMP messages for this UCAM.')
cadInterfaceUtilizationTable = MibTable((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 23), )
if mibBuilder.loadTexts: cadInterfaceUtilizationTable.setStatus('current')
if mibBuilder.loadTexts: cadInterfaceUtilizationTable.setDescription('Reports utilization statistics for attached interfaces.')
cadInterfaceUtilizationEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 23, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "CADANT-HW-MEAS-MIB", "cadInterfaceUtilizationDirection"))
if mibBuilder.loadTexts: cadInterfaceUtilizationEntry.setStatus('current')
if mibBuilder.loadTexts: cadInterfaceUtilizationEntry.setDescription('Utilization statistics for a single interface. An entry exists in this table for each ifEntry with an ifType equal to docsCableDownstreamInterface (128), docsCableUpstreamInterface (129), docsCableUpstreamChannel (205), ethernet(6), or gigabitEthernet(117).')
cadInterfaceUtilizationDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 23, 1, 1), CadIfDirection())
if mibBuilder.loadTexts: cadInterfaceUtilizationDirection.setStatus('current')
if mibBuilder.loadTexts: cadInterfaceUtilizationDirection.setDescription("The direction of flow this utilization is for. Cable upstream interfaces will only have a value of 'in' for this object. Likewise, cable downstream interfaces will only hav a value of 'out' for this object. Full-duplex interfaces, such as fastEthernet and gigabitEthernet interfaces, will have both 'in' and 'out' rows.")
cadInterfaceUtilizationPercentage = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 23, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setUnits('percent').setMaxAccess("readonly")
if mibBuilder.loadTexts: cadInterfaceUtilizationPercentage.setStatus('current')
if mibBuilder.loadTexts: cadInterfaceUtilizationPercentage.setDescription('The calculated and truncated utilization index for this interface, accurate as of the most recent docsIfCmtsChannelUtilizationInterval.')
cadInterfaceUtilizationAvgContSlots = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 23, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setUnits('percent').setMaxAccess("readonly")
if mibBuilder.loadTexts: cadInterfaceUtilizationAvgContSlots.setStatus('current')
if mibBuilder.loadTexts: cadInterfaceUtilizationAvgContSlots.setDescription('Applicable for ifType of docsCableUpstreamChannel (205) only. The average percentage of contention mini-slots for upstream channel. This ratio is calculated the most recent utilization interval. Formula: Upstream contention mini-slots utilization = (100 * ((contention mini-slots ) / (total mini-slots))')
cadInterfaceHighResUtilizationPercentage = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 23, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 10000))).setUnits('Hundredth of a percent').setMaxAccess("readonly")
if mibBuilder.loadTexts: cadInterfaceHighResUtilizationPercentage.setStatus('current')
if mibBuilder.loadTexts: cadInterfaceHighResUtilizationPercentage.setDescription('The calculated and truncated utilization index for this interface, accurate (to 0.01% resolution) as of the most recent docsIfCmtsChannelUtilizationInterval.')
cadInterfaceIntervalOctetsForwarded = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 23, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadInterfaceIntervalOctetsForwarded.setStatus('current')
if mibBuilder.loadTexts: cadInterfaceIntervalOctetsForwarded.setDescription('The number of octets forwarded since the most recent docsIfCmtsChannelUtilizationInterval. Note that this count will only apply to the following interface types: Ethernet, Link-Aggregate. For all other interface types this value will display 0')
cadSubMgtPktFilterExtTable = MibTable((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 25), )
if mibBuilder.loadTexts: cadSubMgtPktFilterExtTable.setStatus('current')
if mibBuilder.loadTexts: cadSubMgtPktFilterExtTable.setDescription('This table augments the docsSubMgtPktFilterTable. In its current form, it is used to clear docsSubMgtPktFilterMatches and keep track of the change.')
cadSubMgtPktFilterExtEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 25, 1), )
docsSubmgt3FilterGrpEntry.registerAugmentions(("CADANT-HW-MEAS-MIB", "cadSubMgtPktFilterExtEntry"))
cadSubMgtPktFilterExtEntry.setIndexNames(*docsSubmgt3FilterGrpEntry.getIndexNames())
if mibBuilder.loadTexts: cadSubMgtPktFilterExtEntry.setStatus('current')
if mibBuilder.loadTexts: cadSubMgtPktFilterExtEntry.setDescription('For every docsSubmgt3FilterGrpEntry, there is a matching cadSubMgtPktFilterExtEntry.')
cadSubMgtPktFilterMatchesReset = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 25, 1, 1), TruthValue().clone('false')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cadSubMgtPktFilterMatchesReset.setStatus('current')
if mibBuilder.loadTexts: cadSubMgtPktFilterMatchesReset.setDescription('This object always return false(2) when read. If the value false(2) is assigned to this object, no action is taken. However, if this object it set to the value true(1), the corresponding docsSubMgtPktFilterMatches counter object is set to 0 and cadSubMgtPktFilterLastChanged is set to the current time.')
cadSubMgtPktFilterLastChanged = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 25, 1, 2), TimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadSubMgtPktFilterLastChanged.setStatus('current')
if mibBuilder.loadTexts: cadSubMgtPktFilterLastChanged.setDescription('The time at which docsSubMgtPktFilterMatches might have experienced a discontinuity, such as when cadSubMgtPktFilterMatchesReset is set to true(1) or when any of the parameters in the docsSubMgtPktFilterTable affecting filtering last changed.')
cadSubMgtPktFilterCaptureEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 25, 1, 3), TruthValue().clone('false')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cadSubMgtPktFilterCaptureEnabled.setStatus('current')
if mibBuilder.loadTexts: cadSubMgtPktFilterCaptureEnabled.setDescription('Indicates whether packets matching this filter are captured for possible debug logging. A value of true indicates that packets matching this filter will be captured. A value of false indicates that packets matching this filter will not be captured for later debuggging.')
cadLaesCountTable = MibTable((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 26), )
if mibBuilder.loadTexts: cadLaesCountTable.setStatus('current')
if mibBuilder.loadTexts: cadLaesCountTable.setDescription('This table references pktcEScTapStreamTable')
cadLaesCountEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 26, 1), ).setIndexNames((0, "PKTC-ES-TAP-MIB", "pktcEScTapMediationContentId"), (0, "PKTC-ES-TAP-MIB", "pktcEScTapStreamIndex"))
if mibBuilder.loadTexts: cadLaesCountEntry.setStatus('current')
if mibBuilder.loadTexts: cadLaesCountEntry.setDescription('For every cadLaesCountEntry, there is a matching pktcEScTapStreamEntry.')
cadLaesCountMacDomainIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 26, 1, 1), InterfaceIndex()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadLaesCountMacDomainIfIndex.setStatus('current')
if mibBuilder.loadTexts: cadLaesCountMacDomainIfIndex.setDescription('This object indicates the cable Mac domain interface index that the LAES stream is associated with.')
cadLaesCountStreamDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 26, 1, 2), IfDirection()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadLaesCountStreamDirection.setStatus('current')
if mibBuilder.loadTexts: cadLaesCountStreamDirection.setDescription('This object indicates either downstream or upstream direction that the LAES stream is associated with.')
cadLaesCountInterceptedPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 26, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadLaesCountInterceptedPackets.setStatus('current')
if mibBuilder.loadTexts: cadLaesCountInterceptedPackets.setDescription('Indicates number of intercepted packets are sent of the LAES stream.')
cadLaesCountInterceptDrops = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 26, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadLaesCountInterceptDrops.setStatus('current')
if mibBuilder.loadTexts: cadLaesCountInterceptDrops.setDescription('Indicates number of intercepted packets are dropped of the LAES stream.')
cadFftUpstreamChannelTable = MibTable((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 24), )
if mibBuilder.loadTexts: cadFftUpstreamChannelTable.setStatus('current')
if mibBuilder.loadTexts: cadFftUpstreamChannelTable.setDescription('Reports current FFT operation status.')
cadFftUpstreamChannelEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 24, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: cadFftUpstreamChannelEntry.setStatus('current')
if mibBuilder.loadTexts: cadFftUpstreamChannelEntry.setDescription('FFT status for a single upstream channel with ifType docsCableUpstreamInterface(129).')
cadFftInProgress = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 24, 1, 1), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadFftInProgress.setStatus('current')
if mibBuilder.loadTexts: cadFftInProgress.setDescription('The current state on the FFT capture. ')
cadFftCurrentTriggers = MibTableColumn((1, 3, 6, 1, 4, 1, 4998, 1, 1, 10, 2, 24, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cadFftCurrentTriggers.setStatus('current')
if mibBuilder.loadTexts: cadFftCurrentTriggers.setDescription('The number of times the FFT capture has triggered and transferred data from the Broadcom device.')
mibBuilder.exportSymbols("CADANT-HW-MEAS-MIB", cadDFIDMeasBytsUnkDropped=cadDFIDMeasBytsUnkDropped, cadantDPortMeasIfOutUcastDataPkts=cadantDPortMeasIfOutUcastDataPkts, cadInterfaceUtilizationDirection=cadInterfaceUtilizationDirection, cadDCardIpInReceives=cadDCardIpInReceives, cadLaesCountStreamDirection=cadLaesCountStreamDirection, cadInterfaceUtilizationPercentage=cadInterfaceUtilizationPercentage, cadantUPortMeasInitMaintNoEnergies=cadantUPortMeasInitMaintNoEnergies, cadantUPortMeasErroredFrms=cadantUPortMeasErroredFrms, cadantEtherPhyMeasRxNormCRC=cadantEtherPhyMeasRxNormCRC, cadantEtherPhyMeasRxLongOK=cadantEtherPhyMeasRxLongOK, cadDCardIpInAddrErrors=cadDCardIpInAddrErrors, cadSubMgtPktFilterCaptureEnabled=cadSubMgtPktFilterCaptureEnabled, cadSubMgtPktFilterExtTable=cadSubMgtPktFilterExtTable, cadantUPortMeasUcastDataFrms=cadantUPortMeasUcastDataFrms, cadantUPortMeasBcastReqColls=cadantUPortMeasBcastReqColls, cadantUFIDMeasSIDCollidedBursts=cadantUFIDMeasSIDCollidedBursts, cadIfInUcastPkts=cadIfInUcastPkts, cadantEtherPhyMeasCardId=cadantEtherPhyMeasCardId, cadIfOutUcastPkts=cadIfOutUcastPkts, cadantDPortMeasIfOutMcastPkts=cadantDPortMeasIfOutMcastPkts, SFIDIndex=SFIDIndex, cadDFIDMeasBytsDropped=cadDFIDMeasBytsDropped, cadIfOutErrors=cadIfOutErrors, cadantUFIDMeasSIDNoEnergyDetecteds=cadantUFIDMeasSIDNoEnergyDetecteds, cadantEtherPhyMeasRxMultiOK=cadantEtherPhyMeasRxMultiOK, cadDCardDhcpThrottleDropPkts=cadDCardDhcpThrottleDropPkts, cadantUFIDMeasPktsSGreedyDrop=cadantUFIDMeasPktsSGreedyDrop, cadantEtherPhyMeasRxShortOK=cadantEtherPhyMeasRxShortOK, cadIfInUnknownProtos=cadIfInUnknownProtos, cadantUPortMeasMcastFrms=cadantUPortMeasMcastFrms, cadantUPortMeasBcastDataFrms=cadantUPortMeasBcastDataFrms, cadLaesCountEntry=cadLaesCountEntry, PYSNMP_MODULE_ID=cadHardwareMeasMib, cadantDPortMeasAppMcastPkts=cadantDPortMeasAppMcastPkts, cadantUFIDMeasUFIDIndex=cadantUFIDMeasUFIDIndex, cadantUFIDMeasSIDMacIfIndex=cadantUFIDMeasSIDMacIfIndex, cadQosPktClassMeasSFID=cadQosPktClassMeasSFID, cadantDPortMeasIfOutBcastPkts=cadantDPortMeasIfOutBcastPkts, cadInterfaceUtilizationTable=cadInterfaceUtilizationTable, cadDCardMeasTable=cadDCardMeasTable, cadantUPortMeasEntry=cadantUPortMeasEntry, cadantDPortMeasIfOutOctets=cadantDPortMeasIfOutOctets, cadDFIDMeasPktsArrived=cadDFIDMeasPktsArrived, cadantUPortMeasIfInUnknownProtos=cadantUPortMeasIfInUnknownProtos, cadantUPortMeasBcastReqOpps=cadantUPortMeasBcastReqOpps, cadDFIDMeasGateID=cadDFIDMeasGateID, cadantEtherPhyMeasRxUniOK=cadantEtherPhyMeasRxUniOK, cadantUFIDMeasSCN=cadantUFIDMeasSCN, cadantEtherPhyMeasRxOverflow=cadantEtherPhyMeasRxOverflow, cadantDPortMeasIfOutUcastPkts=cadantDPortMeasIfOutUcastPkts, cadantDPortMeasGotNoDMACs=cadantDPortMeasGotNoDMACs, cadDFIDMeasMacAddress=cadDFIDMeasMacAddress, cadantUFIDMeasBytsOtherDrop=cadantUFIDMeasBytsOtherDrop, cadantUFIDMeasSID=cadantUFIDMeasSID, cadIfOutOctets=cadIfOutOctets, cadantEtherPhyMeasRxRunt=cadantEtherPhyMeasRxRunt, cadantUFIDMeasCcfStatsSgmtValids=cadantUFIDMeasCcfStatsSgmtValids, cadantUPortMeasInitMaintRxPwr2s=cadantUPortMeasInitMaintRxPwr2s, TMSide=TMSide, cadDFIDMeasPHSUnknowns=cadDFIDMeasPHSUnknowns, cadantEtherPhyMeasTxUniOK=cadantEtherPhyMeasTxUniOK, cadantEtherPhyMeasRxOctBad=cadantEtherPhyMeasRxOctBad, cadDFIDMeasDFID=cadDFIDMeasDFID, cadantHWMeasGeneral=cadantHWMeasGeneral, cadQosPktClassMeasPkts=cadQosPktClassMeasPkts, cadDCardIpInHdrErrors=cadDCardIpInHdrErrors, cadFftCurrentTriggers=cadFftCurrentTriggers, cadantEtherPhyMeasRxBroadOK=cadantEtherPhyMeasRxBroadOK, cadDCardIgmpThrottleDropPkts=cadDCardIgmpThrottleDropPkts, cadSubMgtPktFilterMatchesReset=cadSubMgtPktFilterMatchesReset, cadDCardMeasCardId=cadDCardMeasCardId, cadantUFIDMeasEntry=cadantUFIDMeasEntry, cadIfMeasEntry=cadIfMeasEntry, cadDFIDMeasBytsArrived=cadDFIDMeasBytsArrived, cadantUFIDMeasSIDUnerroreds=cadantUFIDMeasSIDUnerroreds, cadIfInDiscards=cadIfInDiscards, cadIfInMulticastPkts=cadIfInMulticastPkts, cadIfOutDiscards=cadIfOutDiscards, cadantUFIDMeasPHSUnknowns=cadantUFIDMeasPHSUnknowns, cadantEtherPhyMeasTxScol=cadantEtherPhyMeasTxScol, cadDCardDhcpV6ThrottleDropPkts=cadDCardDhcpV6ThrottleDropPkts, cadantDPortMeasOfdmIfSpeed=cadantDPortMeasOfdmIfSpeed, DFIDIndex=DFIDIndex, cadInterfaceUtilizationAvgContSlots=cadInterfaceUtilizationAvgContSlots, cadantEtherPhyMeasTxCcol=cadantEtherPhyMeasTxCcol, PktClassId=PktClassId, cadantUPortMeasDiscardFrms=cadantUPortMeasDiscardFrms, cadDCardMeasEntry=cadDCardMeasEntry, cadantEtherPhyMeasTxLcol=cadantEtherPhyMeasTxLcol, cadantUPortMeasBcastReqNoEnergies=cadantUPortMeasBcastReqNoEnergies, cadantUFIDMeasMacAddress=cadantUFIDMeasMacAddress, cadDCardArpThrottleDropPkts=cadDCardArpThrottleDropPkts, cadIfOutMulticastPkts=cadIfOutMulticastPkts, cadInterfaceIntervalOctetsForwarded=cadInterfaceIntervalOctetsForwarded, cadQosPktClassMeasTable=cadQosPktClassMeasTable, cadQosPktClassMeasEntry=cadQosPktClassMeasEntry, cadantUFIDMeasSIDLengthErrors=cadantUFIDMeasSIDLengthErrors, cadantFabActualDepth=cadantFabActualDepth, cadantUFIDMeasCcfStatsSgmtLost=cadantUFIDMeasCcfStatsSgmtLost, cadDFIDMeasPolicedDelayPkts=cadDFIDMeasPolicedDelayPkts, cadantDPortMeasOfdmChanUtilization=cadantDPortMeasOfdmChanUtilization, cadantUFIDMeasSIDUnCorrecteds=cadantUFIDMeasSIDUnCorrecteds, cadDCardNdThrottleDropPkts=cadDCardNdThrottleDropPkts, cadInterfaceUtilizationEntry=cadInterfaceUtilizationEntry, cadantUPortMeasUcastFrms=cadantUPortMeasUcastFrms, cadantDPortMeasPortId=cadantDPortMeasPortId, cadantUFIDMeasFragPkts=cadantUFIDMeasFragPkts, cadantFabAvgDepth=cadantFabAvgDepth, cadLaesCountInterceptedPackets=cadLaesCountInterceptedPackets, cadantDPortMeasSyncPkts=cadantDPortMeasSyncPkts, cadIfInOctets=cadIfInOctets, cadIfOutBroadcastPkts=cadIfOutBroadcastPkts, cadantUPortMeasTable=cadantUPortMeasTable, cadantEtherPhyMeasRxFalsCRS=cadantEtherPhyMeasRxFalsCRS, cadantEtherPhyMeasRxOctOK=cadantEtherPhyMeasRxOctOK, cadInterfaceHighResUtilizationPercentage=cadInterfaceHighResUtilizationPercentage, cadIfInBroadcastPkts=cadIfInBroadcastPkts, cadantEtherPhyMeasTable=cadantEtherPhyMeasTable, cadDFIDMeasEntry=cadDFIDMeasEntry, cadantEtherPhyMeasTxMcol=cadantEtherPhyMeasTxMcol, cadantUFIDMeasConcatBursts=cadantUFIDMeasConcatBursts, cadantEtherPhyMeasRxShortCRC=cadantEtherPhyMeasRxShortCRC, cadHardwareMeasMib=cadHardwareMeasMib, cadantEtherPhyMeasTxBroadOK=cadantEtherPhyMeasTxBroadOK, cadantDPortMeasIfOutBcastDataPkts=cadantDPortMeasIfOutBcastDataPkts, cadantEtherPhyMeasTxDeferred=cadantEtherPhyMeasTxDeferred, cadantDPortMeasGotNoClasses=cadantDPortMeasGotNoClasses, cadSubMgtPktFilterLastChanged=cadSubMgtPktFilterLastChanged, cadantUFIDMeasBytsArrived=cadantUFIDMeasBytsArrived, cadantEtherPhyMeasTxPause=cadantEtherPhyMeasTxPause, cadantUPortMeasCardId=cadantUPortMeasCardId, cadantUFIDMeasSIDCRCErrors=cadantUFIDMeasSIDCRCErrors, cadantUPortMeasIfInDataOctets=cadantUPortMeasIfInDataOctets, cadFftUpstreamChannelTable=cadFftUpstreamChannelTable, cadantUPortMeasInitMaintRxPwr1s=cadantUPortMeasInitMaintRxPwr1s, cadDFIDMeasSCN=cadDFIDMeasSCN, cadantUPortMeasIfInOctets=cadantUPortMeasIfInOctets, cadantUFIDMeasIncompletePkts=cadantUFIDMeasIncompletePkts, cadLaesCountInterceptDrops=cadLaesCountInterceptDrops, cadantDPortMeasIfOutTotalOctets=cadantDPortMeasIfOutTotalOctets, cadQosPktClassMeasPktClassId=cadQosPktClassMeasPktClassId, cadantUFIDMeasSIDSignalNoise=cadantUFIDMeasSIDSignalNoise, cadFftInProgress=cadFftInProgress, cadantUPortMeasBcastReqRxPwr2s=cadantUPortMeasBcastReqRxPwr2s, cadantDPortMeasEntry=cadantDPortMeasEntry, cadantUFIDMeasCcfStatsSgmtDrop=cadantUFIDMeasCcfStatsSgmtDrop, cadantUFIDMeasSIDBonded=cadantUFIDMeasSIDBonded, cadantUPortMeasInitMaintOpps=cadantUPortMeasInitMaintOpps, cadantUPortMeasPortId=cadantUPortMeasPortId, cadantUFIDMeasPktsArrived=cadantUFIDMeasPktsArrived, cadantEtherPhyMeasRxNormAlign=cadantEtherPhyMeasRxNormAlign, cadantUPortMeasAppMinusBWReqFrms=cadantUPortMeasAppMinusBWReqFrms, cadantUFIDMeasTable=cadantUFIDMeasTable, cadIfMeasTable=cadIfMeasTable, cadantEtherPhyMeasTxMultiOK=cadantEtherPhyMeasTxMultiOK, cadIfInErrors=cadIfInErrors, cadantUPortMeasInitMaintColls=cadantUPortMeasInitMaintColls, cadQosPktClassMeasIfIndex=cadQosPktClassMeasIfIndex, cadantEtherPhyMeasPortId=cadantEtherPhyMeasPortId, cadantUFIDMeasSIDMACErrors=cadantUFIDMeasSIDMACErrors, cadantEtherPhyMeasTxOctOK=cadantEtherPhyMeasTxOctOK, cadantDPortMeasCardId=cadantDPortMeasCardId, cadantDPortMeasOfdmNumDataSubc=cadantDPortMeasOfdmNumDataSubc, cadantEtherPhyMeasEntry=cadantEtherPhyMeasEntry, cadantEtherPhyMeasRxSymbolErrors=cadantEtherPhyMeasRxSymbolErrors, SIDValue=SIDValue, cadantDPortMeasOfdmHighestAvgBitsPerSubc=cadantDPortMeasOfdmHighestAvgBitsPerSubc, cadantEtherPhyMeasRxLongCRC=cadantEtherPhyMeasRxLongCRC, cadLaesCountTable=cadLaesCountTable, cadantUPortMeasFilteredFrms=cadantUPortMeasFilteredFrms, cadDFIDMeasPktsDropped=cadDFIDMeasPktsDropped, cadantUPortMeasBcastReqRxPwr1s=cadantUPortMeasBcastReqRxPwr1s, cadantDPortMeasIfOutDataOctets=cadantDPortMeasIfOutDataOctets, cadantEtherPhyMeasRxPause=cadantEtherPhyMeasRxPause, cadantDPortMeasIfOutMcastDataPkts=cadantDPortMeasIfOutMcastDataPkts, cadantUPortMeasBcastFrms=cadantUPortMeasBcastFrms, cadantUFIDMeasSIDMicroreflections=cadantUFIDMeasSIDMicroreflections, cadantUPortMeasMcastDataFrms=cadantUPortMeasMcastDataFrms, cadDFIDMeasTable=cadDFIDMeasTable, cadantDPortMeasAppUcastPkts=cadantDPortMeasAppUcastPkts, UFIDIndex=UFIDIndex, cadantUFIDMeasSFID=cadantUFIDMeasSFID, cadFftUpstreamChannelEntry=cadFftUpstreamChannelEntry, cadantUFIDMeasSIDNoUniqueWordDetecteds=cadantUFIDMeasSIDNoUniqueWordDetecteds, cadSubMgtPktFilterExtEntry=cadSubMgtPktFilterExtEntry, cadantUFIDMeasSIDHCSErrors=cadantUFIDMeasSIDHCSErrors, cadantUFIDMeasGateID=cadantUFIDMeasGateID, cadDFIDMeasIndex=cadDFIDMeasIndex, cadLaesCountMacDomainIfIndex=cadLaesCountMacDomainIfIndex, cadantDPortMeasTable=cadantDPortMeasTable, cadantUFIDMeasSIDCorrecteds=cadantUFIDMeasSIDCorrecteds, cadantEtherPhyMeasTxErr=cadantEtherPhyMeasTxErr)
| 131.649919 | 9,986 | 0.800032 | 8,870 | 81,228 | 7.326156 | 0.090417 | 0.06851 | 0.119893 | 0.011388 | 0.456966 | 0.328594 | 0.299355 | 0.283859 | 0.183879 | 0.173645 | 0 | 0.060285 | 0.08859 | 81,228 | 616 | 9,987 | 131.863636 | 0.817484 | 0.004063 | 0 | 0.013289 | 0 | 0.059801 | 0.257353 | 0.030424 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.009967 | 0.026578 | 0 | 0.068106 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
06727bf100c4fb8664be5f4b6b4c1321bde755fb | 1,200 | py | Python | dfsimage/__init__.py | monkeyman79/dfsimage | de24cf0ff52b9204e52cfe7255a571b4089f5116 | [
"MIT"
] | 2 | 2021-02-20T16:55:12.000Z | 2021-08-18T09:55:09.000Z | dfsimage/__init__.py | monkeyman79/dfsimage | de24cf0ff52b9204e52cfe7255a571b4089f5116 | [
"MIT"
] | 8 | 2021-02-12T13:18:22.000Z | 2021-02-18T13:10:15.000Z | dfsimage/__init__.py | monkeyman79/dfsimage | de24cf0ff52b9204e52cfe7255a571b4089f5116 | [
"MIT"
] | null | null | null | """BBC Micro Acorn DFS floppy disk image maintenance package and command-line utility."""
import sys
if sys.version_info[0] != 3 or sys.version_info[1] < 8:
raise ImportError("Module dfsimage requires Python version 3.8.")
# pylint: disable=wrong-import-position
from .misc import ValidationWarning, InfWarning, DFSWarning
from .sectors import Sectors
from .inf import Inf
from .entry import Entry
from .side import Side
from .image import Image
from .mmbfile import MMBFile
from .mmbentry import MMBEntry
from .cli import cli
from .enums import ListFormat, DigestMode, SizeOption, WarnMode
from .enums import InfMode, OpenMode, TranslationMode
from .enums import ListFormatUnion
from .pattern import ParsedPattern, PatternList
from .pattern import PatternUnion
__version__ = '0.9rc3'
VERSION = __version__
__all__ = ['Image', 'Side', 'Entry', 'Inf', 'Sectors', 'MMBFile', 'MMBEntry', 'cli',
'ValidationWarning', 'InfWarning', 'DFSWarning',
'ListFormat', 'DigestMode', 'SizeOption', 'WarnMode', 'InfMode', 'ListFormatUnion',
'OpenMode', 'TranslationMode', 'ParsedPattern', 'PatternList', 'PatternUnion']
__author__ = "Tadek Kijkowski <tkijkowski@gmail.com>"
| 37.5 | 94 | 0.746667 | 139 | 1,200 | 6.316547 | 0.47482 | 0.030752 | 0.051253 | 0.08656 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008763 | 0.144167 | 1,200 | 31 | 95 | 38.709677 | 0.846154 | 0.101667 | 0 | 0 | 0 | 0 | 0.266791 | 0.020522 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
067b291a0adcf9ad025fa442cc815c60ff528f8a | 171 | py | Python | Python/Download_Audio_From_Video/config.py | Lakshita2002/code-n-stitch | 5ae168e541c057e33996bb694903d627846b278f | [
"MIT"
] | 50 | 2020-09-19T16:40:21.000Z | 2022-02-05T05:48:42.000Z | Python/Download_Audio_From_Video/config.py | Lakshita2002/code-n-stitch | 5ae168e541c057e33996bb694903d627846b278f | [
"MIT"
] | 266 | 2020-09-25T17:24:04.000Z | 2021-11-29T07:17:57.000Z | Python/Download_Audio_From_Video/config.py | Lakshita2002/code-n-stitch | 5ae168e541c057e33996bb694903d627846b278f | [
"MIT"
] | 113 | 2020-09-26T10:28:11.000Z | 2021-10-15T06:58:53.000Z | YT_API_SERVICE_NAME = 'youtube'
DEVELOPER_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
MAX_RESULTS = 50
YT_API_VERSION = 'v3'
LINK = 'https://www.youtube.com/watch?v='
| 28.5 | 57 | 0.789474 | 22 | 171 | 5.818182 | 0.863636 | 0.078125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019231 | 0.087719 | 171 | 5 | 58 | 34.2 | 0.801282 | 0 | 0 | 0 | 0 | 0 | 0.467836 | 0.22807 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
069d4c62462dc7aa232b8dec3cd99f18bd73a59d | 264 | py | Python | PythonExercicios/ex010.py | mateuscorreiamartins/Curso-de-Python | 1ae14b47d6fde74203eea6f5075bb9cf4d11c1c2 | [
"MIT"
] | null | null | null | PythonExercicios/ex010.py | mateuscorreiamartins/Curso-de-Python | 1ae14b47d6fde74203eea6f5075bb9cf4d11c1c2 | [
"MIT"
] | null | null | null | PythonExercicios/ex010.py | mateuscorreiamartins/Curso-de-Python | 1ae14b47d6fde74203eea6f5075bb9cf4d11c1c2 | [
"MIT"
] | null | null | null | # Crie um programa que leia quanto dinheiro uma pessoa
# tem na carteira e mostre quantos Dólares ela
# pode comprar.
# Considere US$ 1.00 = R$ 3.27
d = float(input('Digite quanto tem na carteira: '))
print('Você pode comprar US${:.2f} doláres.'.format(d/3.27))
| 33 | 60 | 0.708333 | 45 | 264 | 4.155556 | 0.777778 | 0.053476 | 0.139037 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.045455 | 0.166667 | 264 | 7 | 61 | 37.714286 | 0.804545 | 0.534091 | 0 | 0 | 0 | 0 | 0.567797 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
06b00cab250db168b90f8db6cd1b5d9ee0988b50 | 2,459 | py | Python | fix_weights.py | deapplegate/wtgpipeline | 9693e8562022cc97bf5a96427e22965e1a5e8497 | [
"MIT"
] | 1 | 2019-03-15T04:01:19.000Z | 2019-03-15T04:01:19.000Z | fix_weights.py | deapplegate/wtgpipeline | 9693e8562022cc97bf5a96427e22965e1a5e8497 | [
"MIT"
] | 5 | 2017-12-11T00:11:39.000Z | 2021-07-09T17:05:16.000Z | fix_weights.py | deapplegate/wtgpipeline | 9693e8562022cc97bf5a96427e22965e1a5e8497 | [
"MIT"
] | 2 | 2017-08-15T21:19:11.000Z | 2017-10-12T00:36:35.000Z | import sys,os
sys.path.append('/u/ki/awright/InstallingSoftware/pythons/')
from import_tools import *
from scipy import ndimage
s = ndimage.generate_binary_structure(2,2)
def fixwt(filt,i,cutval):
globwtfl2='/u/ki/awright/data/2015-12-15_%s/WEIGHTS/globalweight_%s.fits' % (filt,i)
globwtfl1='/u/ki/awright/data/2015-12-15_%s/WEIGHTS/ORIGINAL_globalweights/globalweight_%s.fits' % (filt,i)
#os.mkdir('/u/ki/awright/data/2015-12-15_%s/WEIGHTS/fixed_globalweights/' % (filt))
globwtflnew='/u/ki/awright/data/2015-12-15_%s/WEIGHTS/fixed_globalweights/globalweight_%s.fits' % (filt,i)
globwtfo1=pyfits.open(globwtfl1)[0].data
globwtfo2=pyfits.open(globwtfl2)[0].data
globwtfo2_header=pyfits.open(globwtfl2)[0].header
#labels1,Nlabels1=ndimage.measurements.label(globwtfo1==0,s)
labels2,Nlabels2=ndimage.measurements.label(globwtfo2==0,s)
#print globwtfl1,(globwtfo1==0).sum(),globwtfo1[globwtfo1>0].min(),Nlabels1
#print globwtfl2,(globwtfo2==0).sum(),globwtfo2[globwtfo2>0].min(),Nlabels2
fitfl8=pyfits.open('/u/ki/awright/data/2015-12-15_%s/BASE_WEIGHT/BASE_WEIGHT_%s.fits' % (filt,i))
wt8=fitfl8[0].data
#labels8_7,Nlabels_7=ndimage.measurements.label((wt8<.7),s)
spots2=globwtfo2==0
spots1=globwtfo1==0
labels_old=unique(labels2[spots1])
label2_list=range(1,1+Nlabels2)
for l in labels_old:
label2_list.remove(l)
labels_2not1=array(label2_list)
min_labels2=ndimage.measurements.minimum(wt8,labels=labels2,index=label2_list)
cut_labels2_bools=(min_labels2>cutval)
print "%10s,%2i: percent=%.2f, #=%6i, (with min>%.2f), total_percent=%.2f" % (filt,i,cut_labels2_bools.mean()*100,cut_labels2_bools.sum(),cutval,cut_labels2_bools.sum()/float(Nlabels2))
head_str="put back: per=%.2f #=%6i with min>%.2f" % (cut_labels2_bools.mean()*100,cut_labels2_bools.sum(),cutval,)
rid_labels2=labels_2not1[cut_labels2_bools]
slices2=scipy.ndimage.find_objects(labels2)
globwt2new=globwtfo2
for rid_label in rid_labels2:
sl=slices2[rid_label-1]
lab2sl=labels2[sl]
spot2sl=lab2sl==rid_label
globwt2new[sl][spot2sl]=wt8[sl][spot2sl]
hdu=astropy.io.fits.PrimaryHDU(globwt2new)
hdu.header=globwtfo2_header
hdu.header['FIXWT']=head_str
hdu.writeto(name=globwtflnew,overwrite=True)
base_cut=.58
cuts=[base_cut , base_cut+.1 , base_cut+.2 , base_cut+.1 , base_cut , base_cut , base_cut+.1 , base_cut+.2 , base_cut+.05 , base_cut]
for i in range(1,11):
for filt in ('W-J-B','W-C-RC','W-S-Z+'):
cutval=cuts[i-1]
fixwt(filt,i,cutval)
| 46.396226 | 186 | 0.758032 | 396 | 2,459 | 4.542929 | 0.30303 | 0.042802 | 0.058366 | 0.038911 | 0.246804 | 0.215675 | 0.183991 | 0.183991 | 0.171206 | 0.137854 | 0 | 0.070742 | 0.068727 | 2,459 | 52 | 187 | 47.288462 | 0.714847 | 0.141114 | 0 | 0 | 1 | 0.113636 | 0.216896 | 0.157095 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.068182 | null | null | 0.022727 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
2307a8f5d579d875050cad19062680f6b6a5b946 | 9,406 | py | Python | pymarshmorpho2d/bmi_marsh_morpho2d.py | gregtucker/pymarshmorpho2d | 848d2eeb8496fe781d5a1495206995ff6b67b96e | [
"MIT"
] | null | null | null | pymarshmorpho2d/bmi_marsh_morpho2d.py | gregtucker/pymarshmorpho2d | 848d2eeb8496fe781d5a1495206995ff6b67b96e | [
"MIT"
] | null | null | null | pymarshmorpho2d/bmi_marsh_morpho2d.py | gregtucker/pymarshmorpho2d | 848d2eeb8496fe781d5a1495206995ff6b67b96e | [
"MIT"
] | null | null | null | #! /usr/bin/env python
"""Basic Model Interface implementation for the pyMarshMorpho2D model."""
import numpy as np
from bmipy import Bmi
from pymarshmorpho2d import MarshEvolver
from landlab import load_params
_DEFAULT_PARAMETERS = {
'rel_sl_rise_rate': 0.001 / 365.0,
'tidal_range': 3.1,
}
class MarshMorphoBmi(Bmi):
"""Simulate tidal marsh evolution."""
_name = "MarshMorphoBmi"
_input_var_names = ("topographic__elevation",)
_output_var_names = ("topographic__elevation",)
def __init__(self):
"""Create a MarshMorphoBmi model that is ready for initialization."""
self._model = None
self._values = {}
self._var_units = {}
self._var_loc = {}
self._grids = {}
self._grid_type = {}
self._start_time = 0.0
self._end_time = np.finfo("d").max
self._time_units = "d"
def initialize(self, filename=None):
"""Initialize the MarshMorphoBmi model.
Parameters
----------
filename : str, optional
Path to name of input file, or dict.
"""
if isinstance(filename, str):
p = load_params(filename)
elif isinstance(filename, dict):
p = filename
else:
p = _DEFAULT_PARAMETERS
if ('number_of_node_rows' in p and 'number_of_node_columns' in p):
p['grid_size'] = (p['number_of_node_rows'],
p['number_of_node_columns'])
p.pop('number_of_node_rows')
p.pop('number_of_node_columns')
# Instantiate model and get handle to grid
self._model = MarshMorphoModel(**p)
self.grid = self._model.grid # Landlab grid as public attribute
#self._values = {"node_state": self.grid.at_node['node_state']}
#self._var_units = {"node_state": "-"}
#self._var_loc = {"node_state": "node"}
#self._grids = {0: ["node_state"]}
#self._grid_type = {0: "unstructured"} # closest BMI category to hexagona
#self._initialized = True
def update(self):
"""Advance forward for one year."""
self._model.run(to=self._model.current_time + 1.0)
def update_frac(self, time_frac):
"""Update model by a fraction of a time step.
Parameters
----------
time_frac : float
Fraction of a year.
"""
self._model.run(to=self._model.current_time + time_frac)
def update_until(self, then):
"""Update model until a particular time.
Parameters
----------
then : float
Time to run model until.
"""
self._model.run(to=then)
def finalize(self):
"""Finalize model."""
self._model = None
def get_var_type(self, var_name):
"""Data type of variable.
Parameters
----------
var_name : str
Name of variable as CSDMS Standard Name.
Returns
-------
str
Data type.
"""
return str(self.get_value_ptr(var_name).dtype)
def get_var_units(self, var_name):
"""Get units of variable.
Parameters
----------
var_name : str
Name of variable as CSDMS Standard Name.
Returns
-------
str
Variable units.
"""
return self._var_units[var_name]
def get_var_nbytes(self, var_name):
"""Get units of variable.
Parameters
----------
var_name : str
Name of variable as CSDMS Standard Name.
Returns
-------
int
Size of data array in bytes.
"""
return self.get_value_ptr(var_name).nbytes
def get_var_itemsize(self, name):
return np.dtype(self.get_var_type(name)).itemsize
def get_var_location(self, name):
return self._var_loc[name]
def get_var_grid(self, var_name):
"""Grid id for a variable.
Parameters
----------
var_name : str
Name of variable as CSDMS Standard Name.
Returns
-------
int
Grid id.
"""
for grid_id, var_name_list in self._grids.items():
if var_name in var_name_list:
return grid_id
def get_grid_rank(self, grid_id):
"""Rank of grid.
Parameters
----------
grid_id : int
Identifier of a grid.
Returns
-------
int
Rank of grid.
"""
return 2
def get_grid_size(self, grid_id):
"""Size of grid.
Parameters
----------
grid_id : int
Identifier of a grid.
Returns
-------
int
Size of grid.
"""
return self.grid.number_of_nodes
def get_value_ptr(self, var_name):
"""Reference to values.
Parameters
----------
var_name : str
Name of variable as CSDMS Standard Name.
Returns
-------
array_like
Value array.
"""
return self._values[var_name]
def get_value(self, var_name):
"""Copy of values.
Parameters
----------
var_name : str
Name of variable as CSDMS Standard Name.
Returns
-------
array_like
Copy of values.
"""
return self.get_value_ptr(var_name).copy()
def get_value_at_indices(self, var_name, indices):
"""Get values at particular indices.
Parameters
----------
var_name : str
Name of variable as CSDMS Standard Name.
indices : array_like
Array of indices.
Returns
-------
array_like
Values at indices.
"""
return self.get_value_ptr(var_name).take(indices)
def set_value(self, var_name, src):
"""Set model values.
Parameters
----------
var_name : str
Name of variable as CSDMS Standard Name.
src : array_like
Array of new values.
"""
val = self.get_value_ptr(var_name)
val[:] = src
def set_value_at_indices(self, name, inds, src):
"""Set model values at particular indices.
Parameters
----------
var_name : str
Name of variable as CSDMS Standard Name.
src : array_like
Array of new values.
indices : array_like
Array of indices.
"""
val = self.get_value_ptr(name)
val.flat[inds] = src
def get_component_name(self):
"""Name of the component."""
return self._name
def get_input_item_count(self):
"""Get names of input variables."""
return len(self._input_var_names)
def get_output_item_count(self):
"""Get names of output variables."""
return len(self._output_var_names)
def get_input_var_names(self):
"""Get names of input variables."""
return self._input_var_names
def get_output_var_names(self):
"""Get names of output variables."""
return self._output_var_names
def get_grid_shape(self, grid_id):
"""Number of rows and columns of uniform rectilinear grid."""
return np.array([self.grid.number_of_node_rows,
self.grid.number_of_node_columns],
dtype=np.int)
def get_grid_spacing(self, grid_id):
"""Spacing of rows and columns of uniform rectilinear grid."""
return 1.0
def get_grid_origin(self, grid_id):
"""Origin of uniform rectilinear grid."""
return np.zeros(2)
def get_grid_type(self, grid_id):
"""Type of grid."""
return self._grid_type[grid_id]
def get_start_time(self):
"""Start time of model."""
return 0.0
def get_end_time(self):
"""End time of model."""
return self._model.run_duration
def get_current_time(self):
return self._model.current_time
def get_time_step(self):
return 1.0 # GrainHill does not use a time step
def get_time_units(self):
return "y"
def get_grid_edge_count(self, grid):
return self.grid.number_of_links
def get_grid_edge_nodes(self, grid, edge_nodes):
edge_nodes[:] = self.grid.nodes_at_link.flatten()
return 0
def get_grid_face_count(self, grid):
return self.grid.number_of_cells
def get_grid_node_count(self, grid):
return self.grid.number_of_nodes
def get_grid_nodes_per_face(self, grid, nodes_per_face):
nodes_per_face[:] = 6 + np.zeros(self.grid.number_of_cells,
dtype=np.int)
return 0
def get_grid_x(self, grid, x):
x[:] = self.grid.x_of_node
return 0
def get_grid_y(self, grid, y):
y[:] = self.grid.y_of_node
return 0
# To implement, Landlab HexModelGrid first needs
# a nodes_at_cell property
def get_grid_face_nodes(self, grid, face_nodes):
raise NotImplementedError("get_grid_node_count")
def get_grid_face_edges(self, grid, face_edges):
raise NotImplementedError("get_grid_node_count")
def get_grid_z(self, grid, z):
raise NotImplementedError("get_grid_z")
| 26.055402 | 82 | 0.562726 | 1,145 | 9,406 | 4.359825 | 0.166812 | 0.042067 | 0.032051 | 0.036058 | 0.398037 | 0.355369 | 0.311298 | 0.255208 | 0.239383 | 0.170873 | 0 | 0.004925 | 0.330746 | 9,406 | 360 | 83 | 26.127778 | 0.788086 | 0.323517 | 0 | 0.108527 | 0 | 0 | 0.050815 | 0.020857 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.031008 | 0.062016 | 0.643411 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
230ab19ded266163e25736654dd12c62755c16be | 5,624 | py | Python | gdshowreelvote/gdshowreelvote/settings.py | Calinou/godot-showreel-voting | bde4ac975d74af569a6e2de74a6bb3db7a746043 | [
"MIT"
] | 7 | 2021-04-08T19:35:19.000Z | 2021-05-31T15:34:15.000Z | gdshowreelvote/gdshowreelvote/settings.py | Calinou/godot-showreel-voting | bde4ac975d74af569a6e2de74a6bb3db7a746043 | [
"MIT"
] | 5 | 2021-05-10T20:51:52.000Z | 2021-07-08T21:17:46.000Z | gdshowreelvote/gdshowreelvote/settings.py | Calinou/godot-showreel-voting | bde4ac975d74af569a6e2de74a6bb3db7a746043 | [
"MIT"
] | 1 | 2021-05-31T15:53:12.000Z | 2021-05-31T15:53:12.000Z | """
Django settings for gdshowreelvote project.
Generated by 'django-admin startproject' using Django 3.0.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
from get_docker_secret import get_docker_secret
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = get_docker_secret('gdshowreel_django_secret', default=None)
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.environ.get('DJANGO_DEBUG', '') != 'False'
# Domain name
ALLOWED_HOSTS = os.environ.get('DJANGO_ALLOWED_HOSTS','').split(',')
# Application definition
INSTALLED_APPS = [
'vote.apps.VoteConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'mozilla_django_oidc',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'mozilla_django_oidc.middleware.SessionRefresh',
]
ROOT_URLCONF = 'gdshowreelvote.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'vote.context_processors.common',
],
},
},
]
WSGI_APPLICATION = 'gdshowreelvote.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'gdshowreel',
'USER': 'mysql',
'PASSWORD': get_docker_secret('gdshowreel_django_db_password'),
'HOST': 'database',
'PORT': '',
}
}
# Password validation
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/3.0/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/
SERVE_STATICS = True
STATIC_ROOT = os.environ.get('DJANGO_STATIC_ROOT', "/var/www/showreel.godotengine.org/static/")
STATIC_URL = '/static/'
### Authentication ###
AUTHENTICATION_BACKENDS = [
'vote.auth.OIDCAuthenticationBackend',
'django.contrib.auth.backends.ModelBackend',
]
AUTH_USER_MODEL = 'vote.User'
# OICD client connection
OIDC_RP_CLIENT_ID = get_docker_secret('gdshowreel_oidc_rp_client_id')
OIDC_RP_CLIENT_SECRET = get_docker_secret('gdshowreel_oidc_rp_client_secret')
print(OIDC_RP_CLIENT_SECRET)
# Signing algorihtm
OIDC_RP_SIGN_ALGO = 'RS256'
# Keycloak configuration
KEYCLOAK_REALM = "master"
KEYCLOAK_HOSTNAME = "keycloak:8080"
# Keycloak roles in authentication claims
KEYCLOAK_ROLES_PATH_IN_CLAIMS = ["realm_access", "roles"]
KEYCLOAK_STAFF_ROLE = "staff"
KEYCLOAK_SUPERUSER_ROLE = "admin"
# Keycloak OICD endpoints. You can get those at this endpoint http://{keycloakhost}:{port}/auth/realms/{realm}/.well-known/openid-configuration
OIDC_OP_AUTHORIZATION_ENDPOINT = f"http://{KEYCLOAK_HOSTNAME}/auth/realms/{KEYCLOAK_REALM}/protocol/openid-connect/auth" # URL of the OIDC OP authorization endpoint
OIDC_OP_TOKEN_ENDPOINT = f"http://{KEYCLOAK_HOSTNAME}/auth/realms/{KEYCLOAK_REALM}/protocol/openid-connect/token" # URL of the OIDC OP token endpoint
OIDC_OP_USER_ENDPOINT = f"http://{KEYCLOAK_HOSTNAME}/auth/realms/{KEYCLOAK_REALM}/protocol/openid-connect/userinfo" # URL of the OIDC OP userinfo endpoint
OIDC_OP_JWKS_ENDPOINT = f"http://{KEYCLOAK_HOSTNAME}/auth/realms/{KEYCLOAK_REALM}/protocol/openid-connect/certs"
OIDC_OP_LOGOUT_ENDPOINT = f"http://{KEYCLOAK_HOSTNAME}/auth/realms/{KEYCLOAK_REALM}/protocol/openid-connect/logout"
# URLS
LOGIN_REDIRECT_URL = '/submissions'
LOGOUT_REDIRECT_URL = '/login'
LOGIN_URL = 'login'
# Automatic Keycloak logout
OIDC_OP_LOGOUT_URL_METHOD = "vote.auth.logout"
### Security ###
SECURE_SSL_REDIRECT = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
### Custom settings ###
VOTE_MAX_SUBMISSIONS_PER_SHOWREEL = 3
VOTE_ONLY_STAFF_CAN_VOTE = True | 30.4 | 164 | 0.734886 | 669 | 5,624 | 5.959641 | 0.339312 | 0.05217 | 0.034111 | 0.043893 | 0.250314 | 0.216203 | 0.177076 | 0.158515 | 0.121645 | 0.091548 | 0 | 0.006404 | 0.139225 | 5,624 | 185 | 165 | 30.4 | 0.817187 | 0.25569 | 0 | 0 | 1 | 0 | 0.514272 | 0.315675 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.057143 | 0.019048 | 0 | 0.019048 | 0.009524 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
23298ea9ccd4c32269467cfb8d9ad3f9c51df1a2 | 44,085 | py | Python | ruckus_vsz_snmp/RUCKUS-SCG-TTG-MIB.py | molekuul/check_ruckus_vsz | 57b243a53794b8ab40b049cdd2ae0380d3476ac8 | [
"Apache-2.0"
] | 3 | 2016-09-06T10:23:23.000Z | 2021-04-27T14:37:40.000Z | ruckus_vsz_snmp/RUCKUS-SCG-TTG-MIB.py | molekuul/check_ruckus_vsz | 57b243a53794b8ab40b049cdd2ae0380d3476ac8 | [
"Apache-2.0"
] | 4 | 2018-06-25T08:45:43.000Z | 2020-10-22T07:26:58.000Z | ruckus_vsz_snmp/RUCKUS-SCG-TTG-MIB.py | molekuul/check_ruckus_vsz | 57b243a53794b8ab40b049cdd2ae0380d3476ac8 | [
"Apache-2.0"
] | null | null | null | # PySNMP SMI module. Autogenerated from smidump -f python RUCKUS-SCG-TTG-MIB
# by libsmi2pysnmp-0.1.3
# Python version sys.version_info(major=2, minor=7, micro=11, releaselevel='final', serial=0)
# pylint:disable=C0302
mibBuilder = mibBuilder # pylint:disable=undefined-variable,used-before-assignment
# Imports
(Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
(NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
(ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint")
(ruckusSCGTTGModule, ) = mibBuilder.importSymbols("RUCKUS-ROOT-MIB", "ruckusSCGTTGModule")
(Bits, Counter32, Counter64, Integer32, Integer32, IpAddress, ModuleIdentity, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, Unsigned32, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Counter32", "Counter64", "Integer32", "Integer32", "IpAddress", "ModuleIdentity", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "Unsigned32")
(DisplayString, ) = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString")
# Objects
ruckusTTGMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1)).setRevisions(("2014-05-19 11:00", ))
if mibBuilder.loadTexts:
ruckusTTGMIB.setOrganization("Ruckus Wireless, Inc.")
if mibBuilder.loadTexts:
ruckusTTGMIB.setContactInfo("Ruckus Wireless, Inc.\n\n350 West Java Dr.\nSunnyvale, CA 94089\nUSA\n\nT: +1 (650) 265-4200\nF: +1 (408) 738-2065\nEMail: info@ruckuswireless.com\nWeb: www.ruckuswireless.com")
if mibBuilder.loadTexts:
ruckusTTGMIB.setDescription("Ruckus TTG MIB")
ruckusTTGObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1))
ruckusAAAInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1))
ruckusAAATable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1))
if mibBuilder.loadTexts:
ruckusAAATable.setDescription("ruckusAAATable")
ruckusAAAEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1)).setIndexNames((0, "RUCKUS-SCG-TTG-MIB", "ruckusAAAIndex"))
if mibBuilder.loadTexts:
ruckusAAAEntry.setDescription("ruckusAAAEntry")
ruckusAAAAaaIp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 1), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAAaaIp.setDescription("ruckusAAAAaaIp")
ruckusAAANumSuccAuthPerm = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumSuccAuthPerm.setDescription("ruckusAAANumSuccAuthPerm")
ruckusAAANumFailAuthPerm = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumFailAuthPerm.setDescription("ruckusAAANumFailAuthPerm")
ruckusAAANumSuccAuthPsd = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumSuccAuthPsd.setDescription("ruckusAAANumSuccAuthPsd")
ruckusAAANumFailAuthPsd = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumFailAuthPsd.setDescription("ruckusAAANumFailAuthPsd")
ruckusAAANumSuccFastAuth = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumSuccFastAuth.setDescription("ruckusAAANumSuccFastAuth")
ruckusAAANumFailFastAuth = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumFailFastAuth.setDescription("ruckusAAANumFailFastAuth")
ruckusAAANumAuthUnknPsd = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumAuthUnknPsd.setDescription("ruckusAAANumAuthUnknPsd")
ruckusAAANumAuthUnknFR = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumAuthUnknFR.setDescription("ruckusAAANumAuthUnknFR")
ruckusAAANumIncompleteAuth = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumIncompleteAuth.setDescription("ruckusAAANumIncompleteAuth")
ruckusAAANumSuccAcc = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 11), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumSuccAcc.setDescription("ruckusAAANumSuccAcc")
ruckusAAANumFailAcc = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 12), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumFailAcc.setDescription("ruckusAAANumFailAcc")
ruckusAAANumRadAcsRq = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 13), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumRadAcsRq.setDescription("ruckusAAANumRadAcsRq")
ruckusAAANumRadAcsAcpt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 14), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumRadAcsAcpt.setDescription("ruckusAAANumRadAcsAcpt")
ruckusAAANumRadAcsChlg = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 15), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumRadAcsChlg.setDescription("ruckusAAANumRadAcsChlg")
ruckusAAANumRadAcsRej = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 16), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumRadAcsRej.setDescription("ruckusAAANumRadAcsRej")
ruckusAAANumRadAccRq = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 17), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumRadAccRq.setDescription("ruckusAAANumRadAccRq")
ruckusAAANumRadAccAcpt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 18), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumRadAccAcpt.setDescription("ruckusAAANumRadAccAcpt")
ruckusAAANumRadCoaRq = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 19), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumRadCoaRq.setDescription("ruckusAAANumRadCoaRq")
ruckusAAANumSuccCoaAcpt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 20), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumSuccCoaAcpt.setDescription("ruckusAAANumSuccCoaAcpt")
ruckusAAANumFailCoaAcpt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 21), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumFailCoaAcpt.setDescription("ruckusAAANumFailCoaAcpt")
ruckusAAANumRadDmRq = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 22), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumRadDmRq.setDescription("ruckusAAANumRadDmRq")
ruckusAAANumSuccDmAcpt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 23), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumSuccDmAcpt.setDescription("ruckusAAANumSuccDmAcpt")
ruckusAAANumFailDmAcpt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 24), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAANumFailDmAcpt.setDescription("ruckusAAANumFailDmAcpt")
ruckusAAAIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 1, 1, 1, 99), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAIndex.setDescription("ruckusAAAIndex")
ruckusAAAProxyInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2))
ruckusAAAProxyTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1))
if mibBuilder.loadTexts:
ruckusAAAProxyTable.setDescription("ruckusAAAProxyTable")
ruckusAAAProxyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1)).setIndexNames((0, "RUCKUS-SCG-TTG-MIB", "ruckusAAAProxyIndex"))
if mibBuilder.loadTexts:
ruckusAAAProxyEntry.setDescription("ruckusAAAProxyEntry")
ruckusAAAProxyAaaIp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 1), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyAaaIp.setDescription("ruckusAAAProxyAaaIp")
ruckusAAAProxyNumSuccAuth = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumSuccAuth.setDescription("ruckusAAAProxyNumSuccAuth")
ruckusAAAProxyNumFailAuth = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumFailAuth.setDescription("ruckusAAAProxyNumFailAuth")
ruckusAAAProxyNumIncmpltAuth = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumIncmpltAuth.setDescription("ruckusAAAProxyNumIncmpltAuth")
ruckusAAAProxyNumSuccAcc = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumSuccAcc.setDescription("ruckusAAAProxyNumSuccAcc")
ruckusAAAProxyNumFailAcc = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumFailAcc.setDescription("ruckusAAAProxyNumFailAcc")
ruckusAAAProxyNumAcsRqRcvdNas = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumAcsRqRcvdNas.setDescription("ruckusAAAProxyNumAcsRqRcvdNas")
ruckusAAAProxyNumAcsRqSntAaa = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumAcsRqSntAaa.setDescription("ruckusAAAProxyNumAcsRqSntAaa")
ruckusAAAProxyNumAcsChRcvdAaa = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumAcsChRcvdAaa.setDescription("ruckusAAAProxyNumAcsChRcvdAaa")
ruckusAAAProxyNumAcsChSntNas = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumAcsChSntNas.setDescription("ruckusAAAProxyNumAcsChSntNas")
ruckusAAAProxyNumAcsAcpRcvdAaa = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 11), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumAcsAcpRcvdAaa.setDescription("ruckusAAAProxyNumAcsAcpRcvdAaa")
ruckusAAAProxyNumAcsAcpSntNas = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 12), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumAcsAcpSntNas.setDescription("ruckusAAAProxyNumAcsAcpSntNas")
ruckusAAAProxyNumAcsRejRcvdAaa = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 13), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumAcsRejRcvdAaa.setDescription("ruckusAAAProxyNumAcsRejRcvdAaa")
ruckusAAAProxyNumAcsRejSntNas = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 14), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumAcsRejSntNas.setDescription("ruckusAAAProxyNumAcsRejSntNas")
ruckusAAAProxyNumAccRqRcvdNas = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 15), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumAccRqRcvdNas.setDescription("ruckusAAAProxyNumAccRqRcvdNas")
ruckusAAAProxyNumAccRqSntAaa = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 16), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumAccRqSntAaa.setDescription("ruckusAAAProxyNumAccRqSntAaa")
ruckusAAAProxyNumAccRspRcdAaa = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 17), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumAccRspRcdAaa.setDescription("ruckusAAAProxyNumAccRspRcdAaa")
ruckusAAAProxyNumAccRspSntNas = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 18), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumAccRspSntNas.setDescription("ruckusAAAProxyNumAccRspSntNas")
ruckusAAAProxyNumCoaRcvdAaa = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 19), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumCoaRcvdAaa.setDescription("ruckusAAAProxyNumCoaRcvdAaa")
ruckusAAAProxyNumCoaSucSntAaa = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 20), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumCoaSucSntAaa.setDescription("ruckusAAAProxyNumCoaSucSntAaa")
ruckusAAAProxyNumCoaFailSntAaa = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 21), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumCoaFailSntAaa.setDescription("ruckusAAAProxyNumCoaFailSntAaa")
ruckusAAAProxyNumDmRcvdAaa = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 22), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumDmRcvdAaa.setDescription("ruckusAAAProxyNumDmRcvdAaa")
ruckusAAAProxyNumDmSntNas = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 23), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumDmSntNas.setDescription("ruckusAAAProxyNumDmSntNas")
ruckusAAAProxyNumDmSucRcdNas = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 24), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumDmSucRcdNas.setDescription("ruckusAAAProxyNumDmSucRcdNas")
ruckusAAAProxyNumDmSucSntAaa = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 25), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumDmSucSntAaa.setDescription("ruckusAAAProxyNumDmSucSntAaa")
ruckusAAAProxyNumDmFailRcdNas = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 26), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumDmFailRcdNas.setDescription("ruckusAAAProxyNumDmFailRcdNas")
ruckusAAAProxyNumDmFailSntAaa = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 27), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyNumDmFailSntAaa.setDescription("ruckusAAAProxyNumDmFailSntAaa")
ruckusAAAProxyIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 2, 1, 1, 99), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusAAAProxyIndex.setDescription("ruckusAAAProxyIndex")
ruckusCGFInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 3))
ruckusCGFTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 3, 1))
if mibBuilder.loadTexts:
ruckusCGFTable.setDescription("ruckusCGFTable")
ruckusCGFEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 3, 1, 1)).setIndexNames((0, "RUCKUS-SCG-TTG-MIB", "ruckusCGFIndex"))
if mibBuilder.loadTexts:
ruckusCGFEntry.setDescription("ruckusCGFEntry")
ruckusCGFCgfSrvcName = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 3, 1, 1, 1), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusCGFCgfSrvcName.setDescription("ruckusCGFCgfSrvcName")
ruckusCGFCgfIp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 3, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusCGFCgfIp.setDescription("ruckusCGFCgfIp")
ruckusCGFNumSuccCdrTxfd = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 3, 1, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusCGFNumSuccCdrTxfd.setDescription("ruckusCGFNumSuccCdrTxfd")
ruckusCGFNumCdrTxfrFail = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 3, 1, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusCGFNumCdrTxfrFail.setDescription("ruckusCGFNumCdrTxfrFail")
ruckusCGFNumCdrPossDup = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 3, 1, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusCGFNumCdrPossDup.setDescription("ruckusCGFNumCdrPossDup")
ruckusCGFNumCdrRlsReq = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 3, 1, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusCGFNumCdrRlsReq.setDescription("ruckusCGFNumCdrRlsReq")
ruckusCGFNumCdrCnclReq = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 3, 1, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusCGFNumCdrCnclReq.setDescription("ruckusCGFNumCdrCnclReq")
ruckusCGFNumDrtrReqSnt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 3, 1, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusCGFNumDrtrReqSnt.setDescription("ruckusCGFNumDrtrReqSnt")
ruckusCGFNumDrtrSucRspRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 3, 1, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusCGFNumDrtrSucRspRcvd.setDescription("ruckusCGFNumDrtrSucRspRcvd")
ruckusCGFNumDrtrFailRspRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 3, 1, 1, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusCGFNumDrtrFailRspRcvd.setDescription("ruckusCGFNumDrtrFailRspRcvd")
ruckusCGFIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 3, 1, 1, 99), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusCGFIndex.setDescription("ruckusCGFIndex")
ruckusGTPUInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 4))
ruckusGTPUTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 4, 1))
if mibBuilder.loadTexts:
ruckusGTPUTable.setDescription("ruckusGTPUTable")
ruckusGTPUEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 4, 1, 1)).setIndexNames((0, "RUCKUS-SCG-TTG-MIB", "ruckusGTPUIndex"))
if mibBuilder.loadTexts:
ruckusGTPUEntry.setDescription("ruckusGTPUEntry")
ruckusGTPUGgsnIPAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 4, 1, 1, 1), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGTPUGgsnIPAddr.setDescription("ruckusGTPUGgsnIPAddr")
ruckusGTPUTxPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 4, 1, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGTPUTxPkts.setDescription("ruckusGTPUTxPkts")
ruckusGTPUTxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 4, 1, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGTPUTxBytes.setDescription("ruckusGTPUTxBytes")
ruckusGTPURxPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 4, 1, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGTPURxPkts.setDescription("ruckusGTPURxPkts")
ruckusGTPURxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 4, 1, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGTPURxBytes.setDescription("ruckusGTPURxBytes")
ruckusGTPUTxDrops = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 4, 1, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGTPUTxDrops.setDescription("ruckusGTPUTxDrops")
ruckusGTPURxDrops = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 4, 1, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGTPURxDrops.setDescription("ruckusGTPURxDrops")
ruckusGTPUNumBadGTPU = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 4, 1, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGTPUNumBadGTPU.setDescription("ruckusGTPUNumBadGTPU")
ruckusGTPUNumRXTeidInvalid = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 4, 1, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGTPUNumRXTeidInvalid.setDescription("ruckusGTPUNumRXTeidInvalid")
ruckusGTPUNumTXTeidInvalid = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 4, 1, 1, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGTPUNumTXTeidInvalid.setDescription("ruckusGTPUNumTXTeidInvalid")
ruckusGTPUNumOfEchoRX = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 4, 1, 1, 11), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGTPUNumOfEchoRX.setDescription("ruckusGTPUNumOfEchoRX")
ruckusGTPUIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 4, 1, 1, 99), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGTPUIndex.setDescription("ruckusGTPUIndex")
ruckusGGSNGTPCInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5))
ruckusGGSNGTPCTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1))
if mibBuilder.loadTexts:
ruckusGGSNGTPCTable.setDescription("ruckusGGSNGTPCTable")
ruckusGGSNGTPCEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1)).setIndexNames((0, "RUCKUS-SCG-TTG-MIB", "ruckusGGSNGTPCIndex"))
if mibBuilder.loadTexts:
ruckusGGSNGTPCEntry.setDescription("ruckusGGSNGTPCEntry")
ruckusGGSNGTPCGgsnIp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 1), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCGgsnIp.setDescription("ruckusGGSNGTPCGgsnIp")
ruckusGGSNGTPCNumActPdp = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCNumActPdp.setDescription("ruckusGGSNGTPCNumActPdp")
ruckusGGSNGTPCSuccPdpCrt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCSuccPdpCrt.setDescription("ruckusGGSNGTPCSuccPdpCrt")
ruckusGGSNGTPCFailPdpCrt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCFailPdpCrt.setDescription("ruckusGGSNGTPCFailPdpCrt")
ruckusGGSNGTPCSuccPdpUpdRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCSuccPdpUpdRcvd.setDescription("ruckusGGSNGTPCSuccPdpUpdRcvd")
ruckusGGSNGTPCFailPdpUpdRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCFailPdpUpdRcvd.setDescription("ruckusGGSNGTPCFailPdpUpdRcvd")
ruckusGGSNGTPCSuccPdpUpdInitRM = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCSuccPdpUpdInitRM.setDescription("ruckusGGSNGTPCSuccPdpUpdInitRM")
ruckusGGSNGTPCFailPdpUpdInitRM = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCFailPdpUpdInitRM.setDescription("ruckusGGSNGTPCFailPdpUpdInitRM")
ruckusGGSNGTPCSuccPdpUpdInitAAA = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCSuccPdpUpdInitAAA.setDescription("ruckusGGSNGTPCSuccPdpUpdInitAAA")
ruckusGGSNGTPCFailPdpUpdInitAAA = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCFailPdpUpdInitAAA.setDescription("ruckusGGSNGTPCFailPdpUpdInitAAA")
ruckusGGSNGTPCSuccPdpUpdInitHLR = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 11), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCSuccPdpUpdInitHLR.setDescription("ruckusGGSNGTPCSuccPdpUpdInitHLR")
ruckusGGSNGTPCFailPdpUpdInitHLR = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 12), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCFailPdpUpdInitHLR.setDescription("ruckusGGSNGTPCFailPdpUpdInitHLR")
ruckusGGSNGTPCSuccDelPdpRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 13), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCSuccDelPdpRcvd.setDescription("ruckusGGSNGTPCSuccDelPdpRcvd")
ruckusGGSNGTPCFailDelPdpRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 14), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCFailDelPdpRcvd.setDescription("ruckusGGSNGTPCFailDelPdpRcvd")
ruckusGGSNGTPCSuccDelPdpInitErr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 15), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCSuccDelPdpInitErr.setDescription("ruckusGGSNGTPCSuccDelPdpInitErr")
ruckusGGSNGTPCFailDelPdpInitErr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 16), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCFailDelPdpInitErr.setDescription("ruckusGGSNGTPCFailDelPdpInitErr")
ruckusGGSNGTPCSuccDelPdpInitDM = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 17), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCSuccDelPdpInitDM.setDescription("ruckusGGSNGTPCSuccDelPdpInitDM")
ruckusGGSNGTPCFailDelPdpInitDM = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 18), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCFailDelPdpInitDM.setDescription("ruckusGGSNGTPCFailDelPdpInitDM")
ruckusGGSNGTPCSuccDelPdpInitHLR = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 19), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCSuccDelPdpInitHLR.setDescription("ruckusGGSNGTPCSuccDelPdpInitHLR")
ruckusGGSNGTPCFailDelPdpInitHLR = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 20), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCFailDelPdpInitHLR.setDescription("ruckusGGSNGTPCFailDelPdpInitHLR")
ruckusGGSNGTPCSuccDelPdpInitSCG = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 21), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCSuccDelPdpInitSCG.setDescription("ruckusGGSNGTPCSuccDelPdpInitSCG")
ruckusGGSNGTPCFailDelPdpInitSCG = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 22), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCFailDelPdpInitSCG.setDescription("ruckusGGSNGTPCFailDelPdpInitSCG")
ruckusGGSNGTPCSuccDelPdpInitAP = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 23), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCSuccDelPdpInitAP.setDescription("ruckusGGSNGTPCSuccDelPdpInitAP")
ruckusGGSNGTPCFailDelPdpInitAP = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 24), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCFailDelPdpInitAP.setDescription("ruckusGGSNGTPCFailDelPdpInitAP")
ruckusGGSNGTPCSuccDelPdpInitD = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 25), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCSuccDelPdpInitD.setDescription("ruckusGGSNGTPCSuccDelPdpInitD")
ruckusGGSNGTPCFailDelPdpInitD = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 26), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCFailDelPdpInitD.setDescription("ruckusGGSNGTPCFailDelPdpInitD")
ruckusGGSNGTPCSuccDelPdpInitClnt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 27), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCSuccDelPdpInitClnt.setDescription("ruckusGGSNGTPCSuccDelPdpInitClnt")
ruckusGGSNGTPCFailDelPdpInitClnt = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 28), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCFailDelPdpInitClnt.setDescription("ruckusGGSNGTPCFailDelPdpInitClnt")
ruckusGGSNGTPCIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 5, 1, 1, 99), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusGGSNGTPCIndex.setDescription("ruckusGGSNGTPCIndex")
ruckusHLRInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7))
ruckusHLRTable = MibTable((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1))
if mibBuilder.loadTexts:
ruckusHLRTable.setDescription("ruckusHLRTable")
ruckusHLREntry = MibTableRow((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1)).setIndexNames((0, "RUCKUS-SCG-TTG-MIB", "ruckusHLRIndex"))
if mibBuilder.loadTexts:
ruckusHLREntry.setDescription("ruckusHLREntry")
ruckusHLRHlrSrvcName = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 1), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRHlrSrvcName.setDescription("ruckusHLRHlrSrvcName")
ruckusHLRNumSucAuthInfoReqSim = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumSucAuthInfoReqSim.setDescription("ruckusHLRNumSucAuthInfoReqSim")
ruckusHLRNumAuthInfoRqErrHlrSim = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumAuthInfoRqErrHlrSim.setDescription("ruckusHLRNumAuthInfoRqErrHlrSim")
ruckusHLRNumAuthInfoRqTmotSim = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumAuthInfoRqTmotSim.setDescription("ruckusHLRNumAuthInfoRqTmotSim")
ruckusHLRNumSucAuthInfoReqAka = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumSucAuthInfoReqAka.setDescription("ruckusHLRNumSucAuthInfoReqAka")
ruckusHLRNumAuthInfoRqErrHlrAka = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumAuthInfoRqErrHlrAka.setDescription("ruckusHLRNumAuthInfoRqErrHlrAka")
ruckusHLRNumAuthInfoRqTmotAka = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumAuthInfoRqTmotAka.setDescription("ruckusHLRNumAuthInfoRqTmotAka")
ruckusHLRNumUpdGprsSuccSim = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumUpdGprsSuccSim.setDescription("ruckusHLRNumUpdGprsSuccSim")
ruckusHLRNumUpdGprsFailErrSim = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumUpdGprsFailErrSim.setDescription("ruckusHLRNumUpdGprsFailErrSim")
ruckusHLRNumUpdGprsFailTmoSim = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumUpdGprsFailTmoSim.setDescription("ruckusHLRNumUpdGprsFailTmoSim")
ruckusHLRNumUpdGprsSuccAka = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 11), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumUpdGprsSuccAka.setDescription("ruckusHLRNumUpdGprsSuccAka")
ruckusHLRNumUpdGprsFailErrAka = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 12), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumUpdGprsFailErrAka.setDescription("ruckusHLRNumUpdGprsFailErrAka")
ruckusHLRNumUpdGprsFailTmoAka = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 13), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumUpdGprsFailTmoAka.setDescription("ruckusHLRNumUpdGprsFailTmoAka")
ruckusHLRNumRstDtaSuccSim = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 14), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumRstDtaSuccSim.setDescription("ruckusHLRNumRstDtaSuccSim")
ruckusHLRNumRstDtaFailErrHlrSim = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 15), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumRstDtaFailErrHlrSim.setDescription("ruckusHLRNumRstDtaFailErrHlrSim")
ruckusHLRNumRstDtaFailTmoSim = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 16), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumRstDtaFailTmoSim.setDescription("ruckusHLRNumRstDtaFailTmoSim")
ruckusHLRNumRstDtaSuccAka = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 17), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumRstDtaSuccAka.setDescription("ruckusHLRNumRstDtaSuccAka")
ruckusHLRNumRstDtaFailErrHlrAka = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 18), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumRstDtaFailErrHlrAka.setDescription("ruckusHLRNumRstDtaFailErrHlrAka")
ruckusHLRNumRstDtaFailTmoAka = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 19), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumRstDtaFailTmoAka.setDescription("ruckusHLRNumRstDtaFailTmoAka")
ruckusHLRNumInsrtDtaSuccSim = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 20), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumInsrtDtaSuccSim.setDescription("ruckusHLRNumInsrtDtaSuccSim")
ruckusHLRNumInsrtDtaFailSim = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 21), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumInsrtDtaFailSim.setDescription("ruckusHLRNumInsrtDtaFailSim")
ruckusHLRNumInsrtDtaSuccAka = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 22), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumInsrtDtaSuccAka.setDescription("ruckusHLRNumInsrtDtaSuccAka")
ruckusHLRNumInsrtDtaFailAka = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 23), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumInsrtDtaFailAka.setDescription("ruckusHLRNumInsrtDtaFailAka")
ruckusHLRNumSaInsrtDtaSucc = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 24), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumSaInsrtDtaSucc.setDescription("ruckusHLRNumSaInsrtDtaSucc")
ruckusHLRNumSaInsrtDtaFailUnkS = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 25), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumSaInsrtDtaFailUnkS.setDescription("ruckusHLRNumSaInsrtDtaFailUnkS")
ruckusHLRNumSaInsrtDtaFailErr = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 26), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumSaInsrtDtaFailErr.setDescription("ruckusHLRNumSaInsrtDtaFailErr")
ruckusHLRNumCfgAssoc = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 27), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumCfgAssoc.setDescription("ruckusHLRNumCfgAssoc")
ruckusHLRNumActAssoc = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 28), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumActAssoc.setDescription("ruckusHLRNumActAssoc")
ruckusHLRNumRtgFail = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 29), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRNumRtgFail.setDescription("ruckusHLRNumRtgFail")
ruckusHLRIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 25053, 1, 3, 3, 1, 1, 7, 1, 1, 99), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts:
ruckusHLRIndex.setDescription("ruckusHLRIndex")
# Augmentions
# Exports
# Module identity
mibBuilder.exportSymbols("RUCKUS-SCG-TTG-MIB", PYSNMP_MODULE_ID=ruckusTTGMIB)
# Objects
mibBuilder.exportSymbols("RUCKUS-SCG-TTG-MIB", ruckusTTGMIB=ruckusTTGMIB, ruckusTTGObjects=ruckusTTGObjects, ruckusAAAInfo=ruckusAAAInfo, ruckusAAATable=ruckusAAATable, ruckusAAAEntry=ruckusAAAEntry, ruckusAAAAaaIp=ruckusAAAAaaIp, ruckusAAANumSuccAuthPerm=ruckusAAANumSuccAuthPerm, ruckusAAANumFailAuthPerm=ruckusAAANumFailAuthPerm, ruckusAAANumSuccAuthPsd=ruckusAAANumSuccAuthPsd, ruckusAAANumFailAuthPsd=ruckusAAANumFailAuthPsd, ruckusAAANumSuccFastAuth=ruckusAAANumSuccFastAuth, ruckusAAANumFailFastAuth=ruckusAAANumFailFastAuth, ruckusAAANumAuthUnknPsd=ruckusAAANumAuthUnknPsd, ruckusAAANumAuthUnknFR=ruckusAAANumAuthUnknFR, ruckusAAANumIncompleteAuth=ruckusAAANumIncompleteAuth, ruckusAAANumSuccAcc=ruckusAAANumSuccAcc, ruckusAAANumFailAcc=ruckusAAANumFailAcc, ruckusAAANumRadAcsRq=ruckusAAANumRadAcsRq, ruckusAAANumRadAcsAcpt=ruckusAAANumRadAcsAcpt, ruckusAAANumRadAcsChlg=ruckusAAANumRadAcsChlg, ruckusAAANumRadAcsRej=ruckusAAANumRadAcsRej, ruckusAAANumRadAccRq=ruckusAAANumRadAccRq, ruckusAAANumRadAccAcpt=ruckusAAANumRadAccAcpt, ruckusAAANumRadCoaRq=ruckusAAANumRadCoaRq, ruckusAAANumSuccCoaAcpt=ruckusAAANumSuccCoaAcpt, ruckusAAANumFailCoaAcpt=ruckusAAANumFailCoaAcpt, ruckusAAANumRadDmRq=ruckusAAANumRadDmRq, ruckusAAANumSuccDmAcpt=ruckusAAANumSuccDmAcpt, ruckusAAANumFailDmAcpt=ruckusAAANumFailDmAcpt, ruckusAAAIndex=ruckusAAAIndex, ruckusAAAProxyInfo=ruckusAAAProxyInfo, ruckusAAAProxyTable=ruckusAAAProxyTable, ruckusAAAProxyEntry=ruckusAAAProxyEntry, ruckusAAAProxyAaaIp=ruckusAAAProxyAaaIp, ruckusAAAProxyNumSuccAuth=ruckusAAAProxyNumSuccAuth, ruckusAAAProxyNumFailAuth=ruckusAAAProxyNumFailAuth, ruckusAAAProxyNumIncmpltAuth=ruckusAAAProxyNumIncmpltAuth, ruckusAAAProxyNumSuccAcc=ruckusAAAProxyNumSuccAcc, ruckusAAAProxyNumFailAcc=ruckusAAAProxyNumFailAcc, ruckusAAAProxyNumAcsRqRcvdNas=ruckusAAAProxyNumAcsRqRcvdNas, ruckusAAAProxyNumAcsRqSntAaa=ruckusAAAProxyNumAcsRqSntAaa, ruckusAAAProxyNumAcsChRcvdAaa=ruckusAAAProxyNumAcsChRcvdAaa, ruckusAAAProxyNumAcsChSntNas=ruckusAAAProxyNumAcsChSntNas, ruckusAAAProxyNumAcsAcpRcvdAaa=ruckusAAAProxyNumAcsAcpRcvdAaa, ruckusAAAProxyNumAcsAcpSntNas=ruckusAAAProxyNumAcsAcpSntNas, ruckusAAAProxyNumAcsRejRcvdAaa=ruckusAAAProxyNumAcsRejRcvdAaa, ruckusAAAProxyNumAcsRejSntNas=ruckusAAAProxyNumAcsRejSntNas, ruckusAAAProxyNumAccRqRcvdNas=ruckusAAAProxyNumAccRqRcvdNas, ruckusAAAProxyNumAccRqSntAaa=ruckusAAAProxyNumAccRqSntAaa, ruckusAAAProxyNumAccRspRcdAaa=ruckusAAAProxyNumAccRspRcdAaa, ruckusAAAProxyNumAccRspSntNas=ruckusAAAProxyNumAccRspSntNas, ruckusAAAProxyNumCoaRcvdAaa=ruckusAAAProxyNumCoaRcvdAaa, ruckusAAAProxyNumCoaSucSntAaa=ruckusAAAProxyNumCoaSucSntAaa, ruckusAAAProxyNumCoaFailSntAaa=ruckusAAAProxyNumCoaFailSntAaa, ruckusAAAProxyNumDmRcvdAaa=ruckusAAAProxyNumDmRcvdAaa, ruckusAAAProxyNumDmSntNas=ruckusAAAProxyNumDmSntNas, ruckusAAAProxyNumDmSucRcdNas=ruckusAAAProxyNumDmSucRcdNas, ruckusAAAProxyNumDmSucSntAaa=ruckusAAAProxyNumDmSucSntAaa, ruckusAAAProxyNumDmFailRcdNas=ruckusAAAProxyNumDmFailRcdNas, ruckusAAAProxyNumDmFailSntAaa=ruckusAAAProxyNumDmFailSntAaa, ruckusAAAProxyIndex=ruckusAAAProxyIndex, ruckusCGFInfo=ruckusCGFInfo, ruckusCGFTable=ruckusCGFTable, ruckusCGFEntry=ruckusCGFEntry, ruckusCGFCgfSrvcName=ruckusCGFCgfSrvcName, ruckusCGFCgfIp=ruckusCGFCgfIp, ruckusCGFNumSuccCdrTxfd=ruckusCGFNumSuccCdrTxfd, ruckusCGFNumCdrTxfrFail=ruckusCGFNumCdrTxfrFail, ruckusCGFNumCdrPossDup=ruckusCGFNumCdrPossDup, ruckusCGFNumCdrRlsReq=ruckusCGFNumCdrRlsReq, ruckusCGFNumCdrCnclReq=ruckusCGFNumCdrCnclReq, ruckusCGFNumDrtrReqSnt=ruckusCGFNumDrtrReqSnt, ruckusCGFNumDrtrSucRspRcvd=ruckusCGFNumDrtrSucRspRcvd, ruckusCGFNumDrtrFailRspRcvd=ruckusCGFNumDrtrFailRspRcvd, ruckusCGFIndex=ruckusCGFIndex, ruckusGTPUInfo=ruckusGTPUInfo, ruckusGTPUTable=ruckusGTPUTable, ruckusGTPUEntry=ruckusGTPUEntry, ruckusGTPUGgsnIPAddr=ruckusGTPUGgsnIPAddr, ruckusGTPUTxPkts=ruckusGTPUTxPkts, ruckusGTPUTxBytes=ruckusGTPUTxBytes, ruckusGTPURxPkts=ruckusGTPURxPkts, ruckusGTPURxBytes=ruckusGTPURxBytes, ruckusGTPUTxDrops=ruckusGTPUTxDrops, ruckusGTPURxDrops=ruckusGTPURxDrops, ruckusGTPUNumBadGTPU=ruckusGTPUNumBadGTPU, ruckusGTPUNumRXTeidInvalid=ruckusGTPUNumRXTeidInvalid, ruckusGTPUNumTXTeidInvalid=ruckusGTPUNumTXTeidInvalid, ruckusGTPUNumOfEchoRX=ruckusGTPUNumOfEchoRX, ruckusGTPUIndex=ruckusGTPUIndex, ruckusGGSNGTPCInfo=ruckusGGSNGTPCInfo, ruckusGGSNGTPCTable=ruckusGGSNGTPCTable, ruckusGGSNGTPCEntry=ruckusGGSNGTPCEntry, ruckusGGSNGTPCGgsnIp=ruckusGGSNGTPCGgsnIp, ruckusGGSNGTPCNumActPdp=ruckusGGSNGTPCNumActPdp, ruckusGGSNGTPCSuccPdpCrt=ruckusGGSNGTPCSuccPdpCrt, ruckusGGSNGTPCFailPdpCrt=ruckusGGSNGTPCFailPdpCrt, ruckusGGSNGTPCSuccPdpUpdRcvd=ruckusGGSNGTPCSuccPdpUpdRcvd, ruckusGGSNGTPCFailPdpUpdRcvd=ruckusGGSNGTPCFailPdpUpdRcvd, ruckusGGSNGTPCSuccPdpUpdInitRM=ruckusGGSNGTPCSuccPdpUpdInitRM, ruckusGGSNGTPCFailPdpUpdInitRM=ruckusGGSNGTPCFailPdpUpdInitRM, ruckusGGSNGTPCSuccPdpUpdInitAAA=ruckusGGSNGTPCSuccPdpUpdInitAAA, ruckusGGSNGTPCFailPdpUpdInitAAA=ruckusGGSNGTPCFailPdpUpdInitAAA, ruckusGGSNGTPCSuccPdpUpdInitHLR=ruckusGGSNGTPCSuccPdpUpdInitHLR, ruckusGGSNGTPCFailPdpUpdInitHLR=ruckusGGSNGTPCFailPdpUpdInitHLR, ruckusGGSNGTPCSuccDelPdpRcvd=ruckusGGSNGTPCSuccDelPdpRcvd, ruckusGGSNGTPCFailDelPdpRcvd=ruckusGGSNGTPCFailDelPdpRcvd, ruckusGGSNGTPCSuccDelPdpInitErr=ruckusGGSNGTPCSuccDelPdpInitErr, ruckusGGSNGTPCFailDelPdpInitErr=ruckusGGSNGTPCFailDelPdpInitErr, ruckusGGSNGTPCSuccDelPdpInitDM=ruckusGGSNGTPCSuccDelPdpInitDM, ruckusGGSNGTPCFailDelPdpInitDM=ruckusGGSNGTPCFailDelPdpInitDM, ruckusGGSNGTPCSuccDelPdpInitHLR=ruckusGGSNGTPCSuccDelPdpInitHLR, ruckusGGSNGTPCFailDelPdpInitHLR=ruckusGGSNGTPCFailDelPdpInitHLR, ruckusGGSNGTPCSuccDelPdpInitSCG=ruckusGGSNGTPCSuccDelPdpInitSCG, ruckusGGSNGTPCFailDelPdpInitSCG=ruckusGGSNGTPCFailDelPdpInitSCG, ruckusGGSNGTPCSuccDelPdpInitAP=ruckusGGSNGTPCSuccDelPdpInitAP, ruckusGGSNGTPCFailDelPdpInitAP=ruckusGGSNGTPCFailDelPdpInitAP, ruckusGGSNGTPCSuccDelPdpInitD=ruckusGGSNGTPCSuccDelPdpInitD, ruckusGGSNGTPCFailDelPdpInitD=ruckusGGSNGTPCFailDelPdpInitD, ruckusGGSNGTPCSuccDelPdpInitClnt=ruckusGGSNGTPCSuccDelPdpInitClnt, ruckusGGSNGTPCFailDelPdpInitClnt=ruckusGGSNGTPCFailDelPdpInitClnt, ruckusGGSNGTPCIndex=ruckusGGSNGTPCIndex, ruckusHLRInfo=ruckusHLRInfo, ruckusHLRTable=ruckusHLRTable, ruckusHLREntry=ruckusHLREntry, ruckusHLRHlrSrvcName=ruckusHLRHlrSrvcName)
mibBuilder.exportSymbols("RUCKUS-SCG-TTG-MIB", ruckusHLRNumSucAuthInfoReqSim=ruckusHLRNumSucAuthInfoReqSim, ruckusHLRNumAuthInfoRqErrHlrSim=ruckusHLRNumAuthInfoRqErrHlrSim, ruckusHLRNumAuthInfoRqTmotSim=ruckusHLRNumAuthInfoRqTmotSim, ruckusHLRNumSucAuthInfoReqAka=ruckusHLRNumSucAuthInfoReqAka, ruckusHLRNumAuthInfoRqErrHlrAka=ruckusHLRNumAuthInfoRqErrHlrAka, ruckusHLRNumAuthInfoRqTmotAka=ruckusHLRNumAuthInfoRqTmotAka, ruckusHLRNumUpdGprsSuccSim=ruckusHLRNumUpdGprsSuccSim, ruckusHLRNumUpdGprsFailErrSim=ruckusHLRNumUpdGprsFailErrSim, ruckusHLRNumUpdGprsFailTmoSim=ruckusHLRNumUpdGprsFailTmoSim, ruckusHLRNumUpdGprsSuccAka=ruckusHLRNumUpdGprsSuccAka, ruckusHLRNumUpdGprsFailErrAka=ruckusHLRNumUpdGprsFailErrAka, ruckusHLRNumUpdGprsFailTmoAka=ruckusHLRNumUpdGprsFailTmoAka, ruckusHLRNumRstDtaSuccSim=ruckusHLRNumRstDtaSuccSim, ruckusHLRNumRstDtaFailErrHlrSim=ruckusHLRNumRstDtaFailErrHlrSim, ruckusHLRNumRstDtaFailTmoSim=ruckusHLRNumRstDtaFailTmoSim, ruckusHLRNumRstDtaSuccAka=ruckusHLRNumRstDtaSuccAka, ruckusHLRNumRstDtaFailErrHlrAka=ruckusHLRNumRstDtaFailErrHlrAka, ruckusHLRNumRstDtaFailTmoAka=ruckusHLRNumRstDtaFailTmoAka, ruckusHLRNumInsrtDtaSuccSim=ruckusHLRNumInsrtDtaSuccSim, ruckusHLRNumInsrtDtaFailSim=ruckusHLRNumInsrtDtaFailSim, ruckusHLRNumInsrtDtaSuccAka=ruckusHLRNumInsrtDtaSuccAka, ruckusHLRNumInsrtDtaFailAka=ruckusHLRNumInsrtDtaFailAka, ruckusHLRNumSaInsrtDtaSucc=ruckusHLRNumSaInsrtDtaSucc, ruckusHLRNumSaInsrtDtaFailUnkS=ruckusHLRNumSaInsrtDtaFailUnkS, ruckusHLRNumSaInsrtDtaFailErr=ruckusHLRNumSaInsrtDtaFailErr, ruckusHLRNumCfgAssoc=ruckusHLRNumCfgAssoc, ruckusHLRNumActAssoc=ruckusHLRNumActAssoc, ruckusHLRNumRtgFail=ruckusHLRNumRtgFail, ruckusHLRIndex=ruckusHLRIndex)
| 91.084711 | 6,264 | 0.78149 | 4,589 | 44,085 | 7.506864 | 0.063848 | 0.020668 | 0.014717 | 0.017998 | 0.370577 | 0.364829 | 0.358501 | 0.358501 | 0.35345 | 0.153531 | 0 | 0.086313 | 0.08597 | 44,085 | 483 | 6,265 | 91.273292 | 0.768607 | 0.007417 | 0 | 0.322581 | 1 | 0.002151 | 0.126343 | 0.067892 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.012903 | 0 | 0.012903 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
2339b2319d21cbc5b65c99d5a35baa432000799c | 1,529 | py | Python | admit/xmlio/bdpTest.py | astroumd/admit | bbf3d79bb6e1a6f7523553ed8ede0d358d106f2c | [
"MIT"
] | 4 | 2017-03-01T17:26:28.000Z | 2022-03-03T19:23:06.000Z | admit/xmlio/bdpTest.py | teuben/admit | 1cae54d1937c9af3f719102838df716e7e6d655c | [
"MIT"
] | 48 | 2016-10-04T01:25:33.000Z | 2021-09-08T14:51:10.000Z | admit/xmlio/bdpTest.py | teuben/admit | 1cae54d1937c9af3f719102838df716e7e6d655c | [
"MIT"
] | 2 | 2016-11-10T14:10:22.000Z | 2017-03-30T18:58:05.000Z | #! /usr/bin/env python
from admit.bdp import *
import admit.xmlio.dtdGenerator as dtdGenerator
import admit.xmlio.Parser as Parser
import numpy as np
if __name__ == "__main__" :
dtdGenerator.generate()
print "Creating initial class"
cs = CubeStats.CubeStats()
print "Setting initial values"
cs.set("project","cx369")
cs.set("mous","test")
cs.set("sous","test2")
cs.set("date","13-09-10")
cs.set("UID","123456789")
cs.set("xmlFile","cs.225.xml")
cs.stats.setData([[1,2,3,4],[5,6,7,8]])
cs.stats.setColumns(["col1","col2","col3","col4"])
print "Writing xml file"
cs.write()
print "Reading xml file into new class"
p = Parser.Parser(None,"cs.225.xml")
b = p.parse()
print "\n\nComparing classes"
print cs.project,b.project
if(cs.project == b.project) :
print " project OK"
print cs.mous,b.mous
if(cs.mous == b.mous) :
print " mous OK"
print cs.sous,b.sous
if(cs.sous == b.sous) :
print " sous OK"
print cs.date,b.date
if(cs.date == b.date) :
print " date OK"
print cs.UID,b.UID
if(cs.UID == b.UID) :
print " UID OK"
print cs.xmlFile,b.xmlFile
if(cs.xmlFile == b.xmlFile) :
print " xmlFile OK"
print cs.stats.columns,b.stats.columns
if(cs.stats.columns == b.stats.columns) :
print " Columns OK"
print cs.stats.data,b.stats.data
if((cs.stats.data == b.stats.data).all()) :
print " Data OK"
| 26.824561 | 54 | 0.584696 | 226 | 1,529 | 3.920354 | 0.327434 | 0.063205 | 0.071106 | 0.038375 | 0.108352 | 0.108352 | 0 | 0 | 0 | 0 | 0 | 0.032456 | 0.254415 | 1,529 | 56 | 55 | 27.303571 | 0.744737 | 0.013734 | 0 | 0 | 0 | 0 | 0.201725 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.085106 | null | null | 0.446809 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
234388e79da91646410a32c231a800b9c9dbd109 | 337 | py | Python | WordRPG/systems/character/slot.py | ChristopherLBruce/WordRPG | e545cf313afc430e8191a7c813db9ee9759a6fd4 | [
"Apache-2.0"
] | 2 | 2018-12-15T15:06:35.000Z | 2022-02-09T00:19:28.000Z | WordRPG/systems/character/slot.py | ChristopherLBruce/WordRPG | e545cf313afc430e8191a7c813db9ee9759a6fd4 | [
"Apache-2.0"
] | null | null | null | WordRPG/systems/character/slot.py | ChristopherLBruce/WordRPG | e545cf313afc430e8191a7c813db9ee9759a6fd4 | [
"Apache-2.0"
] | null | null | null | class Slot:
def __init__(name, _type=None, item=None):
self.name = name,
if _type is not None:
self.type = _type
else:
self.type = name
self.item = item,
def equip(self):
pass
def unequip(self):
pass
def show(self):
pass
| 14.652174 | 46 | 0.47181 | 39 | 337 | 3.897436 | 0.435897 | 0.157895 | 0.144737 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.442137 | 337 | 22 | 47 | 15.318182 | 0.808511 | 0 | 0 | 0.214286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0.214286 | 0 | 0 | 0.357143 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
234a322c817ddc13e41f0d62246fabe1be6dde72 | 676 | py | Python | quiz/models.py | Raul-Azahares/unit | eb0c11f6efc56cfccdecea1dc4b425e8c0765878 | [
"MIT"
] | null | null | null | quiz/models.py | Raul-Azahares/unit | eb0c11f6efc56cfccdecea1dc4b425e8c0765878 | [
"MIT"
] | null | null | null | quiz/models.py | Raul-Azahares/unit | eb0c11f6efc56cfccdecea1dc4b425e8c0765878 | [
"MIT"
] | null | null | null | from django.db import models
# Crea tus modelos de preguntas y respuestas para el quiz aqui.
class Answer(models.Model):
text = models.CharField(max_length=500, verbose_name="respuesta")
def __unicode__(self):
return self.text
class Meta:
verbose_name = 'Respuesta'
verbose_name_plural = 'Respuestas'
class Question(models.Model):
text = models.CharField(max_length=300, verbose_name="pregunta")
answer = models.ForeignKey(Answer, verbose_name="respuesta", null=True, blank=True)
def __unicode__(self):
return self.text
class Meta:
verbose_name = 'Pregunta'
verbose_name_plural = 'Preguntas' | 26 | 87 | 0.696746 | 83 | 676 | 5.445783 | 0.481928 | 0.170354 | 0.132743 | 0.09292 | 0.384956 | 0.384956 | 0.384956 | 0.212389 | 0.212389 | 0.212389 | 0 | 0.011236 | 0.210059 | 676 | 26 | 88 | 26 | 0.835206 | 0.090237 | 0 | 0.375 | 0 | 0 | 0.100977 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.0625 | 0.125 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 2 |
234b7e484c385b53202efc2de7cebe72acfc242c | 480 | py | Python | migrations/versions/1050_add_admin_manager_role.py | uk-gov-mirror/alphagov.digitalmarketplace-api | 5a1db63691d0c4a435714837196ab6914badaf62 | [
"MIT"
] | 25 | 2015-01-14T10:45:13.000Z | 2021-05-26T17:21:41.000Z | migrations/versions/1050_add_admin_manager_role.py | uk-gov-mirror/alphagov.digitalmarketplace-api | 5a1db63691d0c4a435714837196ab6914badaf62 | [
"MIT"
] | 641 | 2015-01-15T11:10:50.000Z | 2021-06-15T22:18:42.000Z | migrations/versions/1050_add_admin_manager_role.py | uk-gov-mirror/alphagov.digitalmarketplace-api | 5a1db63691d0c4a435714837196ab6914badaf62 | [
"MIT"
] | 22 | 2015-06-13T15:37:45.000Z | 2021-08-19T23:40:49.000Z | """Add admin-manager role
Revision ID: 1050
Revises: 1040
Create Date: 2017-11-21 11:20:00.000000
"""
# revision identifiers, used by Alembic.
revision = '1050'
down_revision = '1040'
from alembic import op
def upgrade():
op.execute("COMMIT") # See: http://stackoverflow.com/a/30910417/15720
op.execute("ALTER TYPE user_roles_enum ADD VALUE IF NOT EXISTS 'admin-manager' AFTER 'admin-ccs-sourcing';")
def downgrade():
# Cannot remove user role value
pass
| 20 | 112 | 0.7125 | 70 | 480 | 4.842857 | 0.742857 | 0.070796 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1225 | 0.166667 | 480 | 23 | 113 | 20.869565 | 0.725 | 0.441667 | 0 | 0 | 0 | 0.125 | 0.418605 | 0.081395 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.125 | 0.125 | 0 | 0.375 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
234d7e5a30a3331056a29c2623f76f58b47c2913 | 500 | py | Python | tests/test_models.py | abitrolly/stellar5 | 15b2904fa36c8acbe188324f7e58032e81f2484e | [
"MIT"
] | 932 | 2015-01-01T16:51:32.000Z | 2022-03-14T05:12:52.000Z | tests/test_models.py | abitrolly/stellar5 | 15b2904fa36c8acbe188324f7e58032e81f2484e | [
"MIT"
] | 43 | 2015-01-05T13:31:30.000Z | 2021-10-12T17:24:07.000Z | tests/test_models.py | abitrolly/stellar5 | 15b2904fa36c8acbe188324f7e58032e81f2484e | [
"MIT"
] | 64 | 2015-01-02T14:44:22.000Z | 2021-12-10T18:47:44.000Z | from stellar.models import get_unique_hash, Table, Snapshot
def test_get_unique_hash():
assert get_unique_hash()
assert get_unique_hash() != get_unique_hash()
assert len(get_unique_hash()) == 32
def test_table():
table = Table(
table_name='hapsu',
snapshot=Snapshot(
snapshot_name='snapshot',
project_name='myproject',
hash='3330484d0a70eecab84554b5576b4553'
)
)
assert len(table.get_table_name('master')) == 24
| 25 | 59 | 0.65 | 57 | 500 | 5.368421 | 0.368421 | 0.176471 | 0.254902 | 0.186275 | 0.166667 | 0.166667 | 0.166667 | 0 | 0 | 0 | 0 | 0.071429 | 0.244 | 500 | 19 | 60 | 26.315789 | 0.738095 | 0 | 0 | 0 | 0 | 0 | 0.12 | 0.064 | 0 | 0 | 0 | 0 | 0.266667 | 1 | 0.133333 | false | 0 | 0.066667 | 0 | 0.2 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
234df647dd90abb64fceb047aeae050fd0a9bdd4 | 72 | py | Python | _solutions/intermediate/datetime/datetime_timedelta_a.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null | _solutions/intermediate/datetime/datetime_timedelta_a.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null | _solutions/intermediate/datetime/datetime_timedelta_a.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null |
duration = ARMSTRONG - GAGARIN
result = round(duration.days / YEAR, 1)
| 18 | 39 | 0.722222 | 9 | 72 | 5.777778 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016667 | 0.166667 | 72 | 3 | 40 | 24 | 0.85 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
2353182ccc2d0ee08a6404b25b4a9f86ac9e93d7 | 295 | py | Python | main.py | danieldanuega/fastapi-graphql | d97ae9f85b3ac74fd765a2cc258bb21c991d4655 | [
"MIT"
] | 2 | 2021-10-03T05:44:22.000Z | 2021-12-10T10:25:04.000Z | main.py | danieldanuega/fastapi-graphql | d97ae9f85b3ac74fd765a2cc258bb21c991d4655 | [
"MIT"
] | null | null | null | main.py | danieldanuega/fastapi-graphql | d97ae9f85b3ac74fd765a2cc258bb21c991d4655 | [
"MIT"
] | 1 | 2021-12-10T10:25:06.000Z | 2021-12-10T10:25:06.000Z | from fastapi import FastAPI
import graphene
from starlette.graphql import GraphQLApp
from schema import Query, Mutation
app = FastAPI()
app.add_route(
"/graphiql", GraphQLApp(schema=graphene.Schema(query=Query, mutation=Mutation))
)
@app.get("/")
def main():
return {"Hello": "World"} | 21.071429 | 83 | 0.738983 | 37 | 295 | 5.864865 | 0.540541 | 0.119816 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.132203 | 295 | 14 | 84 | 21.071429 | 0.847656 | 0 | 0 | 0 | 0 | 0 | 0.067568 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.090909 | false | 0 | 0.363636 | 0.090909 | 0.545455 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
235525129082cff5841370425e1f8b69a61f9a3f | 856 | py | Python | speech_analysis/text_analysis.py | tngaspar/speech-analysis | a1bdca0b7465c2da0743cc02992da643b556a3fc | [
"MIT"
] | null | null | null | speech_analysis/text_analysis.py | tngaspar/speech-analysis | a1bdca0b7465c2da0743cc02992da643b556a3fc | [
"MIT"
] | null | null | null | speech_analysis/text_analysis.py | tngaspar/speech-analysis | a1bdca0b7465c2da0743cc02992da643b556a3fc | [
"MIT"
] | null | null | null | import re
from nltk.stem import WordNetLemmatizer
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk.util import ngrams
from collections import Counter
def filter_text(text):
"""Returns a filtered version of a str ready for analysis
Args:
text (str): string of a speech
Returns:
str: filtered string of a speech
"""
# remove all puntuation and uppercases
text = re.sub("[^a-zA-Z]+", " ", text).lower()
# lemmatize text
lemmatizer = WordNetLemmatizer()
text = lemmatizer.lemmatize(text)
# remove common english stop words
stop_words = set(stopwords.words('english'))
word_tokens = word_tokenize(text)
filtered_tokens = [w for w in word_tokens if w not in stop_words]
# return str of filtered text
return " ".join(filtered_tokens) | 27.612903 | 69 | 0.690421 | 115 | 856 | 5.06087 | 0.452174 | 0.054983 | 0.030928 | 0.051546 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.23014 | 856 | 31 | 70 | 27.612903 | 0.883156 | 0.300234 | 0 | 0 | 0 | 0 | 0.033333 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.071429 | false | 0 | 0.428571 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
236ebb416538f56b0b8a6ba021077f8b19cdff44 | 336 | py | Python | test/mitmproxy/console/test_common.py | johnsoft/mitmproxy | d133b8baeeefa04fa6bdf43c39be822def013a6b | [
"MIT"
] | null | null | null | test/mitmproxy/console/test_common.py | johnsoft/mitmproxy | d133b8baeeefa04fa6bdf43c39be822def013a6b | [
"MIT"
] | null | null | null | test/mitmproxy/console/test_common.py | johnsoft/mitmproxy | d133b8baeeefa04fa6bdf43c39be822def013a6b | [
"MIT"
] | 1 | 2020-11-07T08:54:29.000Z | 2020-11-07T08:54:29.000Z | from mitmproxy.test import tflow
from mitmproxy.tools.console import common
from ...conftest import skip_appveyor
@skip_appveyor
def test_format_flow():
f = tflow.tflow(resp=True)
assert common.format_flow(f, True)
assert common.format_flow(f, True, hostheader=True)
assert common.format_flow(f, True, extended=True)
| 25.846154 | 55 | 0.764881 | 49 | 336 | 5.102041 | 0.408163 | 0.16 | 0.176 | 0.264 | 0.356 | 0.356 | 0.356 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 336 | 12 | 56 | 28 | 0.868056 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | 1 | 0.111111 | false | 0 | 0.333333 | 0 | 0.444444 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
88ba8573ff378b4f6440be0b930e84e7fad00121 | 346 | py | Python | duckdb_builder.py | pjotrscholtze/trident | 865da68fff21d31490acc24db2f4b6bde0b80796 | [
"Apache-2.0"
] | null | null | null | duckdb_builder.py | pjotrscholtze/trident | 865da68fff21d31490acc24db2f4b6bde0b80796 | [
"Apache-2.0"
] | null | null | null | duckdb_builder.py | pjotrscholtze/trident | 865da68fff21d31490acc24db2f4b6bde0b80796 | [
"Apache-2.0"
] | null | null | null | import build.trident as trident
import sys, json
print("loading db")
db = trident.Db("/var/scratch/pse740/db/dbpedia-times-details", "/var/scratch/pse740/db/duckdb/dbpedia.duckdb")
print("aa")
schema = db.extract_schema()
print("bb")
with open("/var/scratch/pse740/db/duckdb/dbpedia.schema.json", "w") as f:
json.dump(schema, f)
sys.exit(0)
| 28.833333 | 111 | 0.725434 | 56 | 346 | 4.464286 | 0.482143 | 0.12 | 0.192 | 0.216 | 0.248 | 0.248 | 0 | 0 | 0 | 0 | 0 | 0.031746 | 0.089595 | 346 | 11 | 112 | 31.454545 | 0.761905 | 0 | 0 | 0 | 0 | 0 | 0.439306 | 0.395954 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 0.3 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
88bf65e3d7fb472948387f6dfc7989867485df7d | 492 | py | Python | app/pydantic_schemas.py | mikey-no/cert_tool | 7a3dc671d3b7d62eab25194e23c13b09071d4ed1 | [
"MIT"
] | 1 | 2022-02-20T14:03:12.000Z | 2022-02-20T14:03:12.000Z | app/pydantic_schemas.py | mikey-no/cert_tool | 7a3dc671d3b7d62eab25194e23c13b09071d4ed1 | [
"MIT"
] | null | null | null | app/pydantic_schemas.py | mikey-no/cert_tool | 7a3dc671d3b7d62eab25194e23c13b09071d4ed1 | [
"MIT"
] | null | null | null | import pathlib
from typing import List, Optional
from pydantic import BaseModel
class CSRPydanticModel(BaseModel):
common_name: str
prefix: str
csr: str
san: Optional[List[str]]
class RootCertInfoModel(BaseModel):
root_cert_subject: str
root_cert_not_valid_before: str
root_cert_not_valid_after: str
root_cert_serial_number: str
root_cert_extensions: str
class CAInfoModel(BaseModel):
common_name: str
prefix: str
location: pathlib.Path
| 18.923077 | 35 | 0.75 | 64 | 492 | 5.5 | 0.46875 | 0.113636 | 0.125 | 0.125 | 0.284091 | 0.176136 | 0 | 0 | 0 | 0 | 0 | 0 | 0.195122 | 492 | 25 | 36 | 19.68 | 0.888889 | 0 | 0 | 0.222222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.166667 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
88d56c328f605192c7b99f686b939d984f53fa3e | 8,736 | py | Python | src/ptpip/constants/object/property_type.py | DethCount/ptpip-d5300 | ed2f8a46600f2bb3330a7e5f4d5d47cf93fc10bd | [
"MIT"
] | null | null | null | src/ptpip/constants/object/property_type.py | DethCount/ptpip-d5300 | ed2f8a46600f2bb3330a7e5f4d5d47cf93fc10bd | [
"MIT"
] | null | null | null | src/ptpip/constants/object/property_type.py | DethCount/ptpip-d5300 | ed2f8a46600f2bb3330a7e5f4d5d47cf93fc10bd | [
"MIT"
] | null | null | null | from enum import Enum
class ObjectPropertyType(Enum):
Undefined = 0x0000 # 0
WirelessConfigurationFile = 0xB104
BuyFlag = 0xD901
# MTP Object Prop Code 0xDC00..0xDFFF
StorageID = 0xDC01 # 56321
ObjectFormat = 0xDC02 # 56322 @see ObjectFormat
ProtectionStatus = 0xDC03 # 56323 @see OnOffProperty
ObjectSize = 0xDC04 # 56324
AssociationType = 0xDC05
AssociationDesc = 0xDC06
ObjectFilename = 0xDC07 # 56327
DateCreated = 0xDC08 # 56328
DateModified = 0xDC09 # 56329
Keywords = 0xDC0A
ParentObject = 0xDC0B # 56331
AllowedFolderContents = 0xDC0C
Hidden = 0xDC0D
SystemObject = 0xDC0E
PersistentUniqueObjectIdentifier = 0xDC41 # 56385
SyncID = 0xDC42
PropertyBag = 0xDC43
Name = 0xDC44 # 56388
CreatedBy = 0xDC45
Artist = 0xDC46
DateAuthored = 0xDC47
Description = 0xDC48
URLReference = 0xDC49
LanguageLocale = 0xDC4A
CopyrightInformation = 0xDC4B
Source = 0xDC4C
OriginLocation = 0xDC4D
DateAdded = 0xDC4E
NonConsumable = 0xDC4F
CorruptOrUnplayable = 0xDC50
ProducerSerialNumber = 0xDC51
RepresentativeSampleFormat = 0xDC81 # 56449 @see ObjectFormat
RepresentativeSampleSize = 0xDC82 # 56450
RepresentativeSampleHeight = 0xDC83 # 56451
RepresentativeSampleWidth = 0xDC84 # 56452
RepresentativeSampleDuration = 0xDC85
RepresentativeSampleData = 0xDC86 # 56454
Width = 0xDC87 # 56455
Height = 0xDC88 # 56456
Duration = 0xDC89 # 56457
Rating = 0xDC8A
Track = 0xDC8B
Genre = 0xDC8C
Credits = 0xDC8D
Lyrics = 0xDC8E
SubscriptionContentID = 0xDC8F
ProducedBy = 0xDC90
UseCount = 0xDC91
SkipCount = 0xDC92
LastAccessed = 0xDC93
ParentalRating = 0xDC94
MetaGenre = 0xDC95
Composer = 0xDC96
EffectiveRating = 0xDC97
Subtitle = 0xDC98
OriginalReleaseDate = 0xDC99
AlbumName = 0xDC9A
AlbumArtist = 0xDC9B
Mood = 0xDC9C
DRMStatus = 0xDC9D
SubDescription = 0xDC9E
IsCropped = 0xDCD1
IsColorCorrected = 0xDCD2
ImageBitDepth = 0xDCD3 # 56531 @see ImageBitDepth
Fnumber = 0xDCD4
ExposureTime = 0xDCD5
ExposureIndex = 0xDCD6
DisplayName = 0xDCE0
BodyText = 0xDCE1
Subject = 0xDCE2
Priority = 0xDCE3
GivenName = 0xDD00
MiddleNames = 0xDD01
FamilyName = 0xDD02
Prefix = 0xDD03
Suffix = 0xDD04
PhoneticGivenName = 0xDD05
PhoneticFamilyName = 0xDD06
EmailPrimary = 0xDD07
EmailPersonal1 = 0xDD08
EmailPersonal2 = 0xDD09
EmailBusiness1 = 0xDD0A
EmailBusiness2 = 0xDD0B
EmailOthers = 0xDD0C
PhoneNumberPrimary = 0xDD0D
PhoneNumberPersonal = 0xDD0E
PhoneNumberPersonal2 = 0xDD0F
PhoneNumberBusiness = 0xDD10
PhoneNumberBusiness2 = 0xDD11
PhoneNumberMobile = 0xDD12
PhoneNumberMobile2 = 0xDD13
FaxNumberPrimary = 0xDD14
FaxNumberPersonal = 0xDD15
FaxNumberBusiness = 0xDD16
PagerNumber = 0xDD17
PhoneNumberOthers = 0xDD18
PrimaryWebAddress = 0xDD19
PersonalWebAddress = 0xDD1A
BusinessWebAddress = 0xDD1B
InstantMessengerAddress = 0xDD1C
InstantMessengerAddress2 = 0xDD1D
InstantMessengerAddress3 = 0xDD1E
PostalAddressPersonalFull = 0xDD1F
PostalAddressPersonalFullLine1 = 0xDD20
PostalAddressPersonalFullLine2 = 0xDD21
PostalAddressPersonalFullCity = 0xDD22
PostalAddressPersonalFullRegion = 0xDD23
PostalAddressPersonalFullPostalCode = 0xDD24
PostalAddressPersonalFullCountry = 0xDD25
PostalAddressBusinessFull = 0xDD26
PostalAddressBusinessLine1 = 0xDD27
PostalAddressBusinessLine2 = 0xDD28
PostalAddressBusinessCity = 0xDD29
PostalAddressBusinessRegion = 0xDD2A
PostalAddressBusinessPostalCode = 0xDD2B
PostalAddressBusinessCountry = 0xDD2C
PostalAddressOtherFull = 0xDD2D
PostalAddressOtherLine1 = 0xDD2E
PostalAddressOtherLine2 = 0xDD2F
PostalAddressOtherCity = 0xDD30
PostalAddressOtherRegion = 0xDD31
PostalAddressOtherPostalCode = 0xDD32
PostalAddressOtherCountry = 0xDD33
OrganizationName = 0xDD34
PhoneticOrganizationName = 0xDD35
Role = 0xDD36
Birthdate = 0xDD37
MessageTo = 0xDD40
MessageCC = 0xDD41
MessageBCC = 0xDD42
MessageRead = 0xDD43
MessageReceivedTime = 0xDD44
MessageSender = 0xDD45
ActivityBeginTime = 0xDD50
ActivityEndTime = 0xDD51
ActivityLocation = 0xDD52
ActivityRequiredAttendees = 0xDD54
ActivityOptionalAttendees = 0xDD55
ActivityResources = 0xDD56
ActivityAccepted = 0xDD57
Owner = 0xDD5D
Editor = 0xDD5E
Webmaster = 0xDD5F
URLSource = 0xDD60
URLDestination = 0xDD61
TimeBookmark = 0xDD62
ObjectBookmark = 0xDD63
ByteBookmark = 0xDD64
LastBuildDate = 0xDD70
TimetoLive = 0xDD71
MediaGUID = 0xDD72
TotalBitRate = 0xDE91
BitRateType = 0xDE92
SampleRate = 0xDE93 # 56979 @see SampleRate
NumberOfChannels = 0xDE94 # 56980 @see NumberOfChannels
AudioBitDepth = 0xDE95
ScanType = 0xDE97 # 56983 @see ScanType
AudioWAVECodec = 0xDE99
AudioBitRate = 0xDE9A # 56986
VideoFourCCCode = 0xDE9B # 56987 @see VideoFourCCCode
VideoBitRate = 0xDE9C # 56988
FramesPerMilliseconds = 0xDE9D
KeyframeDistance = 0xDE9E
BufferSize = 0xDE9F
EncodingQuality = 0xDEA0
EncodingProfile = 0xDEA1
| 48.265193 | 78 | 0.44391 | 393 | 8,736 | 9.867684 | 0.959288 | 0.007736 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.145584 | 0.532166 | 8,736 | 180 | 79 | 48.533333 | 0.803279 | 0.038233 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121089 | 0 | 0 | 1 | 0 | false | 0 | 0.005848 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
88d959107cd44ebfd61ba81cc58548676b6e69f2 | 514 | py | Python | Bidding/forms.py | Ishikashah2510/nirvaas_main | 5eaf92756d06261a7f555b10aad864a34c9e761b | [
"MIT"
] | null | null | null | Bidding/forms.py | Ishikashah2510/nirvaas_main | 5eaf92756d06261a7f555b10aad864a34c9e761b | [
"MIT"
] | null | null | null | Bidding/forms.py | Ishikashah2510/nirvaas_main | 5eaf92756d06261a7f555b10aad864a34c9e761b | [
"MIT"
] | 3 | 2020-12-30T11:35:22.000Z | 2021-01-07T13:10:26.000Z | from django import forms
from welcome.models import Users
from django.contrib.auth.models import User
from Bidding.models import *
class Sell_Form(forms.Form):
item_name = forms.CharField(label='Item Name')
item_description = forms.CharField(max_length=1000, default='',label='Item Description')
item_photo = forms.ImageField(label='Upload Photo of Item')
threshold_value = forms.FloatField(label='Base Value')
class Make_Bid(forms.Form):
bid_value = forms.FloatField(label='Enter Bid Value') | 39.538462 | 92 | 0.766537 | 72 | 514 | 5.361111 | 0.472222 | 0.093264 | 0.103627 | 0.129534 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008909 | 0.126459 | 514 | 13 | 93 | 39.538462 | 0.85078 | 0 | 0 | 0 | 0 | 0 | 0.135922 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.363636 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
88e0c5bd65e06f9b108254c7c5f2ed78a06ce6b0 | 72 | py | Python | commands/__init__.py | Nichodon/Democracy-Bot | 708613944b25f7331b18153e5f90c18f44e38aff | [
"MIT"
] | null | null | null | commands/__init__.py | Nichodon/Democracy-Bot | 708613944b25f7331b18153e5f90c18f44e38aff | [
"MIT"
] | 8 | 2018-05-12T17:11:04.000Z | 2020-02-24T22:28:23.000Z | commands/__init__.py | UnsignedByte/Democracy-Bot | da37e8428ea7252712d7c2f8771f06658afdb990 | [
"MIT"
] | null | null | null | __all__ = ['setup', 'elections', 'proposals', 'utilities', 'enforcing']
| 36 | 71 | 0.666667 | 6 | 72 | 7.333333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.097222 | 72 | 1 | 72 | 72 | 0.676923 | 0 | 0 | 0 | 0 | 0 | 0.569444 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
88f02cefa349f834ee823699c17d2fbaa2e1e0d7 | 791 | py | Python | necrobot/racebot/__init__.py | pancelor/necrobot | 03003f0b4208c4e952cfa6b41a33d30480a351d7 | [
"MIT"
] | 8 | 2016-01-15T00:28:55.000Z | 2020-02-10T21:23:11.000Z | necrobot/racebot/__init__.py | pancelor/necrobot | 03003f0b4208c4e952cfa6b41a33d30480a351d7 | [
"MIT"
] | 12 | 2017-01-01T22:14:54.000Z | 2021-02-10T00:09:51.000Z | necrobot/racebot/__init__.py | pancelor/necrobot | 03003f0b4208c4e952cfa6b41a33d30480a351d7 | [
"MIT"
] | 18 | 2016-02-05T22:19:46.000Z | 2020-02-12T05:11:57.000Z | """
This very high-level module determines/implements the specific behavior of the "standard" Necrobot running on the Crypt
of the Necrobot server.
Package Requirements
--------------------
botbase
util
daily
race
stats
user
Dependencies
------------
mainchannel
botbase/
cmd_admin
daily/
cmd_daily
racebot/
cmd_seedgen
cmd_color
cmd_role
race/
cmd_racemake
cmd_racestats
user/
cmd_user
pmbotchannel
botbase/
cmd_admin
daily/
cmd_daily
racebot/
cmd_seedgen
race/
cmd_racemake
cmd_racestats
user/
cmd_user
""" | 18.833333 | 120 | 0.501896 | 71 | 791 | 5.394366 | 0.507042 | 0.02611 | 0.078329 | 0.104439 | 0.43342 | 0.43342 | 0.43342 | 0.43342 | 0.234987 | 0 | 0 | 0 | 0.4311 | 791 | 42 | 121 | 18.833333 | 0.851111 | 0.989886 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
88f32cb584a82e0827e95bb7ae3cb09328f0d5a3 | 570 | py | Python | hashgen/algorithms.py | romerodiesan/password-generator | 955b8e897082d86a640766c74b3c3297baffe00d | [
"MIT"
] | 3 | 2021-11-26T19:52:16.000Z | 2021-11-27T01:20:36.000Z | hashgen/algorithms.py | romerodiesan/password-generator | 955b8e897082d86a640766c74b3c3297baffe00d | [
"MIT"
] | null | null | null | hashgen/algorithms.py | romerodiesan/password-generator | 955b8e897082d86a640766c74b3c3297baffe00d | [
"MIT"
] | null | null | null | import bcrypt
import hashlib
from hashgen.utilities import string_generator_and_encoding
class Algorithms:
def __init__(self, algorithm, difficulty) -> None:
self.algorithm = algorithm
self.difficulty = difficulty
def bcrypt_gen(self, difficulty):
string = string_generator_and_encoding(difficulty=difficulty)
return bcrypt.hashpw(string, bcrypt.gensalt()).decode('utf-8')
def gen(self, algorithm, difficulty):
string = string_generator_and_encoding(difficulty=difficulty)
return hashlib.new(name=algorithm, data=string).hexdigest() | 30 | 66 | 0.77193 | 67 | 570 | 6.358209 | 0.432836 | 0.105634 | 0.126761 | 0.183099 | 0.319249 | 0.319249 | 0.319249 | 0.319249 | 0.319249 | 0 | 0 | 0.002033 | 0.136842 | 570 | 19 | 67 | 30 | 0.863821 | 0 | 0 | 0.153846 | 0 | 0 | 0.008757 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0 | 0.230769 | 0 | 0.692308 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
88f919ad3b4182008a2c9af566db1e29cae0261e | 870 | py | Python | database/models/move.py | Sytten/artis | fd407b4558212c435abf8f697ea7891c5375a10e | [
"MIT"
] | 6 | 2018-12-17T19:43:26.000Z | 2021-12-19T22:49:13.000Z | database/models/move.py | Sytten/artis | fd407b4558212c435abf8f697ea7891c5375a10e | [
"MIT"
] | null | null | null | database/models/move.py | Sytten/artis | fd407b4558212c435abf8f697ea7891c5375a10e | [
"MIT"
] | 1 | 2019-09-19T05:30:53.000Z | 2019-09-19T05:30:53.000Z | from sqlalchemy import Column, Integer, DateTime, String, Enum, Numeric, ForeignKey
from sqlalchemy.orm import relationship
from database.models.coins import Coins
from database.models.markets import Markets
from database.models.status import Status
from database.models.base import Base
class Move(Base):
__tablename__ = 'moves'
id = Column(Integer, primary_key=True)
#transaction_id = Column(Integer, ForeignKey(Transaction.id))
#transaction = relationship(Transaction, backref='moves')
created = Column(DateTime)
updated = Column(DateTime)
origin = Column(Enum(Markets))
destination = Column(Enum(Markets))
amount = Column(Numeric(25, 18))
coin = Column(Enum(Coins))
status = Column(Enum(Status))
error = Column(String)
def __repr__(self):
return "<Move(id='%s', status='%s')>" % (self.id, self.status)
| 33.461538 | 83 | 0.718391 | 105 | 870 | 5.857143 | 0.4 | 0.078049 | 0.117073 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00551 | 0.165517 | 870 | 25 | 84 | 34.8 | 0.841598 | 0.133333 | 0 | 0 | 0 | 0 | 0.043883 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.052632 | false | 0 | 0.315789 | 0.052632 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
001109e36a3744e62834fed1080bf902694a1603 | 916 | py | Python | datasets/utils.py | creaiter/Quantization-Implementations | 8e97ae9b91dbd3f02ebeccc05d12aee241d252d4 | [
"MIT"
] | 2 | 2021-10-12T06:09:55.000Z | 2022-01-28T08:17:13.000Z | datasets/utils.py | creaiter/Quantization-Implementations | 8e97ae9b91dbd3f02ebeccc05d12aee241d252d4 | [
"MIT"
] | null | null | null | datasets/utils.py | creaiter/Quantization-Implementations | 8e97ae9b91dbd3f02ebeccc05d12aee241d252d4 | [
"MIT"
] | null | null | null | import torchvision.transforms as transforms
def change_normalize(cfg, dataset):
if hasattr(dataset, 'normalize'):
if cfg.dataset not in ds.keys():
raise Warning(f'There is no change in the normalization of {cfg.dataset} dataset for quantized inference.')
dataset.normarlize = ds[cfg.dataset]['normalize']
ds = {
'cifar10': {'normalize': transforms.Normalize(
mean=[125/255, 123/255, 114/255],
std=[0.2023, 0.1994, 0.2010])},
'cifar100': {'normalize': transforms.Normalize(
mean=[129/255, 124/255, 112/255],
std=[0.2673, 0.2564, 0.2762])},
'imagenet': {'normalize': transforms.Normalize(
mean=[124/255, 116/255, 104/255],
std=[0.229, 0.224, 0.225])},
}
| 41.636364 | 119 | 0.508734 | 99 | 916 | 4.69697 | 0.525253 | 0.086022 | 0.180645 | 0.206452 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.171477 | 0.356987 | 916 | 21 | 120 | 43.619048 | 0.617997 | 0 | 0 | 0 | 0 | 0 | 0.171397 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.058824 | false | 0 | 0.058824 | 0 | 0.117647 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
0011a81863f3674c8679e290ec6883830eae8618 | 319 | py | Python | infusionsoft/contrib/django/apps.py | theY4Kman/infusionsoft-api | 3171171432dfcf291fc291ae39b47250b07dbb4c | [
"Apache-2.0"
] | 8 | 2017-04-13T01:37:24.000Z | 2020-07-30T01:03:02.000Z | infusionsoft/contrib/django/apps.py | theY4Kman/infusionsoft-api | 3171171432dfcf291fc291ae39b47250b07dbb4c | [
"Apache-2.0"
] | 12 | 2017-04-11T18:18:18.000Z | 2021-06-13T02:05:28.000Z | infusionsoft/contrib/django/apps.py | theY4Kman/infusionsoft-api | 3171171432dfcf291fc291ae39b47250b07dbb4c | [
"Apache-2.0"
] | 3 | 2017-07-24T04:50:34.000Z | 2017-07-25T08:35:33.000Z | import os
from django.apps import AppConfig
from infusionsoft.contrib.django.initialize import initialize
class InfusionsoftAppConfig(AppConfig):
name = 'infusionsoft'
verbose_name = 'Infusionsoft'
path = os.path.join(os.path.dirname(__file__), '__init__.py')
def ready(self):
initialize()
| 21.266667 | 65 | 0.733542 | 36 | 319 | 6.25 | 0.611111 | 0.142222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.169279 | 319 | 14 | 66 | 22.785714 | 0.849057 | 0 | 0 | 0 | 0 | 0 | 0.109718 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.333333 | 0 | 0.888889 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
001e3606cf017ee9b09d1a628bef770a6fab2627 | 237 | py | Python | exercises-and-answers/chapter2-analysis/code-examples/2.4-anagram-etection/solution3-brute-force.py | robrac/algorithms-exercises-with-python | 5780171517eacc1c7133fdc32cf079623cd14cf9 | [
"MIT"
] | null | null | null | exercises-and-answers/chapter2-analysis/code-examples/2.4-anagram-etection/solution3-brute-force.py | robrac/algorithms-exercises-with-python | 5780171517eacc1c7133fdc32cf079623cd14cf9 | [
"MIT"
] | null | null | null | exercises-and-answers/chapter2-analysis/code-examples/2.4-anagram-etection/solution3-brute-force.py | robrac/algorithms-exercises-with-python | 5780171517eacc1c7133fdc32cf079623cd14cf9 | [
"MIT"
] | null | null | null | """
Project: algorithms-exercises-using-python
Created by robin1885@github on 17-2-20.
"""
def anagram_solution3(s1, s2):
"""
@rtype : bool
@param s1: str1
@param s2: str2
@return: True or False
"""
pass | 13.941176 | 42 | 0.607595 | 31 | 237 | 4.612903 | 0.903226 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.090909 | 0.257384 | 237 | 17 | 43 | 13.941176 | 0.721591 | 0.637131 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0.5 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
003937a12c02710ba00cb34459411c60a44e1491 | 1,293 | py | Python | src/sact/epoch/interfaces.py | 0k/sact.epoch | 6b0a47068992ff6a73f0f1da36090affad7c8be0 | [
"BSD-3-Clause"
] | null | null | null | src/sact/epoch/interfaces.py | 0k/sact.epoch | 6b0a47068992ff6a73f0f1da36090affad7c8be0 | [
"BSD-3-Clause"
] | null | null | null | src/sact/epoch/interfaces.py | 0k/sact.epoch | 6b0a47068992ff6a73f0f1da36090affad7c8be0 | [
"BSD-3-Clause"
] | null | null | null |
from zope.interface import Interface, Attribute
class ITimeZone(Interface):
"""Standard TimeZone interface as defined in datetime module"""
def utcoffset(dt):
"""Return offset of local time from UTC, in minutes"""
def dst(dt):
"""Return the daylight saving time (DST) adjustment, in minutes"""
def tzname(dt):
"""Return the time zone name corresponding to the datetime object dt"""
class ITime(Interface):
"""Factory to make time object.
minimal interface
"""
def now():
"""Return a time object that represent the current time"""
class IClock(Interface):
"""Factory to make time object.
minimal interface
"""
def time():
"""Return a time object that represent the current time"""
class IManageableClock(IClock):
is_running = Attribute(
u"Freeze the return result of now() command")
def set(date):
"""Set the result of now() command to date"""
def stop():
"""Freeze the return result of now() command"""
def start():
"""Unfreeze the return result of now() command"""
def wait(timelapse=None, days=0, hours=0, minutes=0, seconds=0):
"""Shortcut to alter_now relative
Should accept negative value also.
"""
| 21.55 | 79 | 0.629544 | 162 | 1,293 | 5.012346 | 0.444444 | 0.049261 | 0.054187 | 0.08867 | 0.371921 | 0.371921 | 0.371921 | 0.334975 | 0.246305 | 0.12069 | 0 | 0.004184 | 0.260634 | 1,293 | 59 | 80 | 21.915254 | 0.845188 | 0.485692 | 0 | 0 | 0 | 0 | 0.072566 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5625 | false | 0 | 0.0625 | 0 | 0.9375 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
003992e10166dc58a065d114c2a2b6c6861ab099 | 5,871 | py | Python | quotapolicyd/database.py | Anthchirp/postfix-quota-policyd | 12c18d2826dcb7bb811a590019731f06bc9b3f12 | [
"Apache-2.0"
] | null | null | null | quotapolicyd/database.py | Anthchirp/postfix-quota-policyd | 12c18d2826dcb7bb811a590019731f06bc9b3f12 | [
"Apache-2.0"
] | null | null | null | quotapolicyd/database.py | Anthchirp/postfix-quota-policyd | 12c18d2826dcb7bb811a590019731f06bc9b3f12 | [
"Apache-2.0"
] | null | null | null | import MySQLdb
import MySQLdb.cursors
import threading
class DBLink():
def __init__(self):
# Set some sensible defaults
self.defaults = {
'--db-host': '127.0.0.1',
'--db-port': 3306,
'--db-user': 'quotapolicyd',
'--db-pass': 'quotapolicyd',
'--db-name': 'quotapolicyd'
}
# Effective configuration
self.config = {}
self._connected = False
self._db = None
# single-threaded database access
self._lock = threading.Lock()
def connect(self):
with self._lock:
if self._connected: return
kwargs = { 'cursorclass': MySQLdb.cursors.DictCursor }
for kw, val in [('host', '--db-host'),
('port', '--db-port'),
('user', '--db-user'),
('passwd', '--db-pass'),
('db', '--db-name'),
('read_default_file', '--db-conf')]:
set_value = self.config.get(val, self.defaults.get(val))
if set_value is not None:
kwargs[kw] = set_value
self._db = MySQLdb.connect(**kwargs)
self._db.raise_on_warnings = True
self._connected = True
def is_connected(self):
return self._connected
def get_user_info(self, username):
self.connect()
with self._lock:
try:
c=self._db.cursor()
c.execute("""SELECT username,
smtplogin.username IS NULL AS unseen,
smtplogin.locked,
smtplogin.password != auth.password AS reset,
smtplogin.authcount,
smtplogin.limit,
smtplogin.dynlimit,
smtplogin.lastseen
FROM auth
LEFT OUTER JOIN smtplogin USING (username, source)
WHERE username=%s""", (username,))
result = c.fetchone()
return result
except MySQLdb.MySQLError, e:
# TODO: errors should be handled properly at some point
print e
return None
finally:
c.close()
def create_user(self, username):
self.connect()
with self._lock:
try:
c=self._db.cursor()
c.execute("""INSERT INTO smtplogin
(username, source, password, authcount, lastseen)
SELECT username, source, password, 1, NOW()
FROM auth
WHERE username=%s""", (username,))
self._db.commit()
return True
except MySQLdb.MySQLError, e:
# TODO: errors should be handled properly at some point
print e
return False
finally:
c.close()
def increment_user(self, username):
self.connect()
with self._lock:
try:
c=self._db.cursor()
c.execute("""UPDATE smtplogin
SET authcount = authcount + 1, lastseen = NOW()
WHERE username=%s""", (username,))
self._db.commit()
return True
except MySQLdb.MySQLError, e:
# TODO: errors should be handled properly at some point
print e
return False
finally:
c.close()
def increment_lock_user(self, username):
self.connect()
with self._lock:
try:
c=self._db.cursor()
c.execute("""UPDATE smtplogin
SET authcount = authcount + 1, lastseen = NOW(), locked = 'Y'
WHERE username=%s""", (username,))
self._db.commit()
return True
except MySQLdb.MySQLError, e:
# TODO: errors should be handled properly at some point
print e
return False
finally:
c.close()
def unlock_user_increase_limit(self, username, newlimit):
self.connect()
with self._lock:
try:
c=self._db.cursor()
c.execute("""UPDATE smtplogin
SET locked = 'N', dynlimit = %s, password = (
SELECT password
FROM auth
WHERE username = %s
)
WHERE username=%s""", (newlimit, username, username))
self._db.commit()
return True
except MySQLdb.MySQLError, e:
# TODO: errors should be handled properly at some point
print e
return False
finally:
c.close()
def _set_parameter(self, option, opt, value, parser):
'''callback function for optionparser'''
del option, parser # unused
self.config[opt] = value
if opt == '--db-conf':
self.defaults = {}
def add_command_line_options(self, optparser):
'''function to inject command line parameters'''
optparser.add_option('--db-host', metavar='HOST',
default=self.defaults.get('--db-host'),
help='MySQL host address, default %default',
type='string', nargs=1,
action='callback', callback=self._set_parameter)
optparser.add_option('--db-port', metavar='PORT',
default=self.defaults.get('--db-port'),
help='MySQL host port, default %default',
type='int', nargs=1,
action='callback', callback=self._set_parameter)
optparser.add_option('--db-user', metavar='USER',
default=self.defaults.get('--db-user'),
help='MySQL user, default %default',
type='string', nargs=1,
action='callback', callback=self._set_parameter)
optparser.add_option('--db-pass', metavar='PASS',
default=self.defaults.get('--db-pass'),
help='MySQL password, default %default',
type='string', nargs=1,
action='callback', callback=self._set_parameter)
optparser.add_option('--db-name', metavar='DB',
default=self.defaults.get('--db-name'),
help='MySQL database name, default %default',
type='string', nargs=1,
action='callback', callback=self._set_parameter)
optparser.add_option('--db-conf', metavar='CNF',
default=self.defaults.get('--db-conf'),
help='MySQL configuration file containing connection information, disables MySQL default values',
type='string', nargs=1,
action='callback', callback=self._set_parameter)
| 32.081967 | 103 | 0.589848 | 669 | 5,871 | 5.076233 | 0.218236 | 0.021201 | 0.030919 | 0.035336 | 0.505595 | 0.454358 | 0.454358 | 0.454358 | 0.454358 | 0.454358 | 0 | 0.004503 | 0.281383 | 5,871 | 182 | 104 | 32.258242 | 0.800427 | 0.061148 | 0 | 0.465409 | 0 | 0 | 0.304581 | 0 | 0 | 0 | 0 | 0.005495 | 0 | 0 | null | null | 0.062893 | 0.018868 | null | null | 0.031447 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
004dac555520076c883cd498a1d172a5550a08e9 | 3,367 | py | Python | helper.py | nhardy/etude-04 | be71213d6dc35472b5a07622e818e3f33a263e8a | [
"MIT"
] | null | null | null | helper.py | nhardy/etude-04 | be71213d6dc35472b5a07622e818e3f33a263e8a | [
"MIT"
] | null | null | null | helper.py | nhardy/etude-04 | be71213d6dc35472b5a07622e818e3f33a263e8a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Etude 04
Authors:
"""
import sys
_TOTAL_DISTANCE = 2413
class Can:
CAPACITY = 20
def __init__(self):
self._fuel = 0
def fill(self, amount: float):
self._fuel = min(self.CAPACITY, self._fuel + amount)
return self
def remove(self, amount: float) -> float:
if amount <= self._fuel:
self._fuel = self._fuel - amount
return amount
else:
removed = self._fuel
self._fuel = 0
return removed
@property
def fuel(self):
return self._fuel
class Vehicle:
_CAPACITY = 60
MAX_CANS = 4
_KM_PER_LITRE = 12
def __init__(self):
self._fuel = 0
self._position = 0
self._cans = []
def fill(self, amount: float):
assert self._fuel + amount <= self._CAPACITY
self._fuel += amount
def move(self, distance: float):
fuel_consumed = abs(distance) / self._KM_PER_LITRE
assert fuel_consumed <= self._fuel
self._fuel -= fuel_consumed
self._position += distance
def is_empty(self) -> bool:
return self._fuel == 0
@property
def position(self):
return self._position
def pickup_cans(self, cans: list) -> list:
amount = sum([can.fuel for can in cans])
assert sum([can.fuel for can in self._cans]) + amount <= Can.CAPACITY * self.MAX_CANS
previous = len(self._cans)
new = len(cans)
n_cans, excess = divmod(amount, Can.CAPACITY)
self._cans = [Can().fill(Can.CAPACITY) for _ in range(n_cans)]
if excess > 0:
self._cans.append([Can().fill(excess))
return [Can() for _ in range(previous + new - self.MAX_CANS)]
def remove_cans(self, amount: float) -> list:
assert amount <= sum([can.fuel for can in self._cans])
previous = len(self._cans)
n_cans, excess = divmod(amount, Can.CAPACITY)
class Desert:
def __init__(self):
self._cans = {}
def pickup_fuel(self, position, amount) -> float:
if position == 0:
return amount
assert position in self._cans
assert amount <= sum([can.fuel for can in self._cans[position]])
amount_to_remove = amount
for can in cans:
remove = min(amount_to_remove, can.fuel)
amount_to_remove -= remove
can.remove(remove)
def put_can(self, position: float, can):
if position not in self._cans:
self._cans[position] = []
self._cans[position].append(can)
def pickup_cans(self, position: float, amount: float) -> list:
assert position in self._cans
assert amount <= sum([can.fuel for can in self._cans[position]])
cans = []
pass
def q1():
d = Desert()
v = Vehicle()
v.fill(d.pickup_fuel(v.position, 60))
v.move(360)
v.move(-360)
assert v.is_empty()
print('Q1 passed')
def q2():
d = Desert()
v = Vehicle()
v.fill(d.pickup_fuel(v.position, 60))
v.pickup_cans([Can().fill(Can.CAPACITY) for _ in range(Vehicle.MAX_CANS)])
v.move(360)
assert v.position == _TOTAL_DISTANCE
print('Q2 passed')
def q3():
pass
def q4():
pass
def q5():
pass
def main():
q1()
q2()
q3()
q4()
q5()
if __name__ == '__main__':
main()
| 23.061644 | 93 | 0.579745 | 439 | 3,367 | 4.232346 | 0.177677 | 0.068891 | 0.037675 | 0.034984 | 0.354144 | 0.265877 | 0.244349 | 0.231432 | 0.142088 | 0.142088 | 0 | 0.019566 | 0.301752 | 3,367 | 145 | 94 | 23.22069 | 0.770736 | 0 | 0 | 0.299065 | 0 | 0 | 0.007831 | 0 | 0 | 0 | 0 | 0 | 0.093458 | 0 | null | null | 0.056075 | 0.009346 | null | null | 0.018692 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
cc61a6cf5b7cc41fe8f6e03c8a314709e9295da2 | 433 | py | Python | apps/misc/forms.py | HON95/studlan | 8dc38c64d0060506d865b9c834466fed2f9f9571 | [
"MIT"
] | 9 | 2016-03-15T21:03:49.000Z | 2020-12-02T19:45:44.000Z | apps/misc/forms.py | HON95/studlan | 8dc38c64d0060506d865b9c834466fed2f9f9571 | [
"MIT"
] | 161 | 2016-02-05T14:11:50.000Z | 2020-10-14T10:13:21.000Z | apps/misc/forms.py | HON95/studlan | 8dc38c64d0060506d865b9c834466fed2f9f9571 | [
"MIT"
] | 11 | 2016-07-27T12:20:05.000Z | 2021-04-18T05:49:17.000Z | # -*- coding: utf-8 -*-
from django.forms.utils import ErrorList
from django.utils.safestring import mark_safe
class InlineSpanErrorList(ErrorList):
def __unicode__(self):
return self.as_spans()
def as_spans(self):
if not self:
return u''
return mark_safe(''.join([u'<span class="help-inline alert alert-error">{0}</span>'.format(e) for e in self])) # noqa: S308, S703: Potential XSS
| 28.866667 | 153 | 0.658199 | 60 | 433 | 4.616667 | 0.65 | 0.072202 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.023324 | 0.207852 | 433 | 14 | 154 | 30.928571 | 0.784257 | 0.122402 | 0 | 0 | 0 | 0 | 0.143236 | 0.061008 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.222222 | 0.111111 | 0.888889 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
cc6d7da3dd27bf1ac8883abc5c63c58c69ed18c1 | 5,539 | py | Python | ooobuild/lo/sdbc/result_set.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/sdbc/result_set.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/sdbc/result_set.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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.
#
# Service Class
# this is a auto generated file generated by Cheetah
# Libre Office Version: 7.3
# Namespace: com.sun.star.sdbc
from abc import abstractproperty
from ..beans.x_property_set import XPropertySet as XPropertySet_bc180bfa
from ..lang.x_component import XComponent as XComponent_98dc0ab5
from .x_closeable import XCloseable as XCloseable_98290a86
from .x_column_locate import XColumnLocate as XColumnLocate_ba5e0bc2
from .x_result_set import XResultSet as XResultSet_98e30aa7
from .x_result_set_meta_data_supplier import XResultSetMetaDataSupplier as XResultSetMetaDataSupplier_777010fc
from .x_result_set_update import XResultSetUpdate as XResultSetUpdate_e0fb0d0a
from .x_row import XRow as XRow_5f360834
from .x_row_update import XRowUpdate as XRowUpdate_989c0a97
from .x_warnings_supplier import XWarningsSupplier as XWarningsSupplier_ef210d99
class ResultSet(XPropertySet_bc180bfa, XComponent_98dc0ab5, XCloseable_98290a86, XColumnLocate_ba5e0bc2, XResultSet_98e30aa7, XResultSetMetaDataSupplier_777010fc, XResultSetUpdate_e0fb0d0a, XRow_5f360834, XRowUpdate_989c0a97, XWarningsSupplier_ef210d99):
"""
Service Class
provides access to a table of data.
A ResultSet object is usually generated by executing a Statement.
A ResultSet maintains a cursor pointing to its current row of data. Initially the cursor is positioned before the first row. The \"next\" method moves the cursor to the next row.
The getXXX methods retrieve column values for the current row. You can retrieve values using either the index number of the column. Columns are numbered from 1.
For maximum portability, ResultSet columns within each row should be read in left-to-right order and each column should be read only once.
For the getXXX methods, the SDBC driver attempts to convert the underlying data to the specified type and returns a suitable value.
Column names used as input to the findColumn method are case insensitive. When several columns have the same name, then the value of the first matching column will be returned. The column name option is designed to be used when column names are used in the SQL query. For columns that are NOT explicitly named in the query, it is best to use column numbers. If column names are used, there is no way for the programmer to guarantee that they actually refer to the intended columns.
A ResultSet is automatically closed (disposed) by the Statement that generated it when that Statement is closed, re-executed, or used to retrieve the next result from a sequence of multiple results.
The number, types, and properties of a ResultSet's columns are provided by the ResultSetMetaData object returned by the getMetaData method.
See Also:
`API ResultSet <https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1sdbc_1_1ResultSet.html>`_
"""
__ooo_ns__: str = 'com.sun.star.sdbc'
__ooo_full_ns__: str = 'com.sun.star.sdbc.ResultSet'
__ooo_type_name__: str = 'service'
@abstractproperty
def CursorName(self) -> str:
"""
defines the SQL cursor name that will be used by subsequent Statement execute methods.
This name can then be used in SQL positioned update/delete statements to identify the current row in the ResultSet generated by this statement. If the database doesn't support positioned update/delete, this property is a noop. To ensure that a cursor has the proper isolation level to support updates, the cursor's SELECT statement should be of the form \"select for update ...\". If the \"for update\" phrase is omitted, positioned updates may fail.
Note: By definition, positioned update/delete execution must be done by a different Statement than the one which generated the ResultSet being used for positioning. Also, cursor names must be unique within a connection.
"""
@abstractproperty
def FetchDirection(self) -> int:
"""
retrieves the direction for fetching rows from database tables that is the default for result sets generated from this com.sun.star.sdbcx.Statement object.
If this Statement object has not set a fetch direction, the return value is implementation-specific.
"""
@abstractproperty
def FetchSize(self) -> int:
"""
retrieves the number of result set rows that is the default fetch size for result sets generated from this com.sun.star.sdbcx.Statement object.
If this com.sun.star.sdbcx.Statement object has not set a fetch size, the return value is implementation-specific.
"""
@abstractproperty
def ResultSetConcurrency(self) -> int:
"""
retrieves the result set concurrency.
"""
@abstractproperty
def ResultSetType(self) -> int:
"""
determines the result set type.
"""
__all__ = ['ResultSet']
| 53.259615 | 485 | 0.757176 | 786 | 5,539 | 5.245547 | 0.380407 | 0.009702 | 0.014553 | 0.010187 | 0.087073 | 0.087073 | 0.077856 | 0.059665 | 0.032016 | 0.032016 | 0 | 0.026416 | 0.193537 | 5,539 | 103 | 486 | 53.776699 | 0.896575 | 0.672324 | 0 | 0.192308 | 0 | 0 | 0.039526 | 0.017787 | 0 | 0 | 0 | 0 | 0 | 1 | 0.192308 | false | 0 | 0.423077 | 0 | 0.769231 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
cc79e2691a1fd6e960c81dd4103cde9e0ebb8789 | 86 | py | Python | lesson_4_work/Ex_8.py | NaychukAnastasiya/goiteens-python3-naychuk | a79d0af238a15f58a822bb5d8e4d48227d4a7bc1 | [
"MIT"
] | null | null | null | lesson_4_work/Ex_8.py | NaychukAnastasiya/goiteens-python3-naychuk | a79d0af238a15f58a822bb5d8e4d48227d4a7bc1 | [
"MIT"
] | null | null | null | lesson_4_work/Ex_8.py | NaychukAnastasiya/goiteens-python3-naychuk | a79d0af238a15f58a822bb5d8e4d48227d4a7bc1 | [
"MIT"
] | null | null | null | players = ["Ярослав", "Бенджамін", "Євген", "Саша"]
for el in players:
print(el) | 28.666667 | 52 | 0.616279 | 11 | 86 | 4.818182 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.186047 | 86 | 3 | 53 | 28.666667 | 0.757143 | 0 | 0 | 0 | 0 | 0 | 0.294118 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
cc820f34465bae2386200ee38974bfd50fc296c5 | 273 | py | Python | Random Drafts/rolling a dice.py | Kevinskwk/ILP | 7a3925a22232d486a5a8f5df8255f9297fd73fec | [
"MIT"
] | 1 | 2020-07-09T23:10:56.000Z | 2020-07-09T23:10:56.000Z | Random Drafts/rolling a dice.py | Kevinskwk/ILP | 7a3925a22232d486a5a8f5df8255f9297fd73fec | [
"MIT"
] | null | null | null | Random Drafts/rolling a dice.py | Kevinskwk/ILP | 7a3925a22232d486a5a8f5df8255f9297fd73fec | [
"MIT"
] | null | null | null | import random
def dice():
return random.randint(1,6)
n=100000
l=[0,0,0,0,0,0]
r=[0,0,0,0,0,0]
for i in range(n):
l[dice()-1]+=1
s=0
a=1/6.0
for x in range(2):
r[x]=l[x]/float(n)
s+=(abs(r[x]-a))**2
s=s/6.0
print l
print r
print s
| 11.869565 | 31 | 0.505495 | 67 | 273 | 2.059701 | 0.358209 | 0.144928 | 0.173913 | 0.173913 | 0.086957 | 0.086957 | 0 | 0 | 0 | 0 | 0 | 0.149254 | 0.263736 | 273 | 22 | 32 | 12.409091 | 0.537313 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.058824 | null | null | 0.176471 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
cc8ee3c957665dddb6b146bbfbdac775422e7b75 | 13,199 | py | Python | firebird/base/config_pb2.py | FirebirdSQL/python3-base | 541ed8df8d52467d03cc2ebc5f3f72aa93a29ab1 | [
"MIT"
] | 2 | 2020-05-29T09:51:26.000Z | 2020-10-19T10:42:59.000Z | firebird/base/config_pb2.py | FirebirdSQL/python3-base | 541ed8df8d52467d03cc2ebc5f3f72aa93a29ab1 | [
"MIT"
] | null | null | null | firebird/base/config_pb2.py | FirebirdSQL/python3-base | 541ed8df8d52467d03cc2ebc5f3f72aa93a29ab1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: firebird/base/config.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='firebird/base/config.proto',
package='firebird.base',
syntax='proto3',
serialized_options=None,
serialized_pb=b'\n\x1a\x66irebird/base/config.proto\x12\rfirebird.base\x1a\x19google/protobuf/any.proto\"\xf0\x01\n\x05Value\x12\x13\n\tas_string\x18\x02 \x01(\tH\x00\x12\x12\n\x08\x61s_bytes\x18\x03 \x01(\x0cH\x00\x12\x11\n\x07\x61s_bool\x18\x04 \x01(\x08H\x00\x12\x13\n\tas_double\x18\x05 \x01(\x01H\x00\x12\x12\n\x08\x61s_float\x18\x06 \x01(\x02H\x00\x12\x13\n\tas_sint32\x18\x07 \x01(\x11H\x00\x12\x13\n\tas_sint64\x18\x08 \x01(\x12H\x00\x12\x13\n\tas_uint32\x18\t \x01(\rH\x00\x12\x13\n\tas_uint64\x18\n \x01(\x04H\x00\x12&\n\x06\x61s_msg\x18\x0b \x01(\x0b\x32\x14.google.protobuf.AnyH\x00\x42\x06\n\x04kind\"\x93\x02\n\x0b\x43onfigProto\x12\x38\n\x07options\x18\x01 \x03(\x0b\x32\'.firebird.base.ConfigProto.OptionsEntry\x12\x38\n\x07\x63onfigs\x18\x02 \x03(\x0b\x32\'.firebird.base.ConfigProto.ConfigsEntry\x1a\x44\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.firebird.base.Value:\x02\x38\x01\x1aJ\n\x0c\x43onfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.firebird.base.ConfigProto:\x02\x38\x01\x62\x06proto3'
,
dependencies=[google_dot_protobuf_dot_any__pb2.DESCRIPTOR,])
_VALUE = _descriptor.Descriptor(
name='Value',
full_name='firebird.base.Value',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='as_string', full_name='firebird.base.Value.as_string', index=0,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='as_bytes', full_name='firebird.base.Value.as_bytes', index=1,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=b"",
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='as_bool', full_name='firebird.base.Value.as_bool', index=2,
number=4, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='as_double', full_name='firebird.base.Value.as_double', index=3,
number=5, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='as_float', full_name='firebird.base.Value.as_float', index=4,
number=6, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='as_sint32', full_name='firebird.base.Value.as_sint32', index=5,
number=7, type=17, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='as_sint64', full_name='firebird.base.Value.as_sint64', index=6,
number=8, type=18, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='as_uint32', full_name='firebird.base.Value.as_uint32', index=7,
number=9, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='as_uint64', full_name='firebird.base.Value.as_uint64', index=8,
number=10, type=4, cpp_type=4, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='as_msg', full_name='firebird.base.Value.as_msg', index=9,
number=11, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
_descriptor.OneofDescriptor(
name='kind', full_name='firebird.base.Value.kind',
index=0, containing_type=None, fields=[]),
],
serialized_start=73,
serialized_end=313,
)
_CONFIGPROTO_OPTIONSENTRY = _descriptor.Descriptor(
name='OptionsEntry',
full_name='firebird.base.ConfigProto.OptionsEntry',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='key', full_name='firebird.base.ConfigProto.OptionsEntry.key', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='value', full_name='firebird.base.ConfigProto.OptionsEntry.value', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=b'8\001',
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=447,
serialized_end=515,
)
_CONFIGPROTO_CONFIGSENTRY = _descriptor.Descriptor(
name='ConfigsEntry',
full_name='firebird.base.ConfigProto.ConfigsEntry',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='key', full_name='firebird.base.ConfigProto.ConfigsEntry.key', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='value', full_name='firebird.base.ConfigProto.ConfigsEntry.value', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=b'8\001',
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=517,
serialized_end=591,
)
_CONFIGPROTO = _descriptor.Descriptor(
name='ConfigProto',
full_name='firebird.base.ConfigProto',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='options', full_name='firebird.base.ConfigProto.options', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='configs', full_name='firebird.base.ConfigProto.configs', index=1,
number=2, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[_CONFIGPROTO_OPTIONSENTRY, _CONFIGPROTO_CONFIGSENTRY, ],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=316,
serialized_end=591,
)
_VALUE.fields_by_name['as_msg'].message_type = google_dot_protobuf_dot_any__pb2._ANY
_VALUE.oneofs_by_name['kind'].fields.append(
_VALUE.fields_by_name['as_string'])
_VALUE.fields_by_name['as_string'].containing_oneof = _VALUE.oneofs_by_name['kind']
_VALUE.oneofs_by_name['kind'].fields.append(
_VALUE.fields_by_name['as_bytes'])
_VALUE.fields_by_name['as_bytes'].containing_oneof = _VALUE.oneofs_by_name['kind']
_VALUE.oneofs_by_name['kind'].fields.append(
_VALUE.fields_by_name['as_bool'])
_VALUE.fields_by_name['as_bool'].containing_oneof = _VALUE.oneofs_by_name['kind']
_VALUE.oneofs_by_name['kind'].fields.append(
_VALUE.fields_by_name['as_double'])
_VALUE.fields_by_name['as_double'].containing_oneof = _VALUE.oneofs_by_name['kind']
_VALUE.oneofs_by_name['kind'].fields.append(
_VALUE.fields_by_name['as_float'])
_VALUE.fields_by_name['as_float'].containing_oneof = _VALUE.oneofs_by_name['kind']
_VALUE.oneofs_by_name['kind'].fields.append(
_VALUE.fields_by_name['as_sint32'])
_VALUE.fields_by_name['as_sint32'].containing_oneof = _VALUE.oneofs_by_name['kind']
_VALUE.oneofs_by_name['kind'].fields.append(
_VALUE.fields_by_name['as_sint64'])
_VALUE.fields_by_name['as_sint64'].containing_oneof = _VALUE.oneofs_by_name['kind']
_VALUE.oneofs_by_name['kind'].fields.append(
_VALUE.fields_by_name['as_uint32'])
_VALUE.fields_by_name['as_uint32'].containing_oneof = _VALUE.oneofs_by_name['kind']
_VALUE.oneofs_by_name['kind'].fields.append(
_VALUE.fields_by_name['as_uint64'])
_VALUE.fields_by_name['as_uint64'].containing_oneof = _VALUE.oneofs_by_name['kind']
_VALUE.oneofs_by_name['kind'].fields.append(
_VALUE.fields_by_name['as_msg'])
_VALUE.fields_by_name['as_msg'].containing_oneof = _VALUE.oneofs_by_name['kind']
_CONFIGPROTO_OPTIONSENTRY.fields_by_name['value'].message_type = _VALUE
_CONFIGPROTO_OPTIONSENTRY.containing_type = _CONFIGPROTO
_CONFIGPROTO_CONFIGSENTRY.fields_by_name['value'].message_type = _CONFIGPROTO
_CONFIGPROTO_CONFIGSENTRY.containing_type = _CONFIGPROTO
_CONFIGPROTO.fields_by_name['options'].message_type = _CONFIGPROTO_OPTIONSENTRY
_CONFIGPROTO.fields_by_name['configs'].message_type = _CONFIGPROTO_CONFIGSENTRY
DESCRIPTOR.message_types_by_name['Value'] = _VALUE
DESCRIPTOR.message_types_by_name['ConfigProto'] = _CONFIGPROTO
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
Value = _reflection.GeneratedProtocolMessageType('Value', (_message.Message,), {
'DESCRIPTOR' : _VALUE,
'__module__' : 'firebird.base.config_pb2'
# @@protoc_insertion_point(class_scope:firebird.base.Value)
})
_sym_db.RegisterMessage(Value)
ConfigProto = _reflection.GeneratedProtocolMessageType('ConfigProto', (_message.Message,), {
'OptionsEntry' : _reflection.GeneratedProtocolMessageType('OptionsEntry', (_message.Message,), {
'DESCRIPTOR' : _CONFIGPROTO_OPTIONSENTRY,
'__module__' : 'firebird.base.config_pb2'
# @@protoc_insertion_point(class_scope:firebird.base.ConfigProto.OptionsEntry)
})
,
'ConfigsEntry' : _reflection.GeneratedProtocolMessageType('ConfigsEntry', (_message.Message,), {
'DESCRIPTOR' : _CONFIGPROTO_CONFIGSENTRY,
'__module__' : 'firebird.base.config_pb2'
# @@protoc_insertion_point(class_scope:firebird.base.ConfigProto.ConfigsEntry)
})
,
'DESCRIPTOR' : _CONFIGPROTO,
'__module__' : 'firebird.base.config_pb2'
# @@protoc_insertion_point(class_scope:firebird.base.ConfigProto)
})
_sym_db.RegisterMessage(ConfigProto)
_sym_db.RegisterMessage(ConfigProto.OptionsEntry)
_sym_db.RegisterMessage(ConfigProto.ConfigsEntry)
_CONFIGPROTO_OPTIONSENTRY._options = None
_CONFIGPROTO_CONFIGSENTRY._options = None
# @@protoc_insertion_point(module_scope)
| 42.304487 | 1,104 | 0.751951 | 1,761 | 13,199 | 5.312323 | 0.09824 | 0.045323 | 0.032068 | 0.044896 | 0.703474 | 0.669375 | 0.569856 | 0.558311 | 0.554249 | 0.554249 | 0 | 0.040453 | 0.115994 | 13,199 | 311 | 1,105 | 42.440514 | 0.761313 | 0.035003 | 0 | 0.594306 | 1 | 0.007117 | 0.192111 | 0.136403 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.017794 | 0 | 0.017794 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
cc995593c99cb84dc604088d73174c08b6c5721e | 2,047 | py | Python | Framework/base/ManagerDictionary.py | jonreding2010/MAQS.Python | 43f73784fa9f0ab46545b0275fa8de38d86c76ed | [
"MIT"
] | null | null | null | Framework/base/ManagerDictionary.py | jonreding2010/MAQS.Python | 43f73784fa9f0ab46545b0275fa8de38d86c76ed | [
"MIT"
] | null | null | null | Framework/base/ManagerDictionary.py | jonreding2010/MAQS.Python | 43f73784fa9f0ab46545b0275fa8de38d86c76ed | [
"MIT"
] | null | null | null |
from Framework.base import BaseTest
class ManagerDictionary():
# Get the driver for the associated driver manager
# @param T Type of driver
# @param key Key for the manager
# @returns The managed driver
def get_Driver(self, driverType, key):
return driverType.key.Get()
# Get a driver
# @param T The type of driver
# @param U The type of driver manager
# @returns The driver</returns>
def GetDriver(self, driverType, driverManager):
# where U : DriverManager
return self[type(driverManager).FullName].Get()
# Add a manager
# @param manager The manager
def add(self, manager):
self.Add(manager.GetType().FullName, manager);
# Add or replace a manager
# @param manager The manager
def add_or_override(self, manager):
self.add_or_override(manager.GetType().FullName, manager)
# Add or replace a manager
# @param Key for storing the manager
# @param manager The manager
def add_or_override(self, key, manager):
self.remove(key);
self.add(key, manager);
# Remove a driver manager
# @param key Key for the manager you want removed
# @returns True if the manager was removed
def remove(self, key):
if (self.ContainsKey(key)):
self[key].Dispose()
return BaseTest.remove(key)
# Remove a driver manager
# @param type The type of manager
# @returns True if the manager was removed
def remove(self, type):
key = type.FullName;
if (self.ContainsKey(key)):
self[key].Dispose()
return self.remove(key)
# Clear the dictionary
def clear(self):
for driver in self:
driver.Value.Dispose();
BaseTest.clear()
# Cleanup the driver
def dispose(self):
dispose(True);
# GC.SuppressFinalize(self)
# Cleanup the driver
# @param disposing Dispose managed objects
def dispose(self, disposing):
# Only dealing with managed objects
if (disposing):
self.clear() | 28.041096 | 66 | 0.642404 | 260 | 2,047 | 5.030769 | 0.219231 | 0.061162 | 0.041284 | 0.050459 | 0.37844 | 0.344037 | 0.307339 | 0.307339 | 0.218654 | 0.218654 | 0 | 0 | 0.268686 | 2,047 | 73 | 67 | 28.041096 | 0.873747 | 0.396678 | 0 | 0.129032 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.322581 | false | 0 | 0.032258 | 0.064516 | 0.516129 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
cc9fe1157ef61d46a4162af3490c99ca247cf4f5 | 273 | py | Python | services/movies_streaming_converter/src/db/postgres/connection.py | fuodorov/yacinema | 43ad869575fbaab7c7056229538638666aa87110 | [
"MIT"
] | null | null | null | services/movies_streaming_converter/src/db/postgres/connection.py | fuodorov/yacinema | 43ad869575fbaab7c7056229538638666aa87110 | [
"MIT"
] | null | null | null | services/movies_streaming_converter/src/db/postgres/connection.py | fuodorov/yacinema | 43ad869575fbaab7c7056229538638666aa87110 | [
"MIT"
] | 1 | 2021-09-30T09:49:40.000Z | 2021-09-30T09:49:40.000Z | from core.config.postgres import get_tortoise_config
from tortoise import Tortoise
async def init_postgres():
await Tortoise.init(config=get_tortoise_config())
await Tortoise.generate_schemas()
async def close_postgres():
await Tortoise.close_connections()
| 22.75 | 53 | 0.794872 | 35 | 273 | 5.971429 | 0.428571 | 0.186603 | 0.162679 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.131868 | 273 | 11 | 54 | 24.818182 | 0.881857 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.285714 | 0 | 0.285714 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
cca238df75170ab11df56f494b15ca55629672db | 2,650 | py | Python | airbyte-integrations/base-python/airbyte_protocol/airbyte_protocol/__init__.py | gasparakos/airbyte | 3b420c1775af3db355e9dd247378c3d7fe060004 | [
"MIT"
] | null | null | null | airbyte-integrations/base-python/airbyte_protocol/airbyte_protocol/__init__.py | gasparakos/airbyte | 3b420c1775af3db355e9dd247378c3d7fe060004 | [
"MIT"
] | null | null | null | airbyte-integrations/base-python/airbyte_protocol/airbyte_protocol/__init__.py | gasparakos/airbyte | 3b420c1775af3db355e9dd247378c3d7fe060004 | [
"MIT"
] | null | null | null | from typing import Generator
import yaml
import pkgutil
import warnings
import python_jsonschema_objects as pjs
def _load_classes(yaml_path: str):
data = yaml.load(pkgutil.get_data(__name__, yaml_path), Loader=yaml.FullLoader)
builder = pjs.ObjectBuilder(data)
return builder.build_classes(standardize_names=False)
# hide json schema version warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=UserWarning)
message_classes = _load_classes("types/airbyte_message.yaml")
AirbyteMessage = message_classes.AirbyteMessage
AirbyteLogMessage = message_classes.AirbyteLogMessage
AirbyteRecordMessage = message_classes.AirbyteRecordMessage
AirbyteStateMessage = message_classes.AirbyteStateMessage
catalog_classes = _load_classes("types/airbyte_catalog.yaml")
AirbyteCatalog = catalog_classes.AirbyteCatalog
AirbyteStream = catalog_classes.AirbyteStream
class AirbyteSpec(object):
def __init__(self, spec_string):
self.spec_string = spec_string
class AirbyteCheckResponse(object):
def __init__(self, successful, field_to_error):
self.successful = successful
self.field_to_error = field_to_error
class AirbyteSchema(object):
def __init__(self, schema):
self.schema = schema
class AirbyteConfig(object):
def __init__(self, config_string):
self.config_string = config_string
class Integration(object):
def __init__(self):
pass
def spec(self) -> AirbyteSpec:
raise Exception("Not Implemented")
# default version reads the config_path to a string
# this will often be overwritten to add fields for easy consumption or to modify the string for delegating to singer
def read_config(self, config_path) -> AirbyteConfig:
with open(config_path, 'r') as file:
contents = file.read()
return AirbyteConfig(contents)
def render_config(self, config_object, rendered_config_path):
with open(rendered_config_path, 'w') as fh:
fh.write(config_object.config_string)
def check(self, config_object, rendered_config_path) -> AirbyteCheckResponse:
raise Exception("Not Implemented")
def discover(self, config_object, rendered_config_path) -> AirbyteSchema:
raise Exception("Not Implemented")
class Source(Integration):
def __init__(self):
pass
# Iterator<AirbyteMessage>
def read(self, config_object, rendered_config_path, state=None) -> Generator[AirbyteMessage, None, None]:
raise Exception("Not Implemented")
class Destination(Integration):
def __init__(self):
pass
| 30.813953 | 120 | 0.739245 | 302 | 2,650 | 6.192053 | 0.347682 | 0.042781 | 0.041176 | 0.045455 | 0.167914 | 0.072727 | 0 | 0 | 0 | 0 | 0 | 0 | 0.183774 | 2,650 | 85 | 121 | 31.176471 | 0.86454 | 0.084151 | 0 | 0.178571 | 0 | 0 | 0.049546 | 0.02147 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.053571 | 0.089286 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
ccb20438a9b921bb9e1ff19d0f9435a85958850e | 598 | py | Python | _teaching/csci127-summer-2020/readings/activities/etch-a-sketch.py | lgw2/lgw2.github.io | 3e2b0fb849407c26a64afd8e97be0eff7ce07f9b | [
"MIT"
] | null | null | null | _teaching/csci127-summer-2020/readings/activities/etch-a-sketch.py | lgw2/lgw2.github.io | 3e2b0fb849407c26a64afd8e97be0eff7ce07f9b | [
"MIT"
] | null | null | null | _teaching/csci127-summer-2020/readings/activities/etch-a-sketch.py | lgw2/lgw2.github.io | 3e2b0fb849407c26a64afd8e97be0eff7ce07f9b | [
"MIT"
] | null | null | null | import turtle
import random
window = turtle.Screen()
square = turtle.Turtle()
square.speed(0)
square.hideturtle()
square.up()
square.goto(-200, 200)
square.down()
for i in range(4):
square.forward(50)
square.right(90)
square.up()
square.goto(-205, 205)
square.write("Change Color")
pencil = turtle.Turtle()
pencil.shape("circle")
def drawing_controls(x, y):
if (-200 <= x <= -150) and (150 <= y <= 200):
pencil.color(random.random(), random.random(), random.random())
window.onclick(drawing_controls)
pencil.onrelease(pencil.goto)
| 18.6875 | 79 | 0.64214 | 79 | 598 | 4.835443 | 0.493671 | 0.157068 | 0.188482 | 0.188482 | 0.094241 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0625 | 0.197324 | 598 | 31 | 80 | 19.290323 | 0.733333 | 0 | 0 | 0.090909 | 0 | 0 | 0.031746 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.045455 | false | 0 | 0.090909 | 0 | 0.136364 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
ccb411183786e11bdf4eb08feb173ee016ac5380 | 3,443 | py | Python | auth.py | nelsonrds/price_database | 00f7a9d0839640782fac13c814c2c6b17c047de2 | [
"MIT"
] | null | null | null | auth.py | nelsonrds/price_database | 00f7a9d0839640782fac13c814c2c6b17c047de2 | [
"MIT"
] | 3 | 2021-06-08T21:18:43.000Z | 2022-03-12T00:24:24.000Z | auth.py | nelsonrds/price_database | 00f7a9d0839640782fac13c814c2c6b17c047de2 | [
"MIT"
] | null | null | null | import functools
from flask import (
Blueprint, flash, g, redirect, render_template, request, session, url_for, current_app, session
)
from werkzeug.security import check_password_hash, generate_password_hash
from .document import User
bp = Blueprint('auth', __name__, url_prefix='/auth')
@bp.route('/register', methods=('GET', 'POST'))
def register():
if request.method == 'POST':
email = request.form['email']
username = email.split('@')[0]
first_name = request.form['firstname']
last_name = request.form['lastname']
password = request.form['password']
password2 = request.form['password2']
error = None
if not username:
error = {
'code': 'username',
'message': 'Username is required.'
}
elif not password and not password2:
error = {
'code': 'password',
'message': 'Password is required.'
}
elif password != password2:
error = {
'code': 'password',
'message': "Passwords don't match."
}
#elif User.objects(username=username) is not None:
#error = {
#'code': 'username',
#'message': 'User already exists.'
# }
if error is None:
new_user = User(username=username,
email=email,
first_name=first_name,
last_name=last_name,
password=generate_password_hash(password))
new_user.save()
return redirect(url_for('auth.login'))
flash(error)
return render_template('auth/register.html')
@bp.route('/login', methods=('GET', 'POST'))
def login():
if request.method == 'POST':
username = request.form['email']
password = request.form['password']
if "remember" in request.form:
print("Sim")
else:
print("Não")
error = None
user = User.objects(username=username.split('@')[0]).first()
if user is None:
error = 'Incorrect username.'
elif not check_password_hash(user['password'], password):
error = 'Incorrect password.'
if error is None:
session.clear()
session['user_id'] = str(user['id'])
session["url"] = []
return redirect(url_for('product.index'))
flash(error)
return render_template('auth/login.html')
@bp.route('/logout')
def logout():
session.clear()
return redirect(url_for('auth.login'))
@bp.route('/forgot-password')
def forgot_password():
return render_template('auth/forgot_password.html')
@bp.before_app_request
def load_logged_in_user():
user_id = session.get('user_id')
if user_id is None:
g.user = None
else:
user = User.objects(id=user_id)
g.user = user.first()
def login_required(view):
@functools.wraps(view)
def wrapped_view(**kwargs):
if g.user is None:
return redirect(url_for('auth.login'))
return view(**kwargs)
return wrapped_view
def protected(view):
@functools.wraps(view)
def wrapped_view(**kwargs):
if g.user is None:
return '<p>not authorized</p>'
return view(**kwargs)
return wrapped_view
| 26.898438 | 99 | 0.556491 | 370 | 3,443 | 5.048649 | 0.245946 | 0.047109 | 0.036403 | 0.042827 | 0.215739 | 0.180407 | 0.06531 | 0.06531 | 0.06531 | 0.06531 | 0 | 0.002555 | 0.318037 | 3,443 | 127 | 100 | 27.110236 | 0.793015 | 0.03253 | 0 | 0.344086 | 1 | 0 | 0.133794 | 0.007517 | 0 | 0 | 0 | 0 | 0 | 1 | 0.096774 | false | 0.172043 | 0.043011 | 0.010753 | 0.268817 | 0.043011 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
ccc6840bf1ee14e63f7cee39888a7bf59c02a53c | 3,469 | py | Python | app/ml/artificial_user.py | sp0x/orion | 7ba1856546afe48710ef12d1e201f854f8d8d8ae | [
"MIT"
] | null | null | null | app/ml/artificial_user.py | sp0x/orion | 7ba1856546afe48710ef12d1e201f854f8d8d8ae | [
"MIT"
] | 3 | 2020-11-13T18:52:53.000Z | 2022-02-10T01:54:50.000Z | app/ml/artificial_user.py | sp0x/orion | 7ba1856546afe48710ef12d1e201f854f8d8d8ae | [
"MIT"
] | null | null | null |
class World:
def __init__(self):
pass
def get_state(self):
pass
def execute_action(self,a):
pass
class GameTree:
class GameNode:
def __init__(self, state, action, par):
self.state = state
self.action = action
self.visited = 0.0
self.par = par
# key = the goal aka desired result, val = the times that goal was reached through this node
self.goal_outcomes = dict()
# key = state of the system in which this node can be accessed, val = list<GameNode>
self.children = dict()
def probability(self):
"""The likelihood of ending up in this state"""
return self.visited / self.par.visited
def probability_for(self, goal):
"""The likelihood that the given GameNode will lead the 'player' to their final goal"""
return self.goal_outcomes.get(goal,0.0) / self.visited
def get_utility(self, goal, policy_params):
"""Returns the utility that the 'player' will receive if they pick this action"""
pass
def apply_action(self, world):
self.visited += 1.0
world.execute_action(self.action)
def update(self, goal, win=0):
"""
Updates the number of times that this node led to the desired goal
:param goal: the goal that was supposed to be reached
:param win: 1 if goal was reached 0 otherwise
:return:
"""
self.goal_outcomes[goal] = self.goal_outcomes.get(goal) + win
self.par.update(goal, win)
def prune(self):
pass
def get_next_move(self, state, goal, policy_params):
"""
Returns the best action for a certain goal given the current state of the world
:param state: the current state of the world
:param goal: the desired final outcome
:param policy_params: additional data regarding the choice of a next action
:return: GameNode with highest utility
"""
if goal in self.children:
return self.children.get(goal)[0]
best = None
max_u = 0
nodes = self.children.get(state)
for n in nodes:
u = n.get_utility(goal, policy_params)
if u > max_u:
max_u = u
best = n
return best
def __init__(self, policy):
self.root = None
self.cursor = None
self.policy = policy
def get_next_action(self, state, goal):
if not self.cursor:
self.cursor = self.root
new_c = self.cursor.get_next_move(state, goal,self.policy)
self.cursor = new_c
return new_c
class AIUser:
def __init__(self, world):
"""
Creates a new AI user
:param world: World instance wrapper for the environment
"""
self.world = world
self.game_tree = GameTree(None)
def learn(self):
pass
def execute(self, goal):
state = self.world.get_state()
while state != goal:
a = self.game_tree.get_next_action(state, goal)
a.apply_action(self.world)
state = self.world.get_state()
| 33.038095 | 105 | 0.544537 | 423 | 3,469 | 4.347518 | 0.250591 | 0.034802 | 0.023926 | 0.015226 | 0.109842 | 0.032626 | 0.032626 | 0 | 0 | 0 | 0 | 0.005112 | 0.379648 | 3,469 | 104 | 106 | 33.355769 | 0.849442 | 0.262612 | 0 | 0.125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.09375 | 0 | 0 | 0.390625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
ccca360676e3b7718b279666eca7277d488c1fec | 63 | py | Python | Premier-eye.API/controllers/areaMap/__init__.py | Sapfir0/premier-eye | 26bb27e5f804c2e9375cb6f5edebad58e7b5dffe | [
"MIT"
] | 16 | 2019-08-05T09:38:53.000Z | 2021-12-26T19:24:31.000Z | Premier-eye.API/controllers/areaMap/__init__.py | Sapfir0/premier-eye | 26bb27e5f804c2e9375cb6f5edebad58e7b5dffe | [
"MIT"
] | 4 | 2020-01-09T22:22:37.000Z | 2021-07-29T18:33:57.000Z | Premier-eye.API/controllers/areaMap/__init__.py | Sapfir0/premier-eye | 26bb27e5f804c2e9375cb6f5edebad58e7b5dffe | [
"MIT"
] | 4 | 2019-08-04T14:02:08.000Z | 2020-07-10T09:47:06.000Z |
namespace = '/map'
routes = {
'getAllObjectDest': '/',
}
| 9 | 28 | 0.539683 | 4 | 63 | 8.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.238095 | 63 | 6 | 29 | 10.5 | 0.708333 | 0 | 0 | 0 | 0 | 0 | 0.33871 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
ccd61acf39ff32cbf63568e1b6fc233c4e3f4beb | 231 | py | Python | NumPy/Array Basics/Reading and Writing Files/tests/test_task.py | jetbrains-academy/Python-Libraries-NumPy | 7ce0f2d08f87502d5d97bbc6921f0566184d4ebb | [
"MIT"
] | null | null | null | NumPy/Array Basics/Reading and Writing Files/tests/test_task.py | jetbrains-academy/Python-Libraries-NumPy | 7ce0f2d08f87502d5d97bbc6921f0566184d4ebb | [
"MIT"
] | 4 | 2022-01-14T10:40:47.000Z | 2022-02-14T13:01:13.000Z | NumPy/Array Basics/Reading and Writing Files/tests/test_task.py | jetbrains-academy/Python-Libraries-NumPy | 7ce0f2d08f87502d5d97bbc6921f0566184d4ebb | [
"MIT"
] | null | null | null | import unittest
import numpy as np
from task import arr
# todo: replace this with an actual test
class TestCase(unittest.TestCase):
def test_add(self):
self.assertEqual((100, 4), arr.shape, msg="Wrong array shape.")
| 21 | 71 | 0.718615 | 35 | 231 | 4.714286 | 0.771429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.021277 | 0.186147 | 231 | 10 | 72 | 23.1 | 0.856383 | 0.164502 | 0 | 0 | 0 | 0 | 0.094241 | 0 | 0 | 0 | 0 | 0.1 | 0.166667 | 1 | 0.166667 | false | 0 | 0.5 | 0 | 0.833333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
aea3b21daff026772370e5d3884f05603fd8cbb1 | 433 | py | Python | hackoregon_examplar/api/models.py | hackoregon/2019-examplar-backend | a7dcfe7c64e81e957112a837c4fa277be59e4f26 | [
"MIT"
] | null | null | null | hackoregon_examplar/api/models.py | hackoregon/2019-examplar-backend | a7dcfe7c64e81e957112a837c4fa277be59e4f26 | [
"MIT"
] | 1 | 2019-07-22T04:00:15.000Z | 2019-07-22T04:11:04.000Z | hackoregon_examplar/api/models.py | hackoregon/2019-examplar-backend | a7dcfe7c64e81e957112a837c4fa277be59e4f26 | [
"MIT"
] | null | null | null | from django.db import models
class RouteChange(models.Model):
route_id = models.TextField(primary_key=True)
shape_id = models.TextField(blank=True, null=True)
y2009_trip_count = models.IntegerField(blank=True, null=True)
y2017_trip_count = models.IntegerField(blank=True, null=True)
pct_change = models.FloatField(blank=True, null=True)
class Meta:
managed = False
db_table = 'route_change'
| 33.307692 | 65 | 0.727483 | 58 | 433 | 5.258621 | 0.5 | 0.118033 | 0.170492 | 0.222951 | 0.288525 | 0.288525 | 0.288525 | 0.288525 | 0 | 0 | 0 | 0.022346 | 0.17321 | 433 | 12 | 66 | 36.083333 | 0.829609 | 0 | 0 | 0 | 0 | 0 | 0.027714 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.1 | 0 | 0.8 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
aeab51d918e7f285f52097772c118f2d0d9c94cd | 1,068 | py | Python | 2doElemento/A17EjercicioVehiculo.py | Antonio985/SeminarioDeProgramacion | a1bdd7fa6fa202a0a7a2e9a0f72def24d0f1c465 | [
"Unlicense"
] | null | null | null | 2doElemento/A17EjercicioVehiculo.py | Antonio985/SeminarioDeProgramacion | a1bdd7fa6fa202a0a7a2e9a0f72def24d0f1c465 | [
"Unlicense"
] | null | null | null | 2doElemento/A17EjercicioVehiculo.py | Antonio985/SeminarioDeProgramacion | a1bdd7fa6fa202a0a7a2e9a0f72def24d0f1c465 | [
"Unlicense"
] | null | null | null | #Creacion de clase padre
class Vehiculo:
def __init__(self, color, ruedas):
self.color = color
self.ruedas = ruedas
def __str__(self):
return "Color : "+self.color+" ruedas: "+str(self.ruedas)
#creacion de una clase hija/o
class Coche(Vehiculo):
def __init__(self, color, ruedas, velocidad):
super().__init__(color, ruedas)
self.velocidad = velocidad
def __str__(self):
return super().__str__() + " velocidad : "+str(self.velocidad)+" km/hr"
#Creacion de clase hija/o
class Bici(Vehiculo):
def __init__(self, color, ruedas, tipo):
super().__init__(color, ruedas)
self.tipo = tipo
def __str__(self):
return super().__str__() + " tipo : "+str(self.tipo)
#creacion de un objeto
carro = Vehiculo("Rojo ",4 )
#enviar impresion
print(carro)
#Creacion de un objeto
coche = Coche("Negro ", 4 , 180)
#Enviamos a impresion el nuevo objeto
print(coche)
#Creacion de un objeto
bici = Bici("Negro ", 2 , "Montaña")
#Enviamos a impresion el nuevo objeto
print(bici)
| 24.837209 | 80 | 0.648876 | 139 | 1,068 | 4.697842 | 0.280576 | 0.091884 | 0.091884 | 0.087289 | 0.3951 | 0.321593 | 0.11026 | 0 | 0 | 0 | 0 | 0.007246 | 0.224719 | 1,068 | 42 | 81 | 25.428571 | 0.781401 | 0.21161 | 0 | 0.208333 | 0 | 0 | 0.084135 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0.125 | 0.5 | 0.125 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
aebb6b993f7dc32f2063c8072caef7072ecf137e | 17,760 | py | Python | pysnmp-with-texts/HH3C-STACK-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/HH3C-STACK-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/HH3C-STACK-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module HH3C-STACK-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HH3C-STACK-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:29:46 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection, SingleValueConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ValueSizeConstraint")
entPhysicalIndex, = mibBuilder.importSymbols("ENTITY-MIB", "entPhysicalIndex")
hh3cCommon, = mibBuilder.importSymbols("HH3C-OID-MIB", "hh3cCommon")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
Counter32, ModuleIdentity, Bits, Gauge32, TimeTicks, IpAddress, ObjectIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter64, Unsigned32, MibIdentifier, Integer32, NotificationType, iso = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "ModuleIdentity", "Bits", "Gauge32", "TimeTicks", "IpAddress", "ObjectIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter64", "Unsigned32", "MibIdentifier", "Integer32", "NotificationType", "iso")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
hh3cStack = ModuleIdentity((1, 3, 6, 1, 4, 1, 25506, 2, 91))
hh3cStack.setRevisions(('2008-04-30 16:50',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: hh3cStack.setRevisionsDescriptions(('The initial revision of this MIB module.',))
if mibBuilder.loadTexts: hh3cStack.setLastUpdated('200804301650Z')
if mibBuilder.loadTexts: hh3cStack.setOrganization('Hangzhou H3C Technologies Co., Ltd.')
if mibBuilder.loadTexts: hh3cStack.setContactInfo('Platform Team H3C Technologies Co., Ltd. Hai-Dian District Beijing P.R. China Http://www.h3c.com Zip:100085')
if mibBuilder.loadTexts: hh3cStack.setDescription('This MIB is used to manage STM (Stack Topology Management) information for IRF (Intelligent Resilient Framework) device. This MIB is applicable to products which support IRF. Some objects in this MIB may be used only for some specific products, so users should refer to the related documents to acquire more detailed information.')
hh3cStackGlobalConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 91, 1))
hh3cStackMaxMember = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 91, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hh3cStackMaxMember.setStatus('current')
if mibBuilder.loadTexts: hh3cStackMaxMember.setDescription('The maximum number of members in a stack.')
hh3cStackMemberNum = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 91, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hh3cStackMemberNum.setStatus('current')
if mibBuilder.loadTexts: hh3cStackMemberNum.setDescription('The number of members currently in a stack.')
hh3cStackMaxConfigPriority = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 91, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hh3cStackMaxConfigPriority.setStatus('current')
if mibBuilder.loadTexts: hh3cStackMaxConfigPriority.setDescription('The highest priority that can be configured for a member in a stack.')
hh3cStackAutoUpdate = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 91, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hh3cStackAutoUpdate.setStatus('current')
if mibBuilder.loadTexts: hh3cStackAutoUpdate.setDescription('The function for automatically updating the image from master to slave. When a new device tries to join a stack, the image version is checked. When this function is enabled, if the image version of the new device is different from that of the master, the image of the new device will be updated to be consistent with that of the master. When this function is disabled, the new device can not join the stack if the image version of the new device is different from that of the master. disabled: disable auto update function enabled: enable auto update function')
hh3cStackMacPersistence = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 91, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("notPersist", 1), ("persistForSixMin", 2), ("persistForever", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hh3cStackMacPersistence.setStatus('current')
if mibBuilder.loadTexts: hh3cStackMacPersistence.setDescription('The mode of bridge MAC address persistence. When a stack starts, the bridge MAC address of master board will be used as that of the stack. If the master board leaves the stack, the bridge MAC address of the stack will change based on the mode of bridge MAC address persistence. notPersist: The bridge MAC address of the new master board will be used as that of the stack immediately. persistForSixMin: The bridge MAC address will be reserved for six minutes. In this period, if the master board which has left the stack rejoins the stack, the bridge MAC address of the stack will not change. Otherwise, the bridge MAC address of the new master board will be used as that of the stack. persistForever: Whether the master leaves or not, the bridge MAC address of the stack will never change.')
hh3cStackLinkDelayInterval = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 91, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(200, 2000), ))).setUnits('millisecond').setMaxAccess("readwrite")
if mibBuilder.loadTexts: hh3cStackLinkDelayInterval.setStatus('current')
if mibBuilder.loadTexts: hh3cStackLinkDelayInterval.setDescription('The delay time for a device in a stack to report the change of stack port link status. If the delay time is configured, a device in a stack will not report the change immediately when the stack port link status changes to down. During the delay period, if the stack port link status is resumed, the device will ignore the current change of the stack port link status. If the stack port link status is not resumed after the delay time, the device will report the change. 0 means no delay, namely, the device will report the change as soon as the stack port link status changes to down. 0: no delay 200-2000(ms): delay time')
hh3cStackTopology = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 91, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("chainConn", 1), ("ringConn", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hh3cStackTopology.setStatus('current')
if mibBuilder.loadTexts: hh3cStackTopology.setDescription('The topology of the stack. chainConn: chain connection ringConn: ring connection')
hh3cStackDeviceConfigTable = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 91, 2), )
if mibBuilder.loadTexts: hh3cStackDeviceConfigTable.setStatus('current')
if mibBuilder.loadTexts: hh3cStackDeviceConfigTable.setDescription('This table contains objects to manage device information in a stack.')
hh3cStackDeviceConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 91, 2, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"))
if mibBuilder.loadTexts: hh3cStackDeviceConfigEntry.setStatus('current')
if mibBuilder.loadTexts: hh3cStackDeviceConfigEntry.setDescription('This table contains objects to manage device information in a stack.')
hh3cStackMemberID = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 91, 2, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hh3cStackMemberID.setStatus('current')
if mibBuilder.loadTexts: hh3cStackMemberID.setDescription('The member ID of the device in a stack.')
hh3cStackConfigMemberID = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 91, 2, 1, 2), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hh3cStackConfigMemberID.setStatus('current')
if mibBuilder.loadTexts: hh3cStackConfigMemberID.setDescription('The configured member ID of the device. The valid value ranges from 1 to the value of hh3cStackMaxMember. After the member ID is configured for a device, if this ID is not the same with that of another device, the ID will be used as the member ID of the device when the device reboots. If a same ID exists, the member ID of the device will be set as another exclusive ID automatically.')
hh3cStackPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 91, 2, 1, 3), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hh3cStackPriority.setStatus('current')
if mibBuilder.loadTexts: hh3cStackPriority.setDescription('The priority of a device in a stack. The valid value ranges from 1 to the value of hh3cStackMaxConfigPriority.')
hh3cStackPortNum = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 91, 2, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hh3cStackPortNum.setStatus('current')
if mibBuilder.loadTexts: hh3cStackPortNum.setDescription('The number of stack ports which is enabled in a device.')
hh3cStackPortMaxNum = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 91, 2, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hh3cStackPortMaxNum.setStatus('current')
if mibBuilder.loadTexts: hh3cStackPortMaxNum.setDescription('The maximum number of stack ports in a device.')
hh3cStackBoardConfigTable = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 91, 3), )
if mibBuilder.loadTexts: hh3cStackBoardConfigTable.setStatus('current')
if mibBuilder.loadTexts: hh3cStackBoardConfigTable.setDescription('This table contains objects to manage board information of the device in a stack.')
hh3cStackBoardConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 91, 3, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"))
if mibBuilder.loadTexts: hh3cStackBoardConfigEntry.setStatus('current')
if mibBuilder.loadTexts: hh3cStackBoardConfigEntry.setDescription('This table contains objects to manage board information of the device in a stack.')
hh3cStackBoardRole = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 91, 3, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("slave", 1), ("master", 2), ("loading", 3), ("other", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hh3cStackBoardRole.setStatus('current')
if mibBuilder.loadTexts: hh3cStackBoardRole.setDescription('The role of the board in a stack. slave: slave board master: master board loading: slave board whose image version is different from that of the master board. other: other')
hh3cStackBoardBelongtoMember = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 91, 3, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hh3cStackBoardBelongtoMember.setStatus('current')
if mibBuilder.loadTexts: hh3cStackBoardBelongtoMember.setDescription('The member ID of the device where the current board resides in a stack.')
hh3cStackPortInfoTable = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 91, 4), )
if mibBuilder.loadTexts: hh3cStackPortInfoTable.setStatus('current')
if mibBuilder.loadTexts: hh3cStackPortInfoTable.setDescription('This table contains objects to manage stack port information of a device in a stack.')
hh3cStackPortInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 91, 4, 1), ).setIndexNames((0, "HH3C-STACK-MIB", "hh3cStackMemberID"), (0, "HH3C-STACK-MIB", "hh3cStackPortIndex"))
if mibBuilder.loadTexts: hh3cStackPortInfoEntry.setStatus('current')
if mibBuilder.loadTexts: hh3cStackPortInfoEntry.setDescription('This table contains objects to manage stack port information of a device in a stack.')
hh3cStackPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 91, 4, 1, 1), Integer32()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: hh3cStackPortIndex.setStatus('current')
if mibBuilder.loadTexts: hh3cStackPortIndex.setDescription('The index of a stack port of the device in a stack.')
hh3cStackPortEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 91, 4, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hh3cStackPortEnable.setStatus('current')
if mibBuilder.loadTexts: hh3cStackPortEnable.setDescription("The status of the stack port of the device in a stack. If no physical port is added to the stack port, its status is 'disabled'; otherwise, its status is 'enabled'. disabled: The stack port is disabled. enabled: The stack port is enabled.")
hh3cStackPortStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 91, 4, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("silent", 3), ("disabled", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hh3cStackPortStatus.setStatus('current')
if mibBuilder.loadTexts: hh3cStackPortStatus.setDescription('The link status of the stack port of the device in a stack. up: The link status of a stack port with reasonable physical connection is up. down: The link status of a stack port without physical connection is down. silent: The link status of a stack port which can not be used normally is silent. disabled: The link status of a stack port in disabled status is disabled.')
hh3cStackNeighbor = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 91, 4, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hh3cStackNeighbor.setStatus('current')
if mibBuilder.loadTexts: hh3cStackNeighbor.setDescription("The member ID of the stack port's neighbor in a stack. 0 means no neighbor exists.")
hh3cStackPhyPortInfoTable = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 91, 5), )
if mibBuilder.loadTexts: hh3cStackPhyPortInfoTable.setStatus('current')
if mibBuilder.loadTexts: hh3cStackPhyPortInfoTable.setDescription('This table contains objects to manage the information for physical ports which can be used for physical connection of stack port in a stack.')
hh3cStackPhyPortInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 91, 5, 1), ).setIndexNames((0, "ENTITY-MIB", "entPhysicalIndex"))
if mibBuilder.loadTexts: hh3cStackPhyPortInfoEntry.setStatus('current')
if mibBuilder.loadTexts: hh3cStackPhyPortInfoEntry.setDescription('This table contains objects to manage the information for physical ports which can be used for physical connection of stack port in a stack.')
hh3cStackBelongtoPort = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 91, 5, 1, 1), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hh3cStackBelongtoPort.setStatus('current')
if mibBuilder.loadTexts: hh3cStackBelongtoPort.setDescription('The index of the stack port to which the physical port is added. 0 means the physical port is not added to any stack port. The value will be valid after the device in the stack reboots.')
hh3cStackTrap = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 91, 6))
hh3cStackTrapOjbects = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 91, 6, 0))
hh3cStackPortLinkStatusChange = NotificationType((1, 3, 6, 1, 4, 1, 25506, 2, 91, 6, 0, 1)).setObjects(("HH3C-STACK-MIB", "hh3cStackMemberID"), ("HH3C-STACK-MIB", "hh3cStackPortIndex"), ("HH3C-STACK-MIB", "hh3cStackPortStatus"))
if mibBuilder.loadTexts: hh3cStackPortLinkStatusChange.setStatus('current')
if mibBuilder.loadTexts: hh3cStackPortLinkStatusChange.setDescription('The hh3cStackPortLinkStatusChange trap indicates that the link status of the stack port has changed.')
hh3cStackTopologyChange = NotificationType((1, 3, 6, 1, 4, 1, 25506, 2, 91, 6, 0, 2)).setObjects(("HH3C-STACK-MIB", "hh3cStackTopology"))
if mibBuilder.loadTexts: hh3cStackTopologyChange.setStatus('current')
if mibBuilder.loadTexts: hh3cStackTopologyChange.setDescription('The hh3cStackTopologyChange trap indicates that the topology type of the stack has changed.')
mibBuilder.exportSymbols("HH3C-STACK-MIB", hh3cStackTopology=hh3cStackTopology, hh3cStackConfigMemberID=hh3cStackConfigMemberID, hh3cStackBelongtoPort=hh3cStackBelongtoPort, hh3cStackTopologyChange=hh3cStackTopologyChange, hh3cStackMacPersistence=hh3cStackMacPersistence, hh3cStackGlobalConfig=hh3cStackGlobalConfig, hh3cStackPortIndex=hh3cStackPortIndex, hh3cStackPriority=hh3cStackPriority, hh3cStackPhyPortInfoTable=hh3cStackPhyPortInfoTable, hh3cStackTrap=hh3cStackTrap, hh3cStackPortMaxNum=hh3cStackPortMaxNum, hh3cStackLinkDelayInterval=hh3cStackLinkDelayInterval, hh3cStackMemberNum=hh3cStackMemberNum, hh3cStackPortEnable=hh3cStackPortEnable, hh3cStackMaxMember=hh3cStackMaxMember, hh3cStackDeviceConfigEntry=hh3cStackDeviceConfigEntry, hh3cStackMemberID=hh3cStackMemberID, hh3cStackBoardConfigEntry=hh3cStackBoardConfigEntry, hh3cStackPhyPortInfoEntry=hh3cStackPhyPortInfoEntry, hh3cStackPortStatus=hh3cStackPortStatus, PYSNMP_MODULE_ID=hh3cStack, hh3cStackBoardConfigTable=hh3cStackBoardConfigTable, hh3cStackPortNum=hh3cStackPortNum, hh3cStackNeighbor=hh3cStackNeighbor, hh3cStackBoardBelongtoMember=hh3cStackBoardBelongtoMember, hh3cStack=hh3cStack, hh3cStackBoardRole=hh3cStackBoardRole, hh3cStackDeviceConfigTable=hh3cStackDeviceConfigTable, hh3cStackPortInfoEntry=hh3cStackPortInfoEntry, hh3cStackAutoUpdate=hh3cStackAutoUpdate, hh3cStackTrapOjbects=hh3cStackTrapOjbects, hh3cStackPortLinkStatusChange=hh3cStackPortLinkStatusChange, hh3cStackPortInfoTable=hh3cStackPortInfoTable, hh3cStackMaxConfigPriority=hh3cStackMaxConfigPriority)
| 153.103448 | 1,549 | 0.791385 | 2,219 | 17,760 | 6.333033 | 0.148716 | 0.053796 | 0.094144 | 0.009393 | 0.439408 | 0.331104 | 0.287981 | 0.262364 | 0.2265 | 0.212695 | 0 | 0.058118 | 0.102872 | 17,760 | 115 | 1,550 | 154.434783 | 0.823888 | 0.018131 | 0 | 0 | 0 | 0.121495 | 0.388433 | 0.007057 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.074766 | 0 | 0.074766 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
aecb23d58213ed265f6e0f11e9c2fd0998664391 | 356 | py | Python | map func.py | ps2809/Python-Examples | 0574f53787af28bf5bd011c139d340091454a4f9 | [
"MIT"
] | 1 | 2021-07-30T06:15:18.000Z | 2021-07-30T06:15:18.000Z | map func.py | ps2809/Python-Examples | 0574f53787af28bf5bd011c139d340091454a4f9 | [
"MIT"
] | null | null | null | map func.py | ps2809/Python-Examples | 0574f53787af28bf5bd011c139d340091454a4f9 | [
"MIT"
] | null | null | null | l1=[1,2,3,4,5,6,7,8,9,10]
l2=list(map(lambda n:n*n,l1))
print('l2:',l2)
l3=list((map(lambda n,m:n*m,l1,l2)))#map function can take more than one sequence argument
print('l3:',l3)
#if the length of the sequence is not equal then function will perform till same length
l3.pop()
print('popped l3:',l3)
l4=list(map(lambda n,m,o:n+m+o,l1,l2,l3))
print('l4:',l4) | 35.6 | 90 | 0.691011 | 82 | 356 | 3 | 0.52439 | 0.03252 | 0.158537 | 0.170732 | 0.121951 | 0 | 0 | 0 | 0 | 0 | 0 | 0.09375 | 0.101124 | 356 | 10 | 91 | 35.6 | 0.675 | 0.390449 | 0 | 0 | 0 | 0 | 0.087963 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.444444 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
aed04305de4a221d1f525935a5ea1e7889c1c659 | 22,411 | py | Python | controller.py | PhilippeDura/Banking_project | 9b6859f883db52a70f83e61adbbfad8edc7dd19f | [
"MIT"
] | null | null | null | controller.py | PhilippeDura/Banking_project | 9b6859f883db52a70f83e61adbbfad8edc7dd19f | [
"MIT"
] | null | null | null | controller.py | PhilippeDura/Banking_project | 9b6859f883db52a70f83e61adbbfad8edc7dd19f | [
"MIT"
] | null | null | null |
import logging
from model import Client, SavingAccount, DebitAccount, BankAccount, TotalAccounts #on importe les classes du model
from model import session as db # importe la variale session du fichier model renomme db
from flask import render_template, request, redirect, url_for # url_for récupère l'url lié à l'etiquette donner en paramètre
import hashlib
import random
import string
log = logging.getLogger(__name__)# on instancie le loggeur (programme qui va faire les logs)
def home_admin():
log.info('Controler home admin starts')# on crée un message dans le log au niveau de gravité le plus bas c a d info
clients = db.query(Client).order_by(Client.lastname) # soumet une requête à la base de données à l'aide de la méthode query à laquelle on passe en paramètre une classe faisant référence à une table de la base de données, order_by, méthode qui permet de trié suivant un champ de la table ici last_name(Client.last_name)
return render_template("home.html", clients=clients)# la variable clients fait référence à la donnée que l'on va injecter dans la page html home.htlm au niveau de la variable clients dans la même page, on peut mettre autant de champs ou de mots clés (nom de variable qui ne sont pas soumis) que l'on veut séparés par une virgule
def welcome_home():
log.info('Controler welcome home starts')
return render_template("welcome_home.html")
def generate_token():
tmp = ""
list = string.ascii_letters
list_add_with_digit = list + string.digits
for i in range(20):
tmp += random.choice(list_add_with_digit)
return tmp
def add_client(): #fonction d'ajout de client
log.info('Controler add_clients starts')
if request.method == 'POST':
# TODO check that firstname and lastname are defined
client_email =db.query(Client).filter_by(email=request.form['email']).first()
if client_email is None:
client = Client( # ici in instancie un objet client (de la classe client)
request.form['firstname'],
request.form['lastname'],
request.form['email'],
generate_token(),
request.form['password'])
db.add(client)
db.commit()
return redirect(url_for('client_file_client', token=client.token))
if request.form['email'] == client_email.email:
return render_template('redirect_add_client.html')
else:
return render_template('add_client.html')
def add_client_admin():
log.info('Controler add_clients_admin starts')
if request.method == 'POST':
# TODO check that firstname and lastname are defined
client_email =db.query(Client).filter_by(email=request.form['email']).first()
if client_email is None:
client = Client( # ici in instancie un objet client (de la classe client)
request.form['firstname'],
request.form['lastname'],
request.form['email'],
generate_token(),
request.form['password'])
#print(client.password)
db.add(client)
db.commit()
return redirect(url_for('client_file', token=client.token))
if request.form['email'] == client_email.email:
return render_template('redirect_add_client.html')
else:
return render_template('add_client_admin.html')
def del_client():
log.info('Controle del_clients starts')
if request.method == 'POST':
# si la méthode du formaulaire est post on interroge la table Client avec comme contrainte le prénom et le nom de l'utilisateur
client_account= db.query(Client).filter_by(firstname=request.form['firstname']).filter_by(lastname=request.form['lastname'])#.filter_by(email=request.form['email'])
#ensuite on récupère sous forme tuples la ligne du client
client= db.execute(client_account).fetchone()
#si le client n'existe pas on redirige l'utilisateur sur un page d'erreur
if client is None:
return render_template('redirectory_delete_client.html')
else:
#si il existe on récupère on id en interrogeant la table Client on récupère son id à l'indcice 0
client_id = db.query(Client).get(client[0])
#ensuite on interroge la table Bankaccount possédant tous les ocmptes bancaires du client à l'aide de l'id du client,
# ensuite on supprime le client de la table Bankaccount
db.query(BankAccount).filter_by(client_id=client_id.client_id).delete()
# enusite on supprime l'id du client existant dans la table Client, il n'y a plus de trace de lui
db.delete(client_id)
db.commit()
return redirect(url_for('home_admin'))
else:
return render_template('delete_client.html')
def get_amount(): # pour récupérer le montant (la valeur que l'on rentre)
try:
amount = float(request.form['amount'])# on va tenter (try) de récupèrer la valeur du champ input ayant pour nom amount que l'on convertit en float
except ValueError as v: # avec le except on récupère un objet de type ValueError(erreur de type valeur) que l'on nomme v (noter ici qu'il ne sera pas utlisé) et donc si on récupère la bonne exception on évite que le programme plante, à noter également que si l'on appel une fonction dans le bloc try et que celle-ci opère une exception qui n'est pas protège dans le coprs de lafonction dite et quelle corresponder au type d'execption du bloc except alors elle sera quand même levée par cette dernière
raise ValueError('Please, enter only digits in amount.') #le raise lève une exception ici de type ValueError seulment si l'on rentre dans l'except et renvois un message, à noter que si l'on finit par le mot raise uniquement cela qu'on relève la même exception qu'auparavant
if amount == 0:
raise ValueError('Amount must not be zero (0).')
elif amount < 0:
raise ValueError('Amount must be positive.')
else:
return amount
"""def convert_to_client(row_proxy):
tmp =[row_proxy[0], row_proxy[1], row_proxy[2], row_proxy[3], row_proxy[4]]
result= db.query(Client).filter_by(client_id=row_proxy[0])
result_id = db.execute(result).fetchone()
print(result_id[0])
client = db.query(BankAccount).filter_by(client_id=result_id[0])
client_exe = db.execute(client).fetchone()
print(client_exe)
return client_exe
def get_client_by_token(token):
req = db.query(Client).filter_by(token=token)
result = db.execute(req).fetchone()
client = convert_to_client(result)
return client"""
def get_client_using_Token(token): #récupère un id à parir d'un token, sert à authentifier un client
client_id = db.query(Client).filter_by(token=token)
result= db.execute(client_id).fetchone()
#print(result)
result_id= result[0]
return result_id
#print(result_id)
def login():
log.info('Controle login starts')
if request.method == 'POST':
client = db.query(Client).filter_by(email = request.form['email'], password=hashlib.sha256(bytes(request.form['password'],"utf_8")).hexdigest() ).first()
#and db.query(Client).filter_by(password=hashlib.sha256(bytes(request.form['password'],"utf_8")).hexdigest()).first()
#db.query(Client).filter_by(firstname= request.form['firstname']) \
#and db.query(Client).filter_by(lastname = request.form['lastname'])\
#print(client)
if client is None:
return render_template('redirectory_login.html')
#print(client)
return redirect(url_for('client_file_client', token=client.token))
else:
return render_template('login.html')
def login_admin():
log.info('Controle login_admin starts')
admin_password = hashlib.sha256(bytes("admin", "utf-8")).hexdigest()
if request.method == 'POST':
if hashlib.sha256(bytes(request.form['password_admin'], "utf-8")).hexdigest() == admin_password:
#print(admin_password)
#print(hashlib.sha256(bytes(request.form['password_admin'], "utf-8")).hexdigest())
return redirect(url_for('home_admin'))
else:
return render_template('redirectory_login_admin.html')
return render_template('login_admin.html')
def iterate_credit_account(token):
sum = 0
id_client = get_client_using_Token(token)
accounts = db.query(BankAccount).filter_by(client_id=id_client).all()
client = db.query(Client).get(id_client)
# total_account = TotalAccounts(client,token)
for account in accounts:
#print(account)
#print("\nsum credit {} ".format(sum))
#print("balance credit {}\n".format(account.get_account_balance()))
sum += account.get_account_balance()
db.add(client)
db.commit()
return sum
def client_file(token): #ici on consulte la fiche client
log.info('Controler client_file starts')
#req = db.query(Client).filter_by(token=token)#.filter_by(token)# ici grace à db.query(Client) on parcours la table client et on récupère le client qui correspond au get(client_id) (l'id du client donc le client qui a pour id, l'id demandé c a d passé en paramètre)
#result = db.execute(req).fetchone()
#client = convert_to_client(result)
id_client = get_client_using_Token(token)
client = db.query(Client).get(id_client)
#print(client)
account_client= client.accounts
#print(account_client)
#total =0
total = iterate_credit_account(token)
if request.method == 'POST': # si la requête que le serveur a reçu est post( request.method fait référence à une variable contenu dans request qui contient le mode post ou get ou delete ect...)
account_number = request.form['account_number']# ici on récupère la valeur du input account_number, qui va déterminer le type de compte
#account = db.query(BankAccount).get(account_number)# ici on va chercher dans la table BankAccount la ligne correspondante à l'account_number
#print(account_number)
account = db.query(BankAccount).filter_by(number=account_number).first()
#total_account = TotalAccounts(client,token)
#iterate_account(token)
total = 0
if request.form['action'] == 'interest': # va faire la distinction entre les bouttons débit ou interest, ici si la valeur du boutton vaut interest on rentre dans la condition
earned = account.interest()# ici l'objet courant (en fonction de l'account_number, soit de type saving_account soit de type debit_account dans le cas du if c'est un saving) on lui applique la méthode interest de la classe saving_account
account.credit(earned)# ici comme l'objet account de type saving_account hérite de BankAccount on peut accéder donc à la méthode credit dans laquelle on passe en paramètre le resultat de interest contenue dans earned
#total = total_account.total_amount(token)
total=iterate_credit_account(token)
#print(total)
else:
try:
amount = get_amount()# ici on tente de récupèrer le montant que l'on a rentrer
except ValueError as ve: # si il n'arrive pas à convertir en float
return render_template('client_file.html', client=account_client, error=ve)# ici on retourne la page html client_file.html au niveau de laquelle on injecte dans les variables client et error accessibles depuis la page html, on leur pattribut comme valeur pour client la variable client définit plus haut qui contient le client en cours, et dans error le message d'erreur définit dans exception
if request.form['action'] == 'credit':# ici on verifie quel boutton a été cliquer (c a d que l'on vérifie si la velur de la clé action est bien credit)
account.credit(amount) #dans ce cas on ajoute amount à l'account
#print(account)
#total= total_account.total_amount(token)
total = iterate_credit_account(token)
else:
account.debit(amount)# sinon on débite amount d'account
#total= total_account.total_amount(token)
#print(client)
total = iterate_credit_account(token)
#current_sum = total
#db.commit()# ici on commit la base de données et on enregistre les modifs de l'account
#print(request.method)
#print("Total : {}".format(total))
return render_template('client_file.html', client=client , accounts=account_client, token=token, name=total)# on rend le résultat avec le nouveau solde dans la page html (client à comme paramètre une variable de classe account[] qui met à jour à chaque fois la liste des comptes (saving et debit account)
def client_file_client(token): #ici on consulte la fiche client
log.info('Controler client_file_client starts')
#req = db.query(Client).filter_by(token=token)#.filter_by(token)# ici grace à db.query(Client) on parcours la table client et on récupère le client qui correspond au get(client_id) (l'id du client donc le client qui a pour id, l'id demandé c a d passé en paramètre)
#result = db.execute(req).fetchone()
#client = convert_to_client(result)
id_client = get_client_using_Token(token)
client = db.query(Client).get(id_client)
#print(client)
account_client= client.accounts
print(account_client)
#print(account_client)
#total =0
total = iterate_credit_account(token)
if request.method == 'POST': # si la requête que le serveur a reçu est post( request.method fait référence à une variable contenu dans request qui contient le mode post ou get ou delete ect...)
account_number = request.form['account_number']# ici on récupère la valeur du input account_number, qui va déterminer le type de compte
#account = db.query(BankAccount).get(account_number)# ici on va chercher dans la table BankAccount la ligne correspondante à l'account_number
#print(account_number)
account = db.query(BankAccount).filter_by(number=account_number).first()
#total_account = TotalAccounts(client,token)
#iterate_account(token)
total = 0
if request.form['action'] == 'interest': # va faire la distinction entre les bouttons débit ou interest, ici si la valeur du boutton vaut interest on rentre dans la condition
earned = account.interest()# ici l'objet courant (en fonction de l'account_number, soit de type saving_account soit de type debit_account dans le cas du if c'est un saving) on lui applique la méthode interest de la classe saving_account
account.credit(earned)# ici comme l'objet account de type saving_account hérite de BankAccount on peut accéder donc à la méthode credit dans laquelle on passe en paramètre le resultat de interest contenue dans earned
#total = total_account.total_amount(token)
total=iterate_credit_account(token)
#print(total)
else:
try:
amount = get_amount()# ici on tente de récupèrer le montant que l'on a rentrer
except ValueError as ve: # si il n'arrive pas à convertir en float
return render_template('client_file.html', client=account_client, error=ve)# ici on retourne la page html client_file.html au niveau de laquelle on injecte dans les variables client et error accessibles depuis la page html, on leur pattribut comme valeur pour client la variable client définit plus haut qui contient le client en cours, et dans error le message d'erreur définit dans exception
if request.form['action'] == 'credit':# ici on verifie quel boutton a été cliquer (c a d que l'on vérifie si la velur de la clé action est bien credit)
account.credit(amount) #dans ce cas on ajoute amount à l'account
#print(account)
#total= total_account.total_amount(token)
total = iterate_credit_account(token)
else:
account.debit(amount)# sinon on débite amount d'account
#total= total_account.total_amount(token)
#print(client)
total = iterate_credit_account(token)
#current_sum = total
#db.commit()# ici on commit la base de données et on enregistre les modifs de l'account
#print(request.method)
#print("Total : {}".format(total))
return render_template('client_file_client.html', client=client , accounts=account_client, token=token, name=total)
def add_account(token, type): # Au clic de "Debit account" ou "Saving account" dans la page client_file.html, on injecte les valeurs de client_id et de type dans l'url, qui est ensuite récupéré comme paramètres client_id et type dans la fonction add_account
log.info('Controler add_account starts') # On met à jour le log avec une entrée de type info
client = get_client_using_Token(token)
if type == 1: # type est une variable qui va permettre a Flask de discriminer quel type de compte l'utilisateur a souhaité créer. Ici type=1 fait référence à un "Debit account"
account = DebitAccount(client) # Si l'utilisateur a souhaité créer un "Debit account", on crée une instance de DebitAccount, liée au client en cours à travers le paramètre client_id et stockée dans la variable account
else:
account = SavingAccount(client, 0.03) # Sinon, l'utilisateur a souhaité créer un "Saving account", on crée donc une instance de SavingAccount, liée au client à travers client_id et stockée dans account
db.add(account) # On ajoute le nouveau compte dans la base de donnée
db.commit() # et on valide la modification de la base de donnée (commit)
return redirect(url_for('client_file_client', token=token))# Enfin on redirige l'utilisateur vers sa page profil client_file.html
def add_account_admin(token, type): # Au clic de "Debit account" ou "Saving account" dans la page client_file.html, on injecte les valeurs de client_id et de type dans l'url, qui est ensuite récupéré comme paramètres client_id et type dans la fonction add_account
log.info('Controler add_account starts') # On met à jour le log avec une entrée de type info
client = get_client_using_Token(token)
if type == 1: # type est une variable qui va permettre a Flask de discriminer quel type de compte l'utilisateur a souhaité créer. Ici type=1 fait référence à un "Debit account"
account = DebitAccount(client) # Si l'utilisateur a souhaité créer un "Debit account", on crée une instance de DebitAccount, liée au client en cours à travers le paramètre client_id et stockée dans la variable account
else:
account = SavingAccount(client, 0.03) # Sinon, l'utilisateur a souhaité créer un "Saving account", on crée donc une instance de SavingAccount, liée au client à travers client_id et stockée dans account
db.add(account) # On ajoute le nouveau compte dans la base de donnée
db.commit() # et on valide la modification de la base de donnée (commit)
return redirect(url_for('client_file', token=token))# Enfin on redirige l'utilisateur vers sa page profil client_file.html
def del_account(token):
log.info('Controle del_account starts')
client_id= get_client_using_Token(token)
if request.method == 'POST':
enter_number= request.form['number']
req= db.query(BankAccount).filter_by(number=enter_number)
account=db.execute(req).fetchone()
#print("this account admin", account)
if account is None:
return render_template('redirectory_to_delete_account.html', number=enter_number)
if client_id != account[2]:
return render_template('redirectory_to_delete_account.html', number=enter_number)
if client_id == account[2]:
db.query(SavingAccount).filter_by(number=request.form['number']).delete()
#print(req)
db.commit()
return redirect(url_for('client_file', token=token))# dans le url_for (qui est une fonction) le 'client file' ici est un end point d'une url définiit dans le main et qui va appeler le reste de l'url au moment de l'éxécution de la fonction, et qui va injecter la donneé contenu de "client_id" à l'emplcement correspondant dans l'url du main
else:
return render_template('delete_account.html', token=token)
def del_account_client(token):
log.info('Controle del_account_client starts')
client_id= get_client_using_Token(token)
if request.method == 'POST':
enter_number= request.form['number']
req= db.query(BankAccount).filter_by(number=enter_number)
account=db.execute(req).fetchone()
print("this account client", account)
if account is None:
return render_template('redirectory_to_delete_account_client.html', number=enter_number)
if client_id != account[2] or account is None:
return render_template('redirectory_to_delete_account_client.html', number=enter_number)
if client_id == account[2]:
db.query(SavingAccount).filter_by(number=request.form['number']).delete()
#print(req)
db.commit()
return redirect(url_for('client_file', token=token))# dans le url_for (qui est une fonction) le 'client file' ici est un end point d'une url définiit dans le main et qui va appeler le reste de l'url au moment de l'éxécution de la fonction, et qui va injecter la donneé contenu de "client_id" à l'emplcement correspondant dans l'url du main
else:
return render_template('delete_account_client.html',token=token)
def display_account(token): # Permet d'afficher le profil du compte sélectionné
log.info('Controler display_account starts') # On met à jour le log avec une entrée de type info
#raise NotImplementedError() # La fonction est prévue mais pas encore implémentée. Le raise permet de traiter proprement le cas d'erreur en informant l'utilisateur que la fonctionnalité n'est pas encore opérationnelle
| 61.065395 | 522 | 0.693677 | 3,253 | 22,411 | 4.670458 | 0.130341 | 0.023893 | 0.028961 | 0.015007 | 0.726321 | 0.710985 | 0.688672 | 0.677878 | 0.671757 | 0.662015 | 0 | 0.003166 | 0.2248 | 22,411 | 366 | 523 | 61.23224 | 0.871352 | 0.488867 | 0 | 0.603524 | 0 | 0 | 0.132426 | 0.032454 | 0 | 0 | 0 | 0.002732 | 0 | 1 | 0.079295 | false | 0.022026 | 0.030837 | 0 | 0.264317 | 0.008811 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
aeddb855c5a797610dabb8dbde157b30a300ad42 | 2,452 | py | Python | dds/core/models.py | htrueman/data-delivery-system | 667681f09df4b4cd0adfbaae86b878d08e3a08c6 | [
"Apache-2.0"
] | null | null | null | dds/core/models.py | htrueman/data-delivery-system | 667681f09df4b4cd0adfbaae86b878d08e3a08c6 | [
"Apache-2.0"
] | null | null | null | dds/core/models.py | htrueman/data-delivery-system | 667681f09df4b4cd0adfbaae86b878d08e3a08c6 | [
"Apache-2.0"
] | null | null | null | from django.contrib.auth import password_validation
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
from django.contrib.auth.hashers import make_password
from django.contrib.auth.models import PermissionsMixin
from django.db import models
class SystemUserManager(BaseUserManager):
use_in_migrations = True
def _create_user(self, username, email, password, **extra_fields):
"""
Creates and saves a user with the given username, email and password.
"""
if not email:
raise ValueError('Email is required.')
email = self.normalize_email(email)
user = self.model(username=username, email=email, **extra_fields)
user.set_password(password)
user.save(using=self._db)
return user
def create_user(self, username, email, password=None, **extra_fields):
extra_fields.setdefault('is_superuser', False)
return self._create_user(username, email, password, **extra_fields)
def create_superuser(self, username, email, password, **extra_fields):
extra_fields.setdefault('is_superuser', True)
if extra_fields.get('is_superuser') is not True:
raise ValueError('Superuser must have is_superuser=True.')
return self._create_user(username, email, password, **extra_fields)
class SystemUser(AbstractBaseUser, PermissionsMixin):
username = models.CharField(max_length=40)
email = models.EmailField(max_length=50, unique=True)
is_active = models.BooleanField(default=True)
USERNAME_FIELD = 'email'
REQUIRED_FIELDS = ['username']
objects = SystemUserManager()
@property
def is_staff(self):
return self.is_superuser
class GitRepository(models.Model):
username = models.CharField(max_length=40)
password = models.CharField(max_length=128)
deep_link = models.CharField(max_length=150)
user = models.ForeignKey('SystemUser', on_delete=models.CASCADE)
_password = None
class Meta:
verbose_name_plural = 'Git repositories'
def save(self, *args, **kwargs):
self.set_password(self.password)
super().save(*args, **kwargs)
if self._password is not None:
password_validation.password_changed(self._password, self)
self._password = None
def set_password(self, raw_password):
self.password = make_password(raw_password)
self._password = raw_password
| 34.535211 | 77 | 0.705546 | 290 | 2,452 | 5.772414 | 0.310345 | 0.05914 | 0.062724 | 0.050179 | 0.221027 | 0.221027 | 0.158901 | 0.062127 | 0.062127 | 0 | 0 | 0.006119 | 0.200245 | 2,452 | 70 | 78 | 35.028571 | 0.847527 | 0.02814 | 0 | 0.08 | 0 | 0 | 0.055532 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.12 | false | 0.34 | 0.1 | 0.02 | 0.62 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
aef3007d13ada0815d1caed5154b33e00a29e3cb | 862 | py | Python | GUI/Cocoa/Container.py | gcewing/PyGUI | 58c6c38ccb8e66acdf98dea6b24bef1d9a03147c | [
"MIT"
] | 9 | 2019-07-15T19:03:27.000Z | 2021-11-24T19:50:02.000Z | GUI/Cocoa/Container.py | mnabeelp/PyGUI | 58c6c38ccb8e66acdf98dea6b24bef1d9a03147c | [
"MIT"
] | 3 | 2019-09-11T13:22:10.000Z | 2020-08-19T20:13:00.000Z | GUI/Cocoa/Container.py | mnabeelp/PyGUI | 58c6c38ccb8e66acdf98dea6b24bef1d9a03147c | [
"MIT"
] | 4 | 2020-02-23T16:50:06.000Z | 2022-02-10T07:15:35.000Z | #
# Python GUI - Containers - PyObjC version
#
from AppKit import NSView
from GUI.Utils import PyGUI_Flipped_NSView
from GUI import export
from GUI.GContainers import Container as GContainer
class Container(GContainer):
# _ns_inner_view NSView Containing NSView for subcomponents
# def __init__(self, _ns_view, **kwds):
# GContainer.__init__(self, _ns_view = _ns_view, **kwds)
# def destroy(self):
# #print "Container.destroy:", self ###
# GContainer.destroy(self)
# #print "Container.destroy: breaking inner link to", self._ns_inner_view ###
def _add(self, comp):
GContainer._add(self, comp)
self._ns_inner_view.addSubview_(comp._ns_view)
def _remove(self, comp):
GContainer._remove(self, comp)
comp._ns_view.removeFromSuperview()
#------------------------------------------------------------------------------
export(Container)
| 26.9375 | 79 | 0.679814 | 103 | 862 | 5.359223 | 0.368932 | 0.054348 | 0.059783 | 0.050725 | 0.115942 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.13109 | 862 | 31 | 80 | 27.806452 | 0.736983 | 0.49652 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 0 | 0.583333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
4e0349dfed050e2f0c2d7deb551b772a3559056a | 523 | py | Python | tests/test_question.py | thiagosalvatore/poo-exercise | ab897d9b17b3aa63252c4fa7334f624f6d380d9a | [
"Apache-2.0"
] | null | null | null | tests/test_question.py | thiagosalvatore/poo-exercise | ab897d9b17b3aa63252c4fa7334f624f6d380d9a | [
"Apache-2.0"
] | null | null | null | tests/test_question.py | thiagosalvatore/poo-exercise | ab897d9b17b3aa63252c4fa7334f624f6d380d9a | [
"Apache-2.0"
] | null | null | null | import pytest
from poo_exercise.models import Question
def test_create_question():
question = Question("Whats your name", ["Thiago", "James", "Bond"], "Thiago")
assert question
def test_create_question_without_options_should_raise_error():
with pytest.raises(AssertionError):
Question("Whats your name", [], None)
def test_create_question_invalid_correct_value_should_raise_error():
with pytest.raises(AssertionError):
Question("Whats your name", ["Thiago", "James", "Bond"], "Joao")
| 27.526316 | 81 | 0.730402 | 63 | 523 | 5.777778 | 0.47619 | 0.057692 | 0.107143 | 0.173077 | 0.667582 | 0.508242 | 0.508242 | 0.368132 | 0.368132 | 0.368132 | 0 | 0 | 0.14914 | 523 | 18 | 82 | 29.055556 | 0.817978 | 0 | 0 | 0.181818 | 0 | 0 | 0.162524 | 0 | 0 | 0 | 0 | 0 | 0.272727 | 1 | 0.272727 | false | 0 | 0.181818 | 0 | 0.454545 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4e1579e95ea1c5c41beabd72c1214ff8afca88c6 | 913 | py | Python | model/dataloader.py | georgehalal/DetectNet | 8fc6661af60ae0bc26e3553117179ec3b5ddaacf | [
"MIT"
] | null | null | null | model/dataloader.py | georgehalal/DetectNet | 8fc6661af60ae0bc26e3553117179ec3b5ddaacf | [
"MIT"
] | null | null | null | model/dataloader.py | georgehalal/DetectNet | 8fc6661af60ae0bc26e3553117179ec3b5ddaacf | [
"MIT"
] | null | null | null | import os
import pdb
import pandas as pd
import pickle as pkl
import torch
from torch.utils.data import Dataset, DataLoader
class DetectionDataset(Dataset):
def __init__(self, dslice):
"""Load the datasets
Args:
dslice: data slice (train, test, or val)
"""
dirname = os.path.join('/scratch/users/georgech/data/preprocessed_binary/',dslice)
self.true = torch.load(os.path.join(dirname,'true.pth'))
self.cond = torch.load(os.path.join(dirname,'cond.pth'))
self.out = torch.load(os.path.join(dirname,'out.pth'))#.view([-1,1])
def __len__(self):
# Return the size of the dataset
return self.out.size()[0]
def __getitem__(self, idx):
"""Access data sample given an index
Args:
idx: index of data sample
"""
return self.cond[idx], self.true[idx], self.out[idx]
| 25.361111 | 90 | 0.613363 | 123 | 913 | 4.447154 | 0.447154 | 0.043876 | 0.073126 | 0.082267 | 0.142596 | 0.142596 | 0 | 0 | 0 | 0 | 0 | 0.004438 | 0.259584 | 913 | 35 | 91 | 26.085714 | 0.804734 | 0.202629 | 0 | 0 | 0 | 0 | 0.109756 | 0.074695 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1875 | false | 0 | 0.375 | 0.0625 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
4e182abe2bd01aafd28e9ab0a5bb9f08c612a469 | 587 | py | Python | ExpenseTracker/expense/migrations/0002_auto_20200912_1458.py | lennyAiko/LifeExpenses | ec345228bca00742b0b08cf3fc294dba6574b515 | [
"MIT"
] | null | null | null | ExpenseTracker/expense/migrations/0002_auto_20200912_1458.py | lennyAiko/LifeExpenses | ec345228bca00742b0b08cf3fc294dba6574b515 | [
"MIT"
] | null | null | null | ExpenseTracker/expense/migrations/0002_auto_20200912_1458.py | lennyAiko/LifeExpenses | ec345228bca00742b0b08cf3fc294dba6574b515 | [
"MIT"
] | 1 | 2020-09-01T15:38:19.000Z | 2020-09-01T15:38:19.000Z | # Generated by Django 3.1.1 on 2020-09-12 13:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('expense', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='expenseitem',
name='date_purchased',
field=models.DateField(),
),
migrations.AlterField(
model_name='expenseprofile',
name='monthlyBudget',
field=models.DecimalField(blank=True, decimal_places=2, max_digits=50, null=True),
),
]
| 24.458333 | 94 | 0.594549 | 58 | 587 | 5.913793 | 0.741379 | 0.116618 | 0.145773 | 0.169096 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.052885 | 0.291312 | 587 | 23 | 95 | 25.521739 | 0.771635 | 0.076661 | 0 | 0.235294 | 1 | 0 | 0.131481 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.058824 | 0 | 0.235294 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4e1b409402762dd39acfb8b525e5332bf32c844f | 1,215 | py | Python | app.py | ismaeelakram/Discord-Embeds | 3991d984edc6c7d8229784d8372a62dcc226250f | [
"MIT"
] | null | null | null | app.py | ismaeelakram/Discord-Embeds | 3991d984edc6c7d8229784d8372a62dcc226250f | [
"MIT"
] | null | null | null | app.py | ismaeelakram/Discord-Embeds | 3991d984edc6c7d8229784d8372a62dcc226250f | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request
import json
app = Flask(__name__)
base_url = "https://embed.ismaeelakram.com"
# TODO: Make homepage to generate queries
@app.route('/')
def home():
return 'Homepage coming soon..'
@app.route('/embed')
def embed():
title = request.args.get('title') or ""
author = request.args.get('author') or ""
color = request.args.get('color') or ""
image = request.args.get('image') or "https://cdn.ismaeelakram.com/1x1.png"
url = request.args.get('url') or base_url
oembed_url = f"{base_url}/oembed?author={author}".replace(' ', '%20')
if image != "":
image = image.replace('+', ' ').replace(' ', '%20')
if color != "":
color = color.replace('#', '')
if url != base_url:
url = url.replace(' ', '%20')
return render_template('embed.html', title=title, color=color, image=image, author=author, url=url,
oembed_url=oembed_url)
@app.route('/oembed')
def oembed():
author = request.args.get('author') or ""
oembed_dict = dict()
oembed_dict["type"] = "photo"
oembed_dict["author_name"] = author
return oembed_dict
if __name__ == '__main__':
app.run()
| 25.851064 | 103 | 0.611523 | 155 | 1,215 | 4.625806 | 0.309677 | 0.09205 | 0.117155 | 0.055788 | 0.078103 | 0.078103 | 0 | 0 | 0 | 0 | 0 | 0.008316 | 0.20823 | 1,215 | 46 | 104 | 26.413043 | 0.737006 | 0.032099 | 0 | 0.0625 | 1 | 0 | 0.18569 | 0.028109 | 0 | 0 | 0 | 0.021739 | 0 | 1 | 0.09375 | false | 0 | 0.0625 | 0.03125 | 0.25 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4e1c0e88901002cd3ae5f4ecfc2b6d2e051d85b0 | 3,187 | py | Python | src/rules_engine/rules_engine.py | funnel-io/funnel-rules-engine | 637c8973503446c75ca63d08eb3b3f91ef220122 | [
"MIT"
] | 3 | 2021-10-08T12:45:26.000Z | 2022-03-25T11:53:56.000Z | src/rules_engine/rules_engine.py | funnel-io/funnel-rules-engine | 637c8973503446c75ca63d08eb3b3f91ef220122 | [
"MIT"
] | 5 | 2021-10-10T11:18:54.000Z | 2021-12-29T22:02:05.000Z | src/rules_engine/rules_engine.py | funnel-io/funnel-rules-engine | 637c8973503446c75ca63d08eb3b3f91ef220122 | [
"MIT"
] | null | null | null | from concurrent.futures import ThreadPoolExecutor
class RulesEngine:
def __init__(self, *rules):
self.rules = rules
def reject(self, *tags):
"""Returns a new instance without the rules matching any of the given tags."""
return self.__class__(*filter(lambda rule: not rule.matches(*tags), self.rules))
def run(self, state):
"""Short-circuits on the first applicable rule."""
return next(self.run_all(state, lazy=True), None)
def run_all(self, state, lazy=False):
"""
Runs all applicable rules and returns the result as a list.
Accepts the optional boolean argument 'lazy' to return a generator of the results.
"""
return result((rule.action(state) for rule in self.rules if rule.condition(state)), lazy)
def run_all_in_parallel(self, state, lazy=False):
"""
Runs all applicable rules in parallel threads and returns the result as a list.
Accepts the optional boolean argument 'lazy' to return a generator of the results.
"""
def run_rule(rule):
return rule.action(state) if rule.condition(state) else NoMatch
with ThreadPoolExecutor() as parallel:
return result(only_executed(parallel.map(run_rule, self.rules)), lazy)
def select(self, *tags):
"""Returns a new instance with the rules matching any of the given tags."""
return self.__class__(*filter(lambda rule: rule.matches(*tags), self.rules))
class Rule:
"""
Contains a condition callable and an action callable.
The condition takes a state and returns True or False.
The action takes a state and is executed if the condition returned True.
"""
def __init__(self, condition, action, tags=None):
self.condition = condition
self.action = action
self.tags = tags or []
def matches(self, *tags):
"""Returns whether the rule is tagged with any of the given tags."""
return any((tag in self.tags for tag in tags))
def __repr__(self):
return f"<{self.__class__.__name__} id={id(self)} tags={self.tags}>"
class NoAction(Rule):
"""This rule returns None if its condition matches."""
def __init__(self, condition, tags=None):
super().__init__(condition, then(None), tags=tags)
class Otherwise(Rule):
"""This rule always executes its action."""
def __init__(self, action, tags=None):
super().__init__(then(True), action, tags=tags)
class NoMatch:
"""Represents a rule not matching and hence its action not being executed."""
def only_executed(results):
return (result for result in results if result != NoMatch)
def result(generator, lazy):
return generator if lazy else list(generator)
def then(value):
"""
Creates an action that ignores the passed state and returns the value.
>>> then(1)("whatever")
1
>>> then(1)("anything")
1
"""
return lambda _state: value
def when(value):
"""
Creates a predicate function comparing the state to the value.
>>> when(1)(1)
True
>>> when(1)(2)
False
"""
return lambda state: state == value
| 28.20354 | 97 | 0.652338 | 429 | 3,187 | 4.72028 | 0.247086 | 0.027654 | 0.021728 | 0.019259 | 0.256296 | 0.232593 | 0.194568 | 0.194568 | 0.155062 | 0.155062 | 0 | 0.003313 | 0.242234 | 3,187 | 112 | 98 | 28.455357 | 0.835197 | 0.354879 | 0 | 0 | 0 | 0 | 0.030966 | 0.013881 | 0 | 0 | 0 | 0 | 0 | 1 | 0.390244 | false | 0 | 0.02439 | 0.097561 | 0.829268 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
4e25f6f23191d4a60303b03c54da9b561912579a | 299 | py | Python | UpdaterTest/service/main.py | kived/py4a-updater | 44c00382f78297cabba63207a37ea59e722507d9 | [
"MIT"
] | 5 | 2015-03-21T18:45:07.000Z | 2022-03-29T14:58:09.000Z | UpdaterTest/service/main.py | kived/py4a-updater | 44c00382f78297cabba63207a37ea59e722507d9 | [
"MIT"
] | null | null | null | UpdaterTest/service/main.py | kived/py4a-updater | 44c00382f78297cabba63207a37ea59e722507d9 | [
"MIT"
] | 3 | 2015-08-17T13:17:58.000Z | 2021-01-28T10:07:30.000Z | '''
Sample Android app updater service.
Remember to set the update check url below.
'''
UPDATE_CHECK_URL = 'http://192.168.2.130/updatecheck.txt'
from pyupdater.service import Updater
print 'service loading'
if __name__ == '__main__':
print 'service starting'
Updater(UPDATE_CHECK_URL).run()
| 18.6875 | 57 | 0.752508 | 42 | 299 | 5.071429 | 0.714286 | 0.15493 | 0.197183 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03861 | 0.133779 | 299 | 15 | 58 | 19.933333 | 0.783784 | 0 | 0 | 0 | 0 | 0 | 0.35545 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.166667 | null | null | 0.333333 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4e29fa8af5c1c540ab19f0c1eafab2e3233bf16a | 150 | py | Python | bjit_erp/models/contacts.py | KamrulSh/custom_erp_odoo | 5b48d1850888920b2ebf7bb7dcabc024030e2e28 | [
"MIT"
] | null | null | null | bjit_erp/models/contacts.py | KamrulSh/custom_erp_odoo | 5b48d1850888920b2ebf7bb7dcabc024030e2e28 | [
"MIT"
] | null | null | null | bjit_erp/models/contacts.py | KamrulSh/custom_erp_odoo | 5b48d1850888920b2ebf7bb7dcabc024030e2e28 | [
"MIT"
] | null | null | null | from odoo import models, fields, api
class EmployeesInformation(models.Model):
_inherit = 'res.users'
_description = "Inherit Contact Info"
| 21.428571 | 41 | 0.74 | 17 | 150 | 6.411765 | 0.882353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.173333 | 150 | 6 | 42 | 25 | 0.879032 | 0 | 0 | 0 | 0 | 0 | 0.193333 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4e2f8c6c786c92f0f6059123c15169d6456f69da | 402 | py | Python | widgets/message_boxes/DBusErrorMessageBox.py | Wanket/DeSnapper | a321e6ce9ae493dfe4345b6b103e10050e380636 | [
"MIT"
] | null | null | null | widgets/message_boxes/DBusErrorMessageBox.py | Wanket/DeSnapper | a321e6ce9ae493dfe4345b6b103e10050e380636 | [
"MIT"
] | null | null | null | widgets/message_boxes/DBusErrorMessageBox.py | Wanket/DeSnapper | a321e6ce9ae493dfe4345b6b103e10050e380636 | [
"MIT"
] | null | null | null | from typing import Optional
from PyQt5.QtWidgets import QWidget
from dbus import DBusException
from widgets.message_boxes.ErrorMessageBox import ErrorMessageBox
class DBusErrorMessageBox(ErrorMessageBox):
def __init__(self, exception: DBusException, parent: Optional[QWidget] = None):
super().__init__(f"DBus error: {exception.get_dbus_name()}\n{exception.get_dbus_message()}", parent)
| 33.5 | 108 | 0.79602 | 47 | 402 | 6.531915 | 0.574468 | 0.078176 | 0.104235 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002809 | 0.114428 | 402 | 11 | 109 | 36.545455 | 0.859551 | 0 | 0 | 0 | 0 | 0 | 0.176617 | 0.146766 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.571429 | 0 | 0.857143 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
9d891495415c3f1e7a886c1ca6536f82d309da99 | 1,750 | py | Python | Project-Euler/python/8.py | marshallhumble/Project_Euler | 90101d308a3342a0eab33c1f4580df549bfc8896 | [
"MIT"
] | 3 | 2015-12-16T18:38:34.000Z | 2015-12-22T15:21:17.000Z | Project-Euler/python/8.py | marshallhumble/Project_Euler | 90101d308a3342a0eab33c1f4580df549bfc8896 | [
"MIT"
] | null | null | null | Project-Euler/python/8.py | marshallhumble/Project_Euler | 90101d308a3342a0eab33c1f4580df549bfc8896 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Find the greatest product of five consecutive digits in the 1000-digit number
"""
num = '\
73167176531330624919225119674426574742355349194934\
96983520312774506326239578318016984801869478851843\
85861560789112949495459501737958331952853208805511\
12540698747158523863050715693290963295227443043557\
66896648950445244523161731856403098711121722383113\
62229893423380308135336276614282806444486645238749\
30358907296290491560440772390713810515859307960866\
70172427121883998797908792274921901699720888093776\
65727333001053367881220235421809751254540594752243\
52584907711670556013604839586446706324415722155397\
53697817977846174064955149290862569321978468622482\
83972241375657056057490261407972968652414535100474\
82166370484403199890008895243450658541227588666881\
16427171479924442928230863465674813919123162824586\
17866458359124566529476545682848912883142607690042\
24219022671055626321111109370544217506941658960408\
07198403850962455444362981230987879927244284909188\
84580156166097919133875499200524063689912560717606\
05886116467109405077541002256983155200055935729725\
71636269561882670428252483600823257530420752963450'
biggest = 0
i = 0
while i < len(num) - 12:
one = int(num[i])
two = int(num[i + 1])
thr = int(num[i + 2])
fou = int(num[i + 3])
fiv = int(num[i + 4])
six = int(num[i + 5])
sev = int(num[i + 6])
eig = int(num[i + 7])
nin = int(num[i + 8])
ten = int(num[i + 9])
ele = int(num[i + 10])
twe = int(num[i + 11])
thi = int(num[i + 12])
product = one * two * thr * fou * fiv * six * sev * eig * nin * ten * ele * twe * thi
if product > biggest:
biggest = product
i += 1
def test_function():
assert biggest == 23514624000
| 33.018868 | 89 | 0.782857 | 138 | 1,750 | 9.92029 | 0.536232 | 0.056976 | 0.066472 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.684524 | 0.136 | 1,750 | 52 | 90 | 33.653846 | 0.220899 | 0.056 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.023256 | 1 | 0.023256 | false | 0 | 0 | 0 | 0.023256 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
9d8b251777adb233fafcbbb2e29ff957c108f54b | 798 | py | Python | NepsAcademy/Problemas/Python/medalhas.py | jailsonsf/NepsAcademy | ea5bb721cd19631bb5a8fc44c51d5d964ae37f49 | [
"MIT"
] | null | null | null | NepsAcademy/Problemas/Python/medalhas.py | jailsonsf/NepsAcademy | ea5bb721cd19631bb5a8fc44c51d5d964ae37f49 | [
"MIT"
] | null | null | null | NepsAcademy/Problemas/Python/medalhas.py | jailsonsf/NepsAcademy | ea5bb721cd19631bb5a8fc44c51d5d964ae37f49 | [
"MIT"
] | null | null | null | athlete_1 = int(input())
athlete_2 = int(input())
athlete_3 = int(input())
podium = []
if (athlete_1 < athlete_2 and athlete_1 < athlete_3):
podium.append(1)
if(athlete_2 < athlete_3):
podium.append(2)
podium.append(3)
else:
podium.append(3)
podium.append(2)
elif (athlete_2 < athlete_1 and athlete_2 < athlete_3):
podium.append(2)
if(athlete_1 < athlete_3):
podium.append(1)
podium.append(3)
else:
podium.append(3)
podium.append(1)
elif (athlete_3 < athlete_1 and athlete_3 < athlete_2):
podium.append(3)
if(athlete_1 < athlete_2):
podium.append(1)
podium.append(2)
else:
podium.append(2)
podium.append(1)
print(podium[0])
print(podium[1])
print(podium[3])
| 19.95 | 55 | 0.610276 | 115 | 798 | 4.052174 | 0.121739 | 0.386266 | 0.167382 | 0.171674 | 0.613734 | 0.429185 | 0.429185 | 0.180258 | 0.180258 | 0 | 0 | 0.065878 | 0.258145 | 798 | 39 | 56 | 20.461538 | 0.721284 | 0 | 0 | 0.580645 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.096774 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.