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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
36c951e5276d9f53f5952092ad440f64332162cf | 2,083 | py | Python | simpleparam/utilities.py | lukasz-migas/SimpleParam | a796df44c675d67d82a73ff5cac689fd626ebfde | [
"MIT"
] | null | null | null | simpleparam/utilities.py | lukasz-migas/SimpleParam | a796df44c675d67d82a73ff5cac689fd626ebfde | [
"MIT"
] | 16 | 2019-10-28T07:43:59.000Z | 2021-10-19T02:40:28.000Z | simpleparam/utilities.py | lukasz-migas/SimpleParam | a796df44c675d67d82a73ff5cac689fd626ebfde | [
"MIT"
] | null | null | null | """Utilities"""
import inspect
import numbers
def is_number(obj):
"""Check if value is a number"""
if isinstance(obj, numbers.Number):
return True
# The extra check is for classes that behave like numbers, such as those
# found in numpy, gmpy, etc.
elif hasattr(obj, "__int__") and hasattr(obj, "__add__"):
return True
return False
def classlist(class_):
"""
Return a list of the class hierarchy above (and including) the given class.
Same as inspect.getmro(class_)[::-1]
"""
return inspect.getmro(class_)[::-1]
def get_all_slots(class_):
"""
Return a list of slot names for slots defined in class_ and its
superclasses.
"""
# A subclass's __slots__ attribute does not contain slots defined
# in its superclass (the superclass' __slots__ end up as
# attributes of the subclass).
all_slots = []
parent_param_classes = [c for c in classlist(class_)[1::]]
for c in parent_param_classes:
if hasattr(c, "__slots__"):
all_slots += c.__slots__
return all_slots
def get_occupied_slots(instance):
"""
Return a list of slots for which values have been set.
(While a slot might be defined, if a value for that slot hasn't
been set, then it's an AttributeError to request the slot's
value.)
"""
return [slot for slot in get_all_slots(type(instance)) if hasattr(instance, slot)]
# CLS_MATCH = {"Integer": Integer, "Number": Number, "String": String,
# "Choice": Choice, "Option": Option, "Boolean": Boolean, "Range": Range,
# "Color": Color}
# def _validate_parameter(values):
# """Validate and create parameter
# Parameters
# ----------
# values : dict
# dictionary containing standard Parameter values
# Returns
# -------
# Parameter
# Parameter object based on values defined in the `values` object
# """
# obj_cls = values.get("kind", None)
# try:
# return cls_match.get(obj_cls, None)
# except ValueError:
# return None
| 27.051948 | 86 | 0.635142 | 271 | 2,083 | 4.697417 | 0.416974 | 0.031422 | 0.025923 | 0.030636 | 0.02828 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001935 | 0.255881 | 2,083 | 76 | 87 | 27.407895 | 0.819355 | 0.611138 | 0 | 0.105263 | 0 | 0 | 0.032349 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.210526 | false | 0 | 0.105263 | 0 | 0.631579 | 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 |
36d56cba023ac58af790292426c05b96c7e82f4d | 256 | py | Python | sample.py | SuryaThiru/Neural-style-transfer | f3b8b057470272f96b9d2c56843f221423622aa4 | [
"MIT"
] | 2 | 2018-08-23T15:31:55.000Z | 2018-09-02T06:34:58.000Z | sample.py | SuryaThiru/Neural-style-transfer | f3b8b057470272f96b9d2c56843f221423622aa4 | [
"MIT"
] | null | null | null | sample.py | SuryaThiru/Neural-style-transfer | f3b8b057470272f96b9d2c56843f221423622aa4 | [
"MIT"
] | null | null | null | from neural_transer import style_transfer
cnt_image = 'img/neckarfront.jpg'
style_image = 'img/starry_night.jpg'
output = 'test/'
epochs = 600
save_per_epoch = 40
style_transfer(cnt_image, style_image, output, epochs, save_per_epoch, random_canvas=True)
| 25.6 | 90 | 0.800781 | 39 | 256 | 4.923077 | 0.615385 | 0.135417 | 0.166667 | 0.21875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.021834 | 0.105469 | 256 | 9 | 91 | 28.444444 | 0.816594 | 0 | 0 | 0 | 0 | 0 | 0.171875 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.142857 | 0 | 0.142857 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
36ea8a32a0668bd4bbd6c03cb9c6b7c7ebd5724f | 982 | py | Python | Programmers/10. Graph/02. Rank.py | Minoolian/Coding_Test | 5eb781b880919733b07d6a0313f592a6a9ac117a | [
"MIT"
] | null | null | null | Programmers/10. Graph/02. Rank.py | Minoolian/Coding_Test | 5eb781b880919733b07d6a0313f592a6a9ac117a | [
"MIT"
] | null | null | null | Programmers/10. Graph/02. Rank.py | Minoolian/Coding_Test | 5eb781b880919733b07d6a0313f592a6a9ac117a | [
"MIT"
] | null | null | null | # 순위
#
# https://programmers.co.kr/learn/courses/30/lessons/49191
def solution(n, results):
answer=0
adj=[[0 for _ in range(n+1)] for _ in range(n+1)]
for w,l in results:
adj[w][l]=2
adj[l][w]=1
# for i in range(n+1):
# for j in range(n+1):
# if adj[i][j]==1:
# for k in range(n+1):
# if adj[i][k]==2:
# adj[j][k]=2
# elif adj[i][j]==2:
# for k in range(n+1):
# if adj[i][k]==1:
# adj[j][k]=1
for i in range(n+1):
for j in range(n+1):
for k in range(n+1):
if adj[i][j]==1 and adj[i][k]==2:
adj[j][k]=2
elif adj[i][j]==2 and adj[i][k]==1:
adj[j][k]=1
for lis in adj:
if lis.count(0)==2:
answer+=1
return answer
solution(5,[[4, 3], [4, 2], [3, 2], [1, 2], [2, 5]])
| 23.380952 | 58 | 0.382892 | 164 | 982 | 2.280488 | 0.219512 | 0.168449 | 0.192513 | 0.216578 | 0.561497 | 0.561497 | 0.489305 | 0.489305 | 0.489305 | 0.409091 | 0 | 0.081851 | 0.427699 | 982 | 41 | 59 | 23.95122 | 0.58363 | 0.360489 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.055556 | false | 0 | 0 | 0 | 0.111111 | 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 |
36ef964d24945b4eaaa28ef1098391f2ca1097e8 | 296 | py | Python | ProgramFlow/tuple/unpacking_tuple.py | kumarvgit/python3 | 318c5e7503fafc9c60082fa123e2930bd82a4ec9 | [
"MIT"
] | null | null | null | ProgramFlow/tuple/unpacking_tuple.py | kumarvgit/python3 | 318c5e7503fafc9c60082fa123e2930bd82a4ec9 | [
"MIT"
] | null | null | null | ProgramFlow/tuple/unpacking_tuple.py | kumarvgit/python3 | 318c5e7503fafc9c60082fa123e2930bd82a4ec9 | [
"MIT"
] | null | null | null | a = b = c = d = e = f = 12
x, y = 1, 2 # unpacking tuple
print(x)
print(y)
print('unpack tuple - or any sequence type')
data = (1, 2, 3)
a, b, c = data
print(a)
print(b)
print(c)
print('unpack list - or any sequence type')
data_list = [4, 5, 6]
a, b, c = data_list
print(a)
print(b)
print(c)
| 14.8 | 44 | 0.597973 | 61 | 296 | 2.868852 | 0.409836 | 0.034286 | 0.051429 | 0.194286 | 0.445714 | 0.205714 | 0 | 0 | 0 | 0 | 0 | 0.043668 | 0.226351 | 296 | 19 | 45 | 15.578947 | 0.720524 | 0.050676 | 0 | 0.375 | 0 | 0 | 0.248201 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.625 | 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 |
7fda033a8e28be93a2affa940ea5458e245ba96d | 3,779 | py | Python | bitbucket.py | Acidburn0zzz/difio | 1485f657f099f6a8401ad7cfe155f524a8a9a422 | [
"Apache-2.0"
] | 4 | 2016-06-01T12:48:54.000Z | 2021-08-19T22:21:47.000Z | bitbucket.py | Acidburn0zzz/difio | 1485f657f099f6a8401ad7cfe155f524a8a9a422 | [
"Apache-2.0"
] | 3 | 2016-01-20T17:06:45.000Z | 2016-01-20T17:07:06.000Z | bitbucket.py | Acidburn0zzz/difio | 1485f657f099f6a8401ad7cfe155f524a8a9a422 | [
"Apache-2.0"
] | 2 | 2015-01-21T21:30:19.000Z | 2017-08-08T06:03:02.000Z | #!/usr/bin/env python
################################################################################
#
# Copyright (c) 2012, Alexander Todorov <atodorov@nospam.dif.io>
#
# 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.
#
################################################################################
import json
import httplib
import logging
from datetime import datetime
logger = logging.getLogger(__name__)
def _get_user_repo(url):
"""
Return the :user/:repo/ from a bitbucket.org url
"""
if (url.find('://bitbucket.org') > -1) or (url.find('@bitbucket.org') > -1):
p = url.split('/')
return '%s/%s' % (p[3], p[4])
return None
def get_tags(url):
"""
Return all BitBucket tags for this package.
@url - string - either checkout url or http url for the project page
"""
user_repo = _get_user_repo(url)
if not user_repo:
raise Exception("BitBucket - get_tags - can't find repository for %s" % url)
conn = httplib.HTTPSConnection('api.bitbucket.org')
conn.request('GET', '/1.0/repositories/%s/tags' % user_repo)
response = conn.getresponse()
if (response.status != 200):
raise Exception("BitBucket - get_tags - returned %d for %s" % (response.status, url))
json_data = response.read().decode('UTF-8')
data = json.loads(json_data)
return data.keys()
def get_files_and_dirs(url, dir = ""):
"""
Return a list of all files and dirs in the tree.
"""
user_repo = _get_user_repo(url)
if not user_repo:
raise Exception("BitBucket - get_files - can't find repository for %s" % url)
conn = httplib.HTTPSConnection('api.bitbucket.org')
conn.request('GET', '/1.0/repositories/%s/src/tip/%s' % (user_repo, dir))
response = conn.getresponse()
if (response.status != 200):
raise Exception("BitBucket - get_files - returned %d for %s" % (response.status, url))
json_data = response.read().decode('UTF-8')
data = json.loads(json_data)
return [f['path'] for f in data['files']], data['directories']
def get_files(url):
"""
Return a list of all files in the tree.
Used for searching changelog.
"""
files, dirs = get_files_and_dirs(url)
#todo: fix me: need to browse directories as well
return files
if __name__ == "__main__":
from utils import which_tag, which_changelog
for url in ["https://bitbucket.org/runeh/anyjson", "https://bitbucket.org/simplecodes/wtforms/src"]:
tags = get_tags(url)
print url, tags
print "-------------------------------------------------------------"
url = "https://bitbucket.org/haypo/python-ptrace/"
name = "python-ptrace"
version = "0.6.4"
vtag = which_tag(version, get_tags(url), name)
print version, vtag, url
url = "https://bitbucket.org/simplecodes/wtforms"
version = "0.6.2"
vtag = which_tag(version, get_tags(url))
print version, vtag, url
print "-------------------------------------------------------------"
for url in ["https://bitbucket.org/simplecodes/wtforms/src", "https://bitbucket.org/haypo/python-ptrace/"]:
files = get_files(url)
changelog = which_changelog(files)
print url, changelog
| 29.755906 | 111 | 0.60307 | 487 | 3,779 | 4.572895 | 0.328542 | 0.059273 | 0.045802 | 0.0467 | 0.461608 | 0.403682 | 0.305344 | 0.2793 | 0.2793 | 0.2793 | 0 | 0.009977 | 0.204287 | 3,779 | 126 | 112 | 29.992063 | 0.730629 | 0.178089 | 0 | 0.315789 | 0 | 0 | 0.293933 | 0.069667 | 0 | 0 | 0 | 0.015873 | 0 | 0 | null | null | 0 | 0.087719 | null | null | 0.105263 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
7fe05d73c8a1674d7b5671d08de7b53c293e132d | 583 | py | Python | isic/config.py | bomcon123456/isic | bf86f6a057c96c85a089587e2e1076bf5d586d3f | [
"Apache-2.0"
] | null | null | null | isic/config.py | bomcon123456/isic | bf86f6a057c96c85a089587e2e1076bf5d586d3f | [
"Apache-2.0"
] | 2 | 2021-09-28T05:33:52.000Z | 2022-02-26T09:50:37.000Z | isic/config.py | bomcon123456/isic | bf86f6a057c96c85a089587e2e1076bf5d586d3f | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/config.ipynb (unless otherwise specified).
__all__ = ['AppConfig', 'PathConfig', 'TrainConfig']
# Cell
class AppConfig:
SEED = 8080
NUM_CLASSES = 7
class PathConfig:
# DATA_PATH = '/content/data'
# IMAGE_PATH = '/content/data/images'
# CSV_PATH = '/content/data/HAM10000_metadata.csv'
DATA_PATH = "/Work/Workspace/ML/HAM10000/data"
IMAGE_PATH = DATA_PATH + "/images"
CSV_PATH = DATA_PATH + "/HAM10000_metadata.csv"
class TrainConfig:
BATCH_SIZE = 64
EPOCHS = 100
LR = 1e-6 | 24.291667 | 90 | 0.662093 | 72 | 583 | 5.138889 | 0.583333 | 0.086486 | 0.121622 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.059211 | 0.217839 | 583 | 24 | 91 | 24.291667 | 0.752193 | 0.373928 | 0 | 0 | 1 | 0 | 0.252778 | 0.15 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0.916667 | 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 | 0 | 0 | 1 | 0 | 0 | 2 |
7fe53ee82ed46073c6a237e84551569f667f24cc | 678 | py | Python | hardware/Utils/utils.py | ab7289/mercury-hardware | dc2a4e888184a32aaa1355a1fe9ec77a9cb15ebe | [
"MIT"
] | 1 | 2020-05-09T21:37:12.000Z | 2020-05-09T21:37:12.000Z | hardware/Utils/utils.py | ab7289/mercury-hardware | dc2a4e888184a32aaa1355a1fe9ec77a9cb15ebe | [
"MIT"
] | 8 | 2020-05-07T01:54:14.000Z | 2020-05-13T21:31:56.000Z | hardware/Utils/utils.py | ab7289/mercury-hardware | dc2a4e888184a32aaa1355a1fe9ec77a9cb15ebe | [
"MIT"
] | 2 | 2020-05-06T22:24:20.000Z | 2020-05-13T20:32:29.000Z | import os
import json
from datetime import datetime, timezone
from .logger import Logger
SENSOR_KEYS = {
"ALL": "all",
"TEMPERATURE": "temperature",
"PRESSURE": "pressure",
"HUMIDITY": "humidity",
"ACCELERATION": "acceleration",
"ORIENTATION": "orientation",
}
def get_sensor_keys():
return SENSOR_KEYS
def get_serial_stream(s):
return (json.dumps(s) + "\n").encode()
def get_logger(key, file_name=None):
if file_name is None:
file_name = key
logger = Logger(name=key, filename=os.environ[file_name])
return logger
def date_str_with_current_timezone():
return datetime.now(timezone.utc).astimezone().isoformat()
| 19.941176 | 62 | 0.685841 | 84 | 678 | 5.357143 | 0.47619 | 0.071111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.184366 | 678 | 33 | 63 | 20.545455 | 0.813743 | 0 | 0 | 0 | 0 | 0 | 0.159292 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.173913 | false | 0 | 0.173913 | 0.130435 | 0.521739 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 2 |
3d0ee01e1137aa36111fec6b4751453d15c9af03 | 574 | py | Python | Sistema Caixa Supermercados/produtos.py | FelipeECarvalho/Projetos | 978536dc61b2ba19c40d7f6065e99cd605f53aeb | [
"MIT"
] | 1 | 2021-08-22T17:10:08.000Z | 2021-08-22T17:10:08.000Z | Sistema Caixa Supermercados/produtos.py | FelipeECarvalho/Projetos | 978536dc61b2ba19c40d7f6065e99cd605f53aeb | [
"MIT"
] | null | null | null | Sistema Caixa Supermercados/produtos.py | FelipeECarvalho/Projetos | 978536dc61b2ba19c40d7f6065e99cd605f53aeb | [
"MIT"
] | null | null | null | produto = {}
produto["2295"] = [5.99, "Banana Nanica"]
produto["2219"] = [7.99, "Banana prata"]
produto["2172"] = [9.99, "Maçã Fuji"]
produto["2547"] = [8.99, "Maçã Gala"]
produto["2127"] = [12.99, "Mamão Papaya"]
produto["2134"] = [10.99, "Mamão Formosa"]
produto["5843"] = [12.99, "Pão Francês"]
produto["1052"] = [4.99, "Tomate Carmem"]
produto["7622210194046"] = [12.99, "CHOCOLATE MILKA 100G"]
produto["9788575225639"] = [56, "Entendendo algoritmos"]
produto["5601229873236"] = [3, "Lapiseira Molin 0,7mm"]
produto["7898938236034"] = [6.99, "Coca-Cola Garrafa Pet 2L"]
| 41 | 61 | 0.648084 | 77 | 574 | 4.831169 | 0.662338 | 0.032258 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.250493 | 0.116725 | 574 | 13 | 62 | 44.153846 | 0.483235 | 0 | 0 | 0 | 0 | 0 | 0.456446 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
3d110556dac2904883b202a0e3778011b72d0d6a | 8,035 | py | Python | core/metrics_eval.py | YifanQie/Deep_Learning_for_Manufacturing | 9ba19e41f69c561b04b8573ab9c52c0969f45bfd | [
"MIT"
] | 27 | 2019-10-31T15:16:13.000Z | 2022-03-29T03:56:57.000Z | core/metrics_eval.py | YifanQie/Deep_Learning_for_Manufacturing | 9ba19e41f69c561b04b8573ab9c52c0969f45bfd | [
"MIT"
] | 4 | 2020-03-25T14:18:04.000Z | 2022-02-10T00:34:58.000Z | core/metrics_eval.py | YifanQie/Deep_Learning_for_Manufacturing | 9ba19e41f69c561b04b8573ab9c52c0969f45bfd | [
"MIT"
] | 7 | 2020-02-23T22:12:37.000Z | 2021-12-08T20:14:41.000Z | """ Contains classes and methods to obtain various regression based metrics to evaluate"""
from sklearn import metrics
import numpy as np
import pandas as pd
import math
import sys
sys.path.append("../config")
class MetricsEval:
"""MetricsEval Class
Evaluate metrics to evaluate model performance
"""
def metrics_eval_base(self,predicted_y, test_y,logs_path,run_id=0):
"""Get predicted and actual value for all KCCs and return regression metrics namely: Mean Absolute Error, Mean Squared Error, Root Mean Squared Error, R-Squared Value
:param predicted_y: predicted values for the process parameters
:type conn_str: numpy.array [test_samples*kccs] (required)
:param predicted_y: actual values for the process parameters
:type conn_str: numpy.array [test_samples*kccs] (required)
:param logs_path: Logs path to save the evaluation metrics
:type logs_path: str (required)
:returns: dictionary of all metrics for each KCC
:rtype: dict
:returns: dataframe of all metrics for each KCC
:rtype: pandas.dataframe
"""
kcc_dim=test_y.shape[1]
import kcc_config as kcc_config
#kcc_struct=kcc_config.get_kcc_struct()
kcc_struct=kcc_config.kcc_struct
# Calculating Regression Based Evaluation Metrics
mae_KCCs=np.zeros((kcc_dim))
mse_KCCs=np.zeros((kcc_dim))
r2_KCCs=np.zeros((kcc_dim))
#print(kcc_struct)
kcc_id=[]
for kcc in kcc_struct:
if(kcc['kcc_type']==1):
kcc_name=kcc['kcc_id']
kcc_id.append(kcc_name)
mae_KCCs=metrics.mean_absolute_error(predicted_y, test_y,multioutput='raw_values')
mse_KCCs=metrics.mean_squared_error(predicted_y, test_y,multioutput='raw_values')
r2_KCCs = metrics.r2_score(predicted_y, test_y,multioutput='raw_values')
#print(kcc_id)
rmse_KCCs=np.sqrt(mse_KCCs)
eval_metrics= {
"KCC_ID":kcc_id,
"Mean Absolute Error" : mae_KCCs,
"Mean Squared Error" : mse_KCCs,
"Root Mean Squared Error" : rmse_KCCs,
"R Squared" : r2_KCCs
}
#print(len(kcc_id),len(mae_KCCs),len(mae_KCCs),len(rmse_KCCs),len(r2_KCCs))
#print(eval_metrics)
accuracy_metrics_df=pd.DataFrame.from_dict(eval_metrics)
accuracy_metrics_df=accuracy_metrics_df.set_index('KCC_ID')
#accuracy_metrics_df.to_csv(logs_path+'/metrics.csv') #moved to function call
return eval_metrics,accuracy_metrics_df
def metrics_eval_classification(self,y_pred, y_true,logs_path,run_id=0):
"""Get predicted and actual value for all KCCs and return regression metrics namely: Mean Absolute Error, Mean Squared Error, Root Mean Squared Error, R-Squared Value
:param predicted_y: predicted values for the process parameters
:type conn_str: numpy.array [test_samples*kccs] (required)
:param predicted_y: actual values for the process parameters
:type conn_str: numpy.array [test_samples*kccs] (required)
:param logs_path: Logs path to save the evaluation metrics
:type logs_path: str (required)
:returns: dictionary of all metrics for each KCC
:rtype: dict
:returns: dataframe of all metrics for each KCC
:rtype: pandas.dataframe
"""
kcc_dim=y_true.shape[1]
import kcc_config as kcc_config
kcc_struct=kcc_config.get_kcc_struct()
# Calculating Regression Based Evaluation Metrics
kcc_id=[]
for kcc in kcc_struct:
if(kcc['kcc_type']==1):
kcc_name=kcc['kcc_id']
kcc_id.append(kcc_name)
acc_kccs=[]
f1_kccs=[]
pre_kccs=[]
recall_kccs=[]
roc_auc_kccs=[]
kappa_kccs=[]
from sklearn.metrics import accuracy_score,f1_score,precision_score,recall_score,roc_auc_score,cohen_kappa_score
for i in range(y_true.shape[1]):
#Binary Prediction arrray
y_pred_bin=np.where(y_pred[:,i] > 0.5, 1, 0)
acc_kccs.append(accuracy_score(y_true[:,i],y_pred_bin))
f1_kccs.append(f1_score(y_true[:,i],y_pred_bin))
pre_kccs.append(precision_score(y_true[:,i],y_pred_bin))
recall_kccs.append(recall_score(y_true[:,i],y_pred_bin))
kappa_kccs.append(cohen_kappa_score(y_true[:,i],y_pred_bin))
#Probablity based Scoring
roc_auc_kccs.append(roc_auc_score(y_true[:,i],y_pred[:,i]))
eval_metrics= {
"KCC_ID":kcc_id,
"Accuracy" : acc_kccs,
"F1" : f1_kccs,
"Precision" : pre_kccs,
"Recall" : recall_kccs,
"ROC_AUC":roc_auc_kccs,
"Kappa":kappa_kccs
}
accuracy_metrics_df=pd.DataFrame.from_dict(eval_metrics)
accuracy_metrics_df=accuracy_metrics_df.set_index('KCC_ID')
#accuracy_metrics_df.to_csv(logs_path+'/metrics.csv') #moved to function call
return eval_metrics,accuracy_metrics_df
def metrics_eval_cop(self,predicted_y, test_y,logs_path,run_id=0):
"""Get predicted and actual value for all KCCs and return regression metrics namely: Mean Absolute Error, Mean Squared Error, Root Mean Squared Error, R-Squared Value
:param predicted_y: predicted values for the process parameters
:type conn_str: numpy.array [test_samples*kccs] (required)
:param predicted_y: actual values for the process parameters
:type conn_str: numpy.array [test_samples*kccs] (required)
:param logs_path: Logs path to save the evaluation metrics
:type logs_path: str (required)
:returns: dictionary of all metrics for each KCC
:rtype: dict
:returns: dataframe of all metrics for each KCC
:rtype: pandas.dataframe
"""
kcc_dim=test_y.shape[1]
mae_KCCs=np.zeros((kcc_dim))
mse_KCCs=np.zeros((kcc_dim))
r2_KCCs=np.zeros((kcc_dim))
mae_KCCs=metrics.mean_absolute_error(predicted_y, test_y,multioutput='raw_values')
mse_KCCs=metrics.mean_squared_error(predicted_y, test_y,multioutput='raw_values')
r2_KCCs = metrics.r2_score(predicted_y, test_y,multioutput='raw_values')
rmse_KCCs=np.sqrt(mse_KCCs)
r2_adjusted=np.zeros(kcc_dim)
from tqdm import tqdm
for i in tqdm(range(kcc_dim)):
y_cop_test_flat=test_y[:,i]
y_cop_pred_flat=predicted_y[:,i]
combined_array=np.stack([y_cop_test_flat,y_cop_pred_flat],axis=1)
filtered_array=combined_array[np.where(abs(combined_array[:,0]) >= 0)]
y_cop_test_vector=filtered_array[:,0:1]
y_cop_pred_vector=filtered_array[:,1:2]
#print(y_cop_pred_vector.shape)
r2_adjusted[i] = metrics.r2_score(y_cop_test_vector,y_cop_pred_vector,multioutput='raw_values')[0]
eval_metrics= {
"Mean Absolute Error" : mae_KCCs,
"Mean Squared Error" : mse_KCCs,
"Root Mean Squared Error" : rmse_KCCs,
"R Squared" : r2_KCCs,
"R Squared Adjusted" : r2_adjusted
}
accuracy_metrics_df=pd.DataFrame({'MAE':mae_KCCs,'MSE':mse_KCCs,'RMSE':rmse_KCCs,'R2':r2_KCCs,"R2_Adjusted":r2_adjusted},columns=['MAE','MSE','RMSE','R2',"R2_Adjusted"])
#accuracy_metrics_df.to_csv(logs_path+'/metrics.csv') #moved to function call
return eval_metrics,accuracy_metrics_df
def metrics_eval_aleatoric_model(self,predicted_y, test_y,logs_path):
kcc_dim=test_y.shape[1]
log_variance=y_pred[:,kcc_dim]
variance=np.exp(log_variance)
predicted_y_sub=predicted_y[:,0:(kcc_dim-1)]
standard_deviation=np.sqrt(variance)
avg_aleatoric_SD=np.mean(standard_deviation)
# Calculating Regression Based Evaluation Metrics
mae_KCCs=np.zeros((kcc_dim))
mse_KCCs=np.zeros((kcc_dim))
r2_KCCs=np.zeros((kcc_dim))
kcc_id=[]
for i in range(kcc_dim):
kcc_name="KCC_"+str(i+1)
kcc_id.append(kcc_name)
mae_KCCs=metrics.mean_absolute_error(predicted_y_sub, test_y,multioutput='raw_values')
mse_KCCs=metrics.mean_squared_error(predicted_y_sub, test_y,multioutput='raw_values')
r2_KCCs = metrics.r2_score(predicted_y_sub, test_y,multioutput='raw_values')
rmse_KCCs=sqrt(mse_KCCs)
eval_metrics= {
"Mean Absolute Error" : mae_KCCs,
"Mean Squared Error" : mse_KCCs,
"Root Mean Squared Error" : rmse_KCCs,
"R Squared" : r2_KCCs,
"Aleatoric Standard Deviation":avg_aleatoric_SD
}
accuracy_metrics_df=pd.DataFrame({'KCC_ID':kcc_id,'MAE':mae_KCCs,'MSE':mse_KCCs,'RMSE':rmse_KCCs,'R2':r2_KCCs})
accuracy_metrics_df.columns = ['KCC_ID','MAE','MSE','RMSE','R2']
accuracy_metrics_df.to_csv(logs_path+'/metrics.csv')
return eval_metrics | 34.04661 | 171 | 0.743622 | 1,264 | 8,035 | 4.428006 | 0.113924 | 0.03752 | 0.048597 | 0.023227 | 0.721815 | 0.704306 | 0.684831 | 0.650884 | 0.645882 | 0.637663 | 0 | 0.008291 | 0.144368 | 8,035 | 236 | 172 | 34.04661 | 0.805818 | 0.333292 | 0 | 0.460317 | 0 | 0 | 0.105577 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.031746 | false | 0 | 0.071429 | 0 | 0.142857 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
3d21eb68d020e05868581b779ca18d9a0b0fba6b | 176 | py | Python | web/app/helpers.py | anarkiwi/packet_cafe | c21aff28b9526ffa83a0b77352976503915d9c90 | [
"Apache-2.0"
] | 23 | 2020-08-05T01:36:34.000Z | 2022-03-29T11:44:03.000Z | web/app/helpers.py | anarkiwi/packet_cafe | c21aff28b9526ffa83a0b77352976503915d9c90 | [
"Apache-2.0"
] | 232 | 2020-08-10T20:32:20.000Z | 2022-03-31T21:14:57.000Z | web/app/helpers.py | anarkiwi/packet_cafe | c21aff28b9526ffa83a0b77352976503915d9c90 | [
"Apache-2.0"
] | 8 | 2020-08-27T04:17:55.000Z | 2021-07-28T04:52:28.000Z | import json
def load_tools(file_path='/definitions/workers.json'):
tools = {}
with open(file_path) as json_file:
tools = json.load(json_file)
return tools
| 22 | 54 | 0.681818 | 25 | 176 | 4.6 | 0.52 | 0.13913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.210227 | 176 | 7 | 55 | 25.142857 | 0.827338 | 0 | 0 | 0 | 0 | 0 | 0.142045 | 0.142045 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0 | 0.5 | 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 |
3d451b0939082e3bed7d043ceed21a7c3ecb8e4f | 2,481 | py | Python | server/ui/admin/models.py | elise-baumgartner/onramp | beb3c807264fcb70d8069ff2e3990b0ce3f59912 | [
"BSD-3-Clause"
] | 2 | 2016-09-09T04:19:01.000Z | 2019-02-15T20:28:13.000Z | server/ui/admin/models.py | elise-baumgartner/onramp | beb3c807264fcb70d8069ff2e3990b0ce3f59912 | [
"BSD-3-Clause"
] | 67 | 2016-06-02T19:37:56.000Z | 2018-02-22T05:23:45.000Z | server/ui/admin/models.py | elise-baumgartner/onramp | beb3c807264fcb70d8069ff2e3990b0ce3f59912 | [
"BSD-3-Clause"
] | 9 | 2015-06-22T22:10:22.000Z | 2016-04-26T15:35:45.000Z |
from django.contrib.auth.models import User
from django.db import models
class workspace(models.Model):
workspace_id = models.AutoField(primary_key=True)
workspace_name = models.CharField(unique=True, max_length=255)
description = models.TextField()
class pce(models.Model):
pce_id = models.AutoField(primary_key=True)
pce_name = models.CharField(unique=True, max_length=255)
ip_addr = models.TextField(default='127.0.0.1')
ip_port = models.IntegerField(default=0)
state = models.IntegerField(default=0)
contact_info = models.TextField(default='')
location = models.TextField(default='')
description = models.TextField(default='')
pce_username = models.TextField(default='onramp') #TODO not sure if this is right
class module(models.Model):
module_id = models.AutoField(primary_key=True)
module_name = models.CharField(unique=True, max_length=255)
version = models.TextField(default='')
src_location = models.TextField(default='')
description = models.TextField(default='')
class job(models.Model):
job_id = models.AutoField(primary_key=True)
user = models.ForeignKey(User)
workspace = models.ForeignKey(workspace)
pce = models.ForeignKey(pce)
module = models.ForeignKey(module)
job_name = models.TextField()
state = models.IntegerField(default=0)
output_file = models.TextField(default='') # TODO FileField or FilePathField?
# TODO run_parameters, files, runtime
class user_to_workspace(models.Model):
uw_pair_id = models.AutoField(primary_key=True)
user = models.ForeignKey(User)
workspace = models.ForeignKey(workspace)
class Meta:
unique_together = ('user', 'workspace')
class module_to_pce(models.Model):
pm_pair_id = models.AutoField(primary_key=True)
pce = models.ForeignKey(pce)
module = models.ForeignKey(module)
state = models.IntegerField(default=0)
src_location_type = models.TextField(default='local')
src_location_path = models.TextField(default='')
install_location = models.TextField(default='')
is_visible = models.BooleanField(default=True)
# TODO uioptions, runparams
class Meta:
unique_together = ('pce', 'module')
class workspace_to_pce_module(models.Model):
wpm_pair_id = models.AutoField(primary_key=True)
workspace = models.ForeignKey(workspace)
pm_pair = models.ForeignKey(module_to_pce)
class Meta:
unique_together = ('workspace', 'pm_pair')
| 35.442857 | 85 | 0.727126 | 305 | 2,481 | 5.747541 | 0.245902 | 0.119795 | 0.150599 | 0.095836 | 0.460924 | 0.407872 | 0.390188 | 0.300628 | 0.10154 | 0.10154 | 0 | 0.009104 | 0.158807 | 2,481 | 69 | 86 | 35.956522 | 0.830858 | 0.050383 | 0 | 0.314815 | 0 | 0 | 0.024681 | 0 | 0 | 0 | 0 | 0.014493 | 0 | 1 | 0 | false | 0 | 0.037037 | 0 | 0.944444 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
3d52d5c4aa0672e1693dcba4d1903e4c13a09981 | 168 | py | Python | aiocloudflare/api/zones/logpush/validate/destination/exists/exists.py | Stewart86/aioCloudflare | 341c0941f8f888a8b7e696e64550bce5da4949e6 | [
"MIT"
] | 2 | 2021-09-14T13:20:55.000Z | 2022-02-24T14:18:24.000Z | aiocloudflare/api/zones/logpush/validate/destination/exists/exists.py | Stewart86/aioCloudflare | 341c0941f8f888a8b7e696e64550bce5da4949e6 | [
"MIT"
] | 46 | 2021-09-08T08:39:45.000Z | 2022-03-29T12:31:05.000Z | aiocloudflare/api/zones/logpush/validate/destination/exists/exists.py | Stewart86/aioCloudflare | 341c0941f8f888a8b7e696e64550bce5da4949e6 | [
"MIT"
] | 1 | 2021-12-30T23:02:23.000Z | 2021-12-30T23:02:23.000Z | from aiocloudflare.commons.auth import Auth
class Exists(Auth):
_endpoint1 = "zones"
_endpoint2 = "logpush/validate/destination/exists"
_endpoint3 = None
| 21 | 54 | 0.738095 | 18 | 168 | 6.722222 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.021583 | 0.172619 | 168 | 7 | 55 | 24 | 0.848921 | 0 | 0 | 0 | 0 | 0 | 0.238095 | 0.208333 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 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 |
e9f25ffca812b0c9f7dadf75c0e89c4e2ae3f5e4 | 9,439 | py | Python | TB2J/manager.py | obaica/TB2J | 6e6d32769d20d751b1ced15f947b59962dfa0ea3 | [
"BSD-2-Clause"
] | 1 | 2021-01-27T23:53:30.000Z | 2021-01-27T23:53:30.000Z | TB2J/manager.py | obaica/TB2J | 6e6d32769d20d751b1ced15f947b59962dfa0ea3 | [
"BSD-2-Clause"
] | null | null | null | TB2J/manager.py | obaica/TB2J | 6e6d32769d20d751b1ced15f947b59962dfa0ea3 | [
"BSD-2-Clause"
] | 1 | 2021-01-28T00:37:14.000Z | 2021-01-28T00:37:14.000Z | import os
from TB2J.myTB import MyTB, merge_tbmodels_spin
import numpy as np
from TB2J.exchange import ExchangeCL, ExchangeNCL
from TB2J.exchangeCL2 import ExchangeCL2
from TB2J.utils import read_basis, auto_assign_basis_name
from ase.io import read
from TB2J.sisl_wrapper import SislWrapper
from TB2J.gpaw_wrapper import GPAWWrapper
def gen_exchange(path,
colinear=True,
orb_order=1,
posfile='POSCAR',
prefix_up='wannier90.up',
prefix_dn='wannier90.dn',
prefix_SOC='wannier90',
min_hopping_norm=1e-4,
max_distance=None,
efermi=0,
magnetic_elements=[],
kmesh=[4, 4, 4],
emin=-12.0,
emax=0.0,
nz=100,
height=0.2,
nz1=50,
nz2=200,
nz3=50,
exclude_orbs=[],
Rcut=None,
ne=None,
description=''):
atoms = read(os.path.join(path, posfile))
basis_fname = os.path.join(path, 'basis.txt')
if colinear:
print("Reading Wannier90 hamiltonian: spin up.")
tbmodel_up = MyTB.read_from_wannier_dir(
path=path, prefix=prefix_up, posfile=posfile, nls=False)
print("Reading Wannier90 hamiltonian: spin down.")
tbmodel_dn = MyTB.read_from_wannier_dir(
path=path, prefix=prefix_dn, posfile=posfile, nls=False)
if os.path.exists(basis_fname):
basis = read_basis(basis_fname)
else:
basis, _ = auto_assign_basis_name(tbmodel_up.xred, atoms)
print("Starting to calculate exchange.")
exchange = ExchangeCL2(
tbmodels=(tbmodel_up, tbmodel_dn),
atoms=atoms,
basis=basis,
efermi=efermi,
magnetic_elements=magnetic_elements,
kmesh=kmesh,
emin=emin,
emax=emax,
nz=nz,
height=height,
nz1=nz1,
nz2=nz2,
nz3=nz3,
exclude_orbs=exclude_orbs,
Rcut=Rcut,
ne=ne,
description=description)
exchange.run()
print("All calculation finsihed. The results are in TB2J_results directory.")
elif colinear and 0:
print("Reading Wannier90 hamiltonian: spin up.")
tbmodel_up = MyTB.read_from_wannier_dir(
path=path, prefix=prefix_up, posfile=posfile, nls=False)
print("Reading Wannier90 hamiltonian: spin down.")
tbmodel_dn = MyTB.read_from_wannier_dir(
path=path, prefix=prefix_dn, posfile=posfile, nls=False)
tbmodel = merge_tbmodels_spin(tbmodel_up, tbmodel_dn)
if os.path.exists(basis_fname):
basis = read_basis(basis_fname)
else:
basis, _ = auto_assign_basis_name(tbmodel.xred, atoms)
print("Starting to calculate exchange.")
exchange = ExchangeCL(
tbmodels=tbmodel,
atoms=atoms,
basis=basis,
efermi=efermi,
magnetic_elements=magnetic_elements,
kmesh=kmesh,
emin=emin,
emax=emax,
nz=nz,
height=height,
nz1=nz1,
nz2=nz2,
nz3=nz3,
exclude_orbs=exclude_orbs,
Rcut=Rcut,
ne=ne,
description=description)
exchange.run()
print("All calculation finsihed. The results are in TB2J_results directory.")
else:
print("Reading Wannier90 hamiltonian: non-colinear spin.")
tbmodel = MyTB.read_from_wannier_dir(
path=path, prefix=prefix_SOC, posfile=posfile, nls=True)
if orb_order==1:
pass
if orb_order==2:
tbmodel=tbmodel.reorder()
if os.path.exists(basis_fname):
print("The use of basis file is deprecated. It will be ignored.")
#basis = read_basis(basis_fname)
else:
basis, _ = auto_assign_basis_name(tbmodel.xred, atoms)
print("Starting to calculate exchange.")
exchange = ExchangeNCL(
tbmodels=tbmodel,
atoms=atoms,
basis=basis,
efermi=efermi,
magnetic_elements=magnetic_elements,
kmesh=kmesh,
emin=emin,
emax=emax,
nz=nz,
height=height,
nz1=nz1,
nz2=nz2,
nz3=nz3,
exclude_orbs=exclude_orbs,
Rcut=Rcut,
ne=ne,
description=description)
print("\n")
exchange.run()
print("All calculation finsihed. The results are in TB2J_results directory.")
def gen_exchange_siesta(
fdf_fname,
magnetic_elements=[],
kmesh=[4, 4, 4],
emin=-12.0,
emax=0.0,
nz=50,
#height=0.2,
#nz1=50,
#nz2=200,
#nz3=50,
exclude_orbs=[],
Rcut=None,
ne=None,
description=''):
try:
import sisl
except:
raise ImportError("sisl cannot be imported. Please install sisl first.")
fdf = sisl.get_sile(fdf_fname)
H = fdf.read_hamiltonian()
if H.spin.is_colinear:
print("Reading Siesta hamiltonian: colinear spin.")
tbmodel_up = SislWrapper(H, spin=0)
tbmodel_dn = SislWrapper(H, spin=1)
basis = dict(zip(tbmodel_up.orbs, list(range(tbmodel_up.norb))))
print("Starting to calculate exchange.")
exchange = ExchangeCL2(
tbmodels=(tbmodel_up, tbmodel_dn),
atoms=tbmodel_up.atoms,
basis=basis,
efermi=0.0,
magnetic_elements=magnetic_elements,
kmesh=kmesh,
emin=emin,
emax=emax,
nz=nz,
#height=height,
#nz1=nz1,
#nz2=nz2,
#nz3=nz3,
exclude_orbs=exclude_orbs,
Rcut=Rcut,
ne=ne,
description=description)
exchange.run()
print("\n")
print("All calculation finsihed. The results are in TB2J_results directory.")
elif H.spin.is_colinear:
print("Reading Siesta hamiltonian: colinear spin. Treat as non-colinear")
tbmodel = SislWrapper(H, spin='merge')
basis = dict(zip(tbmodel.orbs, list(range(tbmodel.nbasis))))
print("Starting to calculate exchange.")
exchange = ExchangeNCL(
tbmodels=tbmodel,
atoms=tbmodel.atoms,
basis=basis,
efermi=0.0,
magnetic_elements=magnetic_elements,
kmesh=kmesh,
emin=emin,
emax=emax,
nz=nz,
#height=height,
#nz1=nz1,
#nz2=nz2,
#nz3=nz3,
exclude_orbs=exclude_orbs,
Rcut=Rcut,
ne=ne,
description=description)
exchange.run()
print("\n")
print("All calculation finsihed. The results are in TB2J_results directory.")
elif H.spin.is_spinorbit:
print("Reading Siesta hamiltonian: non-colinear spin.")
tbmodel = SislWrapper(H, spin=None)
basis = dict(zip(tbmodel.orbs, list(range(tbmodel.nbasis))))
print("Starting to calculate exchange.")
exchange = ExchangeNCL(
tbmodels=tbmodel,
atoms=tbmodel.atoms,
basis=basis,
efermi=0.0,
magnetic_elements=magnetic_elements,
kmesh=kmesh,
emin=emin,
emax=emax,
nz=nz,
exclude_orbs=exclude_orbs,
Rcut=Rcut,
ne=ne,
description=description)
exchange.run()
print("\n")
print("All calculation finsihed. The results are in TB2J_results directory.")
def gen_exchange_gpaw(
gpw_fname,
magnetic_elements=[],
kmesh=[3, 3, 3],
emin=-12.0,
emax=0.0,
nz=50,
exclude_orbs=[],
Rcut=None,
description=''):
print("Reading from GPAW data and calculate electronic structure.")
model=GPAWWrapper(gpw_fname=gpw_fname)
efermi=model.calc.get_fermi_level()
print(f"Fermi Energy: {efermi}")
poses=np.vstack([model.positions, model.positions])
basis, _ = auto_assign_basis_name(poses, model.atoms)
if model.calc.get_spin_polarized():
print("Starting to calculate exchange.")
exchange = ExchangeNCL(
tbmodels=model,
atoms=model.atoms,
efermi=efermi,
basis=basis,
magnetic_elements=magnetic_elements,
kmesh=kmesh,
emin=emin,
emax=emax,
nz=nz,
exclude_orbs=exclude_orbs,
Rcut=Rcut,
description=description)
exchange.run()
print("\n")
print("All calculation finsihed. The results are in TB2J_results directory.")
| 34.323636 | 85 | 0.531836 | 972 | 9,439 | 5.019547 | 0.158436 | 0.055749 | 0.043042 | 0.034433 | 0.725559 | 0.698299 | 0.69338 | 0.69338 | 0.675548 | 0.66694 | 0 | 0.022638 | 0.377582 | 9,439 | 274 | 86 | 34.448905 | 0.80783 | 0.014832 | 0 | 0.717131 | 0 | 0 | 0.140442 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.011952 | false | 0.003984 | 0.043825 | 0 | 0.055777 | 0.119522 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
e9f2c2ec1fb15d592bc15c9080b09cd348487ccf | 9,580 | py | Python | nanopores/geometries/H_geo/subdomains.py | jhwnkim/nanopores | 98b3dbb5d36464fbdc03f59d224d38e4255324ce | [
"MIT"
] | 8 | 2016-09-07T01:59:31.000Z | 2021-03-06T12:14:31.000Z | nanopores/geometries/H_geo/subdomains.py | jhwnkim/nanopores | 98b3dbb5d36464fbdc03f59d224d38e4255324ce | [
"MIT"
] | null | null | null | nanopores/geometries/H_geo/subdomains.py | jhwnkim/nanopores | 98b3dbb5d36464fbdc03f59d224d38e4255324ce | [
"MIT"
] | 4 | 2017-12-06T17:43:01.000Z | 2020-05-01T05:41:14.000Z | """
mark domains/boundaries with dolfin MeshFunctions
"""
"""
ueberlegungen bzgl. abstraktion:
subdomain numbers werden gebraucht fuer:
-) bilinearformen (masse) --> als tupel
-> jede variable in (v,ionen,wasser) ist mit einem tupel \subset (0,1,2,..) assoziiert
-> diese assoziation ist eine geometrische eigenschaft, gehoert daher in geo file
-) fuer potential: permittivity
-) fuer ionen: versch. diffusionskonstanten
-) spaeter fuer wasser vielleicht etwas aehnliches, bei unified continuum mechanics (??)
-) charges, d.h. neumann boundaries fuer potential
-> moeglicherweise sowohl auf interfaces als auch boundaries
-> bisher aber nur auf interfaces --> also mass dS
-> tupel \subset (0,1,2,..) im geo file passend zu boundaries_list()
UND tupel mit den entsprechenden charges
-> sowas wie
Lv = 0.0*dS
for c in chargedinterfaces
Lv = Lv + Constant(charge(c))*dS(c)
-) dirichlet boundaries + randwerte
es waere schoen das alles in einer klasse zu haben und nicht alles erst "getten" zu muessen
"""
from dolfin import *
from math import sqrt, pow
from . import params_geo
synonymes = {
"bulkfluid": {"bulkfluidtop", "bulkfluidbottom"},
"fluid":{"bulkfluid","pore"},
"pore":{"poretop", "porecenter", "porebottom"},
"lipid":"membrane",
"solid":{"dna", "membrane", "molecule"},
"ions":"fluid",
"bulk":{"upperb","lowerb"}, #,"rightfluidb"},
"sideb":"rightfluidb",
"memb":"membraneb",
"chargeddnab":{"chargeddnainb","chargeddnaoutb"},
"dnab":{"chargeddnab","unchargeddnab"},
"noslip":{"dnab","membraneb"}, #"moleculeb"},
"nopressure":{"upperb","lowerb"},
#"charged":{"chargeddnab","moleculeb","membraneb"},
"ground":"upperb",
"bV":"lowerb",
"chargedmembraneb":"membraneb",
}
def norm2(x, y):
return sqrt(pow(x,2) + pow(y,2))
# lists containing subdomain classes, ordering is important: fluid first, molecule last
def subdomain_list(**params):
tmp = vars(params_geo)
params.update({key:tmp[key] for key in tmp \
if (not key in params and not key.startswith("__"))})
tolc = params["tolc"]
try:
x0 = params["x0"]
except (KeyError, NameError):
x0 = None
# subdomains
class BulkFluidTop(SubDomain):
def inside(self, x, on_boundary):
return x[1] > -tolc # other domains will overwrite
class BulkFluidBottom(SubDomain):
def inside(self, x, on_boundary):
return x[1] < tolc # other domains will overwrite
class Molecule(SubDomain):
def inside(self, x, on_boundary):
if x0 is not None:
return norm2(x[0], x[1]-x0[2]) <= params["rMolecule"] +tolc
else:
return False
#class MoleculeHull(SubDomain):
# def inside(self, x, on_boundary):
# if x0 is not None:
# return norm2(x[0], x[1]-x0[2]) <= params["rMolecule"] + params["rMH"] +tolc
# else:
# return False
class DNA(SubDomain):
def inside(self, x, on_boundary):
return (x[0] >= (params["r0"] - tolc) and x[0] <= (params["r1"] +tolc) \
and (abs(x[1])-tolc) <= 0.5*params["l0"])
class Membrane(SubDomain):
def inside(self, x, on_boundary):
return (x[0] >= (params["r1"] -tolc) and x[0] <= params["Rx"] \
and abs(x[1]) -tolc <= params["l1"]/2 )
# partion pore into three subdomains
class PoreTop(SubDomain):
def inside(self, x, on_boundary):
return (between(x[1],(params["l1"]/2, params["l0"]/2)) and between(x[0], (0,params["r0"])))
class PoreCenter(SubDomain):
def inside(self, x, on_boundary):
return (between(x[1],(-params["l1"]/2, params["l1"]/2)) and between(x[0], (0,params["r0"])))
class PoreBottom(SubDomain):
def inside(self, x, on_boundary):
return (between(x[1],(-params["l0"]/2,-params["l1"]/2)) and between(x[0], (0,params["r0"])))
return [BulkFluidTop(), BulkFluidBottom(), DNA(), Membrane(),
PoreTop(), PoreCenter(), PoreBottom(), Molecule(),]
def boundaries_list(**params):
tmp = vars(params_geo)
params.update({key:tmp[key] for key in tmp \
if (not key in params and not key.startswith("__"))})
tolc = params["tolc"]
try:
x0 = params["x0"]
except (KeyError, NameError):
x0 = None
# exterior fluid boundaries
class UpperB(SubDomain):
def inside(self, x, on_boundary):
return on_boundary and near(x[1], params["Ry"])
class LowerB(SubDomain):
def inside(self, x, on_boundary):
return on_boundary and near(x[1], -params["Ry"])
class LeftFluidB(SubDomain):
def inside(self, x, on_boundary):
if x0 is not None:
return on_boundary and near(x[0], 0) and \
not between(x[1], (x0[2] - params["rMolecule"], x0[2] + params["rMolecule"]))
else:
return on_boundary and near(x[0], 0)
class RightFluidB(SubDomain):
def inside(self, x, on_boundary):
return on_boundary and near(x[0], params["Rx"]) and abs(x[1]) >= params["l1"]/2 -tolc
# DNA boundaries
class ChargedDNAinB(SubDomain):
def inside(self, x, on_boundary):
return between(x[0], (params["r0"] -tolc, params["r0"] +tolc)) \
and between(abs(x[1]), ( -tolc, params["l0"]/2 +tolc))
class ChargedDNAoutB(SubDomain):
def inside(self, x, on_boundary):
return between(x[0], (params["r1"] -tolc, params["r1"] +tolc)) \
and between(abs(x[1]), (params["l1"]/2 -tolc, params["l0"]/2 +tolc))
class UnchargedDNAB(SubDomain):
def inside(self, x, on_boundary):
return ( between(x[0], (params["r0"] -tolc, params["r1"] +tolc)) \
and near(abs(x[1]), params["l0"]/2) )
#return ( ( near(x[0], params["r0"]) and between( x[1], (-params["l1"]/2 -tolc, params["l1"]/2 + tolc) ) ) \
# or ( between(x[0], (params["r0"] -tolc, params["r1"] +tolc)) and near(abs(x[1]), params["l0"]/2) ) )
# Molecule boundaries
class MoleculeB(SubDomain):
def inside(self, x, on_boundary):
if x0 is not None:
return between(norm2(x[0], x[1]-x0[2]), (params["rMolecule"] -tolc, params["rMolecule"] +tolc) )
else:
return False
# Membrane boundaries
class MembraneB(SubDomain):
def inside(self, x, on_boundary):
return between(x[0], (params["r1"] -tolc, params["Rx"] +tolc)) and near(abs(x[1]), params["l1"]/2)
# cross-section interfaces
class CrossTop2D(SubDomain):
def inside(self, x, on_boundary):
return (near(x[1],params["l0"]/2) and between(x[0],(0,params["r0"])))
class CrossCenterTop2D(SubDomain):
def inside(self, x, on_boundary):
return (near(x[1],params["l1"]/2) and between(x[0],(0,params["r0"])))
class CrossCenterBottom2D(SubDomain):
def inside(self, x, on_boundary):
return (near(x[1],-params["l1"]/2) and between(x[0],(0,params["r0"])))
class CrossBottom2D(SubDomain):
def inside(self, x, on_boundary):
return (near(x[1],-params["l0"]/2) and between(x[0],(0,params["r0"])))
return [UpperB(), LowerB(), LeftFluidB(), RightFluidB(),
ChargedDNAinB(), ChargedDNAoutB(), UnchargedDNAB(), MembraneB(),
CrossTop2D(), CrossCenterTop2D(), CrossCenterBottom2D(), CrossBottom2D(), MoleculeB(),]
#the following code seems to be only needed for backward compatibility
# get MeshFunctions
# def get_subdomain(mesh):
# subdomain = CellFunction("size_t", mesh, 0)
# for i,sub in enumerate(subdomain_list()):
# sub.mark(subdomain, i+1)
# return subdomain
# def get_boundaries(mesh):
# boundaries = FacetFunction("size_t", mesh, 0)
# UpperB().mark(boundaries, 11)
# LowerB().mark(boundaries, 12)
# LeftFluidB().mark(boundaries, 13)
# RightFluidB().mark(boundaries, 14)
# ChargedDNAinB().mark(boundaries, 21)
# ChargedDNAoutB().mark(boundaries, 22)
# UnchargedDNAB().mark(boundaries, 23)
# MembraneB().mark(boundaries, 31)
# #MoleculeB(x0).mark(boundaries, 41, False)
# return boundaries
# def get_porepartitions(mesh, x0):
# crosssections = get_subdomain(mesh, x0)
# PoreTop().mark(crosssections, 51, False)
# PoreCenter().mark(crosssections, 52, False)
# PoreBottom().mark(crosssections, 53, False)
# Molecule(x0).mark(crosssections, 4)
# return crosssections
# # get piecewise constant (pwc) function on subdomains (e.g. permittivity)
# # specified by list/array either as CellFunction or as DG0 Function
# class CellFunction2Expression(Expression):
# def __init__(self, cellfun):
# self.cellfun = cellfun
# def eval_cell(self, values, x, cell):
# values[0] = self.cellfun[cell.index]
# def get_pwc_cellfun(mesh,somearray):
# cellfun = CellFunction("double", mesh)
# for i,sub in enumerate(subdomain_list()):
# sub.mark(cellfun, somearray[i])
# return cellfun
# def get_pwc_DG(mesh,somearray):
# cellfun = get_pwc_cellfun(mesh,somearray)
# expr = CellFunction2Expression(cellfun)
# dgfun = Function(FunctionSpace(mesh,"DG",0))
# dgfun.interpolate(expr)
# return dgfun
# def get_permittivity_DG(mesh):
# return get_pwc_DG(mesh,perm)
# def get_diffusion_DG(mesh):
# return get_pwc_DG(mesh,diff)
| 37.131783 | 122 | 0.607411 | 1,184 | 9,580 | 4.860642 | 0.222973 | 0.046916 | 0.06881 | 0.084101 | 0.447785 | 0.423284 | 0.393397 | 0.371156 | 0.357081 | 0.34179 | 0 | 0.026968 | 0.233612 | 9,580 | 257 | 123 | 37.276265 | 0.756878 | 0.283194 | 0 | 0.362903 | 0 | 0 | 0.080695 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.193548 | false | 0 | 0.024194 | 0.153226 | 0.604839 | 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 |
e9f60dadccf90edcefed461f6c41df6e748c054c | 3,039 | py | Python | terrascript/vsphere/r.py | austin-millan/python-terrascript | 0c9793f7d91143728835ffd1e8f9f75d736bef47 | [
"BSD-2-Clause"
] | null | null | null | terrascript/vsphere/r.py | austin-millan/python-terrascript | 0c9793f7d91143728835ffd1e8f9f75d736bef47 | [
"BSD-2-Clause"
] | null | null | null | terrascript/vsphere/r.py | austin-millan/python-terrascript | 0c9793f7d91143728835ffd1e8f9f75d736bef47 | [
"BSD-2-Clause"
] | null | null | null | from terrascript import _resource
class vsphere_custom_attribute(_resource): pass
custom_attribute = vsphere_custom_attribute
class vsphere_datastore_cluster(_resource): pass
datastore_cluster = vsphere_datastore_cluster
class vsphere_resource_pool(_resource): pass
resource_pool = vsphere_resource_pool
class vsphere_storage_drs_vm_override(_resource): pass
storage_drs_vm_override = vsphere_storage_drs_vm_override
class vsphere_datacenter(_resource): pass
datacenter = vsphere_datacenter
class vsphere_compute_cluster(_resource): pass
compute_cluster= vsphere_compute_cluster
class vsphere_compute_cluster_vm_affinity_rule(_resource): pass
compute_cluster_vm_affinity_rule = vsphere_compute_cluster_vm_affinity_rule
class vsphere_compute_cluster_vm_anti_affinity_rule(_resource): pass
compute_cluster_vm_anti_affinity_rule = vsphere_compute_cluster_vm_anti_affinity_rule
class vsphere_compute_cluster_vm_dependency_rule(_resource): pass
compute_cluster_vm_dependency_rule = vsphere_compute_cluster_vm_dependency_rule
class vsphere_compute_cluster_vm_group(_resource): pass
compute_cluster_vm_group = vsphere_compute_cluster_vm_group
class vsphere_compute_cluster_vm_host_rule(_resource): pass
compute_cluster_vm_host_rule = vsphere_compute_cluster_vm_host_rule
class vsphere_drs_vm_override(_resource): pass
drs_vm_override = vsphere_drs_vm_override
class vsphere_dpm_host_override(_resource): pass
dpm_host_override = vsphere_dpm_host_override
class vsphere_ha_vm_override(_resource): pass
ha_vm_override = vsphere_ha_vm_override
class vsphere_compute_cluster_host_group(_resource): pass
compute_cluster_host_group = vsphere_compute_cluster_host_group
class vsphere_datastore_cluster_vm_anti_affinity_rule(_resource): pass
datastore_cluster_vm_anti_affinity_rule = vsphere_datastore_cluster_vm_anti_affinity_rule
class vsphere_distributed_port_group(_resource): pass
distributed_port_group = vsphere_distributed_port_group
class vsphere_distributed_virtual_switch(_resource): pass
distributed_virtual_switch = vsphere_distributed_virtual_switch
class vsphere_file(_resource): pass
file = vsphere_file
class vsphere_folder(_resource): pass
folder = vsphere_folder
class vsphere_host_port_group(_resource): pass
host_port_group = vsphere_host_port_group
class vsphere_host_virtual_switch(_resource): pass
host_virtual_switch = vsphere_host_virtual_switch
class vsphere_license(_resource): pass
license = vsphere_license
class vsphere_tag(_resource): pass
tag = vsphere_tag
class vsphere_tag_category(_resource): pass
tag_category = vsphere_tag_category
class vsphere_virtual_disk(_resource): pass
virtual_disk = vsphere_virtual_disk
class vsphere_virtual_machine(_resource): pass
virtual_machine = vsphere_virtual_machine
class vsphere_nas_datastore(_resource): pass
nas_datastore = vsphere_nas_datastore
class vsphere_vmfs_datastore(_resource): pass
vmfs_datastore = vsphere_vmfs_datastore
class vsphere_virtual_machine_snapshot(_resource): pass
virtual_machine_snapshot = vsphere_virtual_machine_snapshot
| 33.032609 | 89 | 0.890424 | 412 | 3,039 | 5.93932 | 0.097087 | 0.147119 | 0.098079 | 0.093993 | 0.371475 | 0.246016 | 0.121373 | 0 | 0 | 0 | 0 | 0 | 0.070089 | 3,039 | 91 | 90 | 33.395604 | 0.865888 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.491803 | 0.016393 | 0 | 0.508197 | 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 |
e9f8b4928562c1f504f4641a5ee6d00682e133cc | 1,218 | py | Python | scraper/storage_spiders/anhducdigitalvn.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | null | null | null | scraper/storage_spiders/anhducdigitalvn.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | 10 | 2020-02-11T23:34:28.000Z | 2022-03-11T23:16:12.000Z | scraper/storage_spiders/anhducdigitalvn.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | 3 | 2018-08-05T14:54:25.000Z | 2021-06-07T01:49:59.000Z | # Auto generated by generator.py. Delete this line if you make modification.
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//form[@id='product_addtocart_form']/div[@class='product-shop']/div[@class='product-name']/h1",
'price' : "//div[@class='product-img-box']/div[@class='price-box']/span/span[@class='price']",
'category' : "//div[@class='breadcrumbs']/ul/li",
'description' : "//div[@class='tabs_wrapper_details collateral_wrapper ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header']/div[@class='product-collateral tab_content']/div[@id='box-review']/div[@class='std']",
'images' : "//div[@class='product-img-box']/p[@class='product-image']//a/@href",
'canonical' : "",
'base_url' : "",
'brand' : ""
}
name = 'anhducdigital.vn'
allowed_domains = ['anhducdigital.vn']
start_urls = ['http://anhducdigital.vn']
tracking_url = ''
sitemap_urls = ['']
sitemap_rules = [('', 'parse_item')]
sitemap_follow = []
rules = [
Rule(LinkExtractor(allow=['']), 'parse_item'),
Rule(LinkExtractor(allow=['']), 'parse'),
#Rule(LinkExtractor(), 'parse_item_and_links'),
]
| 45.111111 | 277 | 0.674056 | 155 | 1,218 | 5.180645 | 0.516129 | 0.089664 | 0.0934 | 0.044832 | 0.052304 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000923 | 0.110837 | 1,218 | 26 | 278 | 46.846154 | 0.740536 | 0.098522 | 0 | 0 | 1 | 0.173913 | 0.605479 | 0.373516 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.086957 | 0 | 0.086957 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
180c9ec359f9fc270b7df5916b4e21cdf19dd272 | 280 | py | Python | tasks/verify.py | ttzhou/poetry-workspace-plugin | 078d8ab323b0d33e0b542cac93ae7144bace87e8 | [
"MIT"
] | 46 | 2021-08-10T09:30:58.000Z | 2022-03-31T16:18:46.000Z | tasks/verify.py | jacksmith15/workspace-cli | 7de850f81d7f30e0275dea28f3745d44aceafeba | [
"MIT"
] | 1 | 2021-06-06T15:46:12.000Z | 2021-08-09T12:36:27.000Z | tasks/verify.py | jacksmith15/workspace-cli | 7de850f81d7f30e0275dea28f3745d44aceafeba | [
"MIT"
] | 4 | 2021-08-18T02:30:18.000Z | 2022-02-11T23:23:58.000Z | from invoke import task
from tasks.changelog_check import changelog_check
from tasks.lint import lint
from tasks.test import test
from tasks.typecheck import typecheck
@task(post=[changelog_check, lint, typecheck, test])
def verify(_ctx):
"""Run all verification steps."""
| 23.333333 | 52 | 0.785714 | 40 | 280 | 5.4 | 0.45 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.132143 | 280 | 11 | 53 | 25.454545 | 0.888889 | 0.096429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.714286 | 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 |
1810ee991298c0bcc4eba0022a77b4150a7fd5d8 | 567 | py | Python | Hourglass/flip_detect.py | caternuson/CircuitPython-Demos | cffb226750614caed5368d7ca31c06be321f54d8 | [
"MIT"
] | null | null | null | Hourglass/flip_detect.py | caternuson/CircuitPython-Demos | cffb226750614caed5368d7ca31c06be321f54d8 | [
"MIT"
] | null | null | null | Hourglass/flip_detect.py | caternuson/CircuitPython-Demos | cffb226750614caed5368d7ca31c06be321f54d8 | [
"MIT"
] | null | null | null | # Circuit Playground Express Flip Detect
#
# Author: Carter Nelson
# MIT License (https://opensource.org/licenses/MIT)
import time
from adafruit_circuitplayground.express import cpx
while True:
# Wait for Circuit Playground to be flipped over (face down)
while cpx.acceleration[2] > 0:
pass # do nothing
# A little debounce
time.sleep(0.5)
# Wait for Circuit Playground to be flipped back over (face up)
while cpx.acceleration[2] < 0:
pass # do nothing
# Make a beep noise.
cpx.play_tone(800, 1) | 27 | 67 | 0.666667 | 78 | 567 | 4.820513 | 0.641026 | 0.135638 | 0.074468 | 0.12766 | 0.37234 | 0.37234 | 0.37234 | 0.18617 | 0 | 0 | 0 | 0.023697 | 0.255732 | 567 | 21 | 68 | 27 | 0.867299 | 0.518519 | 0 | 0.222222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.222222 | 0.222222 | 0 | 0.222222 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
1815eecf6d5cb01e67393117d2d07c35d6f1176e | 879 | py | Python | broadcast_cli/broadcast_printer.py | cob16/example-cli-and-lib | 0d8f5b67e8c867475828aea2a217b196647067b2 | [
"MIT"
] | 1 | 2019-06-08T09:54:19.000Z | 2019-06-08T09:54:19.000Z | broadcast_cli/broadcast_printer.py | cob16/example-cli-and-lib | 0d8f5b67e8c867475828aea2a217b196647067b2 | [
"MIT"
] | null | null | null | broadcast_cli/broadcast_printer.py | cob16/example-cli-and-lib | 0d8f5b67e8c867475828aea2a217b196647067b2 | [
"MIT"
] | null | null | null | from clint.textui import colored, indent, puts, columns
from datetime import datetime
def broadcast_printer(b):
puts(columns([user_id(b), 7], [broadcast_id(b), 10], [created_at(b), 25], [feed(b), None]))
puts(colored.yellow('Content: ▼'))
# with indent(10):
puts(b.content)
puts()
def broadcast_id(broadcast):
return colored.blue('User_ID: {}').format(broadcast.id)
def user_id(broadcast):
id = broadcast.user_id
if broadcast.user_id is None:
id = 'N/A'
return colored.cyan('ID: {}').format(id)
def feed(broadcast):
feeds = sorted(broadcast.feeds, key=str.lower) #case insensitive sort
return colored.magenta("Feeds: {0}").format(' - '.join(feeds))
def created_at(broadcast):
return colored.cyan(
datetime.strptime(broadcast.created_at, "%Y-%m-%dT%H:%M:%S.%fZ").strftime("Date: %y/%m/%d %H:%M UTC")
)
| 26.636364 | 109 | 0.651877 | 128 | 879 | 4.398438 | 0.4375 | 0.053286 | 0.071048 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010974 | 0.170648 | 879 | 32 | 110 | 27.46875 | 0.759945 | 0.042093 | 0 | 0 | 0 | 0 | 0.104887 | 0.02503 | 0 | 0 | 0 | 0 | 0 | 1 | 0.238095 | false | 0 | 0.095238 | 0.095238 | 0.52381 | 0.047619 | 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 |
1827170c45384b8a87a8fef92bb07c6e4b9da472 | 508 | py | Python | bin/bean/dev.py | akrishna1995/emuedge | d33845107be3c9bbfcaf030df0a989e9d4972743 | [
"MIT"
] | null | null | null | bin/bean/dev.py | akrishna1995/emuedge | d33845107be3c9bbfcaf030df0a989e9d4972743 | [
"MIT"
] | null | null | null | bin/bean/dev.py | akrishna1995/emuedge | d33845107be3c9bbfcaf030df0a989e9d4972743 | [
"MIT"
] | null | null | null | import sys
from node import node
from node import node_type
from abc import abstractmethod
class dev(node):
def __init__(self, did, name, dtype=node_type.DEV):
node.__init__(self, did, name, dtype)
pass
def __str__(self):
attrs = vars(self)
return str(', '.join("%s: %s" % item for item in attrs.items()))
@abstractmethod
def start(self, session=None):
pass
@abstractmethod
def shutdown(self, session=None):
pass
@abstractmethod
def create_vif_on_xbr(self, session, xswitch):
pass | 19.538462 | 66 | 0.720472 | 75 | 508 | 4.653333 | 0.466667 | 0.146132 | 0.080229 | 0.103152 | 0.320917 | 0.206304 | 0 | 0 | 0 | 0 | 0 | 0 | 0.165354 | 508 | 26 | 67 | 19.538462 | 0.823113 | 0 | 0 | 0.35 | 0 | 0 | 0.015717 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.2 | 0.2 | 0 | 0.55 | 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 |
1832b7dfc905e00f47cbfb00cbc7e8792aa57f99 | 217 | py | Python | mcd/__init__.py | zwlanpishu/MCD | f925bd78ab9413dd555c601af88f2b43e5483c3a | [
"BSD-3-Clause"
] | 158 | 2015-04-13T20:05:03.000Z | 2022-03-24T07:05:25.000Z | mcd/__init__.py | zwlanpishu/MCD | f925bd78ab9413dd555c601af88f2b43e5483c3a | [
"BSD-3-Clause"
] | 9 | 2016-01-19T10:48:01.000Z | 2020-08-16T03:50:59.000Z | mcd/__init__.py | zwlanpishu/MCD | f925bd78ab9413dd555c601af88f2b43e5483c3a | [
"BSD-3-Clause"
] | 36 | 2016-01-19T06:36:51.000Z | 2022-03-16T08:49:45.000Z | """Mel cepstral distortion (MCD) computations in python."""
# Copyright 2014, 2015, 2016, 2017 Matt Shannon
# This file is part of mcd.
# See `License` for details of license and warranty.
__version__ = '0.5.dev1'
| 24.111111 | 59 | 0.718894 | 32 | 217 | 4.75 | 0.90625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.105556 | 0.170507 | 217 | 8 | 60 | 27.125 | 0.738889 | 0.815668 | 0 | 0 | 0 | 0 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
183bafc1e99411b88c2b462c761b5d2a1ed2ae9b | 1,067 | py | Python | day_ok/schedule/migrations/0060_auto_20210325_1608.py | bostud/day_ok | 2bcee68252b698f5818808d1766fb3ec3f07fce8 | [
"MIT"
] | null | null | null | day_ok/schedule/migrations/0060_auto_20210325_1608.py | bostud/day_ok | 2bcee68252b698f5818808d1766fb3ec3f07fce8 | [
"MIT"
] | 16 | 2021-02-27T08:36:19.000Z | 2021-04-07T11:43:31.000Z | day_ok/schedule/migrations/0060_auto_20210325_1608.py | bostud/day_ok | 2bcee68252b698f5818808d1766fb3ec3f07fce8 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-25 14:08
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('schedule', '0059_auto_20210324_1503'),
]
operations = [
migrations.AddField(
model_name='studentpresence',
name='participants',
field=models.ManyToManyField(default=None, to='schedule.Student'),
),
migrations.AlterField(
model_name='studentpresence',
name='lessons',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='schedule.lessons', unique=True, verbose_name='Заняття'),
),
migrations.AlterUniqueTogether(
name='studentpresence',
unique_together=set(),
),
migrations.RemoveField(
model_name='studentpresence',
name='is_presence',
),
migrations.RemoveField(
model_name='studentpresence',
name='student',
),
]
| 28.837838 | 141 | 0.599813 | 96 | 1,067 | 6.552083 | 0.552083 | 0.151033 | 0.152623 | 0.17806 | 0.155803 | 0.155803 | 0 | 0 | 0 | 0 | 0 | 0.040736 | 0.286785 | 1,067 | 36 | 142 | 29.638889 | 0.785808 | 0.042174 | 0 | 0.366667 | 1 | 0 | 0.178431 | 0.022549 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.066667 | 0 | 0.166667 | 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 |
183db73317b3f5d5c933067502683d47be67295f | 517 | py | Python | lib/assets/Lib/browser/session_storage.py | s6007589/cafe-grader-web | 18a993801c698fb7b7ec6ae5f4b67920503cb242 | [
"MIT"
] | 25 | 2016-09-04T07:34:13.000Z | 2022-02-14T07:39:02.000Z | lib/assets/Lib/browser/session_storage.py | it56660024/cafe-grader-web | e9a1305fd62e79e54f6961f97ddc5cd57bafd73c | [
"MIT"
] | 25 | 2015-02-05T03:59:27.000Z | 2022-02-11T16:54:04.000Z | lib/assets/Lib/browser/session_storage.py | it56660024/cafe-grader-web | e9a1305fd62e79e54f6961f97ddc5cd57bafd73c | [
"MIT"
] | 16 | 2016-09-05T00:30:27.000Z | 2021-12-05T11:07:02.000Z | # session storage in browser
import sys
from javascript import JSObject
from browser import window
from .local_storage import LocalStorage
has_session_storage = hasattr(window, 'sessionStorage')
class SessionStorage(LocalStorage):
storage_type = "session_storage"
def __init__(self):
if not has_session_storage:
raise EnvironmentError("SessionStorage not available")
self.store = window.sessionStorage
if has_session_storage:
storage = SessionStorage()
| 25.85 | 67 | 0.733075 | 55 | 517 | 6.654545 | 0.472727 | 0.191257 | 0.139344 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.210832 | 517 | 19 | 68 | 27.210526 | 0.897059 | 0.05029 | 0 | 0 | 0 | 0 | 0.121277 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.076923 | false | 0 | 0.307692 | 0 | 0.538462 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
183eae492a27a8db605e6d6f65228342aff13ac2 | 20,762 | py | Python | proxy2.py | thatmarcel/proxy2 | c2d22debec43ec39171ace44402afdd805f515b6 | [
"BSD-3-Clause"
] | null | null | null | proxy2.py | thatmarcel/proxy2 | c2d22debec43ec39171ace44402afdd805f515b6 | [
"BSD-3-Clause"
] | null | null | null | proxy2.py | thatmarcel/proxy2 | c2d22debec43ec39171ace44402afdd805f515b6 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
import os
import socket
import ssl
import select
import httplib
import urlparse
import threading
import gzip
import zlib
import time
import json
import re
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from SocketServer import ThreadingMixIn
from cStringIO import StringIO
from subprocess import Popen, PIPE
from HTMLParser import HTMLParser
def with_color(c, s):
return "\x1b[%dm%s\x1b[0m" % (c, s)
def join_with_script_dir(path):
return os.path.join(os.path.dirname(os.path.abspath(__file__)), path)
class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
address_family = socket.AF_INET6
daemon_threads = True
def handle_error(self, request, client_address):
# surpress socket/ssl related errors
cls, e = sys.exc_info()[:2]
if cls is socket.error or cls is ssl.SSLError:
pass
else:
return HTTPServer.handle_error(self, request, client_address)
class ProxyRequestHandler(BaseHTTPRequestHandler):
cakey = join_with_script_dir('ca.key')
cacert = join_with_script_dir('ca.crt')
certkey = join_with_script_dir('cert.key')
certdir = join_with_script_dir('certs/')
timeout = 5
lock = threading.Lock()
def __init__(self, *args, **kwargs):
self.tls = threading.local()
self.tls.conns = {}
BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
def log_error(self, format, *args):
# surpress "Request timed out: timeout('timed out',)"
if isinstance(args[0], socket.timeout):
return
self.log_message(format, *args)
def do_CONNECT(self):
if os.path.isfile(self.cakey) and os.path.isfile(self.cacert) and os.path.isfile(self.certkey) and os.path.isdir(self.certdir):
self.connect_intercept()
else:
self.connect_relay()
def connect_intercept(self):
hostname = self.path.split(':')[0]
certpath = "%s/%s.crt" % (self.certdir.rstrip('/'), hostname)
with self.lock:
if not os.path.isfile(certpath):
epoch = "%d" % (time.time() * 1000)
p1 = Popen(["openssl", "req", "-new", "-key", self.certkey, "-subj", "/CN=%s" % hostname], stdout=PIPE)
p2 = Popen(["openssl", "x509", "-req", "-days", "3650", "-CA", self.cacert, "-CAkey", self.cakey, "-set_serial", epoch, "-out", certpath], stdin=p1.stdout, stderr=PIPE)
p2.communicate()
self.wfile.write("%s %d %s\r\n" % (self.protocol_version, 200, 'Connection Established'))
self.end_headers()
self.connection = ssl.wrap_socket(self.connection, keyfile=self.certkey, certfile=certpath, server_side=True)
self.rfile = self.connection.makefile("rb", self.rbufsize)
self.wfile = self.connection.makefile("wb", self.wbufsize)
conntype = self.headers.get('Proxy-Connection', '')
if self.protocol_version == "HTTP/1.1" and conntype.lower() != 'close':
self.close_connection = 0
else:
self.close_connection = 1
def connect_relay(self):
address = self.path.split(':', 1)
address[1] = int(address[1]) or 443
try:
s = socket.create_connection(address, timeout=self.timeout)
except Exception as e:
self.send_error(502)
print "lul"
self.send_response(200, 'Connection Established')
self.end_headers()
conns = [self.connection, s]
self.close_connection = 0
while not self.close_connection:
rlist, wlist, xlist = select.select(conns, [], conns, self.timeout)
if xlist or not rlist:
break
for r in rlist:
other = conns[1] if r is conns[0] else conns[0]
data = r.recv(8192)
if not data:
self.close_connection = 1
break
other.sendall(data)
def do_GET(self):
if self.path == 'http://proxy2.test/':
self.send_cacert()
return
req = self
content_length = int(req.headers.get('Content-Length', 0))
req_body = self.rfile.read(content_length) if content_length else None
if req.path[0] == '/':
if isinstance(self.connection, ssl.SSLSocket):
req.path = "https://%s%s" % (req.headers['Host'], req.path)
else:
req.path = "http://%s%s" % (req.headers['Host'], req.path)
req_body_modified = self.request_handler(req, req_body)
if req_body_modified is False:
self.send_error(403)
return
elif req_body_modified is not None:
req_body = req_body_modified
req.headers['Content-length'] = str(len(req_body))
u = urlparse.urlsplit(req.path)
scheme, netloc, path = u.scheme, u.netloc, (u.path + '?' + u.query if u.query else u.path)
assert scheme in ('http', 'https')
if netloc:
req.headers['Host'] = netloc
setattr(req, 'headers', self.filter_headers(req.headers))
try:
origin = (scheme, netloc)
if not origin in self.tls.conns:
if scheme == 'https':
self.tls.conns[origin] = httplib.HTTPSConnection(netloc, timeout=self.timeout)
else:
self.tls.conns[origin] = httplib.HTTPConnection(netloc, timeout=self.timeout)
conn = self.tls.conns[origin]
conn.request(self.command, path, req_body, dict(req.headers))
res = conn.getresponse()
version_table = {10: 'HTTP/1.0', 11: 'HTTP/1.1'}
setattr(res, 'headers', res.msg)
setattr(res, 'response_version', version_table[res.version])
# support streaming
if not 'Content-Length' in res.headers and 'no-store' in res.headers.get('Cache-Control', ''):
self.response_handler(req, req_body, res, '')
setattr(res, 'headers', self.filter_headers(res.headers))
self.relay_streaming(res)
with self.lock:
self.save_handler(req, req_body, res, '')
return
res_body = res.read()
except Exception as e:
if origin in self.tls.conns:
del self.tls.conns[origin]
self.send_error(502)
return
content_encoding = res.headers.get('Content-Encoding', 'identity')
res_body_plain = self.decode_content_body(res_body, content_encoding)
res_body_modified = self.response_handler(req, req_body, res, res_body_plain)
if res_body_modified is False:
self.send_error(403)
return
elif res_body_modified is not None:
res_body_plain = res_body_modified
res_body = self.encode_content_body(res_body_plain, content_encoding)
res.headers['Content-Length'] = str(len(res_body))
setattr(res, 'headers', self.filter_headers(res.headers))
self.wfile.write("%s %d %s\r\n" % (self.protocol_version, res.status, res.reason))
for line in res.headers.headers:
self.wfile.write(line)
self.end_headers()
self.wfile.write(res_body)
self.wfile.flush()
with self.lock:
self.save_handler(req, req_body, res, res_body_plain)
def relay_streaming(self, res):
self.wfile.write("%s %d %s\r\n" % (self.protocol_version, res.status, res.reason))
for line in res.headers.headers:
self.wfile.write(line)
self.end_headers()
try:
while True:
chunk = res.read(8192)
if not chunk:
break
self.wfile.write(chunk)
self.wfile.flush()
except socket.error:
# connection closed by client
pass
do_HEAD = do_GET
do_POST = do_GET
do_PUT = do_GET
do_DELETE = do_GET
do_OPTIONS = do_GET
def filter_headers(self, headers):
# http://tools.ietf.org/html/rfc2616#section-13.5.1
hop_by_hop = ('connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', 'te', 'trailers', 'transfer-encoding', 'upgrade')
for k in hop_by_hop:
del headers[k]
# accept only supported encodings
if 'Accept-Encoding' in headers:
ae = headers['Accept-Encoding']
filtered_encodings = [x for x in re.split(r',\s*', ae) if x in ('identity', 'gzip', 'x-gzip', 'deflate')]
headers['Accept-Encoding'] = ', '.join(filtered_encodings)
return headers
def encode_content_body(self, text, encoding):
if encoding == 'identity':
data = text
elif encoding in ('gzip', 'x-gzip'):
io = StringIO()
with gzip.GzipFile(fileobj=io, mode='wb') as f:
f.write(text)
data = io.getvalue()
elif encoding == 'deflate':
data = zlib.compress(text)
else:
raise Exception("Unknown Content-Encoding: %s" % encoding)
return data
def decode_content_body(self, data, encoding):
if encoding == 'identity':
text = data
elif encoding in ('gzip', 'x-gzip'):
io = StringIO(data)
with gzip.GzipFile(fileobj=io) as f:
text = f.read()
elif encoding == 'deflate':
try:
text = zlib.decompress(data)
except zlib.error:
text = zlib.decompress(data, -zlib.MAX_WBITS)
else:
raise Exception("Unknown Content-Encoding: %s" % encoding)
return text
def send_cacert(self):
with open(self.cacert, 'rb') as f:
data = f.read()
self.wfile.write("%s %d %s\r\n" % (self.protocol_version, 200, 'OK'))
self.send_header('Content-Type', 'application/x-x509-ca-cert')
self.send_header('Content-Length', len(data))
self.send_header('Connection', 'close')
self.end_headers()
self.wfile.write(data)
def print_info(self, req, req_body, res, res_body):
def parse_qsl(s):
return '\n'.join("%-20s %s" % (k, v) for k, v in urlparse.parse_qsl(s, keep_blank_values=True))
req_header_text = "%s %s %s\n%s" % (req.command, req.path, req.request_version, req.headers)
res_header_text = "%s %d %s\n%s" % (res.response_version, res.status, res.reason, res.headers)
print with_color(33, req_header_text)
u = urlparse.urlsplit(req.path)
if u.query:
query_text = parse_qsl(u.query)
print with_color(32, "==== QUERY PARAMETERS ====\n%s\n" % query_text)
cookie = req.headers.get('Cookie', '')
if cookie:
cookie = parse_qsl(re.sub(r';\s*', '&', cookie))
print with_color(32, "==== COOKIE ====\n%s\n" % cookie)
auth = req.headers.get('Authorization', '')
if auth.lower().startswith('basic'):
token = auth.split()[1].decode('base64')
print with_color(31, "==== BASIC AUTH ====\n%s\n" % token)
if req_body is not None:
req_body_text = None
content_type = req.headers.get('Content-Type', '')
if content_type.startswith('application/x-www-form-urlencoded'):
req_body_text = parse_qsl(req_body)
elif content_type.startswith('application/json'):
try:
json_obj = json.loads(req_body)
json_str = json.dumps(json_obj, indent=2)
if json_str.count('\n') < 50:
req_body_text = json_str
else:
lines = json_str.splitlines()
req_body_text = "%s\n(%d lines)" % ('\n'.join(lines[:50]), len(lines))
except ValueError:
req_body_text = req_body
elif len(req_body) < 1024:
req_body_text = req_body
if req_body_text:
print with_color(32, "==== REQUEST BODY ====\n%s\n" % req_body_text)
print with_color(36, res_header_text)
cookies = res.headers.getheaders('Set-Cookie')
if cookies:
cookies = '\n'.join(cookies)
print with_color(31, "==== SET-COOKIE ====\n%s\n" % cookies)
if res_body is not None:
res_body_text = None
content_type = res.headers.get('Content-Type', '')
if content_type.startswith('application/json'):
try:
json_obj = json.loads(res_body)
json_str = json.dumps(json_obj, indent=2)
if json_str.count('\n') < 50:
res_body_text = json_str
else:
lines = json_str.splitlines()
res_body_text = "%s\n(%d lines)" % ('\n'.join(lines[:50]), len(lines))
except ValueError:
res_body_text = res_body
elif content_type.startswith('text/html'):
m = re.search(r'<title[^>]*>\s*([^<]+?)\s*</title>', res_body, re.I)
if m:
h = HTMLParser()
print with_color(32, "==== HTML TITLE ====\n%s\n" % h.unescape(m.group(1).decode('utf-8')))
elif content_type.startswith('text/') and len(res_body) < 1024:
res_body_text = res_body
if res_body_text:
print with_color(32, "==== RESPONSE BODY ====\n%s\n" % res_body_text)
def request_handler(self, req, req_body):
if req.path.contains('/aweme/v1/user/') and req.path.contains('api2-19-h2.musical.ly'):
return '{ "status_code": 0, "user": { "with_stick_entry": false, "weibo_schema": "", "enterprise_verify_reason": "", "region": "US", "apple_account": 0, "video_icon_virtual_URI": "", "follower_count": 11387524, "is_gov_media_vip": false, "follower_status": 0, "latest_order_time": 0, "is_pro_account": false, "avatar_medium": { "uri": "musically-maliva-obj/1639714752984069", "url_list": ["http://p16.muscdn.com/img/musically-maliva-obj/1639714752984069~c5_720x720.jpeg"] }, "is_verified": true, "unique_id": "cash.baker", "mplatform_followers_count": 0, "has_activity_medal": false, "constellation": 0, "school_poi_id": "", "dongtai_count": 1706, "avatar_uri": "musically-maliva-obj/1639714752984069", "nickname": "Cash is here„, "weibo_url": "", "verification_type": 0, "user_mode": 1, "youtube_refresh_token": "", "sync_to_toutiao": 0, "with_commerce_enterprise_tab_entry": false, "signature_language": "en", "wx_tag": 0, "avatar_thumb": { "uri": "musically-maliva-obj/1639714752984069", "url_list": ["http://p16.muscdn.com/img/musically-maliva-obj/1639714752984069~c5_100x100.jpeg"] }, "favoriting_count": 0, "commerce_user_level": 0, "prevent_download": false, "cover_url": [{ "uri": "musically-maliva-obj/1612555907887110", "url_list": ["https://m-p16.akamaized.net/obj/musically-maliva-obj/1612555907887110"] }], "hide_location": false, "original_musician": { "digg_count": 0, "music_count": 0, "music_used_count": 0 }, "star_use_new_download": true, "secret": 0, "city": "", "birthday_hide_level": 0, "total_favorited": 520341200, "location": "", "special_lock": 1, "video_icon": { "uri": "", "url_list": [] }, "province": "", "bio_secure_url": "https://link-va.byteoversea.com/?aid=1233&lang=en&scene=bio&target=http://Shopcashandmav.com", "room_id": 0, "react_setting": 0, "profile_tab_type": 0, "is_star": false, "ad_cover_url": null, "custom_verify": "Popular creator", "download_setting": 0, "iso_country_code": "", "youtube_last_refresh_time": 0, "share_info": { "share_qrcode_url": { "uri": "", "url_list": [] }, "share_image_url": { "uri": "tos-maliva-p-0068/78b03f89f636409c95263fd85094ea21", "url_list": ["https://m-p16.akamaized.net/obj/tos-maliva-p-0068/78b03f89f636409c95263fd85094ea21"] }, "share_weibo_desc": "TikTok: Make Every Second Count", "share_desc": "Check out Cash! #TikTok", "bool_persist": 1, "share_title_myself": "This TikTok app is soooooo fun! Follow me @cash.baker on TikTok and check out my videos!", "share_title_other": "This TikTok user is really cool. Follow @cash.baker on TikTok and check out those amazing videos!", "share_url": "https://m.tiktok.com/h5/share/usr/6558879147065475077.html?language=en&sec_uid=MS4wLjABAAAArg_559ejF51bHxP1pmrtxxw9NKdXBhoiTU_33DBotjZHDl8E0TQ7-OGD6rVHnAs9&u_code=bde96gjfc9bch", "share_title": "Join TikTok and see what I\'ve been up to!" }, "twitter_name": "", "comment_setting": 0, "has_insights": false, "type_label": null, "account_region": "US", "duet_setting": 0, "hide_following_follower_list": 0, "item_list": null, "platform_sync_info": null, "share_qrcode_uri": "", "signature": "Single🔓god💗\nTap the link for the Dallas TX show and the new merch drop!⬇️⬇️", "weibo_verify": "", "bind_phone": "", "avatar_300x300": { "uri": "musically-maliva-obj/1639714752984069", "url_list": ["http://p16.muscdn.com/img/musically-maliva-obj/1639714752984069~c5_300x300.webp"] }, "sec_uid": "MS4wLjABAAAArg_559ejF51bHxP1pmrtxxw9NKdXBhoiTU_33DBotjZHDl8E0TQ7-OGD6rVHnAs9", "with_commerce_entry": false, "ins_id": "cash.baker", "download_prompt_ts": 1554608228, "watch_status": false, "avatar_168x168": { "uri": "musically-maliva-obj/1639714752984069", "url_list": ["http://p16.muscdn.com/img/musically-maliva-obj/1639714752984069~c5_168x168.webp"] }, "district": "", "user_period": 0, "verify_info": "", "content_language_already_popup": 0, "is_block": false, "youtube_channel_id": "UCgV3ODiWCzMvovfLXCU7kNQ", "bio_url": "http://Shopcashandmav.com", "short_id": "0", "following_count": 37, "activity": { "use_music_count": 0, "digg_count": 0 }, "is_effect_artist": false, "cha_list": null, "relative_users": null, "uid": "6558879147065475077", "aweme_count": 1706, "with_shop_entry": false, "geofencing": [], "is_blocked": false, "user_canceled": false, "live_commerce": false, "story_open": false, "new_story_cover": null, "avatar_larger": { "uri": "musically-maliva-obj/1639714752984069", "url_list": ["http://p16.muscdn.com/img/musically-maliva-obj/1639714752984069~c5_1080x1080.jpeg"] }, "follow_status": 1, "reflow_page_uid": 0, "birthday": "1900-01-01", "show_image_bubble": false, "gender": 2, "unique_id_modify_time": 1565443984, "twitter_id": "", "youtube_channel_title": "Cash Baker", "with_fusion_shop_entry": false, "recommend_reason_relation": "", "followers_detail": [{ "name": "抖音", "icon": "http://p3.pstatp.com/origin/50ec00079b64de2050dc", "fans_count": 0, "open_url": "snssdk1128://user/profile/0?", "apple_id": "1142110895", "download_url": "https://d.douyin.com/Y4Fy/", "package_name": "com.ss.android.ugc.aweme", "app_name": "aweme" }, { "app_name": "news_article", "name": "头条", "icon": "http://p3.pstatp.com/origin/50ed00079a1b6b8d1fb1", "fans_count": 0, "open_url": "snssdk141://profile?uid=0?", "apple_id": "529092160", "download_url": "https://d.toutiao.com/fUN5/", "package_name": "com.ss.android.article.news" }, { "package_name": "com.ss.android.ugc.live", "app_name": "live_stream", "name": "火山", "icon": "http://p3.pstatp.com/origin/551900041a7e00ec86ca", "fans_count": 0, "open_url": "snssdk1112://profile?id=0", "apple_id": "1086047750", "download_url": "http://d.huoshanzhibo.com/e7fw/" }], "reflow_page_gid": 0, "with_new_goods": false, "country": "", "with_luban_entry": false }, "extra": { "now": 1565443984000 }, "log_pb": { "impr_id": "20190810133304010110068176339128" } }'
def response_handler(self, req, req_body, res, res_body):
pass
def save_handler(self, req, req_body, res, res_body):
self.print_info(req, req_body, res, res_body)
def test(HandlerClass=ProxyRequestHandler, ServerClass=ThreadingHTTPServer, protocol="HTTP/1.1"):
if sys.argv[1:]:
port = int(sys.argv[1])
else:
port = 8080
server_address = ('::1', port)
HandlerClass.protocol_version = protocol
httpd = ServerClass(server_address, HandlerClass)
sa = httpd.socket.getsockname()
print "Serving HTTP Proxy on", sa[0], "port", sa[1], "..."
httpd.serve_forever()
if __name__ == '__main__':
test()
| 53.510309 | 6,238 | 0.602302 | 2,564 | 20,762 | 4.690718 | 0.23869 | 0.018625 | 0.019456 | 0.031097 | 0.289349 | 0.218592 | 0.173194 | 0.156897 | 0.137441 | 0.107342 | 0 | 0.050322 | 0.25248 | 20,762 | 387 | 6,239 | 53.648579 | 0.724162 | 0.011319 | 0 | 0.248408 | 0 | 0.003185 | 0.251487 | 0.030559 | 0 | 0 | 0 | 0 | 0.003185 | 0 | null | null | 0.009554 | 0.057325 | null | null | 0.041401 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
184b730630e6fcac2718af6501615dc25373f851 | 788 | py | Python | tests/unit/test_service.py | neuro-inc/platform-container-runtime | f7d426191767da1a1d673a1f3fc9264a3dccb9ad | [
"Apache-2.0"
] | null | null | null | tests/unit/test_service.py | neuro-inc/platform-container-runtime | f7d426191767da1a1d673a1f3fc9264a3dccb9ad | [
"Apache-2.0"
] | 51 | 2021-11-15T03:15:19.000Z | 2022-02-23T08:18:46.000Z | tests/unit/test_service.py | neuro-inc/platform-container-runtime | f7d426191767da1a1d673a1f3fc9264a3dccb9ad | [
"Apache-2.0"
] | null | null | null | from platform_container_runtime.service import Stream
class TestStream:
def test_parse_error_channel_v4_success(self) -> None:
result = Stream.parse_error_channel(b'\x03{"metadata":{},"status":"Success"}')
assert result == {"exit_code": 0}
def test_parse_error_channel_v4_failure(self) -> None:
result = Stream.parse_error_channel(
b'\x03{"metadata":{},"status":"Failure","message":"error","reason":"NonZeroExitCode","details":{"causes":[{"reason":"ExitCode","message":"42"}]}}' # noqa: E501
)
assert result == {"exit_code": 42, "message": "error"}
def test_parse_error_channel_v1(self) -> None:
result = Stream.parse_error_channel(b"\x03error")
assert result == {"exit_code": 1, "message": "error"}
| 37.52381 | 172 | 0.652284 | 93 | 788 | 5.258065 | 0.430108 | 0.122699 | 0.208589 | 0.104294 | 0.458078 | 0.408998 | 0.302658 | 0.302658 | 0.224949 | 0.224949 | 0 | 0.027735 | 0.176396 | 788 | 20 | 173 | 39.4 | 0.725732 | 0.01269 | 0 | 0 | 0 | 0.076923 | 0.310567 | 0.233247 | 0 | 0 | 0 | 0 | 0.230769 | 1 | 0.230769 | false | 0 | 0.076923 | 0 | 0.384615 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
184e491aa9a2656325a2686753838d86a616a4f6 | 694 | py | Python | accounts/views.py | tony-joseph/crimson-publisher | a156d0b6f681c1b3ffba890d9581f3a3b78d0d1d | [
"BSD-3-Clause"
] | 1 | 2020-05-06T16:59:43.000Z | 2020-05-06T16:59:43.000Z | accounts/views.py | tony-joseph/crimson-publisher | a156d0b6f681c1b3ffba890d9581f3a3b78d0d1d | [
"BSD-3-Clause"
] | null | null | null | accounts/views.py | tony-joseph/crimson-publisher | a156d0b6f681c1b3ffba890d9581f3a3b78d0d1d | [
"BSD-3-Clause"
] | null | null | null | from hashlib import md5
from django.shortcuts import render, get_object_or_404
from django.views.generic import View
from django.contrib.auth.models import User
from accounts.models import UserProfile
class UserProfileView(View):
def get_object(self, username):
return get_object_or_404(User, username=username, is_active=True)
def get(self, request, username):
user = self.get_object(username)
context = {
'user': user,
'user_profile': get_object_or_404(UserProfile, user=user),
'gravathar_hash': md5(user.email.encode()).hexdigest()
}
return render(request, 'accounts/user-profile-view.html', context)
| 30.173913 | 74 | 0.698847 | 88 | 694 | 5.352273 | 0.431818 | 0.095541 | 0.070064 | 0.089172 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019928 | 0.204611 | 694 | 22 | 75 | 31.545455 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0.087896 | 0.044669 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.3125 | 0.0625 | 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 |
1851ab7d8260e62445a676c951c0892d20945ae1 | 2,379 | py | Python | src/marmo/report/table.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/marmo/report/table.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/marmo/report/table.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | # This an autogenerated file
#
# Generated with Table
from typing import Dict,Sequence,List
from dmt.entity import Entity
from dmt.blueprint import Blueprint
from .blueprints.table import TableBlueprint
from typing import Dict
from marmo.report.column import Column
from marmo.report.reportitem import ReportItem
class Table(ReportItem):
"""
Keyword arguments
-----------------
name : str
(default "")
description : str
(default "")
caption : str
(default "")
transposed : bool
(default True)
columns : List[Column]
"""
def __init__(self , name:str="", description:str="", caption:str="", transposed:bool=True, **kwargs):
super().__init__(**kwargs)
self.__name = name
self.__description = description
self.__caption = caption
self.__transposed = transposed
self.__columns = list()
for key, value in kwargs.items():
if not isinstance(value, Dict):
setattr(self, key, value)
@property
def blueprint(self) -> Blueprint:
"""Return blueprint that this entity represents"""
return TableBlueprint()
@property
def name(self) -> str:
""""""
return self.__name
@name.setter
def name(self, value: str):
"""Set name"""
self.__name = str(value)
@property
def description(self) -> str:
""""""
return self.__description
@description.setter
def description(self, value: str):
"""Set description"""
self.__description = str(value)
@property
def caption(self) -> str:
""""""
return self.__caption
@caption.setter
def caption(self, value: str):
"""Set caption"""
self.__caption = str(value)
@property
def transposed(self) -> bool:
""""""
return self.__transposed
@transposed.setter
def transposed(self, value: bool):
"""Set transposed"""
self.__transposed = bool(value)
@property
def columns(self) -> List[Column]:
""""""
return self.__columns
@columns.setter
def columns(self, value: List[Column]):
"""Set columns"""
if not isinstance(value, Sequence):
raise Exception("Expected sequense, but was " , type(value))
self.__columns = value
| 24.78125 | 105 | 0.591005 | 243 | 2,379 | 5.62963 | 0.251029 | 0.048246 | 0.05848 | 0.037281 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.285414 | 2,379 | 95 | 106 | 25.042105 | 0.804706 | 0.147961 | 0 | 0.113208 | 1 | 0 | 0.014144 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.226415 | false | 0 | 0.132075 | 0 | 0.490566 | 0.075472 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
185ca47ce5e35363d9a78981eb5341fed58ff4da | 1,024 | py | Python | isa.py | schwaaweb/aimlds1_11-NLP | 94fe4e5389ef22933c34849411ea7b7bf5509730 | [
"Unlicense"
] | null | null | null | isa.py | schwaaweb/aimlds1_11-NLP | 94fe4e5389ef22933c34849411ea7b7bf5509730 | [
"Unlicense"
] | null | null | null | isa.py | schwaaweb/aimlds1_11-NLP | 94fe4e5389ef22933c34849411ea7b7bf5509730 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# Income Share Agreement
min = 50000.0
max = 88235.3
max_pay = 30000.0
max_income = 2117647.06
monthly_increment = (max - min)/23
print('\n24 months maximum payment with a minimum of $50,000 annual income')
print('Maximum income for 24 month repayment is $88,235.30\n')
print('For incomes exceeding $88,235.30 see chart below,\nfor reduced payback period on $30,000 repayment cap')
print('\nmonth\tannual_income\tless_isa\tmonthly\t\tless_isa\tmonthly_payment\n')
for n in range(24):
print(
"%d\t%.2f\t%.2f\t%.2f\t\t%.2f\t\t%.2f" % (n+1, (min+(n*monthly_increment)), (min+(n*monthly_increment))*0.83, (min+(n*monthly_increment))/12, (min+(n*monthly_increment))*0.83/12, ((min+(n*monthly_increment))/12) - (min+(n*monthly_increment))*0.83/12
))
print('\n')
print('$30,000 Maximum Shared Income\n')
print('total\t\tannual\t\tmonthly\npayments\tincome\t\tpayment\n')
for n in range(24,0,-1):
print('%d\t\t%.2f\t%.2f' % (n, max/(max*n/max_income), max_pay/n))
print('\n')
| 30.117647 | 258 | 0.685547 | 183 | 1,024 | 3.754098 | 0.382514 | 0.163028 | 0.09607 | 0.174672 | 0.235808 | 0.211063 | 0.136827 | 0.136827 | 0.136827 | 0.136827 | 0 | 0.103219 | 0.120117 | 1,024 | 33 | 259 | 31.030303 | 0.659267 | 0.041992 | 0 | 0.105263 | 0 | 0.105263 | 0.448417 | 0.168539 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.526316 | 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 |
185d79286164e6fe8e60812a3718bbd2dfb9e1e3 | 19,395 | py | Python | pysnmp/IANA-IPPM-METRICS-REGISTRY-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/IANA-IPPM-METRICS-REGISTRY-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/IANA-IPPM-METRICS-REGISTRY-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 IANA-IPPM-METRICS-REGISTRY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/IANA-IPPM-METRICS-REGISTRY-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:38:44 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ValueSizeConstraint, SingleValueConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsIntersection", "ConstraintsUnion")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
TimeTicks, mib_2, ObjectIdentity, NotificationType, IpAddress, Integer32, MibIdentifier, iso, Unsigned32, ModuleIdentity, Bits, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter32, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "mib-2", "ObjectIdentity", "NotificationType", "IpAddress", "Integer32", "MibIdentifier", "iso", "Unsigned32", "ModuleIdentity", "Bits", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter32", "Counter64")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
ianaIppmMetricsRegistry = ModuleIdentity((1, 3, 6, 1, 2, 1, 128))
ianaIppmMetricsRegistry.setRevisions(('2015-08-14 00:00', '2014-05-22 00:00', '2010-09-07 00:00', '2009-09-02 00:00', '2009-04-20 00:00', '2006-12-04 00:00', '2005-04-12 00:00',))
if mibBuilder.loadTexts: ianaIppmMetricsRegistry.setLastUpdated('201508140000Z')
if mibBuilder.loadTexts: ianaIppmMetricsRegistry.setOrganization('IANA')
ianaIppmMetrics = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1))
if mibBuilder.loadTexts: ianaIppmMetrics.setStatus('current')
ietfInstantUnidirConnectivity = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 1))
if mibBuilder.loadTexts: ietfInstantUnidirConnectivity.setStatus('current')
ietfInstantBidirConnectivity = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 2))
if mibBuilder.loadTexts: ietfInstantBidirConnectivity.setStatus('current')
ietfIntervalUnidirConnectivity = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 3))
if mibBuilder.loadTexts: ietfIntervalUnidirConnectivity.setStatus('current')
ietfIntervalBidirConnectivity = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 4))
if mibBuilder.loadTexts: ietfIntervalBidirConnectivity.setStatus('current')
ietfIntervalTemporalConnectivity = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 5))
if mibBuilder.loadTexts: ietfIntervalTemporalConnectivity.setStatus('current')
ietfOneWayDelay = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 6))
if mibBuilder.loadTexts: ietfOneWayDelay.setStatus('current')
ietfOneWayDelayPoissonStream = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 7))
if mibBuilder.loadTexts: ietfOneWayDelayPoissonStream.setStatus('current')
ietfOneWayDelayPercentile = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 8))
if mibBuilder.loadTexts: ietfOneWayDelayPercentile.setStatus('current')
ietfOneWayDelayMedian = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 9))
if mibBuilder.loadTexts: ietfOneWayDelayMedian.setStatus('current')
ietfOneWayDelayMinimum = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 10))
if mibBuilder.loadTexts: ietfOneWayDelayMinimum.setStatus('current')
ietfOneWayDelayInversePercentile = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 11))
if mibBuilder.loadTexts: ietfOneWayDelayInversePercentile.setStatus('current')
ietfOneWayPktLoss = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 12))
if mibBuilder.loadTexts: ietfOneWayPktLoss.setStatus('current')
ietfOneWayPktLossPoissonStream = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 13))
if mibBuilder.loadTexts: ietfOneWayPktLossPoissonStream.setStatus('current')
ietfOneWayPktLossAverage = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 14))
if mibBuilder.loadTexts: ietfOneWayPktLossAverage.setStatus('current')
ietfRoundTripDelay = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 15))
if mibBuilder.loadTexts: ietfRoundTripDelay.setStatus('current')
ietfRoundTripDelayPoissonStream = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 16))
if mibBuilder.loadTexts: ietfRoundTripDelayPoissonStream.setStatus('current')
ietfRoundTripDelayPercentile = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 17))
if mibBuilder.loadTexts: ietfRoundTripDelayPercentile.setStatus('current')
ietfRoundTripDelayMedian = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 18))
if mibBuilder.loadTexts: ietfRoundTripDelayMedian.setStatus('current')
ietfRoundTripDelayMinimum = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 19))
if mibBuilder.loadTexts: ietfRoundTripDelayMinimum.setStatus('current')
ietfRoundTripDelayInvPercentile = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 20))
if mibBuilder.loadTexts: ietfRoundTripDelayInvPercentile.setStatus('current')
ietfOneWayLossDistanceStream = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 21))
if mibBuilder.loadTexts: ietfOneWayLossDistanceStream.setStatus('current')
ietfOneWayLossPeriodStream = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 22))
if mibBuilder.loadTexts: ietfOneWayLossPeriodStream.setStatus('current')
ietfOneWayLossNoticeableRate = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 23))
if mibBuilder.loadTexts: ietfOneWayLossNoticeableRate.setStatus('current')
ietfOneWayLossPeriodTotal = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 24))
if mibBuilder.loadTexts: ietfOneWayLossPeriodTotal.setStatus('current')
ietfOneWayLossPeriodLengths = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 25))
if mibBuilder.loadTexts: ietfOneWayLossPeriodLengths.setStatus('current')
ietfOneWayInterLossPeriodLengths = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 26))
if mibBuilder.loadTexts: ietfOneWayInterLossPeriodLengths.setStatus('current')
ietfOneWayIpdv = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 27))
if mibBuilder.loadTexts: ietfOneWayIpdv.setStatus('current')
ietfOneWayIpdvPoissonStream = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 28))
if mibBuilder.loadTexts: ietfOneWayIpdvPoissonStream.setStatus('current')
ietfOneWayIpdvPercentile = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 29))
if mibBuilder.loadTexts: ietfOneWayIpdvPercentile.setStatus('current')
ietfOneWayIpdvInversePercentile = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 30))
if mibBuilder.loadTexts: ietfOneWayIpdvInversePercentile.setStatus('current')
ietfOneWayIpdvJitter = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 31))
if mibBuilder.loadTexts: ietfOneWayIpdvJitter.setStatus('current')
ietfOneWayPeakToPeakIpdv = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 32))
if mibBuilder.loadTexts: ietfOneWayPeakToPeakIpdv.setStatus('current')
ietfOneWayDelayPeriodicStream = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 33))
if mibBuilder.loadTexts: ietfOneWayDelayPeriodicStream.setStatus('current')
ietfReorderedSingleton = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 34))
if mibBuilder.loadTexts: ietfReorderedSingleton.setStatus('current')
ietfReorderedPacketRatio = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 35))
if mibBuilder.loadTexts: ietfReorderedPacketRatio.setStatus('current')
ietfReorderingExtent = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 36))
if mibBuilder.loadTexts: ietfReorderingExtent.setStatus('current')
ietfReorderingLateTimeOffset = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 37))
if mibBuilder.loadTexts: ietfReorderingLateTimeOffset.setStatus('current')
ietfReorderingByteOffset = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 38))
if mibBuilder.loadTexts: ietfReorderingByteOffset.setStatus('current')
ietfReorderingGap = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 39))
if mibBuilder.loadTexts: ietfReorderingGap.setStatus('current')
ietfReorderingGapTime = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 40))
if mibBuilder.loadTexts: ietfReorderingGapTime.setStatus('current')
ietfReorderingFreeRunx = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 41))
if mibBuilder.loadTexts: ietfReorderingFreeRunx.setStatus('current')
ietfReorderingFreeRunq = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 42))
if mibBuilder.loadTexts: ietfReorderingFreeRunq.setStatus('current')
ietfReorderingFreeRunp = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 43))
if mibBuilder.loadTexts: ietfReorderingFreeRunp.setStatus('current')
ietfReorderingFreeRuna = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 44))
if mibBuilder.loadTexts: ietfReorderingFreeRuna.setStatus('current')
ietfnReordering = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 45))
if mibBuilder.loadTexts: ietfnReordering.setStatus('current')
ietfOneWayPacketArrivalCount = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 46))
if mibBuilder.loadTexts: ietfOneWayPacketArrivalCount.setStatus('current')
ietfOneWayPacketDuplication = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 47))
if mibBuilder.loadTexts: ietfOneWayPacketDuplication.setStatus('current')
ietfOneWayPacketDuplicationPoissonStream = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 48))
if mibBuilder.loadTexts: ietfOneWayPacketDuplicationPoissonStream.setStatus('current')
ietfOneWayPacketDuplicationPeriodicStream = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 49))
if mibBuilder.loadTexts: ietfOneWayPacketDuplicationPeriodicStream.setStatus('current')
ietfOneWayPacketDuplicationFraction = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 50))
if mibBuilder.loadTexts: ietfOneWayPacketDuplicationFraction.setStatus('current')
ietfOneWayReplicatedPacketRate = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 51))
if mibBuilder.loadTexts: ietfOneWayReplicatedPacketRate.setStatus('current')
ietfSpatialOneWayDelayVector = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 52))
if mibBuilder.loadTexts: ietfSpatialOneWayDelayVector.setStatus('current')
ietfSpatialPacketLossVector = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 53))
if mibBuilder.loadTexts: ietfSpatialPacketLossVector.setStatus('current')
ietfSpatialOneWayIpdvVector = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 54))
if mibBuilder.loadTexts: ietfSpatialOneWayIpdvVector.setStatus('current')
ietfSegmentOneWayDelayStream = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 55))
if mibBuilder.loadTexts: ietfSegmentOneWayDelayStream.setStatus('current')
ietfSegmentPacketLossStream = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 56))
if mibBuilder.loadTexts: ietfSegmentPacketLossStream.setStatus('current')
ietfSegmentIpdvPrevStream = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 57))
if mibBuilder.loadTexts: ietfSegmentIpdvPrevStream.setStatus('current')
ietfSegmentIpdvMinStream = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 58))
if mibBuilder.loadTexts: ietfSegmentIpdvMinStream.setStatus('current')
ietfOneToGroupDelayVector = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 59))
if mibBuilder.loadTexts: ietfOneToGroupDelayVector.setStatus('current')
ietfOneToGroupPacketLossVector = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 60))
if mibBuilder.loadTexts: ietfOneToGroupPacketLossVector.setStatus('current')
ietfOneToGroupIpdvVector = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 61))
if mibBuilder.loadTexts: ietfOneToGroupIpdvVector.setStatus('current')
ietfOnetoGroupReceiverNMeanDelay = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 62))
if mibBuilder.loadTexts: ietfOnetoGroupReceiverNMeanDelay.setStatus('current')
ietfOneToGroupMeanDelay = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 63))
if mibBuilder.loadTexts: ietfOneToGroupMeanDelay.setStatus('current')
ietfOneToGroupRangeMeanDelay = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 64))
if mibBuilder.loadTexts: ietfOneToGroupRangeMeanDelay.setStatus('current')
ietfOneToGroupMaxMeanDelay = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 65))
if mibBuilder.loadTexts: ietfOneToGroupMaxMeanDelay.setStatus('current')
ietfOneToGroupReceiverNLossRatio = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 66))
if mibBuilder.loadTexts: ietfOneToGroupReceiverNLossRatio.setStatus('current')
ietfOneToGroupReceiverNCompLossRatio = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 67))
if mibBuilder.loadTexts: ietfOneToGroupReceiverNCompLossRatio.setStatus('current')
ietfOneToGroupLossRatio = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 68))
if mibBuilder.loadTexts: ietfOneToGroupLossRatio.setStatus('current')
ietfOneToGroupRangeLossRatio = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 69))
if mibBuilder.loadTexts: ietfOneToGroupRangeLossRatio.setStatus('current')
ietfOneToGroupRangeDelayVariation = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 70))
if mibBuilder.loadTexts: ietfOneToGroupRangeDelayVariation.setStatus('current')
ietfFiniteOneWayDelayStream = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 71))
if mibBuilder.loadTexts: ietfFiniteOneWayDelayStream.setStatus('current')
ietfFiniteOneWayDelayMean = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 72))
if mibBuilder.loadTexts: ietfFiniteOneWayDelayMean.setStatus('current')
ietfCompositeOneWayDelayMean = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 73))
if mibBuilder.loadTexts: ietfCompositeOneWayDelayMean.setStatus('current')
ietfFiniteOneWayDelayMinimum = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 74))
if mibBuilder.loadTexts: ietfFiniteOneWayDelayMinimum.setStatus('current')
ietfCompositeOneWayDelayMinimum = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 75))
if mibBuilder.loadTexts: ietfCompositeOneWayDelayMinimum.setStatus('current')
ietfOneWayPktLossEmpiricProb = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 76))
if mibBuilder.loadTexts: ietfOneWayPktLossEmpiricProb.setStatus('current')
ietfCompositeOneWayPktLossEmpiricProb = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 77))
if mibBuilder.loadTexts: ietfCompositeOneWayPktLossEmpiricProb.setStatus('current')
ietfOneWayPdvRefminStream = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 78))
if mibBuilder.loadTexts: ietfOneWayPdvRefminStream.setStatus('current')
ietfOneWayPdvRefminMean = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 79))
if mibBuilder.loadTexts: ietfOneWayPdvRefminMean.setStatus('current')
ietfOneWayPdvRefminVariance = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 80))
if mibBuilder.loadTexts: ietfOneWayPdvRefminVariance.setStatus('current')
ietfOneWayPdvRefminSkewness = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 81))
if mibBuilder.loadTexts: ietfOneWayPdvRefminSkewness.setStatus('current')
ietfCompositeOneWayPdvRefminQtil = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 82))
if mibBuilder.loadTexts: ietfCompositeOneWayPdvRefminQtil.setStatus('current')
ietfCompositeOneWayPdvRefminNPA = ObjectIdentity((1, 3, 6, 1, 2, 1, 128, 1, 83))
if mibBuilder.loadTexts: ietfCompositeOneWayPdvRefminNPA.setStatus('current')
mibBuilder.exportSymbols("IANA-IPPM-METRICS-REGISTRY-MIB", ietfRoundTripDelayInvPercentile=ietfRoundTripDelayInvPercentile, ietfOneWayLossNoticeableRate=ietfOneWayLossNoticeableRate, ietfOneWayPktLoss=ietfOneWayPktLoss, ietfOneWayIpdv=ietfOneWayIpdv, ietfOneWayInterLossPeriodLengths=ietfOneWayInterLossPeriodLengths, ietfOnetoGroupReceiverNMeanDelay=ietfOnetoGroupReceiverNMeanDelay, ietfOneWayDelayPoissonStream=ietfOneWayDelayPoissonStream, ietfCompositeOneWayPktLossEmpiricProb=ietfCompositeOneWayPktLossEmpiricProb, ietfOneWayPdvRefminMean=ietfOneWayPdvRefminMean, ietfnReordering=ietfnReordering, ietfSpatialOneWayDelayVector=ietfSpatialOneWayDelayVector, ietfOneWayPacketDuplicationFraction=ietfOneWayPacketDuplicationFraction, ietfSegmentPacketLossStream=ietfSegmentPacketLossStream, ietfSegmentIpdvMinStream=ietfSegmentIpdvMinStream, ietfCompositeOneWayPdvRefminQtil=ietfCompositeOneWayPdvRefminQtil, ietfReorderingExtent=ietfReorderingExtent, ietfOneToGroupRangeDelayVariation=ietfOneToGroupRangeDelayVariation, ietfOneToGroupRangeLossRatio=ietfOneToGroupRangeLossRatio, ietfOneWayIpdvPercentile=ietfOneWayIpdvPercentile, ietfInstantBidirConnectivity=ietfInstantBidirConnectivity, ietfCompositeOneWayDelayMean=ietfCompositeOneWayDelayMean, ietfOneToGroupDelayVector=ietfOneToGroupDelayVector, ietfRoundTripDelayMinimum=ietfRoundTripDelayMinimum, ietfFiniteOneWayDelayStream=ietfFiniteOneWayDelayStream, ietfOneWayDelayMinimum=ietfOneWayDelayMinimum, ietfOneWayDelayPeriodicStream=ietfOneWayDelayPeriodicStream, ietfOneToGroupIpdvVector=ietfOneToGroupIpdvVector, ietfOneWayPacketDuplicationPeriodicStream=ietfOneWayPacketDuplicationPeriodicStream, ietfReorderingByteOffset=ietfReorderingByteOffset, ietfReorderingFreeRuna=ietfReorderingFreeRuna, ietfOneWayLossPeriodLengths=ietfOneWayLossPeriodLengths, ietfOneToGroupMeanDelay=ietfOneToGroupMeanDelay, ietfOneToGroupReceiverNLossRatio=ietfOneToGroupReceiverNLossRatio, ietfReorderingGapTime=ietfReorderingGapTime, PYSNMP_MODULE_ID=ianaIppmMetricsRegistry, ietfCompositeOneWayPdvRefminNPA=ietfCompositeOneWayPdvRefminNPA, ietfOneWayPktLossEmpiricProb=ietfOneWayPktLossEmpiricProb, ietfOneWayPdvRefminVariance=ietfOneWayPdvRefminVariance, ietfOneWayPdvRefminSkewness=ietfOneWayPdvRefminSkewness, ietfOneToGroupReceiverNCompLossRatio=ietfOneToGroupReceiverNCompLossRatio, ietfReorderedPacketRatio=ietfReorderedPacketRatio, ietfOneWayPktLossAverage=ietfOneWayPktLossAverage, ietfOneToGroupLossRatio=ietfOneToGroupLossRatio, ietfOneWayDelay=ietfOneWayDelay, ietfReorderingGap=ietfReorderingGap, ietfOneToGroupMaxMeanDelay=ietfOneToGroupMaxMeanDelay, ietfSpatialPacketLossVector=ietfSpatialPacketLossVector, ietfOneWayDelayMedian=ietfOneWayDelayMedian, ietfCompositeOneWayDelayMinimum=ietfCompositeOneWayDelayMinimum, ietfReorderingLateTimeOffset=ietfReorderingLateTimeOffset, ietfOneWayPktLossPoissonStream=ietfOneWayPktLossPoissonStream, ietfIntervalBidirConnectivity=ietfIntervalBidirConnectivity, ietfOneWayPacketDuplication=ietfOneWayPacketDuplication, ietfOneWayPacketArrivalCount=ietfOneWayPacketArrivalCount, ietfIntervalUnidirConnectivity=ietfIntervalUnidirConnectivity, ietfSegmentIpdvPrevStream=ietfSegmentIpdvPrevStream, ietfReorderedSingleton=ietfReorderedSingleton, ietfIntervalTemporalConnectivity=ietfIntervalTemporalConnectivity, ietfReorderingFreeRunp=ietfReorderingFreeRunp, ietfFiniteOneWayDelayMinimum=ietfFiniteOneWayDelayMinimum, ianaIppmMetricsRegistry=ianaIppmMetricsRegistry, ietfOneToGroupRangeMeanDelay=ietfOneToGroupRangeMeanDelay, ietfOneWayIpdvInversePercentile=ietfOneWayIpdvInversePercentile, ietfOneWayIpdvJitter=ietfOneWayIpdvJitter, ietfOneWayPdvRefminStream=ietfOneWayPdvRefminStream, ietfOneToGroupPacketLossVector=ietfOneToGroupPacketLossVector, ietfOneWayDelayInversePercentile=ietfOneWayDelayInversePercentile, ietfReorderingFreeRunq=ietfReorderingFreeRunq, ietfOneWayPeakToPeakIpdv=ietfOneWayPeakToPeakIpdv, ianaIppmMetrics=ianaIppmMetrics, ietfInstantUnidirConnectivity=ietfInstantUnidirConnectivity, ietfRoundTripDelay=ietfRoundTripDelay, ietfRoundTripDelayPoissonStream=ietfRoundTripDelayPoissonStream, ietfReorderingFreeRunx=ietfReorderingFreeRunx, ietfFiniteOneWayDelayMean=ietfFiniteOneWayDelayMean, ietfOneWayIpdvPoissonStream=ietfOneWayIpdvPoissonStream, ietfOneWayDelayPercentile=ietfOneWayDelayPercentile, ietfSegmentOneWayDelayStream=ietfSegmentOneWayDelayStream, ietfOneWayLossDistanceStream=ietfOneWayLossDistanceStream, ietfOneWayLossPeriodStream=ietfOneWayLossPeriodStream, ietfOneWayReplicatedPacketRate=ietfOneWayReplicatedPacketRate, ietfRoundTripDelayPercentile=ietfRoundTripDelayPercentile, ietfOneWayPacketDuplicationPoissonStream=ietfOneWayPacketDuplicationPoissonStream, ietfRoundTripDelayMedian=ietfRoundTripDelayMedian, ietfOneWayLossPeriodTotal=ietfOneWayLossPeriodTotal, ietfSpatialOneWayIpdvVector=ietfSpatialOneWayIpdvVector)
| 103.716578 | 4,849 | 0.816808 | 1,822 | 19,395 | 8.693194 | 0.147091 | 0.010859 | 0.114022 | 0.021466 | 0.166993 | 0.149568 | 0.149568 | 0.148999 | 0.148999 | 0.021719 | 0 | 0.065217 | 0.072648 | 19,395 | 186 | 4,850 | 104.274194 | 0.815412 | 0.018252 | 0 | 0 | 0 | 0 | 0.062631 | 0.003888 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.03352 | 0 | 0.03352 | 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 |
186b5226f453de36828975ed8e9ab1d53eeef39b | 83 | py | Python | of_team_editor.py | moth1995/WE10JL_OF_Team_Editor | 09f4f29871e93595cf68e33b34ef6d7379d20095 | [
"MIT"
] | 1 | 2022-01-25T06:12:18.000Z | 2022-01-25T06:12:18.000Z | of_team_editor.py | moth1995/WE10JL_OF_Team_Editor | 09f4f29871e93595cf68e33b34ef6d7379d20095 | [
"MIT"
] | null | null | null | of_team_editor.py | moth1995/WE10JL_OF_Team_Editor | 09f4f29871e93595cf68e33b34ef6d7379d20095 | [
"MIT"
] | null | null | null | from gui.gui import Gui
if __name__ == "__main__":
app = Gui()
app.start() | 16.6 | 26 | 0.614458 | 12 | 83 | 3.583333 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.240964 | 83 | 5 | 27 | 16.6 | 0.68254 | 0 | 0 | 0 | 0 | 0 | 0.095238 | 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 |
188201b945234ae8b874a0feb0aba5583ad22cc1 | 696 | py | Python | WeedCode/Synthetic_sugarbeets/mytest.py | danielginn/Mask_RCNN | c95e030855bfdc3ad2f81fc22d5a8ae52be2f75a | [
"MIT"
] | null | null | null | WeedCode/Synthetic_sugarbeets/mytest.py | danielginn/Mask_RCNN | c95e030855bfdc3ad2f81fc22d5a8ae52be2f75a | [
"MIT"
] | null | null | null | WeedCode/Synthetic_sugarbeets/mytest.py | danielginn/Mask_RCNN | c95e030855bfdc3ad2f81fc22d5a8ae52be2f75a | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import matplotlib.pyplot as plt
from math import sqrt,pi,cos,sin
IMAGE = "0148"
# Load in backgrounds
#img_path = ".\\data\\backgrounds_cleaned\\gt\\"+IMAGE+".png"
#img = cv2.imread(img_path)
#diluted_white_mask = (img > 0)
# Taking a matrix of size 5 as the kernel
#kernel = np.ones((3, 3), np.uint8)
#diluted_white_mask = cv2.dilate(diluted_white_mask.astype('uint8'), kernel, iterations=3)
#diluted_white_mask = cv2.erode(diluted_white_mask, kernel, iterations=3)
#plt.imshow(diluted_white_mask*255)
#plt.show()
img = cv2.imread(".\\data\\occlusion_00\\stem_mask\\0035.png", cv2.IMREAD_GRAYSCALE)
plt.imshow(img*255, cmap='gray')
plt.show() | 33.142857 | 91 | 0.721264 | 110 | 696 | 4.4 | 0.5 | 0.14876 | 0.198347 | 0.078512 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.049342 | 0.126437 | 696 | 21 | 92 | 33.142857 | 0.746711 | 0.594828 | 0 | 0 | 0 | 0 | 0.198413 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
43f47f3e5365d75f311a4ddf8ac538a62821f5ec | 342 | py | Python | intro/3_nums_greater.py | Rhoynar/pysel | 7a283cfdcaea3b1e33e615d1e655b6bd1f23f09f | [
"MIT"
] | 1 | 2019-09-09T12:58:36.000Z | 2019-09-09T12:58:36.000Z | intro/3_nums_greater.py | Rhoynar/pysel | 7a283cfdcaea3b1e33e615d1e655b6bd1f23f09f | [
"MIT"
] | null | null | null | intro/3_nums_greater.py | Rhoynar/pysel | 7a283cfdcaea3b1e33e615d1e655b6bd1f23f09f | [
"MIT"
] | null | null | null | num1 = int(input('Enter number 1: '))
num2 = int(input('Enter number 2: '))
num3 = int(input('Enter number 3: '))
if num1 > num2 and num1 > num3:
print(str(num1) + ' is the greatest!')
if num2 > num3 and num2 > num1:
print(str(num2) + ' is the greatest!')
if num3 > num1 and num3 > num2:
print(str(num3) + ' is the greatest!')
| 26.307692 | 42 | 0.614035 | 54 | 342 | 3.888889 | 0.314815 | 0.114286 | 0.185714 | 0.271429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.078652 | 0.219298 | 342 | 12 | 43 | 28.5 | 0.707865 | 0 | 0 | 0 | 0 | 0 | 0.289474 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 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 |
a1011d8a44b7ad5859bd52692e3240bbd0803eff | 1,481 | py | Python | researchutils/chainer/serializers/npz.py | keio-ytlab/researchutils | bb3ec467386d43a1e2282ec6d024216ce4dae841 | [
"MIT"
] | 1 | 2018-10-25T12:57:38.000Z | 2018-10-25T12:57:38.000Z | researchutils/chainer/serializers/npz.py | yuishihara/researchutils | bb3ec467386d43a1e2282ec6d024216ce4dae841 | [
"MIT"
] | 28 | 2018-08-25T03:54:30.000Z | 2018-10-14T12:09:47.000Z | researchutils/chainer/serializers/npz.py | yuishihara/researchutils | bb3ec467386d43a1e2282ec6d024216ce4dae841 | [
"MIT"
] | null | null | null | from researchutils import files
import chainer.serializers
def save_model(path, model):
"""
Save model as an npz file to given path
Parameters
-------
path : string
path of the model to be saved
model : chainer.Link
model to save parameters
Raises
-------
ValueError
File already exists
"""
if files.file_exists(path):
raise ValueError('File already exists in {}'.format(path))
chainer.serializers.save_npz(path, model)
def load_model(path, model):
"""
Load model from the npz file of given path
Parameters
------
path : string
path of the saved model
Returns
------
model : chainer.Link
model with parameters initialized from loaded file
if the file does not exist, then will return given model without any changes
"""
if not files.file_exists(path):
return model
return chainer.serializers.load_npz(path, model)
def load_snapshot(path, trainer):
"""
Load snapshot from the npz file of given path
Parameters
------
path : string
path of the saved model
Returns
------
trainer : chainer.Trainer
trainer with associated objects initialized with loaded file
if the file does not exist, then will return given trainer without any changes
"""
if not files.file_exists(path):
return trainer
return chainer.serializers.load_npz(path, trainer) | 23.140625 | 86 | 0.640783 | 187 | 1,481 | 5.026738 | 0.262032 | 0.076596 | 0.060638 | 0.073404 | 0.505319 | 0.47234 | 0.397872 | 0.397872 | 0.357447 | 0.357447 | 0 | 0 | 0.280891 | 1,481 | 64 | 87 | 23.140625 | 0.882629 | 0.528022 | 0 | 0.142857 | 0 | 0 | 0.046125 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.214286 | false | 0 | 0.142857 | 0 | 0.642857 | 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 |
a11b322077a454bb95372f2a0bde0190e64f8315 | 276 | py | Python | Modulo 1/Lista01/1.py | BelfortJoao/Programacao-1 | 2d463744379ad3e4b0f5882ad923aae7ff80197a | [
"MIT"
] | 2 | 2021-08-17T14:02:13.000Z | 2021-08-19T02:37:28.000Z | Modulo 1/Lista01/1.py | BelfortJoao/Programacao-1 | 2d463744379ad3e4b0f5882ad923aae7ff80197a | [
"MIT"
] | null | null | null | Modulo 1/Lista01/1.py | BelfortJoao/Programacao-1 | 2d463744379ad3e4b0f5882ad923aae7ff80197a | [
"MIT"
] | 1 | 2021-09-05T20:18:45.000Z | 2021-09-05T20:18:45.000Z | Despesas = float(input("Quanto foi gasto?"))
Gorjeta = Despesas / 100 * 10
Total = Despesas + Gorjeta
print("--------------------------------------- \n O total foi de R${:.2f} \n Com uma gorjeta de R${:.2f} \n --------------------------------------- ".format(Total, Gorjeta))
| 55.2 | 173 | 0.471014 | 32 | 276 | 4.0625 | 0.59375 | 0.046154 | 0.076923 | 0.092308 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.028926 | 0.123188 | 276 | 4 | 174 | 69 | 0.508264 | 0 | 0 | 0 | 0 | 0.25 | 0.572464 | 0.282609 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 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 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
a12ebbcb1db55fd012ffccdbeeca3f7a7f02d2c5 | 689 | py | Python | ex099.py | ArthurCorrea/python-exercises | 0c2ac46b8c40dd9868b132e847cfa42e025095e3 | [
"MIT"
] | null | null | null | ex099.py | ArthurCorrea/python-exercises | 0c2ac46b8c40dd9868b132e847cfa42e025095e3 | [
"MIT"
] | null | null | null | ex099.py | ArthurCorrea/python-exercises | 0c2ac46b8c40dd9868b132e847cfa42e025095e3 | [
"MIT"
] | null | null | null | # Faça um programa que tenha uma função chamada maior(), que
# receba vários parâmetros com valores inteiros.
# Seu programa tem que analisar todos os valores e dizer qual
# deles é o maior.
from time import sleep
def maior(* n):
print('-='*15)
print('Analisando os valores passados...')
for num in n:
print(f'{num} ', end='')
sleep(0.5)
print(f'\nForam informados {len(n)} valores.')
print(f'Maior valor: {max(n)}')
print(f'Menor valor: {min(n)}')
sleep(2.5)
# Programa principal
maior(1, 3, 2, 7, 6, 9)
maior(5, 2, 6)
maior(7, 9, 12, 0, 16, 2, 11, 7, 8)
maior(1, 8, -2, 6, -18, 15)
maior(6, 1, 18, 14, 212, 291, -928, -71, 9824, 10231, 5)
| 26.5 | 61 | 0.609579 | 120 | 689 | 3.5 | 0.575 | 0.057143 | 0.033333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.115456 | 0.22061 | 689 | 25 | 62 | 27.56 | 0.666667 | 0.291727 | 0 | 0 | 0 | 0 | 0.246888 | 0 | 0 | 0 | 0 | 0.04 | 0 | 1 | 0.0625 | false | 0.0625 | 0.0625 | 0 | 0.125 | 0.375 | 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 |
a13178788ebffeebdf23558ba8b6308224775c99 | 649 | py | Python | cove/management/commands/expire_files.py | jpmckinney/lib-cove-web | bd849fcd6845b746a80b37d57675e468cdeefefc | [
"MIT"
] | 1 | 2020-05-17T14:39:40.000Z | 2020-05-17T14:39:40.000Z | cove/management/commands/expire_files.py | jpmckinney/lib-cove-web | bd849fcd6845b746a80b37d57675e468cdeefefc | [
"MIT"
] | 53 | 2018-12-04T13:18:55.000Z | 2021-08-30T11:06:28.000Z | cove/management/commands/expire_files.py | jpmckinney/lib-cove-web | bd849fcd6845b746a80b37d57675e468cdeefefc | [
"MIT"
] | 4 | 2018-12-04T13:17:21.000Z | 2021-04-12T18:45:13.000Z | from django.core.management.base import BaseCommand
from cove.input.models import SuppliedData
from django.conf import settings
from django.utils import timezone
from datetime import timedelta
import shutil
class Command(BaseCommand):
help = 'Delete files that are older than 7 days'
def handle(self, *args, **options):
old_data = SuppliedData.objects.filter(created__lt=timezone.now() - timedelta(days=getattr(settings, 'DELETE_FILES_AFTER_DAYS', 7)))
for supplied_data in old_data:
try:
shutil.rmtree(supplied_data.upload_dir())
except FileNotFoundError:
continue
| 34.157895 | 140 | 0.713405 | 80 | 649 | 5.6625 | 0.6625 | 0.066225 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003906 | 0.211094 | 649 | 18 | 141 | 36.055556 | 0.880859 | 0 | 0 | 0 | 0 | 0 | 0.095532 | 0.035439 | 0 | 0 | 0 | 0 | 0 | 1 | 0.066667 | false | 0 | 0.4 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
a1336826d999778e18feae95fbf1a75192e07c98 | 655 | py | Python | infdist/simulator/experiment/legacy/__init__.py | zeroos/infdist | 5fca2c42bbe5ea650866a26568d1eaf240b2b47e | [
"MIT"
] | null | null | null | infdist/simulator/experiment/legacy/__init__.py | zeroos/infdist | 5fca2c42bbe5ea650866a26568d1eaf240b2b47e | [
"MIT"
] | null | null | null | infdist/simulator/experiment/legacy/__init__.py | zeroos/infdist | 5fca2c42bbe5ea650866a26568d1eaf240b2b47e | [
"MIT"
] | null | null | null | __all__ = [
'BaseExperiment',
'BaseTreeExperiment',
'DropRateVsUtilityExperiment',
'LimitedThroughputExperiment',
'GraphMessagesExperiment',
'VaryingBackgroundTrafficExperiment',
'GoodputVsRateExperiment',
]
from .base_experiment import BaseExperiment
from .base_tree_experiment import BaseTreeExperiment
from .drop_rate_vs_utility import DropRateVsUtilityExperiment
from .limited_throughput import LimitedThroughputExperiment
from .groph_messages import GraphMessagesExperiment
from .varying_background_traffic_experiment import (
VaryingBackgroundTrafficExperiment
)
from .goodput_vs_rate import GoodputVsRateExperiment
| 32.75 | 61 | 0.836641 | 49 | 655 | 10.836735 | 0.510204 | 0.090395 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.112977 | 655 | 19 | 62 | 34.473684 | 0.913941 | 0 | 0 | 0 | 0 | 0 | 0.253435 | 0.20458 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.388889 | 0 | 0.388889 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
a138e43f9db7ab55a11b98b7fbe6bbed37e90d88 | 1,085 | py | Python | {{cookiecutter.project_name}}/server/src/common/generators.py | gradam/full-docker-django-cookiecutter | 527ff2ca178424cdd7e552159324de51d334e43d | [
"MIT"
] | 4 | 2018-03-28T15:49:36.000Z | 2021-01-07T12:22:29.000Z | {{cookiecutter.project_name}}/server/src/common/generators.py | gradam/full-docker-django-cookiecutter | 527ff2ca178424cdd7e552159324de51d334e43d | [
"MIT"
] | null | null | null | {{cookiecutter.project_name}}/server/src/common/generators.py | gradam/full-docker-django-cookiecutter | 527ff2ca178424cdd7e552159324de51d334e43d | [
"MIT"
] | null | null | null | import delorean
from django.db.utils import IntegrityError
from faker import Faker
from accounts.models import User
def generate_user(is_superuser=False, password=None, save=True):
fake = Faker()
while True:
first_name = fake.first_name()
last_name = fake.last_name()
simple_profile = fake.simple_profile()
username = simple_profile['username']
birth_date = simple_profile['birthdate']
birth_date = delorean.parse(birth_date).datetime
email = simple_profile['mail']
gender = simple_profile['sex']
password = password if password else 'haslo1234'
user_data = dict(username=username, first_name=first_name, password=password,
last_name=last_name, email=email, is_superuser=is_superuser,
is_staff=is_superuser, birth_date=birth_date, gender=gender)
if save:
try:
return User.objects.create(**user_data)
except IntegrityError:
pass
else:
return User(**user_data)
| 35 | 85 | 0.639631 | 124 | 1,085 | 5.370968 | 0.395161 | 0.117117 | 0.036036 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005109 | 0.278341 | 1,085 | 30 | 86 | 36.166667 | 0.845466 | 0 | 0 | 0 | 1 | 0 | 0.030415 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.038462 | false | 0.153846 | 0.153846 | 0 | 0.269231 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
a1448cde6ec7466dd80b3839886d055a3e88b1fc | 459 | py | Python | www/test.py | liafeiok/awesome-python3-webapp | 19d9b68e1dbc07aaa696ce80eeefd9c2e112d065 | [
"Apache-2.0"
] | null | null | null | www/test.py | liafeiok/awesome-python3-webapp | 19d9b68e1dbc07aaa696ce80eeefd9c2e112d065 | [
"Apache-2.0"
] | null | null | null | www/test.py | liafeiok/awesome-python3-webapp | 19d9b68e1dbc07aaa696ce80eeefd9c2e112d065 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'Pengfei, Li'
import www.orm
from www.models import User
import asyncio
import random
async def test(loop):
await www.orm.create_pool(loop, user='root', password='root', db='awesome')
u = User(name='Test', email='test%s@example.com' % random.randint(0, 10000000), passwd='123', image='about:blank')
await u.save()
loop = asyncio.get_event_loop()
loop.run_until_complete(test(loop))
| 24.157895 | 118 | 0.697168 | 70 | 459 | 4.442857 | 0.7 | 0.038585 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.035176 | 0.132898 | 459 | 18 | 119 | 25.5 | 0.746231 | 0.093682 | 0 | 0 | 0 | 0 | 0.149758 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.181818 | 0.363636 | 0 | 0.363636 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 2 |
a14711ffa7bde24bf3d85a90f8ad82de68757e8a | 50 | py | Python | pythonlearn/Socket-Http/HTTP/pbl/server/__init__.py | yc19890920/Learn | 3990e75b469225ba7b430539ef9a16abe89eb863 | [
"Apache-2.0"
] | 1 | 2021-01-11T06:30:44.000Z | 2021-01-11T06:30:44.000Z | pythonlearn/Socket-Http/HTTP/pbl/server/demo/__init__.py | yc19890920/Learn | 3990e75b469225ba7b430539ef9a16abe89eb863 | [
"Apache-2.0"
] | 23 | 2020-02-12T02:35:49.000Z | 2022-02-11T03:45:40.000Z | pythonlearn/Socket-Http/HTTP/pbl/server/demo/__init__.py | yc19890920/Learn | 3990e75b469225ba7b430539ef9a16abe89eb863 | [
"Apache-2.0"
] | 2 | 2020-04-08T15:39:46.000Z | 2020-10-10T10:13:09.000Z | #!/usr/bin/python
#coding=utf8
__author__ = 'leo'
| 12.5 | 18 | 0.7 | 7 | 50 | 4.428571 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022222 | 0.1 | 50 | 3 | 19 | 16.666667 | 0.666667 | 0.54 | 0 | 0 | 0 | 0 | 0.142857 | 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 |
a15e81d97b870d9d3ae496d3749d1a0023affbb3 | 492 | py | Python | colRecoder2.py | DU-ds/Misc-Python-Scripts | ca68564805ca350f7ee529148c7bd3796adcc929 | [
"MIT"
] | null | null | null | colRecoder2.py | DU-ds/Misc-Python-Scripts | ca68564805ca350f7ee529148c7bd3796adcc929 | [
"MIT"
] | null | null | null | colRecoder2.py | DU-ds/Misc-Python-Scripts | ca68564805ca350f7ee529148c7bd3796adcc929 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 12 13:16:08 2018
@author: Kenneth Collins
"""
"""colRecoder2(dataFrame, colName, oldVal, newVal):
requires: pandas dataFrame, colName must be the columns name (e.g. df.colName), not a string
effects: returns a copy of the column. Does NOT mutate data.
Thus must be assigned to change data.
"""
def colRecoder2(dataFrame, colName, oldVal, newVal):
columnCopy = dataFrame.colName.copy()
columnCopy[oldVal] = newVal
return columnCopy | 30.75 | 93 | 0.719512 | 69 | 492 | 5.130435 | 0.695652 | 0.180791 | 0.152542 | 0.186441 | 0.220339 | 0 | 0 | 0 | 0 | 0 | 0 | 0.036496 | 0.164634 | 492 | 16 | 94 | 30.75 | 0.824818 | 0.170732 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
a160fd7f7e38be6fd2504be7993cccaf6e79413e | 713 | py | Python | pertemuan_2/9_WTForm/forms.py | Muhammad-Yunus/Flask-Web-Development | c13e3fda30151b1155242abe4532d5f4d7bc120e | [
"Apache-2.0"
] | null | null | null | pertemuan_2/9_WTForm/forms.py | Muhammad-Yunus/Flask-Web-Development | c13e3fda30151b1155242abe4532d5f4d7bc120e | [
"Apache-2.0"
] | null | null | null | pertemuan_2/9_WTForm/forms.py | Muhammad-Yunus/Flask-Web-Development | c13e3fda30151b1155242abe4532d5f4d7bc120e | [
"Apache-2.0"
] | null | null | null | from wtforms import Form, BooleanField, StringField, PasswordField, validators, SubmitField
class UserForm(Form):
name = StringField('Name', [validators.Length(min=4, max=50), validators.DataRequired()])
email = StringField('Email Address', [validators.Length(min=6, max=50), validators.DataRequired()])
phone = StringField('Phone Number', [validators.Length(min=8, max=14)])
password = PasswordField('New Password', [validators.InputRequired(),
validators.EqualTo('confirm', message='Passwords must match')])
confirm = PasswordField('Repeat Password')
accept_tos = BooleanField('I accept the TOS', [validators.DataRequired()])
submit = SubmitField('Submit')
| 47.533333 | 103 | 0.709677 | 74 | 713 | 6.824324 | 0.540541 | 0.09505 | 0.112871 | 0.106931 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014851 | 0.15007 | 713 | 14 | 104 | 50.928571 | 0.818482 | 0 | 0 | 0 | 0 | 0 | 0.147472 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.4 | 0.1 | 0 | 0.9 | 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 |
a161f39538f7c09ebfe25c53dad580e39758cc38 | 10,858 | py | Python | hotspringsapp/models.py | 1000Springs/web-app | d6fa34fcffd320c49fc4672c7cfc18aa4938d707 | [
"MIT"
] | null | null | null | hotspringsapp/models.py | 1000Springs/web-app | d6fa34fcffd320c49fc4672c7cfc18aa4938d707 | [
"MIT"
] | null | null | null | hotspringsapp/models.py | 1000Springs/web-app | d6fa34fcffd320c49fc4672c7cfc18aa4938d707 | [
"MIT"
] | null | null | null | from hotspringsapp import app,db
from werkzeug.security import generate_password_hash, check_password_hash
from sqlalchemy.sql import text
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.orm import sessionmaker
class Location(db.Model):
__tablename__ = 'public_location'
id = db.Column(db.Integer, primary_key=True)
feature_name = db.Column(db.String(50))
feature_system = db.Column(db.String(50))
district = db.Column(db.String(50))
location = db.Column(db.String(50))
lat = db.Column(db.Float)
lng = db.Column(db.Float)
description = db.Column(db.String(200))
private = db.Column(db.Boolean)
access = db.Column(db.String(15))
feature_type = db.Column(db.String(50))
def latestSample(self):
return Sample.query.filter(Location.id == self.id, Sample.location_id == Location.id ).order_by(Sample.location_id,Sample.date_gathered.desc()).first()
@staticmethod
def latestSampleIdsAllLocations():
query = text('select id from public_sample s where s.date_gathered = (select max(date_gathered) from public_sample where location_id = s.location_id limit 1 )')
rows = db.engine.execute(query).fetchall()
sample_ids = []
for row in rows:
sample_ids.append(row[0])
return sample_ids
def __init__(self,location_id,fName,latPos,lngPos,fSystem,dist,loc,desc,private,access):
self.id = location_id
self.feature_name = fName
self.feature_system = fSystem
self.district = dist
self.location = loc
self.lat = latPos
self.lng = lngPos
self.description = desc
self.private = private
self.access = access
def __repr__(self):
return '<Location {0} {1}>'.format(self.id,self.feature_name)
class Physical_data(db.Model):
__tablename__ = 'public_physical_data'
id = db.Column(db.Integer, primary_key=True)
initialTemp = db.Column(db.Float)
sampleTemp = db.Column(db.Float)
pH = db.Column(db.Float)
redox = db.Column(db.Float)
dO = db.Column(db.Float)
conductivity = db.Column(db.Float)
size = db.Column(db.String(20))
colour = db.Column(db.String(7))
ebullition = db.Column(db.String(50))
turbidity = db.Column(db.Float)
dnaVolume = db.Column(db.Float)
ferrousIronAbs = db.Column(db.Float)
def __init__(self, phys_id,iTemp,sTemp,ph,red,dis_ox,cond,date,size,colour,ebul,turb,dnaVol,ferIron):
self.id = phys_id
self.initialTemp = iTemp
self.pH = ph
self.redox = red
self.dO = dis_ox
self.conductivity = cond
self.size = size
self.colour = colour
self.ebullition = ebul
self.turbidity = turb
self.dnaVolume = dnaVol
self.ferrousIronAbs = ferIron
self.date_gathered = date
self.sampleTemp = sTemp
class Sample_Taxonomy(db.Model):
__tablename__ = 'public_sample_taxonomy'
id = db.Column(db.Integer, primary_key=True)
sample_id = db.Column( db.Integer, db.ForeignKey('public_sample.id'))
taxonomy_id = db.Column(db.Integer, db.ForeignKey('public_taxonomy.id'))
read_count = db.Column(db.Integer)
sample = db.relationship("Sample",backref="Sample_Taxonomy", lazy="select")
taxon = db.relationship("Taxonomy",backref="Sample_Taxonomy", lazy="joined")
class Taxonomy(db.Model):
__tablename__ = 'public_taxonomy'
id = db.Column(db.Integer, primary_key=True)
domain = db.Column(db.String(100), nullable=True)
phylum = db.Column(db.String(100), nullable=True)
Class = db.Column(db.String(100), nullable=True)
# read_count = db.Column(db.Integer, nullable=True)
def __getitem__(self,index):
return getattr(self,index)
class Sample(db.Model):
__tablename__ = 'public_sample'
id = db.Column(db.Integer, primary_key=True)
date_gathered = db.Column(db.DateTime, nullable=False)
sampler = db.Column(db.String(50), nullable=False)
sample_number = db.Column(db.String(50), nullable=False)
location_id = db.Column(db.Integer, db.ForeignKey("public_location.id"))
phys_id = db.Column(db.Integer, db.ForeignKey("public_physical_data.id"))
chem_id = db.Column(db.Integer, db.ForeignKey("public_chemical_data.id"))
location = db.relationship("Location",backref="Sample",lazy="select")
phys = db.relationship("Physical_data",backref="Sample",lazy="select")
image = db.relationship("Image",backref="Sample",lazy="select" , uselist=True)
chem = db.relationship("Chemical_data",backref="Sample",lazy="select")
samp_taxon = db.relationship("Sample_Taxonomy",backref="Sample",lazy="select")
taxon = association_proxy('samp_taxon', 'taxon')
def __init__(self,id,date,location,physID,chemID,sampleNum):
self.id = id
self.date_gathered = date
self.location_id = location
self.phys_id = physID
self.chem_id = chemID
self.sample_number = sampleNum
def getTaxonomy(self):
# Queries of views without primary keys don't fit very well in the
# SQLAlchemy ORM, so query the DB with raw SQL
column_names = ["read_count", "domain", "phylum", "class", "order", "family", "genus", "species"]
query = text(
'select `' + ('`,`'.join(column_names)) + '` from public_confident_taxonomy where sample_id = :sample_id' +
' order by `'+ ('`,`'.join(column_names[1:])) +'`'
)
rows = db.engine.execute(query, sample_id=self.id).fetchall()
return [dict(zip(column_names,row)) for row in rows]
def hasTaxonomy(self):
query = text(
'select * from public_sample_taxonomy where sample_id = :sample_id limit 1'
)
rows = db.engine.execute(query, sample_id=self.id).fetchall()
return len(rows) > 0
def __repr__(self):
return '<Sample {0} {1} {2}>'.format(self.id,self.location_id,self.date_gathered)
class Image(db.Model):
__tablename__ = 'public_image'
id = db.Column(db.Integer, primary_key=True)
sample_id = db.Column(db.Integer, db.ForeignKey("public_sample.id"), nullable=False)
image_path = db.Column(db.String (150), nullable = False)
image_type = db.Column(db.String (150))
def __init__(self,id,sid,iPath,iName):
self.id = id
self.sample_id = sid
self.image_path = iPath
self.image_name = iName
class User(db.Model):
username = db.Column(db.String(100), primary_key=True)
password = db.Column(db.String(100))
def __init__(self,username,password):
self.username = username
self.password = password
def check_password(self, password):
return check_password_hash(self.password,password)
class Chemical_data(db.Model):
__tablename__ = 'public_chemical_data'
id = db.Column(db.Integer, primary_key=True)
Li = db.Column(db.Float)
B = db.Column(db.Float)
N = db.Column(db.Float)
Na = db.Column(db.Float)
P = db.Column(db.Float)
Cl = db.Column(db.Float)
C = db.Column(db.Float)
Al = db.Column(db.Float)
Si = db.Column(db.Float)
K = db.Column(db.Float)
Ca = db.Column(db.Float)
V = db.Column(db.Float)
Cr = db.Column(db.Float)
Fe = db.Column(db.Float)
Mn = db.Column(db.Float)
cobalt = db.Column(db.Float)
Ni = db.Column(db.Float)
Cu = db.Column(db.Float)
Zn = db.Column(db.Float)
Mg = db.Column(db.Float)
As = db.Column(db.Float)
Se = db.Column(db.Float)
Br = db.Column(db.Float)
Sr = db.Column(db.Float)
Mo = db.Column(db.Float)
Ag = db.Column(db.Float)
Cd = db.Column(db.Float)
In = db.Column(db.Float)
Ba = db.Column(db.Float)
La = db.Column(db.Float)
Ti = db.Column(db.Float)
Pb = db.Column(db.Float)
Bi = db.Column(db.Float)
U = db.Column(db.Float)
CH4 = db.Column(db.Float)
H2S = db.Column(db.Float)
H2 = db.Column(db.Float)
CO = db.Column(db.Float)
nitrate = db.Column(db.Float)
nitrite = db.Column(db.Float)
ammonium = db.Column(db.Float)
sulfate = db.Column(db.Float)
chloride = db.Column(db.Float)
phosphate = db.Column(db.Float)
iron2 = db.Column(db.Float)
bicarbonate = db.Column(db.Float)
thallium = db.Column(db.Float)
def returnElements(self):
elements = []
elements.append(["Li",self.Li])
elements.append(["B",self.B])
elements.append(["N",self.N])
elements.append(["Na",self.Na])
elements.append(["P",self.P])
elements.append(["Cl",self.Cl])
elements.append(["C",self.C])
elements.append(["Al",self.Al])
elements.append(["Si",self.Si])
elements.append(["K",self.K])
elements.append(["Ca",self.Ca])
elements.append(["V",self.V])
elements.append(["Cr",self.Cr])
elements.append(["Fe",self.Fe])
elements.append(["Mn",self.Mn])
elements.append(["cobalt",self.cobalt])
elements.append(["Ni",self.Ni])
elements.append(["Cu",self.Cu])
elements.append(["Zn",self.Zn])
elements.append(["Mg",self.Mg])
elements.append(["As",self.As])
elements.append(["Se",self.Se])
elements.append(["Br",self.Br])
elements.append(["Sr",self.Sr])
elements.append(["Mo",self.Mo])
elements.append(["Ag",self.Ag])
elements.append(["Cd",self.Cd])
elements.append(["In",self.In])
elements.append(["Ba",self.Ba])
elements.append(["La",self.La])
elements.append(["Ti",self.Ti])
elements.append(["Pb",self.Pb])
elements.append(["Bi",self.Bi])
elements.append(["U",self.U])
return elements
def returnGases(self):
gases = []
gases.append(["CH4",self.CH4])
gases.append(["H2S",self.H2S])
gases.append(["H2",self.H2])
gases.append(["CO",self.CO])
return gases
def returnCompounds(self):
compounds = []
compounds.append(["nitrate",self.nitrate])
compounds.append(["nitrite",self.nitrite])
compounds.append(["ammonium",self.ammonium])
compounds.append(["sulfate",self.sulfate])
compounds.append(["chloride",self.chloride])
compounds.append(["phosphate",self.phosphate])
compounds.append(["iron2",self.iron2])
compounds.append(["bicarbonate",self.bicarbonate])
return compounds
def __getitem__(self,index):
return getattr(self,index)
| 35.253247 | 169 | 0.62203 | 1,405 | 10,858 | 4.684698 | 0.161566 | 0.114251 | 0.142814 | 0.132179 | 0.227135 | 0.155728 | 0.134761 | 0.111212 | 0.060316 | 0.041629 | 0 | 0.008067 | 0.235126 | 10,858 | 307 | 170 | 35.368078 | 0.784467 | 0.014644 | 0 | 0.083665 | 1 | 0.003984 | 0.088453 | 0.010753 | 0 | 0 | 0 | 0 | 0 | 1 | 0.067729 | false | 0.023904 | 0.01992 | 0.023904 | 0.59761 | 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 | 0 | 0 | 1 | 0 | 0 | 2 |
a16883b57f53338f5701a5181c04c729508aea3a | 93 | py | Python | PythonCode/1153.py | CrystianPrintes20/ProjetoUri | 92a88ae2671a556f4d418c3605e9a2c6933dc9d8 | [
"MIT"
] | null | null | null | PythonCode/1153.py | CrystianPrintes20/ProjetoUri | 92a88ae2671a556f4d418c3605e9a2c6933dc9d8 | [
"MIT"
] | null | null | null | PythonCode/1153.py | CrystianPrintes20/ProjetoUri | 92a88ae2671a556f4d418c3605e9a2c6933dc9d8 | [
"MIT"
] | null | null | null | n = int(input())
total = 1
while n != 0:
total *= n
n -= 1
print(n)
print(total) | 11.625 | 16 | 0.494624 | 16 | 93 | 2.875 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.047619 | 0.322581 | 93 | 8 | 17 | 11.625 | 0.68254 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.285714 | 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 |
a1756a83e2482589970aaa58326666b09ad9a0df | 632 | py | Python | src/start_horovod.py | jakob-ed/pytorch-dist-pos-tagger | f6143564c0df309ea20a5d6544c31027adf0bc88 | [
"MIT"
] | null | null | null | src/start_horovod.py | jakob-ed/pytorch-dist-pos-tagger | f6143564c0df309ea20a5d6544c31027adf0bc88 | [
"MIT"
] | null | null | null | src/start_horovod.py | jakob-ed/pytorch-dist-pos-tagger | f6143564c0df309ea20a5d6544c31027adf0bc88 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import random
import torch
from horovod_adasum.horovod_adasum import HorovodAdaSum
MIN_FREQ = int(os.environ['SUSML_MIN_FREQ'])
RAND_SEED = int(os.environ['SUSML_RAND_SEED'])
NUM_EPOCHS = int(os.environ['SUSML_NUM_EPOCHS'])
BATCH_SIZE = int(os.environ['SUSML_BATCH_SIZE'])
LR = float(os.environ['SUSML_LR'])
PARALLELISM_LEVEL = int(os.environ['SUSML_PARALLELISM_LEVEL'])
RAY_PARAMETER_SERVER_STRATEGY = os.environ['RAY_PARAMETER_SERVER_STRATEGY']
random.seed(RAND_SEED)
torch.manual_seed(RAND_SEED)
torch.backends.cudnn.deterministic = True
if __name__ == "__main__":
HorovodAdaSum().run()
| 26.333333 | 75 | 0.789557 | 92 | 632 | 5.043478 | 0.434783 | 0.135776 | 0.181034 | 0.18319 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.083861 | 632 | 23 | 76 | 27.478261 | 0.801382 | 0.031646 | 0 | 0 | 0 | 0 | 0.211129 | 0.085106 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 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 |
a177e281caed0d9584244db24a500b0af17df35e | 322 | py | Python | Statistics/zscore.py | jimishapatel/statistic | 73430aeb5c11ae2683047bab16dc976cc7b3e403 | [
"MIT"
] | null | null | null | Statistics/zscore.py | jimishapatel/statistic | 73430aeb5c11ae2683047bab16dc976cc7b3e403 | [
"MIT"
] | null | null | null | Statistics/zscore.py | jimishapatel/statistic | 73430aeb5c11ae2683047bab16dc976cc7b3e403 | [
"MIT"
] | 1 | 2019-12-22T07:27:47.000Z | 2019-12-22T07:27:47.000Z | from Statistics.mean import mean
from Statistics.samplestand import samplestand
from Calculator.subtraction import subtraction
from Calculator.division import division
def zscore(data):
x = 64
u = mean(data)
sample_sd = samplestand(data)
y = subtraction(x, u)
return division(sample_sd, y) | 14 | 46 | 0.729814 | 41 | 322 | 5.682927 | 0.439024 | 0.120172 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007813 | 0.204969 | 322 | 23 | 47 | 14 | 0.902344 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1 | false | 0 | 0.4 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
a178f51527ce39867c1ebfa0e6d25de7679650e7 | 1,801 | py | Python | src/spaceone/inventory/error/custom.py | jean1042/plugin-azure-cloud-services | 3a75a516c9a4d1e8a4962988934ead3fd40e8494 | [
"Apache-2.0"
] | 1 | 2020-12-08T11:59:54.000Z | 2020-12-08T11:59:54.000Z | src/spaceone/inventory/error/custom.py | jean1042/plugin-azure-cloud-services | 3a75a516c9a4d1e8a4962988934ead3fd40e8494 | [
"Apache-2.0"
] | 4 | 2021-01-26T10:43:37.000Z | 2021-12-17T10:13:33.000Z | src/spaceone/inventory/error/custom.py | jean1042/plugin-azure-cloud-services | 3a75a516c9a4d1e8a4962988934ead3fd40e8494 | [
"Apache-2.0"
] | 2 | 2021-01-13T03:24:05.000Z | 2021-01-19T07:25:45.000Z | from spaceone.core.error import ERROR_BASE
class ERROR_REPOSITORY_BACKEND(ERROR_BASE):
status_code = 'INTERNAL'
message = 'Repository backend has problem. ({host})'
class ERROR_DRIVER(ERROR_BASE):
status_code = 'INTERNAL'
message = '{message}'
class ERROR_NOT_INITIALIZED_EXCEPTION(ERROR_BASE):
status_code = 'INTERNAL'
message = 'Collector is not initialized. Please call initialize() method before using it.'
class ERROR_CONNECTOR_INITIALIZE(ERROR_BASE):
status_code = 'INTERNAL'
message = 'Connector is failed to initialized. Connector = {field}.'
class ERROR_CONNECTOR(ERROR_BASE):
status_code = 'INTERNAL'
message = 'Connector is failed to connect. Connector = {field}.'
class ERROR_KEY_VAULTS(ERROR_BASE):
status_code = 'INTERNAL'
message = 'KeyVault manager is failed to get sub resources. {field}.'
class ERROR_KEY_VAULTS_PERMISSION(ERROR_BASE):
status_code = 'INTERNAL'
message = 'KeyVault secret and certification information is failed. Please check the permission.'
class ERROR_PARSE_ID_FROM_RESOURCE_GROUP(ERROR_BASE):
status_code = 'INTERNAL'
message = 'Parse resource name from resource ID is failed. Please check the variation.'
class ERROR_MANAGER_GET_ADDITIONAL_RESOURCE_INFO(ERROR_BASE):
status_code = 'INTERNAL'
message = 'Get an additional information of the resource is failed. Please check the variation. Manager = {field}'
class ERROR_GET_RESOURCE_NAME_FROM_ID(ERROR_BASE):
status_code = 'INTERNAL'
message = 'Get resource name from id is failed. field = {e}.'
class ERROR_CONNECTOR_GET_ADDITIONAL_RESOURCE_INFO(ERROR_BASE):
status_code = 'INTERNAL'
message = 'Get an additional information of the resource is failed. Please check the variation. Connector = {field}'
| 31.596491 | 121 | 0.75347 | 231 | 1,801 | 5.627706 | 0.255411 | 0.083077 | 0.126923 | 0.160769 | 0.585385 | 0.501538 | 0.373077 | 0.28 | 0.28 | 0.28 | 0 | 0 | 0.166019 | 1,801 | 56 | 122 | 32.160714 | 0.865513 | 0 | 0 | 0.323529 | 0 | 0 | 0.441977 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.029412 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
a18082c54f1c98bc0aca473befd849aa1a046552 | 991 | py | Python | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/website_slides/__manifest__.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | 1 | 2019-12-19T01:53:13.000Z | 2019-12-19T01:53:13.000Z | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/website_slides/__manifest__.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/website_slides/__manifest__.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
{
'name': 'Slides',
'version': '1.0',
'sequence': 145,
'summary': 'Share and Publish Videos, Presentations and Documents',
'category': 'Website',
'description': """
Share and Publish Videos, Presentations and Documents'
======================================================
* Website Application
* Channel Management
* Filters and Tagging
* Statistics of Presentation
* Channel Subscription
* Supported document types : PDF, images, YouTube videos and Google Drive documents)
""",
'depends': ['website', 'website_mail'],
'data': [
'view/res_config.xml',
'view/website_slides.xml',
'view/website_slides_embed.xml',
'view/website_slides_backend.xml',
'data/website_slides_data.xml',
'security/ir.model.access.csv',
'security/website_slides_security.xml'
],
'demo': [
'data/website_slides_demo.xml'
],
'installable': True,
'application': True,
}
| 28.314286 | 85 | 0.600404 | 99 | 991 | 5.878788 | 0.545455 | 0.134021 | 0.072165 | 0.103093 | 0.158076 | 0.158076 | 0.158076 | 0 | 0 | 0 | 0 | 0.007663 | 0.209889 | 991 | 34 | 86 | 29.147059 | 0.735632 | 0.021191 | 0 | 0.0625 | 0 | 0 | 0.735537 | 0.265496 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 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 |
a190c7eb7001236bb26d7d5a374fa2335cafbf7c | 7,818 | py | Python | depend.py | liuyang1/depend | d574a6fdc82c8acb51397b3ee6113462730b8ee0 | [
"MIT"
] | null | null | null | depend.py | liuyang1/depend | d574a6fdc82c8acb51397b3ee6113462730b8ee0 | [
"MIT"
] | null | null | null | depend.py | liuyang1/depend | d574a6fdc82c8acb51397b3ee6113462730b8ee0 | [
"MIT"
] | null | null | null | #! /usr/bin/env python2
"""
## Internal Technology
simple topological sort
## How to visulize it?
Use `graphviz` to visulize the dependency.
We have two functions:
- `showDot`
generate `dot` file format with dependency graph.
- `showDotWithSt`
generate `dot` file format with dependency grapha, render disabled feature with gray color.
When have `dot` file, we could generate the picture by this command:
```
dot -Tpng [file.dot] -o [file.png]
```
"""
from collections import defaultdict
from copy import deepcopy
class DiGraph(object):
"""
Directed Grapah
"""
def __init__(self):
"""
self.d :: {source vertex: [destination vertexes]}
self.v :: {[vertexes]}
"""
self.d = defaultdict(list)
self.v = []
def vertexes(self):
"""
return all vertexes
self -> [vertex]
"""
return self.v
def addVertexes(self, vs):
"""
add vertexes to Directed Graph
self -> [vertex] -> None
"""
for v in vs:
self.addVertex(v)
def addVertex(self, v):
"""
add vertex to Directed Graph
self -> vertex -> None
>>> dg = DiGraph()
>>> dg.addVertex(1)
>>> dg.vertexes()
[1]
>>> dg.addVertexes([1, 2, 3])
>>> dg.vertexes()
[1, 2, 3]
"""
if v not in self.v:
self.v.append(v)
def edges(self):
"""
return all edges
self -> [(source vertex, destination vertex)]
"""
r = []
for b, ends in self.d.iteritems():
for e in ends:
r.append([b, e])
return r
def addEdges(self, bgns, ends):
"""
add edges to Directed Graph
self -> [source vertex] -> [destination vertex] -> None
"""
for b in bgns:
for e in ends:
self.addEdge(b, e)
def addEdge(self, bgn, end):
"""
add edge to Directed Graph
self -> source vertex -> destionation vertex -> None
>>> dg = DiGraph()
>>> dg.addEdges([1, 2], [4, 5, 6])
>>> dg.vertexes()
[1, 4, 5, 6, 2]
>>> dg.edges()
[[1, 4], [1, 5], [1, 6], [2, 4], [2, 5], [2, 6]]
"""
self.addVertex(bgn)
self.addVertex(end)
self.d[bgn].append(end)
def dfs(self, v0):
"""
>>> dg = DiGraph()
>>> dg.addEdges([1], [3, 4])
>>> dg.addEdges([2], [4])
>>> dg.addEdges([3], [5])
>>> dg.addEdges([4], [5, 6])
>>> dg.edges()
[[1, 3], [1, 4], [2, 4], [3, 5], [4, 5], [4, 6]]
>>> dg.dfs(1)
[1, 4, 6, 5, 3]
"""
return self.dfsFilter(v0, lambda(v): True)
def dfsFilter(self, v0, pred):
r = []
Q = [v0]
while len(Q) != 0:
v = Q.pop()
nxt = self.d[v]
nxt = [i for i in nxt if i not in r]
if pred(v):
r.append(v)
Q.extend(nxt)
return r
def vertexOut(self, v):
"""
return all vertexes from v
self -> source vertex -> [destionation vertex]
"""
return self.d[v]
def vertexIn(self, v):
"""
return all vertexes to v
self -> destination vertex -> [source vertex]
"""
r = []
for b, ends in self.d.iteritems():
if v in ends:
r.append(b)
return r
def degreeOut(self, v):
"""
return number of vertexes from v
self -> source vertex -> Int
"""
return len(self.d[v])
def degreeIn(self, v):
"""
return number of vertexes to v
self -> destination vertex -> Int
"""
return len(self.vertexIn(v))
def roots(self):
"""
return vertexes in Graph which in-degree is zero
self -> [vertex]
"""
return [i for i in self.vertexes() if self.degreeIn(i) == 0]
def showDot(self):
"""
self -> string
>>> dg = DiGraph()
>>> dg.addEdges([1, 2, 3], [4, 5, 6])
>>> print dg.showDot(),
digraph {
1 -> {4 5 6}
2 -> {4 5 6}
3 -> {4 5 6}
}
>>> dg.vertexIn(4)
[1, 2, 3]
>>> dg.vertexOut(2)
[4, 5, 6]
>>> dg.degreeIn(4)
3
>>> dg.roots()
[1, 2, 3]
"""
s = ""
s += "digraph {\n"
for b, ends in self.d.iteritems():
s += " %s -> {%s}\n" % (b, " ".join([str(i) for i in ends]))
s += "}\n"
return s
def showDotWithSt(self, st):
fullst = {k: False for k in self.vertexes() if k not in st.keys()}
fullst.update(st)
s = ""
s += "digraph {\n"
for k, v in fullst.iteritems():
if not v:
s += ' %s [style = "filled" fillcolor = "gray"]\n' % (k)
for b, ends in self.d.iteritems():
s += " %s -> {%s}\n" % (b, " ".join([str(i) for i in ends]))
s += "}\n"
return s
def tsort(self):
"""
topological sorting on DiGraph
return vertexes, and residual edges if have circle in graph
self -> ([vertex], DiGraph)
>>> dg = DiGraph()
>>> dg.addEdge(0, 1)
>>> dg.addEdge(1, 2)
>>> dg.addEdge(2, 3)
>>> dg.addEdge(4, 2)
>>> L, cg = dg.tsort()
>>> L
[4, 0, 1, 2, 3]
>>> dg.addEdge(2, 0)
>>> L, cg = dg.tsort()
>>> L
[4]
>>> dg.chkCircle()
True
>>> print cg.showDot(),
digraph {
0 -> {1}
1 -> {2}
2 -> {3 0}
4 -> {}
}
"""
dg = deepcopy(self)
L = []
S = dg.roots()
while len(S) != 0:
b = S.pop()
L.append(b)
M = dg.d[b]
dg.d[b] = []
for m in M:
if dg.degreeIn(m) == 0:
S.append(m)
return L, dg
# if len(dg.edges()) != 0:
# print dg.d
# raise Exception('find cycle in DiGraph')
# return []
# return L
def chkCircle(self):
"""
self -> Boolean
"""
_, cg = self.tsort()
return len(cg.edges()) != 0
class DependTbl(object):
def __init__(self):
self.dg = DiGraph()
def dep(self, xs, ys):
"""
self -> [vertex] -> [vertex] -> None
"""
self.dg.addEdges(xs, ys)
def load(self, d):
"""
self -> {source vertex: [destination vertex]} -> None
"""
for k, v in d.iteritems():
self.dep([k], v)
def showDot(self):
return self.dg.showDot()
def showDotWithSt(self, st):
return self.dg.showDotWithSt(st)
def chkCircle(self):
return self.dg.chkCircle()
def chkDep(self, st):
"""
return unmeet sub-graph with DICT type
self -> {vertex : Boolean} -> {source vertex: [destination vertex]}
"""
ret = {}
for k, v in st.iteritems():
if not v:
continue
vs = self.dg.dfs(k)
unmeet = [i for i in vs if i not in st or not st[i]]
if len(unmeet) != 0:
ret[k] = unmeet
return ret
def printDep(unmeetDct):
for k, v in unmeetDct.iteritems():
print "find dependency conflict, when try to enable '%s' feature" % (k)
print " cfg['%s'] = %s" % (k, False)
print "---- or ----"
for i in v:
print " cfg['%s'] = %s" % (i, True)
if len(unmeetDct) == 0:
print "all dependency is meeted"
| 24.43125 | 95 | 0.440138 | 943 | 7,818 | 3.639449 | 0.183457 | 0.016026 | 0.006993 | 0.010198 | 0.259324 | 0.192308 | 0.075758 | 0.052448 | 0.052448 | 0.034382 | 0 | 0.027044 | 0.404068 | 7,818 | 319 | 96 | 24.507837 | 0.709594 | 0.015605 | 0 | 0.260163 | 1 | 0 | 0.059191 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.01626 | null | null | 0.04878 | 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 |
a1a8d6b7a7646abe23f3e25c64adecff4d5966b2 | 1,027 | py | Python | rev/a-bowl-of-pythons/chal.py | nanzggits/sdctf-2021 | fcddb506f5f798a264fc17e5588c0f5b7d5fbb2c | [
"MIT"
] | 6 | 2021-05-17T21:04:31.000Z | 2022-01-01T23:28:18.000Z | rev/a-bowl-of-pythons/chal.py | nanzggits/sdctf-2021 | fcddb506f5f798a264fc17e5588c0f5b7d5fbb2c | [
"MIT"
] | null | null | null | rev/a-bowl-of-pythons/chal.py | nanzggits/sdctf-2021 | fcddb506f5f798a264fc17e5588c0f5b7d5fbb2c | [
"MIT"
] | 1 | 2021-06-01T17:03:06.000Z | 2021-06-01T17:03:06.000Z | #! /usr/bin/env python3
FLAG = 'sdctf{a_v3ry_s3cur3_w4y_t0_st0r3_ur_FLAG}' # lol
a = lambda n: a(n-2) + a(n-1) if n >= 2 else (2 if n == 0 else 1)
b = lambda x: bytes.fromhex(x).decode()
h = eval(b('7072696e74'))
def d():
h(b('496e636f727265637420666c61672120596f75206e65656420746f206861636b206465657065722e2e2e'))
eval(b('5f5f696d706f72745f5f282273797322292e65786974283129'))
h(FLAG)
def e(f):
h("Welcome to SDCTF's the first Reverse Engineering challenge.")
c = input("Input the correct flag: ")
if c[:6].encode().hex() != '{2}3{0}{1}{0}3{2}{1}{0}{0}{2}b'.format(*map(str, [6, 4, 7])):
d()
if c[int(chr(45) + chr(49))] != chr(125):
d()
g = c[6:-1].encode()
if bytes( (g[i] ^ (a(i) & 0xff) for i in range(len(g))) ) != f:
d()
h(b('4e696365206a6f622e20596f7520676f742074686520636f727265637420666c616721'))
if __name__ == "__main__":
e(b't2q}*\x7f&n[5V\xb42a\x7f3\xac\x87\xe6\xb4')
else:
eval(b('5f5f696d706f72745f5f282273797322292e65786974283029'))
| 33.129032 | 96 | 0.63778 | 150 | 1,027 | 4.266667 | 0.533333 | 0.023438 | 0.009375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.3302 | 0.171373 | 1,027 | 30 | 97 | 34.233333 | 0.421857 | 0.025316 | 0 | 0.130435 | 0 | 0.043478 | 0.467467 | 0.366366 | 0 | 0 | 0.004004 | 0 | 0 | 1 | 0.086957 | false | 0 | 0 | 0 | 0.086957 | 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 |
a1a8f246a1c7274d0537ca88423a3964895d4aae | 12,117 | py | Python | feedzero/feeds/models.py | dammitjim/badfeed | 10e0059ff4af36ea2ff67e93a8e3bbb342137af9 | [
"Apache-2.0"
] | null | null | null | feedzero/feeds/models.py | dammitjim/badfeed | 10e0059ff4af36ea2ff67e93a8e3bbb342137af9 | [
"Apache-2.0"
] | 17 | 2020-02-12T00:04:15.000Z | 2021-09-08T01:03:15.000Z | feedzero/feeds/models.py | dammitjim/badfeed | 10e0059ff4af36ea2ff67e93a8e3bbb342137af9 | [
"Apache-2.0"
] | null | null | null | import bleach
from django.conf import settings
from django.contrib.postgres.fields import ArrayField
from django.db import models
from django.db.models import Q
from django.utils.text import Truncator
from loguru import logger
import maya
from feedzero.core.models import SlugifiedMixin
class FeedManager(models.Manager):
"""Custom manager for feed model, adds utility methods."""
def watched_by(self, user):
"""Return feeds watched by the given user."""
return self.filter(watched_by=user)
class Feed(SlugifiedMixin, models.Model):
"""A feed of content."""
link = models.CharField(max_length=1000, unique=True)
title = models.CharField(max_length=255, blank=True, null=True)
logo = models.FileField(upload_to="feeds/logo/", null=True, blank=True)
scraping_enabled = models.BooleanField(default=True)
date_created = models.DateTimeField(auto_now_add=True)
date_modified = models.DateTimeField(auto_now=True)
date_last_scraped = models.DateTimeField(blank=True, null=True)
objects = FeedManager()
def __str__(self):
"""Str representation of feed."""
return self.title
@staticmethod
def slug_uniqueness_check(text, uids):
"""Check for other feeds with this slug."""
if text in uids:
return False
return not Feed.objects.filter(slug=text).exists()
def is_watched_by(self, user) -> bool:
"""Assert user is contained within watched_by m2m field."""
return user in self.watched_by.all()
def mark_entries_archived(self, user):
"""Will archive all current unread entries."""
entries = self.entries.all().exclude(states__isnull=False, states__user=user)
# TODO this may be expensive, consider a bulk operation?
for entry in entries:
entry.mark_deleted(user)
class Author(models.Model):
"""An author of an entry."""
name = models.CharField(max_length=255)
link = models.CharField(max_length=1000, blank=True, null=True)
email = models.CharField(max_length=250, blank=True, null=True)
feed = models.ForeignKey(Feed, on_delete=models.CASCADE, related_name="authors")
def __str__(self):
return self.name
class Tag(models.Model):
"""A tag to categories entries."""
term = models.CharField(max_length=255)
scheme = models.CharField(max_length=255, blank=True, null=True)
label = models.CharField(max_length=1000, blank=True, null=True)
feed = models.ForeignKey(Feed, on_delete=models.CASCADE, related_name="tags")
def __str__(self):
"""Str representation of tag."""
return self.term
class EntryUserStateManager(models.Manager):
def unread(self, user):
"""Get all entries that haven't been read by the user yet."""
feeds = Feed.objects.watched_by(user)
entries = self.filter(feed__in=feeds).exclude(
states__isnull=False, states__user=user
)
return entries.order_by("-date_published")
def saved(self, user):
"""Get all entries that have been saved."""
return self.filter(states__state=EntryState.STATE_SAVED, states__user=user)
def pinned(self, user):
"""Get all entries that have been pinned."""
return self.filter(states__state=EntryState.STATE_PINNED, states__user=user)
def deleted(self, user):
"""Get all entries that have been deleted."""
return self.filter(states__state=EntryState.STATE_DELETED, states__user=user)
class Entry(SlugifiedMixin, models.Model):
"""An entry into a Feed."""
title = models.CharField(max_length=1000)
link = models.CharField(max_length=1000)
guid = models.CharField(max_length=1000)
content = models.TextField()
summary = models.TextField(blank=True, null=True)
date_published = models.DateTimeField(blank=True, null=True)
date_created = models.DateTimeField(auto_now_add=True)
date_modified = models.DateTimeField(auto_now=True)
feed = models.ForeignKey(Feed, on_delete=models.CASCADE, related_name="entries")
author = models.ForeignKey(
Author, on_delete=models.SET_NULL, blank=True, null=True, related_name="entries"
)
contributors = models.ManyToManyField(
Author, related_name="contributed_to", blank=True
)
tags = models.ManyToManyField(Tag, related_name="entries", blank=True)
objects = models.Manager()
user_state = EntryUserStateManager()
def get_initial_slug_uids(self):
"""Prepopulate slug uids with titles for entries in this feed.
This is required due to the `unique_together` constraint of the model.
"""
return [
entry.title for entry in Entry.objects.filter(feed=self.feed).only("title")
]
@staticmethod
def slug_uniqueness_check(text, uids) -> bool:
"""Ensure no other entries with this slug exist."""
if text in uids:
return False
return not Entry.objects.filter(slug=text).exists()
def archive_older_than_this(self, user):
"""Mark all entries older than this entry, for this feed, as archived."""
older_entries = Entry.objects.filter(
date_created__lt=self.date_created, feed=self.feed
)
for entry in older_entries:
entry.mark_deleted(user)
def mark_read_by(self, user):
"""Create an entrystate object marking this entry as having been read."""
return EntryState.objects.get_or_create(
state=EntryState.STATE_READ, entry=self, user=user
)
def mark_pinned(self, user):
"""Pin the entry for the user if not already pinned."""
return EntryState.objects.get_or_create(
state=EntryState.STATE_PINNED, entry=self, user=user
)
def mark_unpinned(self, user):
"""Unpin the entry for the user."""
try:
state = EntryState.objects.get(
state=EntryState.STATE_PINNED, entry=self, user=user
)
state.delete()
except EntryState.DoesNotExist as e:
logger.exception("Attempted to unpin an unpinned entry.", exc_info=e)
def mark_deleted(self, user):
"""Pin the entry for the user if not already deleted.
By marking for deletion, we also delete all other states.
TODO consider moving this to the entry state model?
"""
EntryState.objects.filter(entry=self, user=user).filter(
Q(state=EntryState.STATE_PINNED) | Q(state=EntryState.STATE_SAVED)
).delete()
return EntryState.objects.get_or_create(
state=EntryState.STATE_DELETED, entry=self, user=user
)
def mark_undeleted(self, user):
"""Undelete the entry for the user."""
try:
state = EntryState.objects.get(
state=EntryState.STATE_DELETED, entry=self, user=user
)
state.delete()
except EntryState.DoesNotExist as e:
logger.exception("Attempted to undelete an undeleted entry.", exc_info=e)
def mark_saved(self, user):
"""Save the entry for the user if not already saved.
If the entry has been pinned, delete the pin state.
TODO consider moving this to the entry state model?
"""
if self.is_pinned_by(user):
EntryState.objects.filter(
state=EntryState.STATE_PINNED, entry=self, user=user
).delete()
return EntryState.objects.get_or_create(
state=EntryState.STATE_SAVED, entry=self, user=user
)
def mark_unsaved(self, user):
"""Remove the saved state of an entry."""
try:
state = EntryState.objects.get(
state=EntryState.STATE_SAVED, entry=self, user=user
)
state.delete()
except EntryState.DoesNotExist as e:
logger.exception("Attempted to undelete an undeleted entry.", exc_info=e)
def is_pinned_by(self, user) -> bool:
"""Check if the given entry has been pinned by the given user."""
return EntryState.objects.filter(
state=EntryState.STATE_PINNED, entry=self, user=user
).exists()
def is_saved_by(self, user) -> bool:
"""Check if the given entry has been saved by the given user."""
return EntryState.objects.filter(
state=EntryState.STATE_SAVED, entry=self, user=user
).exists()
def is_deleted_by(self, user) -> bool:
"""Check if the given entry has been deleted by the given user."""
return EntryState.objects.filter(
state=EntryState.STATE_DELETED, entry=self, user=user
).exists()
@property
def slang_date_published(self):
"""Display a human readable, slang datetime."""
if not self.date_published:
return "?"
maya_dt = maya.MayaDT.from_datetime(self.date_published)
return maya_dt.slang_time()
TEASER_WORDS = 15
@property
def teaser(self):
"""Get a displayable teaser for rows or cards."""
text = self.summary if self.summary else self.content
truncated_text = Truncator(text).words(self.TEASER_WORDS)
return truncated_text
def save(self, *args, **kwargs):
"""Ensure certain data mutations always occur."""
if self.summary:
self.summary = bleach.clean(self.summary, strip=True)
return super().save(*args, **kwargs)
def __str__(self):
"""Str dunder implementation."""
return self.title
class Meta:
verbose_name_plural = "entries"
unique_together = (("guid", "feed"),)
class EntryState(models.Model):
"""The user state of an entry.
TODO unread state doesn't need to exist
"""
# TODO consider changing SAVED/PINNED/DELETED into a proper state machine
STATE_UNREAD = "unread"
STATE_READ = "read"
STATE_SAVED = "saved"
STATE_DELETED = "deleted"
STATE_PINNED = "pinned"
STATE_HIDDEN = "hidden"
STATE_CHOICES = [
(STATE_UNREAD, "Unread"),
(STATE_READ, "Read"),
(STATE_HIDDEN, "Hidden"),
(STATE_SAVED, "Saved"),
(STATE_DELETED, "Deleted"),
(STATE_PINNED, "Pinned"),
]
state = models.CharField(choices=STATE_CHOICES, max_length=50)
date_created = models.DateTimeField(auto_now_add=True)
date_modified = models.DateTimeField(auto_now=True)
entry = models.ForeignKey(Entry, related_name="states", on_delete=models.CASCADE)
user = models.ForeignKey(
settings.AUTH_USER_MODEL, related_name="entry_states", on_delete=models.CASCADE
)
@staticmethod
def is_valid_state(state):
"""Check if the provided state is present within the available state choices."""
return state in dict(EntryState.STATE_CHOICES)
class Meta:
unique_together = (("state", "user", "entry"),)
class Enclosure(models.Model):
"""A media file.
TODO can this just be removed?
"""
href = models.CharField(max_length=1000)
file_type = models.CharField(max_length=1000)
# TODO this seems dirty but I'm not sure of the best way to handle this
length = models.TextField()
entry = models.ForeignKey(
Entry, on_delete=models.CASCADE, related_name="enclosures"
)
def __str__(self):
"""Str representation of enclosure."""
return self.href
class EnrichedContent(models.Model):
"""Contains enriched content for entries, pulled from the ingest enricher."""
entry = models.OneToOneField(
Entry, related_name="enriched", on_delete=models.CASCADE, null=True, blank=True
)
content = models.TextField()
summary = models.TextField()
# where the first element is considered the "top image"
images = ArrayField(models.CharField(max_length=500), blank=True, default=list)
movies = ArrayField(models.CharField(max_length=500), blank=True, default=list)
def __str__(self):
# TODO consider what would actually be useful here
return f"{self.entry.title} - enriched"
| 34.132394 | 88 | 0.659569 | 1,517 | 12,117 | 5.127884 | 0.187871 | 0.030852 | 0.041136 | 0.046278 | 0.482067 | 0.439517 | 0.368171 | 0.331019 | 0.270857 | 0.225479 | 0 | 0.006276 | 0.23727 | 12,117 | 354 | 89 | 34.228814 | 0.835425 | 0.186432 | 0 | 0.294118 | 0 | 0 | 0.037462 | 0 | 0 | 0 | 0 | 0.019774 | 0 | 1 | 0.140271 | false | 0 | 0.040724 | 0.00905 | 0.597285 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
a1c5672dafb67e8079f700fd4d90777f8b803937 | 724 | py | Python | models/reservoir/delay_buffer.py | fresh-professor/DiverseCont | 4be198f5531a7efe2cb91b17066322a38d219127 | [
"MIT"
] | 21 | 2021-09-08T14:37:06.000Z | 2022-02-28T02:58:35.000Z | models/reservoir/delay_buffer.py | fresh-professor/DiverseCont | 4be198f5531a7efe2cb91b17066322a38d219127 | [
"MIT"
] | 1 | 2021-12-28T09:17:38.000Z | 2021-12-28T11:49:30.000Z | models/reservoir/delay_buffer.py | fresh-professor/DiverseCont | 4be198f5531a7efe2cb91b17066322a38d219127 | [
"MIT"
] | null | null | null | from .prs import PRS, SubStream_Container
import random
import torch
import numpy as np
from collections import deque
class DelayBuffer(PRS):
"""
Delayed Buffer for new data samples that need to be learned in chunks.
and used to made the decision later whether to enter the buffer or not.
"""
def reset(self):
"""reset the buffer.
"""
self.rsvr = dict()
self.rsvr_available_idx = deque(range(self.rsvr_total_size))
self.substreams = SubStream_Container(self.rsvr_total_size)
self.n = 0
np.random.seed(self.config['random_seed'])
random.seed(self.config['random_seed'])
torch.manual_seed(self.config['random_seed'])
return
| 30.166667 | 75 | 0.671271 | 99 | 724 | 4.787879 | 0.545455 | 0.105485 | 0.088608 | 0.126582 | 0.265823 | 0.126582 | 0 | 0 | 0 | 0 | 0 | 0.001812 | 0.237569 | 724 | 23 | 76 | 31.478261 | 0.856884 | 0.220994 | 0 | 0 | 0 | 0 | 0.062264 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.066667 | false | 0 | 0.333333 | 0 | 0.533333 | 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 |
a1e1eee7eefa81acc6785b658b4b82e467839f63 | 894 | py | Python | widget/build_css_source.py | vesellov/callfeed.net | 88a12f244dac1bcc170c3028d86e53618b33aa6a | [
"MIT"
] | 1 | 2015-11-17T08:44:23.000Z | 2015-11-17T08:44:23.000Z | widget/build_css_source.py | vesellov/callfeed.net | 88a12f244dac1bcc170c3028d86e53618b33aa6a | [
"MIT"
] | null | null | null | widget/build_css_source.py | vesellov/callfeed.net | 88a12f244dac1bcc170c3028d86e53618b33aa6a | [
"MIT"
] | null | null | null | import sys
sys.stdout.write('function CallFeedBuildCSS(settings) {\n')
sys.stdout.write(' var o = "";\n')
sys.stdout.write(' o+="<style type="text/css">\\n";\n')
for line in open(sys.argv[1]).read().splitlines():
l = line.rstrip()
if not l:
continue
l = l.replace('"', '"')
l = ' o+="%s\\n";\n' % (unicode(l, 'utf-8').encode('unicode-escape'))
sys.stdout.write(l)
sys.stdout.write(' o+="</style>\\n";\n')
sys.stdout.write(' for (var key in settings) if (settings.hasOwnProperty(key))\n')
sys.stdout.write(' if ((key.indexOf("flag_")==0)||(key.indexOf("text_")==0)||(key.indexOf("param_")==0)||(key.indexOf("color_")==0))\n')
sys.stdout.write(' o = o.replace(new RegExp("%\\\\("+key+"\\\\)s", "g"), unescape(settings[key]));\n')
sys.stdout.write(' return o;\n')
sys.stdout.write('}\n')
| 49.666667 | 145 | 0.568233 | 133 | 894 | 3.789474 | 0.368421 | 0.178571 | 0.277778 | 0.208333 | 0.22619 | 0.087302 | 0 | 0 | 0 | 0 | 0 | 0.007979 | 0.158837 | 894 | 17 | 146 | 52.588235 | 0.662234 | 0 | 0 | 0 | 0 | 0.117647 | 0.548461 | 0.327252 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.058824 | 0 | 0.058824 | 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 |
a1ecb3aa6425b293c257df4dad7deef4c766b7a9 | 2,682 | py | Python | download/gnosis/xml/validity/dissertation.py | DavidMertz/gnosis-web | df5ab0d470a02ed6c51c971f2b40f1dcdc7d7350 | [
"CC0-1.0"
] | 3 | 2018-09-29T14:14:28.000Z | 2022-01-05T03:45:50.000Z | library/CanFestival/objdictgen/gnosis/xml/validity/dissertation.py | Lembed/STM32duino-gcc-Projects | 67829e9cd1388601daf9815b0561da557e0b9f82 | [
"MIT"
] | 1 | 2017-06-17T08:15:28.000Z | 2017-06-17T08:15:28.000Z | library/CanFestival/objdictgen/gnosis/xml/validity/dissertation.py | Lembed/STM32duino-gcc-Projects | 67829e9cd1388601daf9815b0561da557e0b9f82 | [
"MIT"
] | 1 | 2019-12-08T15:11:55.000Z | 2019-12-08T15:11:55.000Z | """A dissertation DTD that uses all basic constraints
<!ELEMENT dissertation (dedication?, chapter+, appendix*)>
<!ELEMENT dedication (#PCDATA)>
<!ELEMENT chapter (title, paragraph+)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT paragraph (#PCDATA | figure | table)+>
<!ELEMENT figure EMPTY>
<!ELEMENT table EMPTY>
<!ELEMENT appendix (#PCDATA)>
"""
from gnosis.xml.validity import *
class appendix(PCDATA): pass
class table(EMPTY): pass
class figure(EMPTY): pass
class _mixedpara(Or): _disjoins = (PCDATA, figure, table)
class paragraph(Some): _type = _mixedpara
class title(PCDATA): pass
class _paras(Some): _type = paragraph
class chapter(Seq): _order = (title, _paras)
class dedication(PCDATA): pass
class _apps(Any): _type = appendix
class _chaps(Some): _type = chapter
class _dedi(Maybe): _type = dedication
class dissertation(Seq): _order = (_dedi, _chaps, _apps)
explicit_section = \
"""section(( dedication(PCDATA('To Mom')),
chapter(( title(PCDATA('It starts')),
_paras([paragraph(
[_mixedpara(
PCDATA('When it began'))])])
))
))"""
lifting_section = \
"LiftSeq(section, ('To Mom',('It starts','When it began...')))"
def mk_dissertation():
"Miscellaneous other typical uses"
p = paragraph(['spam and eggs', figure(), 'toast'])
ps_ch1 = _paras([ p, paragraph('this and that'), "something else",
paragraph(_mixedpara(figure())),
paragraph(['stuff', table(), PCDATA('still more')])
])
chap1 = chapter((title('My chapter'), ps_ch1))
dedict = _dedi(dedication("To Mom"))
diss = LiftSeq( dissertation, ([], _chaps(chap1), _apps()) )
ps_ch1 += [ "friend, romans, countrymen",
paragraph([figure(), table(), figure()]) ]
ps_ch1.append("whatever")
ps_ch1 += "Just words"
del ps_ch1[-2]
return diss
if __name__=='__main__':
from sys import exit
# Define a new type that is a Seq containing a Seq
class section(Seq): _order = (dedication, chapter)
print "____________ Fully spelled out section initialization _________________"
print explicit_section
print '--'
print eval(explicit_section)
print "________ Aggressive use of 'lifting' in initialization ________________"
print lifting_section
print '--'
print eval(lifting_section)
print "________ Various other OK initializations and operations ______________"
print " (See code for comments and constructs)"
print
print mk_dissertation()
| 34.831169 | 83 | 0.624161 | 282 | 2,682 | 5.5 | 0.382979 | 0.019342 | 0.029014 | 0.027079 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004471 | 0.249441 | 2,682 | 76 | 84 | 35.289474 | 0.766021 | 0.017897 | 0 | 0.041667 | 0 | 0 | 0.243756 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.104167 | 0.041667 | null | null | 0.25 | 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 |
b8080becde645e1f55df063274f29e322bf89979 | 7,141 | py | Python | ASL_CNN.py | TarekIdrees/ASL-using-CNN | 8da50dedb0e637e61936763a246fd548a924f8f9 | [
"MIT"
] | null | null | null | ASL_CNN.py | TarekIdrees/ASL-using-CNN | 8da50dedb0e637e61936763a246fd548a924f8f9 | [
"MIT"
] | null | null | null | ASL_CNN.py | TarekIdrees/ASL-using-CNN | 8da50dedb0e637e61936763a246fd548a924f8f9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""ASL_CNN.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1M5JA5_OV0N_biYsciMnmlUvrAor8Yx_u
**Set up colab for ASL data from kaggel**
"""
! pip install kaggle
! mkdir ~/.kaggle
! cp kaggle.json ~/.kaggle/
! chmod 600 ~/.kaggle/kaggle.json
! kaggle datasets download grassknoted/asl-alphabet
! unzip asl-alphabet.zip
"""**Import needed libraries**"""
import numpy as np
import os
from sklearn.utils import shuffle
from sklearn.model_selection import train_test_split, GridSearchCV
import cv2
import keras
from keras.layers import Conv2D, MaxPool2D, Flatten, Dense, Dropout, BatchNormalization,Activation,MaxPooling2D
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras import regularizers
from sklearn.metrics import accuracy_score
from sklearn.metrics import precision_score
from sklearn.metrics import recall_score
train_dir = 'asl_alphabet_train//asl_alphabet_train'
test_dir = 'asl_alphabet_test//asl_alphabet_test'
labels_dict = {'A': 0, 'B': 1, 'C': 2, 'D': 3, 'E': 4, 'F': 5, 'G': 6, 'H': 7, 'I': 8, 'J': 9, 'K': 10, 'L': 11,
'M': 12,
'N': 13, 'O': 14, 'P': 15, 'Q': 16, 'R': 17, 'S': 18, 'T': 19, 'U': 20, 'V': 21, 'W': 22, 'X': 23,
'Y': 24,
'Z': 25, 'space': 26, 'del': 27, 'nothing': 28}
def load_train_data():
Y_train = []
X_train = []
size = 64, 64
#number_of_images_per_folder = 0
images_per_folder = 0
print("LOADING DATA FROM : ", end="")
for folder in os.listdir(train_dir):
print(folder, end=' | ')
for image in os.listdir(train_dir + "/" + folder):
if images_per_folder == 2000:
images_per_folder = 0
break
# read image
temp_img = cv2.imread(train_dir + '/' + folder + '/' + image)
# resize image
temp_img = cv2.resize(temp_img, size)
#load converted classes
Y_train.append(labels_dict[folder])
X_train.append(temp_img)
images_per_folder = images_per_folder +1
#convert X_train to numpy
X_train = np.array(X_train)
#normalize the pixels of X_train
X_train = X_train.astype('float32')/255.0
#convert Y_train to numpy
Y_train = np.array(Y_train)
print()
print('Loaded', len(X_train), 'images for training,', 'Train data shape =', X_train.shape)
return X_train, Y_train
def load_test_data():
labels = []
X_test = []
size = 64, 64
for image in os.listdir(test_dir):
# read image
temp_img = cv2.imread(test_dir + '/'+ image)
# resize image
temp_img = cv2.resize(temp_img, size)
# load converted classes
labels.append(labels_dict[image.split('_')[0]])
X_test.append(temp_img)
#convert X_test to numpy
X_test = np.array(X_test)
#normalize pixels of X_test
X_test = X_test.astype('float32')/255.0
#convert Y_test to numpy
Y_test = np.array(labels)
print('Loaded', len(X_test), 'images for testing,', 'Test data shape =', X_test.shape)
return X_test, Y_test
"""**Load data with Gray**"""
X_train, Y_train = load_train_data()
X_test, Y_test = load_test_data()
"""**Create first CNN model**
"""
def create_model():
model = Sequential()
model.add(Conv2D(16, kernel_size = [3,3], padding = 'same', activation = 'relu', input_shape = (64,64,3)))
model.add(Conv2D(32, kernel_size = [3,3], padding = 'same', activation = 'relu'))
model.add(MaxPool2D(pool_size = [3,3]))
model.add(Conv2D(32, kernel_size = [3,3], padding = 'same', activation = 'relu'))
model.add(Conv2D(64, kernel_size = [3,3], padding = 'same', activation = 'relu'))
model.add(MaxPool2D(pool_size = [3,3]))
model.add(Conv2D(128, kernel_size = [3,3], padding = 'same', activation = 'relu', input_shape = (64,64,3)))
model.add(Conv2D(256, kernel_size = [3,3], padding = 'same', activation = 'relu'))
model.add(MaxPool2D(pool_size = [3,3]))
model.add(BatchNormalization())
model.add(Flatten())
model.add(Dropout(rate = 0.5))
model.add(Dense(512, activation = 'relu',kernel_regularizer = regularizers.l2(0.001)))
model.add(Dense(29, activation = 'softmax'))
model.summary()
return model
"""**Crete second CNN model**"""
def create_model_2():
model = Sequential()
model.add(Conv2D(32, (5, 5), input_shape=(64, 64, 3)))
model.add(Activation('relu'))
model.add(MaxPooling2D((2, 2)))
model.add(Conv2D(64, (3, 3)))
model.add(Activation('relu'))
model.add(MaxPooling2D((2, 2)))
model.add(Conv2D(64, (3, 3)))
model.add(Activation('relu'))
model.add(MaxPooling2D((2, 2)))
model.add(BatchNormalization())
model.add(Flatten())
model.add(Dense(128, activation='relu'))
model.add(Dense(29, activation='softmax'))
model.summary()
return model
"""**Description of model 2**"""
model_2 = create_model_2()
"""**Description of model 1**"""
model = create_model()
"""**Compile fisrt model**"""
model.compile(optimizer='adam',loss = 'sparse_categorical_crossentropy',metrics=['accuracy'])
"""**Compile second model**"""
model_2.compile(optimizer='adam',loss = 'sparse_categorical_crossentropy',metrics=['accuracy'])
"""**Fit first model with 5 epochs**"""
epochs = 5
ThisModel = model.fit(X_train,Y_train,epochs = epochs, batch_size=64,verbose = 1)
"""**Fit second model with 5 epochs**"""
ThisModel_2 = model_2.fit(X_train, Y_train,epochs=5,batch_size=64,verbose=1)
"""**Report accuracy of model 1**"""
modelLoss , modelAccuracy = model.evaluate(X_test,Y_test)
print('Test Loss is %d'%modelLoss)
print('Test Accuracy is %d'%modelAccuracy)
"""**Report accuracy of model 2**"""
modelLoss_2 , modelAccuracy_2 = model_2.evaluate(X_test,Y_test)
print('Test Loss is %d'%modelLoss_2)
print('Test Accuracy is %d'%modelAccuracy_2)
"""**Predict using first model**"""
Y_predict=model.predict(X_test)
classes_y=np.argmax(Y_predict,axis=1)
"""**Predict using second model**"""
Y_predict_2=model_2.predict(X_test)
classes_y_2=np.argmax(Y_predict_2,axis=1)
"""**Report accuracy,recall and precission**"""
# calculate accuracy
accuracy = accuracy_score(Y_test, classes_y)
print('Model accuracy is: ', accuracy)
# Model Precision: what percentage of positive tuples are labeled as such?
print("Precision:", precision_score(Y_test, classes_y, average='micro'))
# Model Recall: what percentage of positive tuples are labelled as such?
print("Recall:", recall_score(Y_test, classes_y, average='micro'))
"""**Report accuracy,recall and precission**"""
# calculate accuracy
accuracy_2 = accuracy_score(Y_test, classes_y_2)
print('Model accuracy is: ', accuracy_2)
# Model Precision: what percentage of positive tuples are labeled as such?
print("Precision:", precision_score(Y_test, classes_y_2, average='micro'))
# Model Recall: what percentage of positive tuples are labelled as such?
print("Recall:", recall_score(Y_test, classes_y_2, average='micro')) | 31.047826 | 113 | 0.663072 | 1,013 | 7,141 | 4.505429 | 0.237907 | 0.047327 | 0.027607 | 0.038563 | 0.513146 | 0.428352 | 0.371166 | 0.365469 | 0.319018 | 0.28922 | 0 | 0.03901 | 0.185128 | 7,141 | 230 | 114 | 31.047826 | 0.745317 | 0.087103 | 0 | 0.248 | 1 | 0 | 0.099825 | 0.023776 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.104 | null | null | 0.12 | 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 |
b81dd2319a6cc5eb25c9c9df1159e0f17bf4b993 | 2,375 | py | Python | settings.py | airalcorn2/baller2vec | bfe0cc4d7988bd8104d7ef3ecd22867b275310ec | [
"MIT"
] | 54 | 2021-02-08T02:20:58.000Z | 2021-08-10T05:14:51.000Z | settings.py | airalcorn2/baller2vec | bfe0cc4d7988bd8104d7ef3ecd22867b275310ec | [
"MIT"
] | 4 | 2021-03-18T14:56:01.000Z | 2021-09-28T21:18:48.000Z | settings.py | airalcorn2/baller2vec | bfe0cc4d7988bd8104d7ef3ecd22867b275310ec | [
"MIT"
] | 4 | 2021-02-11T23:10:18.000Z | 2021-08-15T06:30:29.000Z | import os
NORMALIZATION_COEF = 7
PLAYER_CIRCLE_SIZE = 12 / NORMALIZATION_COEF
INTERVAL = 10
DIFF = 6
X_MIN = 0
X_MAX = 100
Y_MIN = 0
Y_MAX = 50
COL_WIDTH = 0.3
SCALE = 1.65
FONTSIZE = 6
X_CENTER = X_MAX / 2 - DIFF / 1.5 + 0.10
Y_CENTER = Y_MAX - DIFF / 1.5 - 0.35
BALL_COLOR = "#ff8c00"
(COURT_WIDTH, COURT_LENGTH) = (50, 94)
TEAM_ID2PROPS = {
1610612737: {"color": "#E13A3E", "abbreviation": "ATL"},
1610612738: {"color": "#008348", "abbreviation": "BOS"},
1610612751: {"color": "#061922", "abbreviation": "BKN"},
1610612766: {"color": "#1D1160", "abbreviation": "CHA"},
1610612741: {"color": "#CE1141", "abbreviation": "CHI"},
1610612739: {"color": "#860038", "abbreviation": "CLE"},
1610612742: {"color": "#007DC5", "abbreviation": "DAL"},
1610612743: {"color": "#4D90CD", "abbreviation": "DEN"},
1610612765: {"color": "#006BB6", "abbreviation": "DET"},
1610612744: {"color": "#FDB927", "abbreviation": "GSW"},
1610612745: {"color": "#CE1141", "abbreviation": "HOU"},
1610612754: {"color": "#00275D", "abbreviation": "IND"},
1610612746: {"color": "#ED174C", "abbreviation": "LAC"},
1610612747: {"color": "#552582", "abbreviation": "LAL"},
1610612763: {"color": "#0F586C", "abbreviation": "MEM"},
1610612748: {"color": "#98002E", "abbreviation": "MIA"},
1610612749: {"color": "#00471B", "abbreviation": "MIL"},
1610612750: {"color": "#005083", "abbreviation": "MIN"},
1610612740: {"color": "#002B5C", "abbreviation": "NOP"},
1610612752: {"color": "#006BB6", "abbreviation": "NYK"},
1610612760: {"color": "#007DC3", "abbreviation": "OKC"},
1610612753: {"color": "#007DC5", "abbreviation": "ORL"},
1610612755: {"color": "#006BB6", "abbreviation": "PHI"},
1610612756: {"color": "#1D1160", "abbreviation": "PHX"},
1610612757: {"color": "#E03A3E", "abbreviation": "POR"},
1610612758: {"color": "#724C9F", "abbreviation": "SAC"},
1610612759: {"color": "#BAC3C9", "abbreviation": "SAS"},
1610612761: {"color": "#CE1141", "abbreviation": "TOR"},
1610612762: {"color": "#00471B", "abbreviation": "UTA"},
1610612764: {"color": "#002B5C", "abbreviation": "WAS"},
}
EVENTS_DIR = os.environ["EVENTS_DIR"]
TRACKING_DIR = os.environ["TRACKING_DIR"]
GAMES_DIR = os.environ["GAMES_DIR"]
DATA_DIR = os.environ["DATA_DIR"]
EXPERIMENTS_DIR = os.environ["EXPERIMENTS_DIR"]
| 43.181818 | 60 | 0.618526 | 246 | 2,375 | 5.861789 | 0.520325 | 0.017337 | 0.041609 | 0.009709 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.231188 | 0.149474 | 2,375 | 54 | 61 | 43.981481 | 0.482673 | 0 | 0 | 0 | 0 | 0 | 0.366737 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.018868 | 0 | 0.018868 | 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 |
6296a98cabc6d28ed2db0ea0465b5a22848152b4 | 96 | py | Python | Python/loops/evens_between_numbers.py | mdoprog/Warehouse | 4afb88a32fc20b613d008b86371d505ddeb07e5a | [
"MIT"
] | null | null | null | Python/loops/evens_between_numbers.py | mdoprog/Warehouse | 4afb88a32fc20b613d008b86371d505ddeb07e5a | [
"MIT"
] | null | null | null | Python/loops/evens_between_numbers.py | mdoprog/Warehouse | 4afb88a32fc20b613d008b86371d505ddeb07e5a | [
"MIT"
] | null | null | null | # coding=UTF8
# Processamento
for num in range(100, 201):
if num % 2 > 0:
print(num) | 19.2 | 27 | 0.59375 | 15 | 96 | 3.8 | 0.866667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130435 | 0.28125 | 96 | 5 | 28 | 19.2 | 0.695652 | 0.260417 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
629f932a6d981c3010f0dee6bcf0fd64610a97d5 | 882 | py | Python | gpytorch/likelihoods/gaussian_likelihood.py | ediphy-dwild/gpytorch | 559c78a6446237ed7cc8e1cc7cf4ed8bf31a3c8a | [
"MIT"
] | null | null | null | gpytorch/likelihoods/gaussian_likelihood.py | ediphy-dwild/gpytorch | 559c78a6446237ed7cc8e1cc7cf4ed8bf31a3c8a | [
"MIT"
] | null | null | null | gpytorch/likelihoods/gaussian_likelihood.py | ediphy-dwild/gpytorch | 559c78a6446237ed7cc8e1cc7cf4ed8bf31a3c8a | [
"MIT"
] | null | null | null | import torch
import math
import gpytorch
from torch import nn
from gpytorch.random_variables import GaussianRandomVariable
from .likelihood import Likelihood
class GaussianLikelihood(Likelihood):
def __init__(self, log_noise_bounds=(-1000, 1000)):
super(GaussianLikelihood, self).__init__()
self.register_parameter('log_noise', nn.Parameter(torch.zeros(1)), bounds=log_noise_bounds)
def forward(self, input):
assert(isinstance(input, GaussianRandomVariable))
mean, covar = input.representation()
noise = gpytorch.add_diag(covar, self.log_noise.exp())
return GaussianRandomVariable(mean, noise)
def log_probability(self, input, target):
res = -0.5 * ((target - input.mean()) ** 2 + input.var()) / self.log_noise.exp()
res += -0.5 * self.log_noise - 0.5 * math.log(2 * math.pi)
return res.sum(0)
| 36.75 | 99 | 0.696145 | 110 | 882 | 5.4 | 0.4 | 0.080808 | 0.080808 | 0.050505 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025035 | 0.184807 | 882 | 23 | 100 | 38.347826 | 0.801113 | 0 | 0 | 0 | 0 | 0 | 0.010204 | 0 | 0 | 0 | 0 | 0 | 0.052632 | 1 | 0.157895 | false | 0 | 0.315789 | 0 | 0.631579 | 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 |
62ae8c572c87d215379e1cef4a4816e9aad1307f | 201 | py | Python | floor.py | DReichLab/adna-workflow | 07c6da8e64234decb7373fe7109e09395a45cb58 | [
"BSD-3-Clause"
] | 9 | 2019-05-28T11:16:14.000Z | 2022-02-24T01:22:47.000Z | floor.py | DReichLab/adna-workflow | 07c6da8e64234decb7373fe7109e09395a45cb58 | [
"BSD-3-Clause"
] | 3 | 2020-01-09T20:12:02.000Z | 2020-11-17T14:50:28.000Z | floor.py | DReichLab/adna-workflow | 07c6da8e64234decb7373fe7109e09395a45cb58 | [
"BSD-3-Clause"
] | 1 | 2019-08-04T12:46:01.000Z | 2019-08-04T12:46:01.000Z | # implement a simple floor function because WDL does not have one
import fileinput
import math
for line in fileinput.input():
value = float(line)
intvalue = int(math.floor(value))
print(intvalue)
| 20.1 | 65 | 0.761194 | 30 | 201 | 5.1 | 0.766667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.159204 | 201 | 9 | 66 | 22.333333 | 0.905325 | 0.313433 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.166667 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
62bca10916546c4eeb512a88e27e4211bfdd73ed | 2,486 | py | Python | src/compas/numerical/__init__.py | mpopescu/compas | 55f259607deea501f862cbaea79bd97d7e56ead6 | [
"MIT"
] | null | null | null | src/compas/numerical/__init__.py | mpopescu/compas | 55f259607deea501f862cbaea79bd97d7e56ead6 | [
"MIT"
] | null | null | null | src/compas/numerical/__init__.py | mpopescu/compas | 55f259607deea501f862cbaea79bd97d7e56ead6 | [
"MIT"
] | null | null | null | """
********************************************************************************
numerical
********************************************************************************
.. currentmodule:: compas.numerical
.. note::
For many functions, multiple implementations are available using various backends.
If no backend is specified, the function is assumed to be implemented in pure Python.
The suffix `_numpy` indicates that the function uses Numpy and/or Scipy.
Some of the other possibilities are `_alglib`, `_cpp`, `_matlab`, `_sympy`.
On most platforms, all variants are directly available.
In Rhino, only the pure Python and the `_alglib` variants can be used directly.
All others have to be accessed through an `XFunc` or an `RPC` service.
Solvers
=======
.. autosummary::
:toctree: generated/
:nosignatures:
descent_numpy
devo_numpy
dr
dr_numpy
drx_numpy
fd_numpy
ga
moga
pca_numpy
topop_numpy
Linalg
======
.. autosummary::
:toctree: generated/
:nosignatures:
nullspace
rank
dof
pivots
nonpivots
rref
rref_sympy
rref_matlab
chofactor
lufactorized
uvw_lengths
normrow
normalizerow
rot90
solve_with_known
spsolve_with_known
Matrices
========
.. autosummary::
:toctree: generated/
:nosignatures:
adjacency_matrix
degree_matrix
connectivity_matrix
laplacian_matrix
face_matrix
mass_matrix
equilibrium_matrix
Operators
=========
.. autosummary::
:toctree: generated/
:nosignatures:
grad
Utilities
=========
.. autosummary::
:toctree: generated/
:nosignatures:
float_formatter
set_array_print_precision
unset_array_print_precision
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import compas
if not compas.IPY:
from .linalg import * # noqa: F401 F403
from .matrices import * # noqa: F401 F403
from .operators import * # noqa: F401 F403
from .utilities import * # noqa: F401 F403
from .topop import * # noqa: F401 F403
from .pca import * # noqa: F401 F403
from .ga import * # noqa: F401 F403
from .fd import * # noqa: F401 F403
from .drx import * # noqa: F401 F403
from .dr import * # noqa: F401 F403
from .devo import * # noqa: F401 F403
from .descent import * # noqa: F401 F403
__all__ = [name for name in dir() if not name.startswith('_')]
| 19.730159 | 89 | 0.633548 | 279 | 2,486 | 5.455197 | 0.451613 | 0.078844 | 0.110381 | 0.141919 | 0.159001 | 0 | 0 | 0 | 0 | 0 | 0 | 0.038442 | 0.225664 | 2,486 | 125 | 90 | 19.888 | 0.752208 | 0.78922 | 0 | 0 | 0 | 0 | 0.001988 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.888889 | 0 | 0.888889 | 0.055556 | 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 |
62c51c5bfdbd12c0612c0632359c03e78dc81bc4 | 7,977 | py | Python | logicpy/data.py | evertheylen/logicpy | 18dac5b2b659d6598692a165b39dccbf413781bc | [
"MIT"
] | 11 | 2017-12-12T06:28:07.000Z | 2021-09-18T17:44:09.000Z | logicpy/data.py | evertheylen/logicpy | 18dac5b2b659d6598692a165b39dccbf413781bc | [
"MIT"
] | null | null | null | logicpy/data.py | evertheylen/logicpy | 18dac5b2b659d6598692a165b39dccbf413781bc | [
"MIT"
] | null | null | null |
import operator
# Free functions to enable working with 'foreign' constants
# ---------------------------------------------------------
def with_scope(obj, scope):
if hasattr(obj, 'with_scope'):
return obj.with_scope(scope)
else:
return obj
def has_occurence(obj, var):
if hasattr(obj, 'has_occurence'):
return obj.has_occurence(var)
else:
return False
def occurences(obj, O):
if hasattr(obj, 'occurences'):
return obj.occurences(O)
def replace(obj, A, B):
if obj is A or obj == A:
return B
elif hasattr(obj, 'replace'):
return obj.replace(A, B)
else:
return obj
def instantiate(expr, result):
if hasattr(expr, 'instantiate'):
return expr.instantiate(result)
else:
return expr
# Terms and builtin operations
# ----------------------------
def binary_compounder(name, func):
def operation(self, other):
return InfixEvalCompound(name, func, (self, other))
def rev_operation(self, other):
return InfixEvalCompound(name, func, (other, self))
return operation, rev_operation
def unary_compounder(name, func):
def operation(self):
return PrefixEvalCompound(name, func, (self,))
return operation
class Term:
def __init__(self, been_scoped=False):
self.been_scoped = been_scoped
def with_scope(self, scope):
if self.been_scoped:
return self
else:
return type(self)(been_scoped=True)
# Basic operand support ...............................
__add__, __radd__ = binary_compounder('+', operator.add)
__sub__, __rsub__ = binary_compounder('-', operator.sub)
__mul__, __rmul__ = binary_compounder('*', operator.mul)
__div__, __rdiv__ = binary_compounder('/', operator.truediv)
__floordiv__, __rfloordiv__ = binary_compounder('//', operator.floordiv)
__mod__, __rmod__ = binary_compounder('%', operator.mod)
__matmul__, __rmatmul__ = binary_compounder('@', operator.matmul)
__pow__, __rpow__ = binary_compounder('**', operator.pow)
__pos__ = unary_compounder('+', operator.pos)
__neg__ = unary_compounder('-', operator.neg)
# Comparisons .........................................
def __lt__(l, r):
from logicpy.builtin import Lower
return Lower(l, r)
def __le__(l, r):
from logicpy.builtin import LowerOrEqual
return LowerOrEqual(l, r)
def __gt__(l, r):
from logicpy.builtin import Greater
return Greater(l, r)
def __ge__(l, r):
from logicpy.builtin import GreaterOrEqual
return GreaterOrEqual(l, r)
# Some random operator overloads ......................
def __lshift__(self, other):
"Replaces is in Prolog"
from logicpy.builtin import Evaluation
return Evaluation(self, other)
def __rshift__(self, other):
from logicpy.builtin import Evaluation
return Evaluation(other, self)
def __eq__(self, other):
if self.been_scoped:
return type(self) == type(other) and self.really_equal(other)
else:
from logicpy.builtin import unify
return unify(self, other)
def __ne__(self, other):
if self.been_scoped:
return type(self) != type(other) or (not self.really_equal(other))
else:
from logicpy.builtin import unify, neg
return neg(unify(self, other))
# Subclasses of Term: Atom, Compound, Variable and some shared functionality
# --------------------------------------------------------------------------
class NamedTerm(Term):
TERM_TYPE = 'Term'
def __init__(self, name, been_scoped=False):
super().__init__(been_scoped)
self.name = name
def __str__(self):
return str(self.name)
def __repr__(self):
return f"{type(self).__name__}({self.name!r})"
def really_equal(self, other):
return type(self) == type(other) and self.name == other.name
def __hash__(self):
return hash(self.name)
def has_occurence(self, var):
return False # by default
def occurences(self, O):
pass
def with_scope(self, scope):
if self.been_scoped:
return self
else:
return type(self)(self.name, been_scoped=True)
class BasicTerm(NamedTerm):
pass
class Atom(BasicTerm):
def __call__(self, *args):
assert len(args) >= 1, "Creation of Compound needs at least 1 argument"
return Compound(self.name, args)
children = []
class NotInstantiated(Exception):
pass
class Compound(BasicTerm):
def __init__(self, name, children, been_scoped=False):
super().__init__(name, been_scoped)
self.children = tuple(children)
def __str__(self):
return f"{self.name}({', '.join(map(str, self.children))})"
def __repr__(self):
return f"{type(self).__name__}({self.name!r}, {self.children!r})"
def really_equal(self, other):
return self.name == other.name and self.children == other.children
def __hash__(self):
return hash((self.name, self.children))
def has_occurence(self, var):
return any(has_occurence(c, var) for c in self.children)
def occurences(self, O):
for c in self.children:
occurences(c, O)
def replace(self, A, B):
new_children = tuple(replace(c, A, B) for c in self.children)
return Compound(self.name, new_children, been_scoped=self.been_scoped)
def with_scope(self, scope):
return Compound(self.name, tuple(with_scope(c, scope) for c in self.children), been_scoped=True)
def instantiate(self, result):
return Compound(self.name, tuple(instantiate(c, result) for c in self.children), been_scoped=self.been_scoped)
class EvalCompound(Compound):
def __init__(self, name, func, children, been_scoped=False):
super().__init__(name, children, been_scoped)
self.func = func
def replace(self, A, B):
new_children = tuple(replace(c, A, B) for c in self.children)
return EvalCompound(self.name, self.func, new_children, been_scoped=self.been_scoped)
def with_scope(self, scope):
return EvalCompound(self.name, self.func, tuple(with_scope(c, scope) for c in self.children), been_scoped=True)
def instantiate(self, result):
return EvalCompound(self.name, self.func, tuple(instantiate(c, result) for c in self.children), been_scoped=self.been_scoped)
class InfixEvalCompound(EvalCompound):
def __str__(self):
return '(' + f" {self.name} ".join(map(str, self.children)) + ')'
class PrefixEvalCompound(EvalCompound):
def __str__(self):
return self.name + " ".join(map(str, self.children))
class Variable(NamedTerm):
def __init__(self, name, scope=None):
super().__init__(name, scope is not None)
self.name = name
self.scope = scope
def __str__(self):
if self.scope:
return f"{self.name}:{self.scope % 997}"
else:
return super().__str__()
def __repr__(self):
if self.scope:
return f"Variable({self.name!r}, {self.scope})"
else:
return f"Variable({self.name!r})"
def really_equal(self, other):
return self.name == other.name and self.scope == other.scope
def __hash__(self):
return hash((self.name, self.scope))
def has_occurence(self, var):
return self == var
def occurences(self, O):
O.add(self)
def with_scope(self, scope):
return Variable(self.name, scope)
def instantiate(self, result):
return result.get_var(self)
| 28.3879 | 133 | 0.600351 | 939 | 7,977 | 4.815761 | 0.15442 | 0.056612 | 0.034056 | 0.042459 | 0.496019 | 0.460195 | 0.377488 | 0.290801 | 0.26736 | 0.259177 | 0 | 0.00085 | 0.262505 | 7,977 | 280 | 134 | 28.489286 | 0.767806 | 0.065062 | 0 | 0.331522 | 0 | 0 | 0.050884 | 0.018881 | 0 | 0 | 0 | 0 | 0.005435 | 1 | 0.293478 | false | 0.016304 | 0.048913 | 0.130435 | 0.728261 | 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 |
62c5dbb44b9b9f981e0b8575a57ba4952991600d | 1,077 | py | Python | anonramblings/ramblings/migrations/0012_auto_20200517_1241.py | emre/anonramblings | d759529ced9e6431ab133b1a5a156d0791499948 | [
"MIT"
] | 2 | 2021-05-05T13:57:16.000Z | 2022-01-31T23:27:01.000Z | anonramblings/ramblings/migrations/0012_auto_20200517_1241.py | emre/anonramblings | d759529ced9e6431ab133b1a5a156d0791499948 | [
"MIT"
] | 8 | 2021-03-19T03:25:40.000Z | 2022-03-12T00:29:41.000Z | anonramblings/ramblings/migrations/0012_auto_20200517_1241.py | emre/anonramblings | d759529ced9e6431ab133b1a5a156d0791499948 | [
"MIT"
] | 1 | 2021-07-28T20:42:51.000Z | 2021-07-28T20:42:51.000Z | # Generated by Django 3.0.6 on 2020-05-17 12:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ramblings', '0011_auto_20200517_1237'),
]
operations = [
migrations.AddField(
model_name='post',
name='level',
field=models.PositiveIntegerField(default=1, editable=False),
preserve_default=False,
),
migrations.AddField(
model_name='post',
name='lft',
field=models.PositiveIntegerField(default=1, editable=False),
preserve_default=False,
),
migrations.AddField(
model_name='post',
name='rght',
field=models.PositiveIntegerField(default=1, editable=False),
preserve_default=False,
),
migrations.AddField(
model_name='post',
name='tree_id',
field=models.PositiveIntegerField(db_index=True, default=1, editable=False),
preserve_default=False,
),
]
| 28.342105 | 88 | 0.57753 | 101 | 1,077 | 6.029703 | 0.435644 | 0.118227 | 0.151067 | 0.17734 | 0.651888 | 0.651888 | 0.594417 | 0.527094 | 0.527094 | 0.527094 | 0 | 0.047425 | 0.314763 | 1,077 | 37 | 89 | 29.108108 | 0.777778 | 0.041783 | 0 | 0.612903 | 1 | 0 | 0.065049 | 0.02233 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.032258 | 0 | 0.129032 | 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 |
62c8f892a6474e43a8bfb1912ef700fbbac1702c | 669 | py | Python | basic_program/basic_generater.py | JiaLei123/PythonCamp_PY3 | f8f9df0b33a6942bf11330c097b0f71b5524d666 | [
"Apache-2.0"
] | null | null | null | basic_program/basic_generater.py | JiaLei123/PythonCamp_PY3 | f8f9df0b33a6942bf11330c097b0f71b5524d666 | [
"Apache-2.0"
] | null | null | null | basic_program/basic_generater.py | JiaLei123/PythonCamp_PY3 | f8f9df0b33a6942bf11330c097b0f71b5524d666 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# coding=utf-8
class BasicGenerater(object):
def __init__(self):
self.first_name = 'Jack'
self.last_name = 'Freeman'
def my_name(self):
print('.'.join((self.first_name, self.last_name)))
def __del__(self):
print("call del")
class AdvaceGenerator(BasicGenerater):
def __init__(self):
BasicGenerater.__init__(self)
self.first_name = 'Bob'
class AdvaceGenerator2(BasicGenerater):
def __init__(self):
super(AdvaceGenerator2, self).__init__()
self.first_name = 'Alon'
if __name__ == "__main__":
basic = AdvaceGenerator2()
basic.my_name()
print("end")
| 20.90625 | 58 | 0.639761 | 75 | 669 | 5.173333 | 0.413333 | 0.103093 | 0.134021 | 0.087629 | 0.108247 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007737 | 0.227205 | 669 | 31 | 59 | 21.580645 | 0.742747 | 0.043348 | 0 | 0.15 | 1 | 0 | 0.059561 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.4 | 0.15 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
62d5f3efd2e5d9074a34ad0927852fa0d231b834 | 1,332 | py | Python | crypto.py | TomazSpehar/crypto-portal | f7a819ebec16354a391e1fe826b753838fa31c94 | [
"MIT"
] | null | null | null | crypto.py | TomazSpehar/crypto-portal | f7a819ebec16354a391e1fe826b753838fa31c94 | [
"MIT"
] | null | null | null | crypto.py | TomazSpehar/crypto-portal | f7a819ebec16354a391e1fe826b753838fa31c94 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from flask import *
from auth import sesskey, debug
from githook import app as githook_app
from substitution import app as substitution_app
from steganography import app as steganography_app
from visual import app as visual_app
from alphabet import app as alphabet_app
from timestamp import app as timestamp_app
from password import app as password_app
from hash import app as hash_app
import os # DODANO ZA POTREBE CLOUD9
app = Flask(__name__)
app.debug = debug
app.register_blueprint(githook_app)
app.register_blueprint(substitution_app, url_prefix = '/substitution')
app.register_blueprint(steganography_app, url_prefix = '/steganography')
app.register_blueprint(visual_app, url_prefix = '/visual')
app.register_blueprint(alphabet_app, url_prefix = '/alphabet')
app.register_blueprint(timestamp_app, url_prefix = '/timestamp')
app.register_blueprint(password_app, url_prefix='/password')
app.register_blueprint(hash_app, url_prefix='/hash')
app.secret_key = sesskey
app.config['MAX_CONTENT_LENGTH'] = 1024 * 1024 # limit 1 MB
@app.route("/")
def index():
return render_template("index.html", nav = "start")
@app.route("/favicon.ico")
def favicon():
return redirect('static/images/favicon.ico')
if __name__ == '__main__':
app.run(debug=True) # DODANO ZA POTREBE CLOUD9
| 34.153846 | 72 | 0.78003 | 191 | 1,332 | 5.193717 | 0.314136 | 0.072581 | 0.08871 | 0.042339 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010195 | 0.116366 | 1,332 | 38 | 73 | 35.052632 | 0.832625 | 0.074324 | 0 | 0 | 0 | 0 | 0.118893 | 0.020358 | 0 | 0 | 0 | 0 | 0 | 1 | 0.064516 | false | 0.064516 | 0.354839 | 0.064516 | 0.483871 | 0.258065 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 2 |
62f1c2980bd8f57b3c54d259aeb4989247b0f169 | 2,195 | py | Python | conkit/io/jones.py | mesdaghi/conkit | 01468761352bd3ac5078e5e9fef6f73c8c49036e | [
"BSD-3-Clause"
] | null | null | null | conkit/io/jones.py | mesdaghi/conkit | 01468761352bd3ac5078e5e9fef6f73c8c49036e | [
"BSD-3-Clause"
] | null | null | null | conkit/io/jones.py | mesdaghi/conkit | 01468761352bd3ac5078e5e9fef6f73c8c49036e | [
"BSD-3-Clause"
] | null | null | null | # BSD 3-Clause License
#
# Copyright (c) 2016-19, University of Liverpool
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
Parser module specific to the "Jones" sequence file format
"""
__author__ = "Felix Simkovic"
__date__ = "13 Sep 2016"
__version__ = "0.1"
from conkit.io.a2m import A2mParser
from conkit.misc import deprecate
@deprecate("0.11", msg="Use A2mParser instead")
class JonesParser(A2mParser):
"""Parser class for Jones sequence files
This format is a "new" definition of sequence-only records.
It assumes that there are no comments, headers or any other
data in the file.
The only information present are sequences, whereby one sequence
is represented in a single line!
"""
pass
| 38.508772 | 80 | 0.766287 | 315 | 2,195 | 5.301587 | 0.552381 | 0.021557 | 0.020359 | 0.027545 | 0.11018 | 0.081437 | 0.081437 | 0.081437 | 0.081437 | 0.081437 | 0 | 0.012202 | 0.178588 | 2,195 | 56 | 81 | 39.196429 | 0.914032 | 0.845558 | 0 | 0 | 0 | 0 | 0.194853 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.125 | 0.25 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
62fbbc255ba7434f66f2f1b809c6ed64d853b913 | 1,325 | py | Python | flavio/physics/bdecays/test_bvgamma.py | Felicia56/flavio | ea735bd8febbb961d249eddf338a4960c1fbee69 | [
"MIT"
] | 61 | 2016-03-09T16:19:39.000Z | 2022-03-30T00:55:51.000Z | flavio/physics/bdecays/test_bvgamma.py | Felicia56/flavio | ea735bd8febbb961d249eddf338a4960c1fbee69 | [
"MIT"
] | 167 | 2016-03-15T15:25:57.000Z | 2022-02-27T22:19:22.000Z | flavio/physics/bdecays/test_bvgamma.py | Felicia56/flavio | ea735bd8febbb961d249eddf338a4960c1fbee69 | [
"MIT"
] | 57 | 2016-03-15T14:24:23.000Z | 2022-01-14T01:00:03.000Z | import unittest
import numpy as np
from .bvgamma import *
from flavio.physics.bdecays.formfactors.b_v import bsz_parameters
from flavio.physics.eft import WilsonCoefficients
from flavio.physics.bdecays.wilsoncoefficients import wctot_dict
from flavio.parameters import default_parameters
import flavio
wc = WilsonCoefficients()
par = default_parameters#
class TestBVgamma(unittest.TestCase):
def test_bksgamma(self):
# just check if this works
flavio.Observable["ACP(B0->K*gamma)"].prediction_central(par, wc)
flavio.Observable["S_K*gamma"].prediction_central(par, wc)
# numerical comparison to David's old Mathematica code
self.assertAlmostEqual(
flavio.Observable["BR(B0->K*gamma)"].prediction_central(par, wc)*1e5/3.91526,
1, places=1)
self.assertAlmostEqual(
flavio.Observable["BR(B+->K*gamma)"].prediction_central(par, wc)*1e5/4.11625,
1, places=1)
def test_bksgamma(self):
# just check if this works
flavio.Observable["ACP(Bs->phigamma)"].prediction_central(par, wc)
flavio.Observable["S_phigamma"].prediction_central(par, wc)
flavio.Observable["BR(Bs->phigamma)"].prediction_central(par, wc)
flavio.Observable["ADeltaGamma(Bs->phigamma)"].prediction_central(par, wc)
| 40.151515 | 89 | 0.710943 | 166 | 1,325 | 5.572289 | 0.36747 | 0.138378 | 0.172973 | 0.19027 | 0.549189 | 0.464865 | 0.4 | 0.229189 | 0.125405 | 0.125405 | 0 | 0.020147 | 0.175849 | 1,325 | 32 | 90 | 41.40625 | 0.826923 | 0.077736 | 0 | 0.24 | 0 | 0 | 0.101068 | 0.020542 | 0 | 0 | 0 | 0 | 0.08 | 1 | 0.08 | false | 0 | 0.32 | 0 | 0.44 | 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 |
62fc102e6acc6d8be193a57aea5e08606b86609e | 359 | py | Python | strava_gsheet/core/models/user.py | neozenith/strava-gsheet-python | cce24721d6dcae69638c99261308f3d76512a087 | [
"MIT"
] | null | null | null | strava_gsheet/core/models/user.py | neozenith/strava-gsheet-python | cce24721d6dcae69638c99261308f3d76512a087 | [
"MIT"
] | null | null | null | strava_gsheet/core/models/user.py | neozenith/strava-gsheet-python | cce24721d6dcae69638c99261308f3d76512a087 | [
"MIT"
] | null | null | null | # Standard Library
from typing import Any, Dict, Optional
# Third Party Libraries
from pydantic import BaseModel
class User(BaseModel):
username: str
email: Optional[str] = None
full_name: Optional[str] = None
disabled: Optional[bool] = None
class UserInDB(User):
hashed_password: str
stava_token: Optional[Dict[str, Any]] = None
| 19.944444 | 48 | 0.715877 | 46 | 359 | 5.521739 | 0.608696 | 0.086614 | 0.11811 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.197772 | 359 | 17 | 49 | 21.117647 | 0.881944 | 0.10585 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.1 | 0.2 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
62ff1922df1577de89f6ac346387acb59877c7c1 | 111 | py | Python | instance/local.py | sreecodeslayer/redis-mongo-realtime | a3e6d16ad83a1c16f8435e26d66a003ba3abc1c2 | [
"MIT"
] | null | null | null | instance/local.py | sreecodeslayer/redis-mongo-realtime | a3e6d16ad83a1c16f8435e26d66a003ba3abc1c2 | [
"MIT"
] | 1 | 2019-06-10T15:32:25.000Z | 2019-06-10T15:32:25.000Z | instance/local.py | sreecodeslayer/redis-mongo-realtime | a3e6d16ad83a1c16f8435e26d66a003ba3abc1c2 | [
"MIT"
] | null | null | null | DEBUG = True
TESTING = False
MONGODB_SETTINGS = [{
'host':'localhost',
'port':27017,
'db':'REALTIME_APP'
}] | 13.875 | 21 | 0.657658 | 13 | 111 | 5.461538 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.052632 | 0.144144 | 111 | 8 | 22 | 13.875 | 0.694737 | 0 | 0 | 0 | 0 | 0 | 0.276786 | 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 |
1a0f3493e0212452c327a9de42836571ba8aa75f | 75,565 | py | Python | pySEP/gui.py | mrcsantos1/pySEP | b5491a7c7d947e135c383ec29c4294fc564838fd | [
"Apache-2.0"
] | 2 | 2021-02-15T14:29:04.000Z | 2021-02-22T21:33:42.000Z | pySEP/gui.py | mrcsantos1/pySEP | b5491a7c7d947e135c383ec29c4294fc564838fd | [
"Apache-2.0"
] | null | null | null | pySEP/gui.py | mrcsantos1/pySEP | b5491a7c7d947e135c383ec29c4294fc564838fd | [
"Apache-2.0"
] | 1 | 2022-03-26T00:55:53.000Z | 2022-03-26T00:55:53.000Z | import tkinter as tk
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
<<<<<<< HEAD
=======
import networkx as nx
<<<<<<< HEAD
from PIL import Image, ImageTk
>>>>>>> 61cee31 (logo adicionada)
=======
>>>>>>> c68287f (cálculo fluxo de potência)
# from .circuito import Circuito
from circuito import Circuito
from malha import Malha
class JanelaMain:
def __init__(self):
self.__janela = tk.Tk()
self.__info_basic = {
'nums': {'barras': 1,
'linhas': 1
},
'sBase': 100e6,
}
self.__text_status = tk.StringVar()
# janela
self.set_janela(janela_main=self.__janela)
# menu
self.set_menu(janela_main=self.__janela)
# toolbar
self.set_toolbar(janela_main=self.__janela)
# status bar
self.set_statusbar(janela_main=self.__janela, textvariable=self.__text_status)
# Criando os binds com os eventos de mouse
self.__janela.bind("<Enter>", self.bemvindo)
# self.__circuito = ckt.Circuito(sBase=100e6)
self.__circuito = Circuito(sBase=100e6)
self.__teste = Figure(figsize=(5, 5), dpi=100)
self.__show_logo()
self.__s_base()
## Malha de terra
self.__malha = Malha()
self.__janela.mainloop()
def __show_logo(self):
logo = tk.PhotoImage(file="images/pySEP_logo.png")
self.__label_logo = tk.Label(
master=self.__janela,
bg="light goldenrod",
image=logo,
)
self.__label_logo.photo = logo
self.__label_logo.pack(expand=True)
def set_menu(self, janela_main):
def __fechar_tudo():
self.__janela.destroy()
self.__janela.quit()
def func_teste():
print('\nmenu menu menu menu')
menu = tk.Menu(janela_main, tearoff=False, bg="dark goldenrod")
janela_main.config(menu=menu)
<<<<<<< HEAD
<<<<<<< HEAD
sub_file = tk.Menu(menu, tearoff=False)
menu.add_cascade(label="Arquivo", menu=sub_file)
sub_file.add_command(label="Novo Projeto", command=func_teste)
sub_file.add_command(label="Salvar Projeto", command=func_teste)
sub_file.add_command(label="Importar Projeto", command=func_teste)
sub_file.add_separator()
sub_edit = tk.Menu(menu, tearoff=False)
menu.add_cascade(label="Editar", menu=sub_edit)
sub_edit.add_command(label="Desfazer", command=func_teste)
<<<<<<< HEAD
def __show_grafo(self):
=======
def __grafo_add_edge(self, list_linhas):
self.__f = Figure(figsize=(5, 4), dpi=100)
self.__grafo.add_edges_from(list_linhas)
self.__grafo_pos = nx.spring_layout(self.__grafo)
a = self.__f.add_subplot()
=======
=======
## FILE
>>>>>>> da86f7d (opção menu projeto malha de terra ok)
menu_file = tk.Menu(menu, tearoff=False)
menu.add_cascade(label="Arquivo", menu=menu_file)
menu_file.add_command(label="Novo Projeto", command=func_teste)
menu_file.add_command(label="Salvar Projeto", command=func_teste)
menu_file.add_command(label="Importar Projeto", command=func_teste)
menu_file.add_command(label="Sair", command=__fechar_tudo)
menu_file.add_separator()
## EDIT
menu_edit = tk.Menu(menu, tearoff=False)
menu.add_cascade(label="Editar", menu=menu_edit)
menu_edit.add_command(label="Desfazer", command=func_teste)
menu_edit.add_separator()
## FLUXO DE POTÊNCIA
menu_calc_fluxo = tk.Menu(master=menu, tearoff=False)
menu.add_cascade(label="Fluxo de Potência", menu=menu_calc_fluxo)
menu_calc_fluxo.add_command(label="Calcular!", command=self.__calc_fluxo)
menu_calc_fluxo.add_cascade(label="Relatório Final", command=self.__calc_fluxo_relatorio)
menu_calc_fluxo.add_cascade(label="Mostrar Perdas", command=self.__calc_fluxo_perdas)
menu_calc_fluxo.add_cascade(label="Plotar Convergência da(s) Tensão(ões)",
command=self.__calc_fluxo_plot_tensao)
menu_calc_fluxo.add_cascade(label="Plotar Convergência do(s) Ângulo(os)", command=self.__calc_fluxo_plot_angulo)
menu_calc_fluxo.add_separator()
## PROJETO MALHA DE TERRA
menu_malha_terra = tk.Menu(master=menu, tearoff=False)
menu.add_cascade(label="Projeto Malha de Terra", menu=menu_malha_terra)
menu_malha_terra.add_command(label="Adicionar informações de projeto", command=self.__malha_terra_add_info)
menu_malha_terra.add_cascade(label="Realizar teste de projeto", command=self.__malha_terra_testar)
# menu_malha_terra.add_cascade(label="Mostrar Perdas", command=self.__calc_fluxo_perdas)
# menu_malha_terra.add_cascade(label="Plotar Convergência da(s) Tensão(ões)",
# command=self.__calc_fluxo_plot_tensao)
# menu_malha_terra.add_cascade(label="Plotar Convergência do(s) Ângulo(os)", command=self.__calc_fluxo_plot_angulo)
menu_malha_terra.add_separator()
# Sistemas de Proteção
menu_protecao = tk.Menu(master=menu, tearoff=False)
menu.add_cascade(label="Sistemas de Proteção", menu=menu_protecao)
menu_protecao.add_command(label="Desenhar Circuito do Sistema", command=self.__embreve)
# menu_protecao.add_cascade(label="Realizar teste de projeto", command=self.__malha_terra_testar)
# menu_malha_terra.add_cascade(label="Mostrar Perdas", command=self.__calc_fluxo_perdas)
# menu_malha_terra.add_cascade(label="Plotar Convergência da(s) Tensão(ões)",
# command=self.__calc_fluxo_plot_tensao)
# menu_malha_terra.add_cascade(label="Plotar Convergência do(s) Ângulo(os)", command=self.__calc_fluxo_plot_angulo)
menu_protecao.add_separator()
def __embreve(self):
print("Ferramenta em análise para desenvolvimento")
config_draw_prot = tk.Toplevel()
config_draw_prot.title("Ferramenta em análise para desenvolvimento")
config_draw_prot.geometry("1100x700")
config_draw_prot.wm_iconbitmap("images/logo_pySEP.ico")
config_draw_prot["bg"] = "light goldenrod"
frame_info_draw_prot = tk.LabelFrame(
master=config_draw_prot,
bg="light goldenrod",
text="Ferramenta em análise para desenvolvimento",
font=("Helvetica", 20)
)
frame_info_draw_prot.pack(fill='both', expand=True)
def __malha_terra_testar(self):
config_testar_malha = tk.Toplevel()
config_testar_malha.title("Testar projeto de malha de terra")
config_testar_malha.geometry("660x215")
config_testar_malha.wm_iconbitmap("images/logo_pySEP.ico")
config_testar_malha["bg"] = "light goldenrod"
frame_teste_malha = tk.LabelFrame(
master=config_testar_malha,
bg="light goldenrod",
text="Testar Projeto de Malha de Terra",
font=("Helvetica", 20)
)
# frame_teste_malha.pack(fill='both', expand=True)
frame_teste_malha.grid(row=0, column=0, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# LABEL Profundidade das Hastes
label_profundidade_hastes = tk.Label(
master=frame_teste_malha,
text="Profundidade das hastes [m]: ",
font=("Helvetica", 15),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_profundidade_hastes.grid(row=0, column=0, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
entry_profundidade_hastes = tk.Entry(
font=("Helvetica", 15),
master=frame_teste_malha,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_profundidade_hastes.focus_set()
entry_profundidade_hastes.grid(row=0, column=1, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# LABEL Profundidade das Hastes
label_iteracoes = tk.Label(
master=frame_teste_malha,
text="Número de iterações: \nQuanto maior, mais preciso o cálculo simples. ",
font=("Helvetica", 14),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_iteracoes.grid(row=1, column=0, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
entry_iteracoes = tk.Entry(
font=("Helvetica", 15),
master=frame_teste_malha,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_iteracoes.grid(row=1, column=1, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# BOTÃO ADICIONAR
def __add_butt_salvar():
profundidade = float(entry_profundidade_hastes.get())
print('\n\nProfundidade das hastes = ', profundidade)
iteracoes = int(entry_iteracoes.get())
print('\n\nProfundidade das hastes = ', iteracoes)
print('\n\n\n=========================== TESTE SIMPLES DO PROJETO DA MALHA DE TERRA ======================')
self.__malha.testar_ri_v(profundidade_haste=profundidade, iteracoes=iteracoes, show=True)
if self.__malha.get_teste() is False:
print('\n\n\n======================= TESTE COMPLETO DO PROJETO DA MALHA DE TERRA =====================')
self.__malha.testar_vmalha_vtoq(show=True)
self.__malha.testar_vpsm_vpasso(show=True)
config_testar_malha.destroy()
butt_add_salvar = tk.Button(
master=config_testar_malha,
text="Testar!", font=("Helvetica", 12), height=2, # width=30,
bg="goldenrod",
bd=3,
command=__add_butt_salvar,
anchor=tk.CENTER,
justify=tk.CENTER,
compound=tk.CENTER,
padx=2,
pady=2,
relief=tk.GROOVE,
)
butt_add_salvar.grid(row=1, column=0, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
def __malha_terra_add_info(self):
config_info_malha = tk.Toplevel()
config_info_malha.title("Informações de Projeto da Malha de Terra")
config_info_malha.geometry("1100x700")
config_info_malha.wm_iconbitmap("images/logo_pySEP.ico")
config_info_malha["bg"] = "light goldenrod"
frame_info_malha = tk.LabelFrame(
master=config_info_malha,
bg="light goldenrod",
text="Informações de Projeto da Malha de Terra",
font=("Helvetica", 20)
)
frame_info_malha.pack(fill='both', expand=True)
# LABEL ADD Icc
label_add_icc = tk.Label(
master=frame_info_malha,
text="Corrente de curto-circuito [A]: ",
font=("Helvetica", 15),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_add_icc.grid(row=0, column=0, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
entry_add_icc = tk.Entry(
font=("Helvetica", 15),
master=frame_info_malha,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_add_icc.focus_set()
entry_add_icc.grid(row=0, column=1, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# LABEL ADD Imalha
label_add_imalha = tk.Label(
master=frame_info_malha,
text="Corrente de malha [A]: ",
font=("Helvetica", 15),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_add_imalha.grid(row=0, column=3, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
entry_add_imalha = tk.Entry(
font=("Helvetica", 15),
master=frame_info_malha,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_add_imalha.grid(row=0, column=4, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# LABEL ADD tempo protecao
label_add_t_protecao = tk.Label(
master=frame_info_malha,
text="Tempo da proteção [s]: ",
font=("Helvetica", 15),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_add_t_protecao.grid(row=1, column=0, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
entry_add_t_protecao = tk.Entry(
font=("Helvetica", 15),
master=frame_info_malha,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_add_t_protecao.grid(row=1, column=1, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# LABEL ADD tempo defeito
label_add_t_defeito = tk.Label(
master=frame_info_malha,
text="Tempo do defeito [s]: ",
font=("Helvetica", 15),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_add_t_defeito.grid(row=1, column=3, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
entry_add_t_defeito = tk.Entry(
font=("Helvetica", 15),
master=frame_info_malha,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_add_t_defeito.grid(row=1, column=4, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# LABEL ADD temperatura ambiente
label_add_temp_ambiente = tk.Label(
master=frame_info_malha,
text="Temperatura ambiente [C°]: ",
font=("Helvetica", 15),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_add_temp_ambiente.grid(row=2, column=0, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
entry_add_temp_ambiente = tk.Entry(
font=("Helvetica", 15),
master=frame_info_malha,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_add_temp_ambiente.grid(row=2, column=1, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# LABEL ADD temperatura máxima permissível
label_add_temp_max_permissivel = tk.Label(
master=frame_info_malha,
text="Temperatura máxima permissível [C°]: ",
font=("Helvetica", 15),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_add_temp_max_permissivel.grid(row=2, column=3, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
entry_add_temp_max_permissivel = tk.Entry(
font=("Helvetica", 15),
master=frame_info_malha,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_add_temp_max_permissivel.grid(row=2, column=4, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# BOTÃO ADICIONAR
def __add_butt_salvar():
icc = float(entry_add_icc.get())
print('\n\nIcc = ', icc)
imalha = float(entry_add_imalha.get())
print('Imalha = ', imalha)
t_prot = float(entry_add_t_protecao.get())
print('tempo protecao = ', t_prot)
t_def = float(entry_add_t_defeito.get())
print('tempo defeito = ', t_def)
temp_amb = int(entry_add_temp_ambiente.get())
print('temperatura ambiente = ', temp_amb)
temp_max = int(entry_add_temp_max_permissivel.get())
print('temperatura maxima = ', temp_max)
self.__malha.add_icc(i_cc=icc)
self.__malha.add_i_malha(i_malha=imalha)
self.__malha.add_t_protecao(t_protecao=t_prot)
self.__malha.add_t_defeito(t_defeito=t_def)
self.__malha.add_temp_ambiente(temp_ambiente=temp_amb)
self.__malha.add_temp_max_permissivel(temp_max_permissivel=temp_max)
config_info_malha.destroy()
butt_add_salvar = tk.Button(
master=frame_info_malha,
text="Salvar!", font=("Helvetica", 12), height=2, # width=30,
bg="goldenrod",
bd=3,
command=__add_butt_salvar,
anchor=tk.CENTER,
justify=tk.CENTER,
compound=tk.CENTER,
padx=2,
pady=2,
relief=tk.GROOVE,
)
butt_add_salvar.grid(row=3, columnspan=5, padx=5, pady=5)
def __calc_fluxo_plot_tensao(self):
self.__circuito.plot_conv(tensao=True, ang=False)
def __calc_fluxo_plot_angulo(self):
self.__circuito.plot_conv(tensao=False, ang=True)
def __calc_fluxo_perdas(self):
self.__circuito.relatorio(show_tensoes=False, show_correntes=False, show_fluxo=False)
self.__circuito.perdas(show=True)
self.__text_status.set("Perdas do circuito!")
def __calc_fluxo_relatorio(self):
self.__relatorio_fluxo()
self.__text_status.set("Relatório Final!")
def __relatorio_fluxo(self): # Talvez depois colocar os resultados em um toplevel ou algo assim
config_relatorio = tk.Toplevel()
config_relatorio.title("Relatório Final do Fluxo de Potência")
config_relatorio.geometry("460x250")
config_relatorio.wm_iconbitmap("images/logo_pySEP.ico")
config_relatorio["bg"] = "light goldenrod"
frame_relatorio = tk.LabelFrame(
master=config_relatorio,
bg="light goldenrod"
)
frame_relatorio.pack(fill='both', expand=True)
>>>>>>> 7de809c (relatório e perdas)
# TÍTULO DA JANELA
label_titulo = tk.Label(
master=frame_relatorio,
anchor=tk.CENTER,
bg="light goldenrod",
justify=tk.CENTER,
padx=2,
pady=2,
text="Relatório Final do Fluxo de Potência",
font=("Helvetica", 20)
)
label_titulo.grid(row=0, columnspan=6, padx=5, pady=5)
# MOSTRAR TENSÕES: True ou False
__relatorio_tensoes = tk.BooleanVar()
_tensoes_true = tk.Radiobutton(
master=frame_relatorio,
text="Mostrar Tensões: ",
font=("Helvetica", 13),
variable=__relatorio_tensoes,
value=True,
bg="light goldenrod",
command=__relatorio_tensoes.set(True)
)
_tensoes_true.grid(row=2, column=0, sticky=tk.W)
<<<<<<< HEAD
self.__grafo_pos = nx.spring_layout(self.__grafo)
>>>>>>> 29cc7eb (.)
a = self.__teste.add_subplot(111)
a.plot([1, 2, 3, 4, 5, 6, 7], [1, 2, -1, -2, 0, 3, 4])
<<<<<<< HEAD
canvas = FigureCanvasTkAgg(self.__teste, self.__janela)
=======
def __show_grafo(self, a):
self.__frame_grafo.destroy()
self.__frame_grafo = tk.Frame(
master=self.__janela,
bg="light goldenrod"
=======
_tensoes_false = tk.Radiobutton(
master=frame_relatorio,
text=" Não Mostrar Tensões: ",
font=("Helvetica", 13),
variable=__relatorio_tensoes,
value=False,
bg="light goldenrod",
command=__relatorio_tensoes.set(True)
)
_tensoes_false.grid(row=2, column=3, sticky=tk.W)
# MOSTRAR ÂNGULOS: True ou False
__relatorio_corr = tk.BooleanVar()
_correntes_true = tk.Radiobutton(
master=frame_relatorio,
text="Mostrar Correntes",
font=("Helvetica", 13),
variable=__relatorio_corr,
value=True,
bg="light goldenrod",
command=__relatorio_corr.set(False)
)
_correntes_true.grid(row=4, column=0, sticky=tk.W)
_correntes_false = tk.Radiobutton(
master=frame_relatorio,
text="Não Mostrar Correntes",
font=("Helvetica", 13),
variable=__relatorio_corr,
value=False,
bg="light goldenrod",
command=__relatorio_corr.set(False)
>>>>>>> 7de809c (relatório e perdas)
)
_correntes_false.grid(row=4, column=3, sticky=tk.W)
# MOSTRAR FLUXO: True ou False
__relatorio_fluxo = tk.BooleanVar()
_fluxo_true = tk.Radiobutton(
master=frame_relatorio,
text="Mostrar Fluxo",
font=("Helvetica", 13),
variable=__relatorio_fluxo,
value=True,
bg="light goldenrod",
command=__relatorio_fluxo.set(False)
)
_fluxo_true.grid(row=6, column=0, sticky=tk.W)
<<<<<<< HEAD
canvas = FigureCanvasTkAgg(self.__f, master=self.__frame_grafo)
>>>>>>> fbd7d23 (.)
canvas.draw()
canvas.get_tk_widget().pack(side=tk.BOTTOM, fill=tk.BOTH, expand=True)
toolbar_grafo = NavigationToolbar2Tk(canvas, self.__janela)
canvas._tkcanvas.pack(side=tk.TOP, fill=tk.BOTH, expand=True)
def set_toolbar(self, janela_main):
toolbar = tk.Frame(janela_main, bg="goldenrod")
=======
_fluxo_false = tk.Radiobutton(
master=frame_relatorio,
text="Não Mostrar Fluxo",
font=("Helvetica", 13),
variable=__relatorio_fluxo,
value=False,
bg="light goldenrod",
command=__relatorio_fluxo.set(False)
)
_fluxo_false.grid(row=6, column=3, sticky=tk.W)
# BOTÃO ADICIONAR
def __add_butt():
info_tensoes = __relatorio_tensoes.get()
print('Mostrar tensões = ', info_tensoes)
info_corr = __relatorio_corr.get()
print('Mostrar correntes = ', info_corr)
>>>>>>> 7de809c (relatório e perdas)
info_fluxo = __relatorio_fluxo.get()
print('Mostrar Fluxo = ', info_fluxo)
self.__circuito.relatorio(
show_tensoes=info_tensoes,
show_correntes=info_corr,
show_fluxo=info_fluxo
)
print("\n\nRelatório Mostrado! ")
self.__label_logo.destroy()
config_relatorio.destroy()
butt_add = tk.Button(
master=frame_relatorio,
text="Mostrar!", font=("Helvetica", 12), height=2, width=30,
bg="goldenrod",
bd=3,
command=__add_butt,
anchor=tk.CENTER,
justify=tk.CENTER,
compound=tk.CENTER,
padx=2,
pady=2,
relief=tk.GROOVE,
)
butt_add.grid(row=8, columnspan=6, padx=5, pady=5)
def __calc_fluxo(self):
self.__config_fluxo()
self.__text_status.set("Fluxo de potência calculado!")
def __config_fluxo(self):
config_fluxo = tk.Toplevel()
config_fluxo.title("Calcular Fluxo de Potência")
config_fluxo.geometry("460x250")
config_fluxo.wm_iconbitmap("images/logo_pySEP.ico")
config_fluxo["bg"] = "light goldenrod"
frame_config = tk.LabelFrame(
master=config_fluxo,
bg="light goldenrod"
)
frame_config.pack(fill='both', expand=True)
# TÍTULO DA JANELA
label_titulo = tk.Label(
master=frame_config,
anchor=tk.CENTER,
bg="light goldenrod",
justify=tk.CENTER,
padx=2,
pady=2,
text="Calcular Fluxo de Potência",
font=("Helvetica", 20)
)
label_titulo.grid(row=0, columnspan=6, padx=5, pady=5)
# NÚMERO DA BARRA
label_erro_fluxo = tk.Label(
master=frame_config,
text="Erro de convergência: \nExemplo: 1e-2 ou 0.01",
font=("Helvetica", 15),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_erro_fluxo.grid(row=1, column=0, padx=5, pady=5, sticky=tk.W)
entry_erro_fluxo = tk.Entry(
font=("Helvetica", 15),
master=frame_config,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_erro_fluxo.focus_set()
entry_erro_fluxo.grid(row=1, column=3, padx=5, pady=5, sticky=tk.W)
# MOSTRAR ITERAÇÕES: True ou False
__show_iter = tk.BooleanVar()
_iter_true = tk.Radiobutton(
master=frame_config,
text="Mostrar Iterações",
font=("Helvetica", 13),
variable=__show_iter,
value=True,
bg="light goldenrod",
command=__show_iter.set(True)
)
_iter_true.grid(row=2, column=0, sticky=tk.W)
_iter_false = tk.Radiobutton(
master=frame_config,
text="Não Mostrar Iterações",
font=("Helvetica", 13),
variable=__show_iter,
value=False,
bg="light goldenrod",
command=__show_iter.set(False)
)
_iter_false.grid(row=2, column=3, sticky=tk.W)
# BOTÃO ADICIONAR
def __add_butt():
err_flux = float(entry_erro_fluxo.get())
print('\n\nErro iterações = ', err_flux)
show_inter = int(__show_iter.get())
print('Mostrar iterações = ', show_inter)
self.__circuito.calcular_fluxo_pot_nr(
erro=err_flux,
show=show_inter
)
print("\n\nFluxo de Potência calculado! ")
self.__circuito.showBarras()
self.__label_logo.destroy()
config_fluxo.destroy()
butt_add = tk.Button(
master=frame_config,
text="Calcular!", font=("Helvetica", 12), height=2, width=30,
bg="goldenrod",
bd=3,
command=__add_butt,
anchor=tk.CENTER,
justify=tk.CENTER,
compound=tk.CENTER,
padx=2,
pady=2,
relief=tk.GROOVE,
)
butt_add.grid(row=4, columnspan=5, padx=5, pady=5)
def __grafo_add_edge(self, list_linhas):
self.__f = Figure(figsize=(5, 4), dpi=100)
self.__grafo.add_edges_from(list_linhas)
self.__grafo_pos = nx.spring_layout(self.__grafo)
a = self.__f.add_subplot()
self.__show_grafo(a=a)
def __grafo_add_node(self, list_numBar):
self.__f = Figure(figsize=(5, 4), dpi=100)
self.__grafo.add_nodes_from(list_numBar)
self.__grafo_pos = nx.spring_layout(self.__grafo)
a = self.__f.add_subplot()
self.__show_grafo(a=a)
def __show_grafo(self, a):
self.__frame_grafo.destroy()
self.__frame_grafo = tk.Frame(
master=self.__janela,
bg="light goldenrod"
)
self.__frame_grafo.pack(fill='both', expand=True)
pesos = nx.get_edge_attributes(self.__grafo, 'z')
nx.draw_networkx(self.__grafo, self.__grafo_pos, ax=a, font_color='w', font_size=15,
node_size=700, node_color='saddlebrown', node_shape='s',
width=5, edge_color='black')
nx.draw_networkx_edge_labels(self.__grafo, self.__grafo_pos, ax=a, font_size=20,
node_size=700, node_color='saddlebrown', node_shape='s',
width=5, edge_color='black', edge_labels=pesos, font_color='black')
canvas = FigureCanvasTkAgg(self.__f, master=self.__frame_grafo)
canvas.draw()
canvas.get_tk_widget().pack(side=tk.BOTTOM, fill=tk.BOTH, expand=True)
toolbar_grafo = NavigationToolbar2Tk(canvas, self.__frame_grafo)
toolbar_grafo.update()
canvas._tkcanvas.pack(side=tk.TOP, fill=tk.BOTH, expand=True)
def set_toolbar(self, janela_main):
toolbar = tk.Frame(janela_main, bg="goldenrod")
# Adicionar Barra
add_barra = tk.Button(
master=toolbar,
text="Adicionar Novo Nó",
font=("Helvetica", 11),
relief=tk.FLAT,
bg="light goldenrod",
bd=2,
justify=tk.CENTER,
)
add_barra.bind("<Button-1>", self.__add_bar)
add_barra.pack(side=tk.LEFT, padx=2, pady=2)
# Adicionar Linha
add_linha = tk.Button(
master=toolbar,
text="Adicionar Nova Linha",
font=("Helvetica", 11),
relief=tk.FLAT,
bg="light goldenrod",
bd=2,
justify=tk.CENTER,
)
add_linha.bind("<Button-1>", self.__add_lin)
add_linha.pack(side=tk.LEFT, padx=2, pady=2)
# Adicionar Solos
add_solo = tk.Button(
master=toolbar,
text="Informações do solo",
font=("Helvetica", 11),
relief=tk.FLAT,
bg="light goldenrod",
bd=2,
justify=tk.CENTER,
)
add_solo.bind("<Button-1>", self.__add_solo)
add_solo.pack(side=tk.LEFT, padx=2, pady=2)
# Adicionar Malha
add_malha = tk.Button(
master=toolbar,
text="Informações da malha de terra",
font=("Helvetica", 11),
relief=tk.FLAT,
bg="light goldenrod",
bd=2,
justify=tk.CENTER,
)
add_malha.bind("<Button-1>", self.__add_malha)
add_malha.pack(side=tk.LEFT, padx=2, pady=2)
toolbar.pack(side=tk.TOP, fill=tk.X)
def __add_malha(self, event):
self.__config_malha()
self.__text_status.set("Adicionando informações da malha de terra! ")
def __config_malha(self):
config_malha = tk.Toplevel()
config_malha.title("Configurações da malha")
config_malha.geometry("1060x900")
config_malha.wm_iconbitmap("images/logo_pySEP.ico")
config_malha["bg"] = "light goldenrod"
frame_config = tk.Frame(
master=config_malha,
bg="light goldenrod"
)
frame_config.pack(fill='both', expand=True)
# TÍTULO DA JANELA
label_titulo = tk.Label(
master=frame_config,
anchor=tk.CENTER,
bg="light goldenrod",
justify=tk.CENTER,
padx=2,
pady=2,
text="Configurações da malha",
font=("Helvetica", 20)
)
label_titulo.grid(row=0, columnspan=10, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# Informações --> LABEL Largura da malha
label_malha_largura = tk.Label(
master=frame_config,
text="Largura da malha [m]: ",
font=("Helvetica", 12),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_malha_largura.grid(row=1, column=0, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# Informações --> ENTRY Largura da malha
entry_malha_largura = tk.Entry(
font=("Helvetica", 12),
master=frame_config,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_malha_largura.focus_set()
entry_malha_largura.grid(row=1, column=1, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# Informações --> LABEL Comprimento da malha
label_malha_comprimento = tk.Label(
master=frame_config,
text="Comprimento da malha [m]: ",
font=("Helvetica", 12),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_malha_comprimento.grid(row=1, column=2, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# Informações --> ENTRY Comprimento da malha
entry_malha_comprimento = tk.Entry(
font=("Helvetica", 12),
master=frame_config,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_malha_comprimento.grid(row=1, column=3, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# Informações --> LABEL Espaçamento da largura da malha
label_malha_esp_larg = tk.Label(
master=frame_config,
text="Espaçamento de cada haste\nno eixo X [0.05 a 0.1]: ",
font=("Helvetica", 12),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_malha_esp_larg.grid(row=2, column=0, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# Informações --> ENTRY Espaçamento da largura da malha
entry_malha_esp_larg = tk.Entry(
font=("Helvetica", 12),
master=frame_config,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_malha_esp_larg.grid(row=2, column=1, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# Informações --> LABEL Espaçamento do comprimento da malha
label_malha_esp_compr = tk.Label(
master=frame_config,
text="Espaçamento de cada haste\nno eixo Y [0.05 a 0.1]: ",
font=("Helvetica", 12),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_malha_esp_compr.grid(row=2, column=2, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# Informações --> ENTRY Espaçamento do comprimento da malha
entry_malha_esp_compr = tk.Entry(
font=("Helvetica", 12),
master=frame_config,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_malha_esp_compr.grid(row=2, column=3, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
########################################################################################################################
_frame_profundidade = tk.Frame(
master=frame_config,
bg="light goldenrod",
padx=2,
pady=2,
)
_frame_profundidade.grid(row=3, columnspan=10, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# Informações --> LABEL profundidade da malha
label_malha_profundidade = tk.Label(
master=_frame_profundidade,
text="Profundidade da malha [m]:",
font=("Helvetica", 12),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_malha_profundidade.pack(fill=tk.BOTH, side=tk.LEFT, expand=True)
# Informações --> ENTRY profundidade da malha
entry_malha_profundidade = tk.Entry(
font=("Helvetica", 12),
master=_frame_profundidade,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_malha_profundidade.pack(fill=tk.BOTH, side=tk.LEFT, expand=True)
########################################################################################################################
_labelframe_periferia = tk.LabelFrame(
master=frame_config,
text="Hastes na periferia? ", font=("Helvetica", 14),
bg="light goldenrod",
padx=2,
pady=2,
)
_labelframe_periferia.grid(row=4, columnspan=10, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# HASTES NA PERIFERIA?
__hastes_periferia = tk.BooleanVar()
_periferia_true = tk.Radiobutton(
master=_labelframe_periferia,
text="Sim: ",
font=("Helvetica", 13),
variable=__hastes_periferia,
value=True,
bg="light goldenrod",
command=__hastes_periferia.set(True)
)
_periferia_true.pack(fill=tk.BOTH, side=tk.LEFT, expand=True)
_periferia_false = tk.Radiobutton(
master=_labelframe_periferia,
text="Não: ",
font=("Helvetica", 13),
variable=__hastes_periferia,
value=False,
bg="light goldenrod",
command=__hastes_periferia.set(True)
)
_periferia_false.pack(fill=tk.BOTH, side=tk.LEFT, expand=True)
_frame_dimensoes = tk.Frame(
master=frame_config,
bg="light goldenrod",
padx=2,
pady=2,
)
_frame_dimensoes.grid(row=5, columnspan=10, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
_frame_grafo_malha = tk.Frame(
master=frame_config,
bg="light goldenrod",
padx=2,
pady=2,
)
_frame_grafo_malha.grid(row=6, columnspan=10, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
def __show_grafo(a, grafo, pos, f):
_frame_grafo_malha = tk.Frame(
master=frame_config,
bg="light goldenrod",
padx=2,
pady=2,
)
_frame_grafo_malha.grid(row=6, columnspan=10, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
nx.draw(grafo, pos, node_color='black', ax=a)
canvas = FigureCanvasTkAgg(f, master=_frame_grafo_malha)
canvas.draw()
canvas.get_tk_widget().pack(side=tk.BOTTOM, fill=tk.BOTH, expand=True)
toolbar_grafo = NavigationToolbar2Tk(canvas, _frame_grafo_malha)
toolbar_grafo.update()
canvas._tkcanvas.pack(side=tk.TOP, fill=tk.BOTH, expand=True)
# BOTÃO ADICIONAR Adicionar dimensões
def __add_butt_dimensoes():
largura = float(entry_malha_largura.get())
print('\n\nlargura malha = ', largura)
comprimento = float(entry_malha_comprimento.get())
print('\n\ncomprimento malha = ', comprimento)
esp_larg = float(entry_malha_esp_larg.get())
print('\n\nEspaçamento malha largura = ', esp_larg)
esp_compr = float(entry_malha_esp_compr.get())
print('\n\nEspaçamento malha comprimento = ', esp_compr)
profundidade = float(entry_malha_profundidade.get())
print('\n\nprofundidade malha = ', profundidade)
periferia = bool(__hastes_periferia.get())
print('\n\nHastes na periferia? ', periferia)
if periferia is True:
periferia_true = True
periferia_false = False
else:
periferia_true = False
periferia_false = True
self.__malha.add_dimensoes(
largura=largura,
comprimento=comprimento,
esp_larg=esp_larg,
esp_compr=esp_compr,
profundidade_malha=profundidade,
malha_com_hastes_na_periferia=periferia_true,
malha_sem_hastes_na_periferia=periferia_false
)
__grafo_malha = nx.Graph()
f = Figure(figsize=(5, 4), dpi=100)
a = f.add_subplot()
na = int(largura * esp_larg)
nb = int(comprimento * esp_compr)
nodes = []
for i in range(na * nb):
nodes.append(str(i + 1))
pos = dict()
cont = 0
for i in range(nb):
for j in range(na):
pos[nodes[cont]] = (j + 1, i + 1)
cont += 1
__grafo_malha.add_nodes_from(nodes)
edges = []
for i in range(na):
edges.append(
(nodes[i], nodes[(na * nb) - na + i])
)
for i in range(nb):
edges.append(
(nodes[i * na], nodes[na + (i * na) - 1])
)
__grafo_malha.add_edges_from(edges)
_frame_grafo_malha.destroy()
__show_grafo(a=a, grafo=__grafo_malha, pos=pos, f=f)
butt_add_dimensoes = tk.Button(
master=_frame_dimensoes,
text="Adicionar informações e mostrar malha de terra!", font=("Helvetica", 12), height=1, # width=10,
bg="goldenrod",
bd=3,
command=__add_butt_dimensoes,
anchor=tk.CENTER,
justify=tk.CENTER,
compound=tk.CENTER,
padx=2,
pady=2,
relief=tk.GROOVE,
)
butt_add_dimensoes.pack(fill=tk.BOTH, side=tk.LEFT, expand=True)
# BOTÃO Salvar informações
def __add_butt_salvar_malha():
config_malha.destroy()
butt_add_dimensoes = tk.Button(
master=frame_config,
text="Salvar informações da malha e sair!", font=("Helvetica", 12), height=1, # width=10,
bg="goldenrod",
bd=3,
command=__add_butt_salvar_malha,
anchor=tk.CENTER,
justify=tk.CENTER,
compound=tk.CENTER,
padx=2,
pady=2,
relief=tk.GROOVE,
)
butt_add_dimensoes.grid(row=7, columnspan=10, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
########################################################################################################################
#######################################################################################################
def __add_solo(self, event):
self.__config_solo()
self.__text_status.set("Adicionando informações do solo! ")
def __config_solo(self):
config_solo = tk.Toplevel()
config_solo.title("Configurações do solo")
config_solo.geometry("1060x900")
config_solo.wm_iconbitmap("images/logo_pySEP.ico")
config_solo["bg"] = "light goldenrod"
frame_config = tk.Frame(
master=config_solo,
bg="light goldenrod"
)
frame_config.pack(fill='both', expand=True)
# TÍTULO DA JANELA
label_titulo = tk.Label(
master=frame_config,
anchor=tk.CENTER,
bg="light goldenrod",
justify=tk.CENTER,
padx=2,
pady=2,
text="Configurações do solo",
font=("Helvetica", 20)
)
label_titulo.grid(row=0, columnspan=8, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# BOTÃO SALVAR INFORMAÇÕES SOLOS
def __add_butt():
config_solo.destroy()
butt_salvar_solos = tk.Button(
master=frame_config,
text="Salvar informações! ", font=("Helvetica", 11), height=2, width=10,
bg="goldenrod",
bd=3,
command=__add_butt,
anchor=tk.CENTER,
justify=tk.CENTER,
compound=tk.CENTER,
padx=2,
pady=2,
relief=tk.GROOVE,
)
butt_salvar_solos.grid(row=0, column=8, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# Informações --> LABEL Brita
label_brita = tk.Label(
master=frame_config,
text="Adicionar Informações da camada de Brita ",
font=("Helvetica", 20),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_brita.grid(row=1, columnspan=10, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# Informações --> LABEL Brita PROFUNDIDADE
label_brita_profundidade = tk.Label(
master=frame_config,
text="Profundidade [m]: ",
font=("Helvetica", 12),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_brita_profundidade.grid(row=2, column=0, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# Informações --> ENTRY Brita PROFUNDIDADE
entry_brita_profundidade = tk.Entry(
font=("Helvetica", 12),
master=frame_config,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_brita_profundidade.focus_set()
entry_brita_profundidade.grid(row=2, column=2, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# Informações --> LABEL Brita RESISTIVIDADE
label_brita_resistividade = tk.Label(
master=frame_config,
text="Resistividade [Ohm.m]: ",
font=("Helvetica", 12),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_brita_resistividade.grid(row=2, column=4, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# Informações --> ENTRY Brita RESISTIVIDADE
entry_brita_resistividade = tk.Entry(
font=("Helvetica", 12),
master=frame_config,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_brita_resistividade.grid(row=2, column=6, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# BOTÃO ADICIONAR BRITA
def __add_butt():
profundidade = float(entry_brita_profundidade.get())
print('\n\nprofundidade = ', profundidade)
resistividade = float(entry_brita_resistividade.get())
print('\n\nresistividade = ', resistividade)
self.__malha.add_info_brita(profundidade=profundidade,
resistividade=resistividade)
self.__malha.show_solo()
set_color_solo(profundidade=profundidade, num_camada=0, resistividade=resistividade, nome="Brita")
butt_add_brita = tk.Button(
master=frame_config,
text="Adicionar informações da camada de Brita!", font=("Helvetica", 12), height=1, # width=10,
bg="goldenrod",
bd=3,
command=__add_butt,
anchor=tk.CENTER,
justify=tk.CENTER,
compound=tk.CENTER,
padx=2,
pady=2,
relief=tk.GROOVE,
)
butt_add_brita.grid(row=2, column=8, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# Informações --> LABEL Solo n
label_solo = tk.Label(
master=frame_config,
text="Adicionar nova camada de solo: ",
font=("Helvetica", 20),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_solo.grid(row=3, columnspan=10, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# Informações --> LABEL Solo PROFUNDIDADE
label_solo_profundidade = tk.Label(
master=frame_config,
text="Profundidade [m]: ",
font=("Helvetica", 12),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_solo_profundidade.grid(row=4, column=0, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# Informações --> ENTRY Solo PROFUNDIDADE
entry_solo_profundidade = tk.Entry(
font=("Helvetica", 12),
master=frame_config,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_solo_profundidade.grid(row=4, column=2, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# Informações --> LABEL Solo RESISTIVIDADE
label_solo_resistividade = tk.Label(
master=frame_config,
text="Resistividade [Ohm.m]: ",
font=("Helvetica", 12),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_solo_resistividade.grid(row=4, column=4, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# Informações --> ENTRY Solo RESISTIVIDADE
entry_solo_resistividade = tk.Entry(
font=("Helvetica", 12),
master=frame_config,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_solo_resistividade.grid(row=4, column=6, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# BOTÃO ADICIONAR BRITA
def __add_butt():
self.__malha.set_num_solo()
num_camada = self.__malha.get_num_solo()
profundidade = float(entry_solo_profundidade.get())
print('\n\nprofundidade = ', profundidade)
resistividade = float(entry_solo_resistividade.get())
print('\n\nresistividade = ', resistividade)
self.__malha.add_info_solo(num_camada=num_camada,
profundidade=profundidade,
resistividade=resistividade)
self.__malha.show_solo()
set_color_solo(profundidade=profundidade, num_camada=num_camada, resistividade=resistividade,
nome="H" + str(num_camada))
frame_solos = tk.Frame(
master=frame_config,
bg="light goldenrod",
)
frame_solos.grid(row=5, columnspan=10, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
def set_color_solo(profundidade, resistividade, num_camada, nome):
cores = ["white", "brown", "red", "yellow", "blue", "black", "green"]
frame = tk.LabelFrame(
master=frame_solos,
width=1050,
height=profundidade * 150,
bg=cores[num_camada],
text="\t\tNome: " + str(nome) + "\t\tProfundidade: " + str(
profundidade) + " [m]\t\tResistividade: " + str(resistividade) + " [Ohm.m]",
font=("Helvetica", 12),
)
frame.pack(fill=tk.BOTH, expand=True)
butt_add_solo = tk.Button(
master=frame_config,
text="Adicionar informações da camada de Solo!", font=("Helvetica", 12), height=1, # width=10,
bg="goldenrod",
bd=3,
command=__add_butt,
anchor=tk.CENTER,
justify=tk.CENTER,
compound=tk.CENTER,
padx=2,
pady=2,
relief=tk.GROOVE,
)
butt_add_solo.grid(row=4, column=8, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
def __add_bar(self, event):
self.__config_bar()
self.__text_status.set("Adicionando uma nova barra! ")
def __s_base(self):
s_base = tk.Toplevel(master=self.__janela)
s_base.title("\tBem-vindo ao pySEP!!\t")
s_base.geometry("500x175+500+500")
s_base.wm_iconbitmap("images/logo_pySEP.ico")
s_base["bg"] = "light goldenrod"
label_s_base = tk.Label(
master=s_base,
anchor=tk.CENTER,
bg="light goldenrod",
justify=tk.CENTER,
padx=2,
pady=2,
text="Defina um valor base para o sistema em [VA]!\nInserir conforme exemplo: 100e6",
font=("Helvetica", 18)
)
label_s_base.grid(row=0, columnspan=3, padx=5, pady=5)
frame_s_base = tk.Entry(
font=("Helvetica", 15),
master=s_base,
justify=tk.CENTER, width=30,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
frame_s_base.focus_set()
frame_s_base.grid(row=1, columnspan=3, padx=5, pady=5)
def __s_base_butt():
self.__info_basic['sBase'] = float(frame_s_base.get())
self.__circuito.set_s_base(sBase=float(frame_s_base.get()))
print('Sbase = ', float(frame_s_base.get()))
s_base.destroy()
button_s_base = tk.Button(
master=s_base,
text="Vamos lá!", font=("Helvetica", 12), width=10,
bg="goldenrod",
bd=3,
command=__s_base_butt,
anchor=tk.CENTER,
justify=tk.CENTER,
compound=tk.CENTER,
padx=2,
pady=2,
)
button_s_base.grid(row=2, columnspan=3, padx=5, pady=5)
def __erro(self, mensagem):
erro = tk.Toplevel()
erro.title("\tERRO!!\t")
erro.geometry("400x250")
erro.wm_iconbitmap("images/logo_pySEP.ico")
erro["bg"] = "red"
label_erro = tk.Label(
master=erro,
anchor=tk.CENTER,
bg="red",
justify=tk.CENTER,
padx=2,
pady=2,
text=mensagem,
font=("Helvetica", 20)
)
label_erro.pack(fill='both', expand=True)
def __config_bar(self):
config_bar = tk.Toplevel()
config_bar.title("Configurações da barra " + str(self.__info_basic['nums'].get('barras')))
config_bar.geometry("1000x275")
config_bar.wm_iconbitmap("images/logo_pySEP.ico")
config_bar["bg"] = "light goldenrod"
frame_config = tk.Frame(
master=config_bar,
bg="light goldenrod"
)
frame_config.pack(fill='both', expand=True)
# TÍTULO DA JANELA
label_titulo = tk.Label(
master=frame_config,
anchor=tk.CENTER,
bg="light goldenrod",
justify=tk.CENTER,
padx=2,
pady=2,
text="Configurações da barra " + str(self.__info_basic['nums'].get('barras')),
font=("Helvetica", 20)
)
label_titulo.grid(row=0, columnspan=6, padx=5, pady=5)
# NÚMERO DA BARRA
label_num_barra = tk.Label(
master=frame_config,
text="Número da barra: ",
font=("Helvetica", 12),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_num_barra.grid(row=1, column=0, padx=5, pady=5, sticky=tk.W)
entry_num_barra = tk.Entry(
font=("Helvetica", 15),
master=frame_config,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_num_barra.focus_set()
entry_num_barra.grid(row=1, column=1, padx=5, pady=5, sticky=tk.W)
##############################################################################
label_div_1 = tk.Label(
master=frame_config,
text=" ||| ",
font=("Helvetica", 12),
justify=tk.CENTER,
bg="light goldenrod",
)
label_div_1.grid(row=1, column=2, padx=5, pady=5)
##############################################################################
# TIPO DA BARRA
__tipo_bar = tk.StringVar()
_tipo1_barra = tk.Radiobutton(
master=frame_config,
text="REF",
variable=__tipo_bar,
value="1",
bg="light goldenrod",
command=__tipo_bar.set("1")
)
_tipo1_barra.grid(row=1, column=3, sticky=tk.W)
_tipo2_barra = tk.Radiobutton(
master=frame_config,
text="PQ",
variable=__tipo_bar,
value="2",
bg="light goldenrod",
command=__tipo_bar.set("2")
)
_tipo2_barra.grid(row=1, column=4, sticky=tk.W)
_tipo3_barra = tk.Radiobutton(
master=frame_config,
text="PV",
variable=__tipo_bar,
value="3",
bg="light goldenrod",
command=__tipo_bar.set("3")
)
_tipo3_barra.grid(row=1, column=5, sticky=tk.W)
##############################################################################
label_div_2 = tk.Label(
master=frame_config,
text=" ||| ",
font=("Helvetica", 12),
justify=tk.CENTER,
bg="light goldenrod",
)
label_div_2.grid(row=2, column=2, padx=5, pady=5)
##############################################################################
# TENSÃO DA BARRA
label_tensao_barra = tk.Label(
master=frame_config,
text="Tensão da barra [pu]: ",
font=("Helvetica", 12),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_tensao_barra.grid(row=2, column=0, padx=5, pady=5, sticky=tk.W)
entry_tensao_barra = tk.Entry(
font=("Helvetica", 15),
master=frame_config,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_tensao_barra.grid(row=2, column=1, padx=5, pady=5, sticky=tk.W)
# ÂNGULO DA BARRA
label_ang_barra = tk.Label(
master=frame_config,
text="Ângulo da tensão \ndesta barra [graus]: ",
font=("Helvetica", 12),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_ang_barra.grid(row=2, column=3, padx=5, pady=5, sticky=tk.W)
entry_ang_barra = tk.Entry(
font=("Helvetica", 15),
master=frame_config,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_ang_barra.grid(row=2, column=4, padx=5, pady=5, sticky=tk.W)
# CARGA DA BARRA
label_carga_barra = tk.Label(
master=frame_config,
text="Carga desta barra (P+Qj)\nex.:100e6+50e6 [VA]: ",
font=("Helvetica", 12),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_carga_barra.grid(row=3, column=0, padx=5, pady=5, sticky=tk.W)
entry_carga_barra = tk.Entry(
font=("Helvetica", 15),
master=frame_config,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_carga_barra.grid(row=3, column=1, padx=5, pady=5, sticky=tk.W)
##############################################################################
label_div_3 = tk.Label(
master=frame_config,
text=" ||| ",
font=("Helvetica", 12),
justify=tk.CENTER,
bg="light goldenrod",
)
label_div_3.grid(row=3, column=2, padx=5, pady=5)
##############################################################################
# GERAÇÃO DA BARRA
label_geracao_barra = tk.Label(
master=frame_config,
text="Geração desta barra (P+Qj)\nex.:100e6+50e6 [VA]: ",
font=("Helvetica", 12),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_geracao_barra.grid(row=3, column=3, padx=5, pady=5, sticky=tk.W)
entry_geracao_barra = tk.Entry(
font=("Helvetica", 15),
master=frame_config,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_geracao_barra.grid(row=3, column=4, padx=5, pady=5, sticky=tk.W)
# BOTÃO ADICIONAR
def __add_butt():
num_bar = int(entry_num_barra.get())
print('\n\nnum bar = ', num_bar)
tp_bar = int(__tipo_bar.get())
print('tipo barra = ', tp_bar)
tensao_bar = float(entry_tensao_barra.get())
print('tensao bar = ', tensao_bar)
ang_bar = float(entry_ang_barra.get())
print('ang bar = ', ang_bar)
carga_bar = str(entry_carga_barra.get())
print('carga bar = ', carga_bar)
geracao_bar = str(entry_geracao_barra.get())
print('geracao bar = ', geracao_bar)
if not carga_bar.__contains__("+") and not carga_bar.__contains__("-"):
self.__erro(mensagem="INSERIR A CARGA NO FORMATO: \n P + Q OU P - Q !")
elif not geracao_bar.__contains__("+") and not geracao_bar.__contains__("-"):
self.__erro(mensagem="INSERIR A CARGA NO FORMATO: \n P + Q OU P - Q !")
else:
carga = list()
geracao = list()
if carga_bar.__contains__("+"):
carga = carga_bar.split("+")
carga = list(map(float, carga))
carga[1] *= 1j
carga = carga[0] + carga[1]
elif carga_bar.__contains__("-"):
carga = carga_bar.split("-")
carga = list(map(float, carga))
carga[1] *= 1j
carga = carga[0] + carga[1]
if geracao_bar.__contains__("+"):
geracao = geracao_bar.split("+")
geracao = list(map(float, geracao))
geracao[1] *= 1j
geracao = geracao[0] + geracao[1]
elif geracao_bar.__contains__("-"):
geracao = geracao_bar.split("-")
geracao = list(map(float, geracao))
geracao[1] *= 1j
geracao = geracao[0] + geracao[1]
self.__circuito.addBarra(
barra=num_bar,
code=tp_bar,
tensao=tensao_bar,
ang=ang_bar,
carga=carga,
geracao=geracao)
print("\n\nBarra ", self.__info_basic['nums'].get('barras'), " adicionada! ")
self.__circuito.showBarras()
self.__info_basic['nums']['barras'] += 1
<<<<<<< HEAD
self.__show_grafo()
=======
self.__grafo_add_node(list_numBar=self.__circuito.getBarras())
self.__label_logo.destroy()
>>>>>>> 61cee31 (logo adicionada)
config_bar.destroy()
butt_add = tk.Button(
master=frame_config,
text="Adicionar", font=("Helvetica", 12), height=2, width=30,
bg="goldenrod",
bd=3,
command=__add_butt,
anchor=tk.CENTER,
justify=tk.CENTER,
compound=tk.CENTER,
padx=2,
pady=2,
relief=tk.GROOVE,
)
butt_add.grid(row=4, columnspan=5, padx=5, pady=5)
def __config_lin(self):
config_lin = tk.Toplevel()
config_lin.title("Configurações de linha ")
config_lin.geometry("815x275")
config_lin.wm_iconbitmap("images/logo_pySEP.ico")
config_lin["bg"] = "light goldenrod"
frame_config = tk.LabelFrame(
master=config_lin,
bg="light goldenrod"
)
frame_config.pack(fill='both', expand=True)
# TÍTULO DA JANELA
label_titulo = tk.Label(
master=frame_config,
anchor=tk.CENTER,
bg="light goldenrod",
justify=tk.CENTER,
padx=2,
pady=2,
text="Configurações da " + str(self.__info_basic['nums'].get('linhas')) + " ª linha.",
font=("Helvetica", 20)
)
label_titulo.grid(row=0, columnspan=5, padx=5, pady=5)
# NÚMERO DA BARRA 1
label_num_barra1 = tk.Label(
master=frame_config,
text="Número da barra \nde origem: ",
font=("Helvetica", 12),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_num_barra1.grid(row=1, column=0, padx=5, pady=5, sticky=tk.W)
entry_num_barra1 = tk.Entry(
font=("Helvetica", 15),
master=frame_config,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_num_barra1.focus_set()
entry_num_barra1.grid(row=1, column=1, padx=5, pady=5, sticky=tk.W)
##############################################################################
label_div_1 = tk.Label(
master=frame_config,
text=" ||| ",
font=("Helvetica", 12),
justify=tk.CENTER,
bg="light goldenrod",
)
label_div_1.grid(row=1, column=2, padx=5, pady=5)
##############################################################################
# NÚMERO DA BARRA 2
label_num_barra2 = tk.Label(
master=frame_config,
text="Número da barra \nde destino: ",
font=("Helvetica", 12),
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_num_barra2.grid(row=1, column=3, padx=5, pady=5, sticky=tk.W)
entry_num_barra2 = tk.Entry(
font=("Helvetica", 15),
master=frame_config,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE
)
entry_num_barra2.focus_set()
entry_num_barra2.grid(row=1, column=4, padx=5, pady=5, sticky=tk.W)
# IMPEDÂNCIA DA LINHA
label_imp_linha = tk.Label(
master=frame_config,
text="Impedância da linha [pu]: \nExemplo: 0.1 + 0.2 ",
font=("Helvetica", 14),
justify=tk.CENTER,
anchor=tk.CENTER,
bd=2,
bg="light goldenrod",
)
label_imp_linha.grid(row=2, columnspan=5, padx=5, pady=5)
entry_imp_linha = tk.Entry(
font=("Helvetica", 15),
master=frame_config,
justify=tk.CENTER,
bd=2,
bg="light goldenrod",
relief=tk.GROOVE,
width=40,
)
entry_imp_linha.grid(row=3, columnspan=5, padx=5, pady=5)
# BOTÃO ADICIONAR
def __add_butt():
num_bar1 = int(entry_num_barra1.get())
print('\n\nnum bar1 = ', num_bar1)
num_bar2 = int(entry_num_barra2.get())
print('num bar2 = ', num_bar2)
z_linha = str(entry_imp_linha.get())
print('impedância = ', z_linha)
if not z_linha.__contains__("+") and not z_linha.__contains__("-"):
self.__erro(mensagem="INSERIR A IMPEDÂNCIA NO FORMATO: \n r + x OU r - x !")
else:
z = list()
if z_linha.__contains__("+"):
z = z_linha.split("+")
z = list(map(float, z))
z[1] *= 1j
z = z[0] + z[1]
elif z_linha.__contains__("-"):
z = z_linha.split("-")
z = list(map(float, z))
z[1] *= 1j
z = z[0] + z[1]
self.__circuito.addLinha(
b1=num_bar1,
b2=num_bar2,
z_ij=z)
print("\n\n", self.__info_basic['nums'].get('linhas'), "ª linha adicionada! ")
self.__circuito.showLinhas()
self.__info_basic['nums']['linhas'] += 1
self.__grafo_add_edge(list_linhas=self.__circuito.getLinhas())
self.__label_logo.destroy()
config_lin.destroy()
butt_add = tk.Button(
master=frame_config,
text="Adicionar", font=("Helvetica", 12), height=2, width=30,
bg="goldenrod",
bd=3,
command=__add_butt,
anchor=tk.CENTER,
justify=tk.CENTER,
compound=tk.CENTER,
padx=2,
pady=2,
relief=tk.GROOVE,
)
butt_add.grid(row=5, columnspan=5, padx=5, pady=5)
############################## PROTEÇÃO ########################################
# ## DESENHAR CIRCUITO DO SISTEMA :
# def __protecao_draw_ckt(self):
# config_draw_prot = tk.Toplevel()
# config_draw_prot.title("Modelagem do Circuito Considerado")
# config_draw_prot.geometry("1100x700")
# config_draw_prot.wm_iconbitmap("images/logo_pySEP.ico")
# config_draw_prot["bg"] = "light goldenrod"
#
# frame_info_draw_prot = tk.LabelFrame(
# master=config_draw_prot,
# bg="light goldenrod",
# text="Informações Preliminares",
# font=("Helvetica", 20)
# )
# frame_info_draw_prot.pack(fill='both', expand=True)
#
# # LABEL ADD Número de nós do sistema
# label_add_num_nos = tk.Label(
# master=frame_info_draw_prot,
# text="Número de Nós do Sisema: ",
# font=("Helvetica", 15),
# justify=tk.CENTER,
# bd=2,
# bg="light goldenrod",
# )
# label_add_num_nos.grid(row=0, column=0, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
#
# entry_add_num_nos = tk.Entry(
# font=("Helvetica", 15),
# master=frame_info_draw_prot,
# justify=tk.CENTER,
# bd=2,
# bg="light goldenrod",
# relief=tk.GROOVE
# )
# entry_add_num_nos.focus_set()
# entry_add_num_nos.grid(row=0, column=1, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
#
# # LABEL ADD Imalha
# label_add_imalha = tk.Label(
# master=frame_info_draw_prot,
# text="Corrente de malha [A]: ",
# font=("Helvetica", 15),
# justify=tk.CENTER,
# bd=2,
# bg="light goldenrod",
# )
# label_add_imalha.grid(row=0, column=3, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
#
# entry_add_imalha = tk.Entry(
# font=("Helvetica", 15),
# master=frame_info_malha,
# justify=tk.CENTER,
# bd=2,
# bg="light goldenrod",
# relief=tk.GROOVE
# )
# entry_add_imalha.grid(row=0, column=4, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
# # LABEL ADD tempo protecao
# label_add_t_protecao = tk.Label(
# master=frame_info_malha,
# text="Tempo da proteção [s]: ",
# font=("Helvetica", 15),
# justify=tk.CENTER,
# bd=2,
# bg="light goldenrod",
# )
# label_add_t_protecao.grid(row=1, column=0, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
#
# entry_add_t_protecao = tk.Entry(
# font=("Helvetica", 15),
# master=frame_info_malha,
# justify=tk.CENTER,
# bd=2,
# bg="light goldenrod",
# relief=tk.GROOVE
# )
# entry_add_t_protecao.grid(row=1, column=1, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
#
# # LABEL ADD tempo defeito
# label_add_t_defeito = tk.Label(
# master=frame_info_malha,
# text="Tempo do defeito [s]: ",
# font=("Helvetica", 15),
# justify=tk.CENTER,
# bd=2,
# bg="light goldenrod",
# )
# label_add_t_defeito.grid(row=1, column=3, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
#
# entry_add_t_defeito = tk.Entry(
# font=("Helvetica", 15),
# master=frame_info_malha,
# justify=tk.CENTER,
# bd=2,
# bg="light goldenrod",
# relief=tk.GROOVE
# )
# entry_add_t_defeito.grid(row=1, column=4, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
#
# # LABEL ADD temperatura ambiente
# label_add_temp_ambiente = tk.Label(
# master=frame_info_malha,
# text="Temperatura ambiente [C°]: ",
# font=("Helvetica", 15),
# justify=tk.CENTER,
# bd=2,
# bg="light goldenrod",
# )
# label_add_temp_ambiente.grid(row=2, column=0, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
#
# entry_add_temp_ambiente = tk.Entry(
# font=("Helvetica", 15),
# master=frame_info_malha,
# justify=tk.CENTER,
# bd=2,
# bg="light goldenrod",
# relief=tk.GROOVE
# )
# entry_add_temp_ambiente.grid(row=2, column=1, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
#
# # LABEL ADD temperatura máxima permissível
# label_add_temp_max_permissivel = tk.Label(
# master=frame_info_malha,
# text="Temperatura máxima permissível [C°]: ",
# font=("Helvetica", 15),
# justify=tk.CENTER,
# bd=2,
# bg="light goldenrod",
# )
# label_add_temp_max_permissivel.grid(row=2, column=3, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
#
# entry_add_temp_max_permissivel = tk.Entry(
# font=("Helvetica", 15),
# master=frame_info_malha,
# justify=tk.CENTER,
# bd=2,
# bg="light goldenrod",
# relief=tk.GROOVE
# )
# entry_add_temp_max_permissivel.grid(row=2, column=4, padx=5, pady=5, sticky=tk.W + tk.E + tk.N + tk.S)
#
# # BOTÃO ADICIONAR
# def __add_butt_salvar():
# icc = float(entry_add_icc.get())
# print('\n\nIcc = ', icc)
#
# imalha = float(entry_add_imalha.get())
# print('Imalha = ', imalha)
#
# t_prot = float(entry_add_t_protecao.get())
# print('tempo protecao = ', t_prot)
#
# t_def = float(entry_add_t_defeito.get())
# print('tempo defeito = ', t_def)
#
# temp_amb = int(entry_add_temp_ambiente.get())
# print('temperatura ambiente = ', temp_amb)
#
# temp_max = int(entry_add_temp_max_permissivel.get())
# print('temperatura maxima = ', temp_max)
#
# self.__malha.add_icc(i_cc=icc)
# self.__malha.add_i_malha(i_malha=imalha)
# self.__malha.add_t_protecao(t_protecao=t_prot)
# self.__malha.add_t_defeito(t_defeito=t_def)
# self.__malha.add_temp_ambiente(temp_ambiente=temp_amb)
# self.__malha.add_temp_max_permissivel(temp_max_permissivel=temp_max)
#
# config_info_malha.destroy()
#
# butt_add_salvar = tk.Button(
# master=frame_info_malha,
# text="Salvar!", font=("Helvetica", 12), height=2, # width=30,
# bg="goldenrod",
# bd=3,
# command=__add_butt_salvar,
# anchor=tk.CENTER,
# justify=tk.CENTER,
# compound=tk.CENTER,
# padx=2,
# pady=2,
# relief=tk.GROOVE,
# )
# butt_add_salvar.grid(row=3, columnspan=5, padx=5, pady=5)
def __add_lin(self, event):
self.__config_lin()
self.__text_status.set("Adicionando uma nova linha! ")
@staticmethod
def set_statusbar(janela_main, textvariable):
status = tk.Label(janela_main,
justify=tk.CENTER,
bd=4,
relief=tk.FLAT,
anchor=tk.W,
bg="dark goldenrod",
padx=2,
pady=2,
textvariable=textvariable)
status.pack(side=tk.BOTTOM, fill=tk.X)
@staticmethod
def set_janela(janela_main):
janela_main.title("pySEP - Python em Sistemas Elétricos de Potência!")
janela_main.geometry("1280x720+100+100")
janela_main.wm_iconbitmap("images/logo_pySEP.ico")
janela_main["bg"] = "light goldenrod"
janela_main["bd"] = 5
def bemvindo(self, event):
self.__text_status.set("Bem-vindo ao pySEP!")
| 34.646951 | 128 | 0.538437 | 8,798 | 75,565 | 4.388952 | 0.053876 | 0.027348 | 0.052209 | 0.024602 | 0.737686 | 0.706169 | 0.652665 | 0.614026 | 0.582742 | 0.518517 | 0 | 0.022681 | 0.326672 | 75,565 | 2,180 | 129 | 34.662844 | 0.736164 | 0 | 0 | 0.493099 | 0 | 0 | 0.112264 | 0.006749 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.000627 | 0.005646 | null | null | 0.025721 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 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 |
1a0f3e76c0043b76bf49d5de6c62e7758b71b1b8 | 528 | py | Python | Week-11/Week-11-Challenge-1.py | abusamrah2005/Python | b601a9daf8a5245bbcc1466d629adda43ed7c6ca | [
"Unlicense"
] | 4 | 2019-09-21T22:47:53.000Z | 2020-04-17T03:32:21.000Z | Week-11/Week-11-Challenge-1.py | abusamrah2005/Python | b601a9daf8a5245bbcc1466d629adda43ed7c6ca | [
"Unlicense"
] | null | null | null | Week-11/Week-11-Challenge-1.py | abusamrah2005/Python | b601a9daf8a5245bbcc1466d629adda43ed7c6ca | [
"Unlicense"
] | 2 | 2019-09-21T22:47:59.000Z | 2020-04-17T03:32:14.000Z | # Week-11 Challenge 1 And Extra Challenge
x = open("Week-11/Week-11-Challenge.txt", "r")
print(x.read())
x.close()
print("\n-*-*-*-*-*-*")
print("-*-*-*-*-*-*")
print("-*-*-*-*-*-*\n")
y = open("Week-11/Week-11-Challenge.txt", "a")
y.write("\nThe best way we learn anything is by practice and exercise questions ")
y = open("Week-11/Week-11-Challenge.txt", "r")
print(y.read())
y.close()
print("\n-*-*-*-*-*-*")
print("-*-*-*-*-*-*")
print("-*-*-*-*-*-*\n")
f = open("Week-11/readline.txt", "r")
print(f.readlines())
f.close | 24 | 82 | 0.5625 | 80 | 528 | 3.7125 | 0.3875 | 0.161616 | 0.20202 | 0.141414 | 0.478114 | 0.478114 | 0.329966 | 0.329966 | 0.228956 | 0 | 0 | 0.035639 | 0.096591 | 528 | 22 | 83 | 24 | 0.587002 | 0.073864 | 0 | 0.352941 | 0 | 0 | 0.536885 | 0.178279 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.529412 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
1a11664b96936a2387c4d2fccd3276105959d63c | 1,323 | py | Python | backup/guitemplates/creationchecksdialog.py | calebtrahan/KujiIn_Python | 0599d36993fa1d5988a4cf3206a12fdbe63781d8 | [
"MIT"
] | null | null | null | backup/guitemplates/creationchecksdialog.py | calebtrahan/KujiIn_Python | 0599d36993fa1d5988a4cf3206a12fdbe63781d8 | [
"MIT"
] | null | null | null | backup/guitemplates/creationchecksdialog.py | calebtrahan/KujiIn_Python | 0599d36993fa1d5988a4cf3206a12fdbe63781d8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'creationchecksdialog.ui'
#
# Created: Mon Jan 12 13:36:57 2015
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName(_fromUtf8("Dialog"))
Dialog.resize(502, 114)
self.label = QtGui.QLabel(Dialog)
self.label.setGeometry(QtCore.QRect(30, 50, 421, 20))
self.label.setAlignment(QtCore.Qt.AlignCenter)
self.label.setObjectName(_fromUtf8("label"))
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
Dialog.setWindowTitle(_translate("Dialog", "Dialog", None))
self.label.setText(_translate("Dialog", "Checking Some Stuff", None))
| 31.5 | 79 | 0.699169 | 154 | 1,323 | 5.935065 | 0.532468 | 0.049234 | 0.087527 | 0.122538 | 0.179431 | 0.179431 | 0.179431 | 0.179431 | 0.179431 | 0.179431 | 0 | 0.037418 | 0.191988 | 1,323 | 41 | 80 | 32.268293 | 0.817587 | 0.170068 | 0 | 0.230769 | 1 | 0 | 0.044077 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.192308 | false | 0 | 0.038462 | 0.115385 | 0.384615 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
1a13ce3f142e09f7a465bff4be3b55b9a8b526b8 | 9,781 | py | Python | finter/helpers.py | lwerdna/finter | e954bd505c85a5d48ab7026bce08ad458bdd57d4 | [
"Unlicense"
] | 1 | 2019-08-22T02:20:44.000Z | 2019-08-22T02:20:44.000Z | finter/helpers.py | lwerdna/finter | e954bd505c85a5d48ab7026bce08ad458bdd57d4 | [
"Unlicense"
] | 1 | 2020-06-16T19:00:29.000Z | 2020-06-16T19:00:29.000Z | finter/helpers.py | lwerdna/finter | e954bd505c85a5d48ab7026bce08ad458bdd57d4 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
import sys
import binascii
from struct import pack, unpack
###############################################################################
# color crap
###############################################################################
palette = [0xbccbde, 0xc2dde6, 0xe6e9f0, 0x431c5d, 0xe05915, 0xcdd422]
def rgbDecomp(color):
return [(color&0xFF0000)>>16, (color&0xFF00)>>8, color&0xFF]
def rgbComp(r,g,b):
return (r<<16)|(g<<8)|b;
def adjValue(color, coeff):
[r,g,b] = map(lambda x: x/255.0, rgbDecomp(color))
[h,s,v] = colorsys.rgb_to_hsv(r,g,b)
v = min(1, coeff*v)
[r,g,b] = map(lambda x: int(x*255), colorsys.hsv_to_rgb(h,s,v))
return rgbComp(r,g,b)
def adjSaturation(color, coeff):
[r,g,b] = map(lambda x: x/255.0, rgbDecomp(color))
[h,s,v] = colorsys.rgb_to_hsv(r,g,b)
s = min(1, coeff*s)
[r,g,b] = map(lambda x: int(x*255), colorsys.hsv_to_rgb(h,s,v))
return rgbComp(r,g,b)
def adjHue(color, addend):
[r,g,b] = map(lambda x: x/255.0, rgbDecomp(color))
[h,s,v] = colorsys.rgb_to_hsv(r,g,b)
h = min(1, h+addend)
[r,g,b] = map(lambda x: int(x*255), colorsys.hsv_to_rgb(h,s,v))
return rgbComp(r,g,b)
def colorFromBytes(data):
color_lookup = [ \
0x772277, 0x752277, 0x732277, 0x722378, 0x702378, 0x6F2378, 0x6D2479, 0x6B2479, \
0x6A257A, 0x68257A, 0x67257A, 0x65267B, 0x64267B, 0x62277C, 0x60277C, 0x5F277C, \
0x5D287D, 0x5C287D, 0x5A297E, 0x58297E, 0x57297E, 0x552A7F, 0x542A7F, 0x522B80, \
0x512B80, 0x4F2B80, 0x4D2C81, 0x4C2C81, 0x4A2D82, 0x492D82, 0x472D82, 0x452E83, \
0x442E83, 0x422F84, 0x412F84, 0x3F2F84, 0x3E3085, 0x3C3085, 0x3A3186, 0x393186, \
0x373186, 0x363287, 0x343287, 0x333388, 0x323388, 0x313389, 0x30348A, 0x2F348B, \
0x2F348B, 0x2E358C, 0x2D358D, 0x2C368E, 0x2B368F, 0x2B368F, 0x2A3790, 0x293791, \
0x283892, 0x273893, 0x273893, 0x263994, 0x253995, 0x243A96, 0x233A97, 0x233A97, \
0x223B98, 0x213B99, 0x203C9A, 0x203C9A, 0x1F3C9B, 0x1E3D9C, 0x1D3D9D, 0x1C3E9E, \
0x1C3E9E, 0x1B3E9F, 0x1A3FA0, 0x193FA1, 0x1840A2, 0x1840A2, 0x1740A3, 0x1641A4, \
0x1541A5, 0x1442A6, 0x1442A6, 0x1342A7, 0x1243A8, 0x1143A9, 0x1144AA, 0x1246A6, \
0x1448A2, 0x154B9F, 0x174D9B, 0x184F98, 0x1A5294, 0x1C5491, 0x1D568D, 0x1F5989, \
0x205B86, 0x225E82, 0x23607F, 0x25627B, 0x276578, 0x286774, 0x2A6971, 0x2B6C6D, \
0x2D6E69, 0x2F7166, 0x307362, 0x32755F, 0x33785B, 0x357A58, 0x367C54, 0x387F51, \
0x3A814D, 0x3B8449, 0x3D8646, 0x3E8842, 0x408B3F, 0x428D3B, 0x438F38, 0x459234, \
0x469431, 0x48972D, 0x499929, 0x4B9B26, 0x4D9E22, 0x4EA01F, 0x50A21B, 0x51A518, \
0x53A714, 0x55AA11, 0x58A510, 0x5CA110, 0x609D0F, 0x64990F, 0x67950E, 0x6B910E, \
0x6F8D0E, 0x73890D, 0x77850D, 0x7A810C, 0x7E7D0C, 0x82790C, 0x86750B, 0x8A710B, \
0x8D6D0A, 0x91690A, 0x95650A, 0x996109, 0x9C5D09, 0xA05908, 0xA45508, 0xA85008, \
0xAC4C07, 0xAF4807, 0xB34406, 0xB74006, 0xBB3C06, 0xBF3805, 0xC23405, 0xC63004, \
0xCA2C04, 0xCE2804, 0xD12403, 0xD52003, 0xD91C02, 0xDD1802, 0xE11402, 0xE41001, \
0xE80C01, 0xEC0800, 0xF00400, 0xF40000, 0xF40500, 0xF40A00, 0xF41001, 0xF51501, \
0xF51B02, 0xF52002, 0xF52503, 0xF62B03, 0xF63004, 0xF63604, 0xF63B05, 0xF74005, \
0xF74606, 0xF74B06, 0xF75107, 0xF85607, 0xF85B08, 0xF86108, 0xF86609, 0xF96C09, \
0xF9710A, 0xF9760A, 0xFA7C0A, 0xFA810B, 0xFA870B, 0xFA8C0C, 0xFB910C, 0xFB970D, \
0xFB9C0D, 0xFBA20E, 0xFCA70E, 0xFCAC0F, 0xFCB20F, 0xFCB710, 0xFDBD10, 0xFDC211, \
0xFDC711, 0xFDCD12, 0xFED212, 0xFED813, 0xFEDD13, 0xFFE314, 0xFEE319, 0xFEE41F, \
0xFEE524, 0xFEE52A, 0xFEE62F, 0xFEE735, 0xFEE73B, 0xFEE840, 0xFEE946, 0xFEE94B, \
0xFEEA51, 0xFEEB57, 0xFEEB5C, 0xFEEC62, 0xFEED67, 0xFEED6D, 0xFEEE73, 0xFEEF78, \
0xFEEF7E, 0xFEF083, 0xFEF189, 0xFEF18F, 0xFEF294, 0xFEF39A, 0xFEF39F, 0xFEF4A5, \
0xFEF5AB, 0xFEF5B0, 0xFEF6B6, 0xFEF7BB, 0xFEF7C1, 0xFEF8C7, 0xFEF9CC, 0xFEF9D2, \
0xFEFAD7, 0xFEFBDD, 0xFEFBE3, 0xFEFCE8, 0xFEFDEE, 0xFEFDF3, 0xFEFEF9, 0xFEFFFF \
]
avg = int(round(sum(map(ord, list(data))) / len(data)))
assert avg >= 0 and avg <= 255
return color_lookup[avg]
def colorFromBytesFP(FP, length, rewind=0):
tmp = FP.tell()
result = colorFromBytes(FP.read(length));
if rewind: FP.seek(tmp)
return result
###############################################################################
# FP conveniences
###############################################################################
def IsEof(FP):
answer = False
temp = FP.tell()
if FP.read() == b'':
answer = True
FP.seek(temp)
return answer
def peek(FP, amt):
value = FP.read(amt)
FP.seek(-amt, 1)
return value
def rewind(FP, amt):
FP.seek(-amt, 1)
###############################################################################
# endianness
###############################################################################
# default to little-endian
fmtu8 = '<B'
fmt8 = '<b'
fmtu16 = '<H'
fmt16 = '<h'
fmtu32 = '<I'
fmt32 = '<i'
fmtu64 = '<Q'
fmt64 = '<q'
def setLittleEndian():
global fmt8, fmtu8, fmt16, fmtu16
global fmt32, fmtu32, fmt64, fmtu64
fmtu8 = '<B'
fmt8 = '<b'
fmtu16 = '<H'
fmt16 = '<h'
fmtu32 = '<I'
fmt32 = '<i'
fmtu64 = '<Q'
fmt64 = '<q'
def setBigEndian():
global fmt8, fmtu8, fmt16, fmtu16
global fmt32, fmtu32, fmt64, fmtu64
fmtu8 = '>B'
fmt8 = '>b'
fmtu16 = '>H'
fmt16 = '>h'
fmtu32 = '>I'
fmt32 = '>i'
fmtu64 = '>Q'
fmt64 = '>q'
###############################################################################
# data accessors
###############################################################################
def int8(FP, peek=0):
global fmt8
value = unpack(fmt8, FP.read(1))[0]
if peek: FP.seek(-1,1)
return value
def uint8(FP, peek=0):
global fmtu8
value = unpack(fmtu8, FP.read(1))[0]
if peek: FP.seek(-1,1)
return value
def int16(FP, peek=0):
global fmt16
value = unpack(fmt16, FP.read(2))[0]
if peek: FP.seek(-2,1)
return value
def uint16(FP, peek=0):
global fmtu16
value = unpack(fmtu16, FP.read(2))[0]
if peek: FP.seek(-2,1)
return value
def int32(FP, peek=0):
global fmt32
value = unpack(fmt32, FP.read(4))[0]
if peek: FP.seek(-4,1)
return value
def uint32(FP, peek=0):
global fmtu32
value = unpack(fmtu32, FP.read(4))[0]
if peek: FP.seek(-4,1)
return value
def int64(FP, peek=0):
global fmt64
value = unpack(fmt64, FP.read(8))[0]
if peek: FP.seek(-8,1)
return value
def uint64(FP, peek=0):
global fmtu64
value = unpack(fmtu64, FP.read(8))[0]
if peek: FP.seek(-8,1)
return value
def uleb128(FP, peek=0):
anchor = FP.tell()
nbytes = 0
value = 0
while 1:
if nbytes > 6:
FP.seek(anchor)
sample = binascii.hexlify(FP.read(5))
raise Exception("invalid uleb128 at offs=0x%X %s..." % (anchor, sample))
t = unpack('B', FP.read(1))[0]
value = value | ((t & 0x7F)<<(7*nbytes))
nbytes += 1
if not (t & 0x80):
break
if peek:
FP.seek(anchor)
return (value, nbytes)
# strings (eats trailing nulls)
def string(FP, length, peek=0):
binary = FP.read(length).rstrip(b'\x00')
if peek: FP.seek(-1*length, 1)
return binary.decode('utf-8')
def string_null(FP, peek=0):
buf = b''
while not buf.endswith(b'\x00'):
buf += FP.read(1)
if peek: FP.seek(-1*len(buf), 1)
return buf[0:-1].decode('utf-8')
#
def dataUntil(FP, terminator, peek=0):
data = b''
lenterm = len(terminator)
while 1:
data += FP.read(1)
if len(data) >= lenterm:
if data[-lenterm:] == terminator:
break
if peek: FP.seek(-len(data), 1)
return data
###############################################################################
# taggers
###############################################################################
def tag(FP, length, comment, rewind=0):
pos = FP.tell()
val = FP.read(length)
print('[0x%X,0x%X) %s' % (pos, pos+length, comment))
if rewind: FP.seek(pos)
return val
def tagUint8(FP, name, comment='', peek=0):
pos = FP.tell()
val = uint8(FP, peek)
print('[0x%X,0x%X) %s=0x%X %s' % (pos, pos+1, name, val, comment))
return val
def tagUint16(FP, name, comment='', peek=0):
pos = FP.tell()
val = uint16(FP, peek)
print('[0x%X,0x%X) %s=0x%X %s' % (pos, pos+2, name, val, comment))
return val
def tagUint32(FP, name, comment='', peek=0):
pos = FP.tell()
val = uint32(FP, peek)
print('[0x%X,0x%X) %s=0x%X %s' % (pos, pos+4, name, val, comment))
return val
def tagUint64(FP, name, comment='', peek=0):
pos = FP.tell()
val = uint64(FP, peek)
print('[0x%X,0x%X) %s=0x%X %s' % (pos, pos+8, name, val, comment))
return val
def tagUleb128(FP, comment, peek=0):
pos = FP.tell()
(val,length) = uleb128(FP, peek)
print('[0x%X,0x%X) %s=0x%X' % (pos, pos+length, comment, val))
return val
def tagString(FP, length, comment, peek=0):
pos = FP.tell()
val = string(FP, length, peek)
print('[0x%X,0x%X) %s=\"%s\"' % (pos, pos+length, comment, val))
return val
def tagDataUntil(FP, term, comment, peek=0):
pos = FP.tell()
data = dataUntil(FP, term, peek)
print('[0x%X,0x%X) %s' % (pos, pos+len(data), comment))
return data
###############################################################################
# main
###############################################################################
if __name__ == '__main__':
sys.exit(-1)
| 32.280528 | 89 | 0.559554 | 1,209 | 9,781 | 4.507858 | 0.33995 | 0.01211 | 0.007156 | 0.026422 | 0.290459 | 0.269725 | 0.246789 | 0.23211 | 0.213028 | 0.191009 | 0 | 0.206272 | 0.204478 | 9,781 | 302 | 90 | 32.387417 | 0.494152 | 0.014416 | 0 | 0.318966 | 0 | 0 | 0.030523 | 0 | 0 | 0 | 0.244414 | 0 | 0.00431 | 1 | 0.137931 | false | 0 | 0.012931 | 0.008621 | 0.275862 | 0.034483 | 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 |
1a1d3d9e95c93601968362551c5458c497c9c24f | 111 | py | Python | images/backer/src/lib/django_webpack/__init__.py | elston/djangit | 1d9ec2e287447fa8926a6fc440469771120df6a1 | [
"MIT"
] | null | null | null | images/backer/src/lib/django_webpack/__init__.py | elston/djangit | 1d9ec2e287447fa8926a6fc440469771120df6a1 | [
"MIT"
] | null | null | null | images/backer/src/lib/django_webpack/__init__.py | elston/djangit | 1d9ec2e287447fa8926a6fc440469771120df6a1 | [
"MIT"
] | null | null | null | __author__ = 'Den Elston'
__version__ = '0.0.1'
default_app_config = 'django_webpack.apps.DjangoWebpackConfig' | 27.75 | 62 | 0.792793 | 14 | 111 | 5.5 | 0.928571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.029703 | 0.09009 | 111 | 4 | 62 | 27.75 | 0.732673 | 0 | 0 | 0 | 0 | 0 | 0.482143 | 0.348214 | 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 |
a7dee417ff698d00a4fc5bfec002a942ae7c6887 | 614 | py | Python | setup.py | michamos/filltex | e23cf57d3686742f5e1fa078aa03c965bf79984d | [
"MIT"
] | null | null | null | setup.py | michamos/filltex | e23cf57d3686742f5e1fa078aa03c965bf79984d | [
"MIT"
] | null | null | null | setup.py | michamos/filltex | e23cf57d3686742f5e1fa078aa03c965bf79984d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from distutils.core import setup
setup(name = 'filltex',
version = '1.3.1',
description = 'Automatic queries to ADS and InSPIRE databases to fill LATEX bibliography',
long_description="See: `github.com/dgerosa/filltex <https://github.com/dgerosa/filltex>`_." ,
author = 'Davide Gerosa and Michele Vallisneri',
author_email = 'dgerosa@caltech.edu',
url = 'https://github.com/dgerosa/filltex',
license='MIT',
py_modules = ['fillbib'],
scripts = ['bin/fillbib','bin/filltex'],
include_package_data=True,
zip_safe=False
)
| 34.111111 | 99 | 0.656352 | 74 | 614 | 5.351351 | 0.716216 | 0.068182 | 0.121212 | 0.174242 | 0.141414 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006148 | 0.205212 | 614 | 17 | 100 | 36.117647 | 0.805328 | 0.032573 | 0 | 0 | 0 | 0.071429 | 0.468803 | 0.045531 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.071429 | 0 | 0.071429 | 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 |
a7f196132b6b6c3fc3e5320ba4d3a427e87ce6e4 | 9,730 | py | Python | src/portals/admins/ai_utils.py | JhonyDev/AudioToText | fe42904cd404580de65bfd66fd2168c03b9af296 | [
"MIT"
] | null | null | null | src/portals/admins/ai_utils.py | JhonyDev/AudioToText | fe42904cd404580de65bfd66fd2168c03b9af296 | [
"MIT"
] | null | null | null | src/portals/admins/ai_utils.py | JhonyDev/AudioToText | fe42904cd404580de65bfd66fd2168c03b9af296 | [
"MIT"
] | null | null | null | # import os
#
# from keras.models import load_model
# # from cocognite import settings
# import numpy as np
# import librosa
#
# BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
import random
DATASET = """
ability
able
about
above
accept
according
account
across
act
action
activity
actually
add
address
administration
admit
adult
affect
after
again
against
age
agency
agent
ago
agree
agreement
ahead
air
all
allow
almost
alone
along
already
also
although
always
American
among
amount
analysis
and
animal
another
answer
any
anyone
anything
appear
apply
approach
area
argue
arm
around
arrive
art
article
artist
as
ask
assume
at
attack
attention
attorney
audience
author
authority
available
avoid
away
baby
back
bad
bag
ball
bank
bar
base
be
beat
beautiful
because
become
bed
before
begin
behavior
behind
believe
benefit
best
better
between
beyond
big
bill
billion
bit
black
blood
blue
board
body
book
born
both
box
boy
break
bring
brother
budget
build
building
business
but
buy
by
call
camera
campaign
can
cancer
candidate
capital
car
card
care
career
carry
case
catch
cause
cell
center
central
century
certain
certainly
chair
challenge
chance
change
character
charge
check
child
choice
choose
church
citizen
city
civil
claim
class
clear
clearly
close
coach
cold
collection
college
color
come
commercial
common
community
company
compare
computer
concern
condition
conference
Congress
consider
consumer
contain
continue
control
cost
could
country
couple
course
court
cover
create
crime
cultural
culture
cup
current
customer
cut
dark
data
daughter
day
dead
deal
death
debate
decade
decide
decision
deep
defense
degree
Democrat
democratic
describe
design
despite
detail
determine
develop
development
die
difference
different
difficult
dinner
direction
director
discover
discuss
discussion
disease
do
doctor
dog
door
down
draw
dream
drive
drop
drug
during
each
early
east
easy
eat
economic
economy
edge
education
effect
effort
eight
either
election
else
employee
end
energy
enjoy
enough
enter
entire
environment
environmental
especially
establish
even
evening
event
ever
every
everybody
everyone
everything
evidence
exactly
example
executive
exist
expect
experience
expert
explain
eye
face
fact
factor
fail
fall
family
far
fast
father
fear
federal
feel
feeling
few
field
fight
figure
fill
film
final
finally
financial
find
fine
finger
finish
fire
firm
first
fish
five
floor
fly
focus
follow
food
foot
for
force
foreign
forget
form
former
forward
four
free
friend
from
front
full
fund
future
game
garden
gas
general
generation
get
girl
give
glass
go
goal
good
government
great
green
ground
group
grow
growth
guess
gun
guy
hair
half
hand
hang
happen
happy
hard
have
he
head
health
hear
heart
heat
heavy
help
her
here
herself
high
him
himself
his
history
hit
hold
home
hope
hospital
hot
hotel
hour
house
how
however
huge
human
hundred
husband
I
idea
identify
if
image
imagine
impact
important
improve
in
include
including
increase
indeed
indicate
individual
industry
information
inside
instead
institution
interest
interesting
international
interview
into
investment
involve
issue
it
item
its
itself
job
join
just
keep
key
kid
kill
kind
kitchen
know
knowledge
land
language
large
last
late
later
laugh
law
lawyer
lay
lead
leader
learn
least
leave
left
leg
legal
less
let
letter
level
lie
life
light
like
likely
line
list
listen
little
live
local
long
look
lose
loss
lot
love
low
machine
magazine
main
maintain
major
majority
make
man
manage
management
manager
many
market
marriage
material
matter
may
maybe
me
mean
measure
media
medical
meet
meeting
member
memory
mention
message
method
middle
might
military
million
mind
minute
miss
mission
model
modern
moment
money
month
more
morning
most
mother
mouth
move
movement
movie
Mr
Mrs
much
music
must
my
myself
name
nation
national
natural
nature
near
nearly
necessary
need
network
never
new
news
newspaper
next
nice
night
no
none
nor
north
not
note
nothing
notice
now
n't
number
occur
of
off
offer
office
officer
official
often
oh
oil
ok
old
on
once
one
only
onto
open
operation
opportunity
option
or
order
organization
other
others
our
out
outside
over
own
owner
page
pain
painting
paper
parent
part
participant
particular
particularly
partner
party
pass
past
patient
pattern
pay
peace
people
per
perform
performance
perhaps
period
person
personal
phone
physical
pick
picture
piece
place
plan
plant
play
player
PM
point
police
policy
political
politics
poor
popular
population
position
positive
possible
power
practice
prepare
present
president
pressure
pretty
prevent
price
private
probably
problem
process
produce
product
production
professional
professor
program
project
property
protect
prove
provide
public
pull
purpose
push
put
quality
question
quickly
quite
race
radio
raise
range
rate
rather
reach
read
ready
real
reality
realize
really
reason
receive
recent
recently
recognize
record
red
reduce
reflect
region
relate
relationship
religious
remain
remember
remove
report
represent
Republican
require
research
resource
respond
response
responsibility
rest
result
return
reveal
rich
right
rise
risk
road
rock
role
room
rule
run
safe
same
save
say
scene
school
science
scientist
score
sea
season
seat
second
section
security
see
seek
seem
sell
send
senior
sense
series
serious
serve
service
set
seven
several
sex
sexual
shake
share
she
shoot
short
shot
should
shoulder
show
side
sign
significant
similar
simple
simply
since
sing
single
sister
sit
site
situation
six
size
skill
skin
small
smile
so
social
society
soldier
some
somebody
someone
something
sometimes
son
song
soon
sort
sound
source
south
southern
space
speak
special
specific
speech
spend
sport
spring
staff
stage
stand
standard
star
start
state
statement
station
stay
step
still
stock
stop
store
story
strategy
street
strong
structure
student
study
stuff
style
subject
success
successful
such
suddenly
suffer
suggest
summer
support
sure
surface
system
table
take
talk
task
tax
teach
teacher
team
technology
television
tell
ten
tend
term
test
than
thank
that
the
their
them
themselves
then
theory
there
these
they
thing
think
third
this
those
though
thought
thousand
threat
three
through
throughout
throw
thus
time
to
today
together
tonight
too
top
total
tough
toward
town
trade
traditional
training
travel
treat
treatment
tree
trial
trip
trouble
true
truth
try
turn
TV
two
type
under
understand
unit
until
up
upon
us
use
usually
value
various
very
victim
view
violence
visit
voice
vote
wait
walk
wall
want
war
watch
water
way
we
weapon
wear
week
weight
well
west
western
what
whatever
when
where
whether
which
while
white
who
whole
whom
whose
why
wide
wife
will
win
wind
window
wish
with
within
without
woman
wonder
word
work
worker
world
worry
would
write
writer
wrong
yard
yeah
year
yes
yet
you
young
your
yourself
"""
classes = DATASET.split()
import os
import librosa
import IPython.display as ipd
import matplotlib.pyplot as plt
import numpy as np
from cocognite import settings
from scipy.io import wavfile
import warnings
import pickle
from pydub import AudioSegment
from pydub.utils import make_chunks
from sklearn.preprocessing import LabelEncoder
from keras.models import load_model
warnings.filterwarnings("ignore")
# define all the labels here
labels = classes
# here outfile is the label file of all the dataset
with open('C:\\Users\\Jhony Dev\\Desktop\\a2tc\\src\\portals\\admins\\outfile', 'rb') as fp:
all_label = pickle.load(fp)
le = LabelEncoder()
y = le.fit_transform(all_label)
classes = list(le.classes_)
# create a folder called chunks which will save chunks of large audio file
folder_name = "chunks"
def concatenate(list_strings):
transcript = ''
for string in list_strings:
transcript += f'{string} '
return transcript
def prediction_filter(list_strings):
return settings.predict_audio_transcription(list_strings)
# pick audio file from directory change test.wav to something else
def make_prediction_on_file(file):
print("CLASSES LENGTH")
print(len(classes))
print(classes)
myaudio = AudioSegment.from_file(file, "wav")
# pydub calculates in millisec
chunk_length_ms = 1000
# Make chunks of one sec
chunks = make_chunks(myaudio, chunk_length_ms)
# create folder is its not created
if not os.path.isdir(folder_name):
os.mkdir(folder_name)
# iterate through the chunks
list_words = []
try:
list_words = set(DATASET.split()).intersection(prediction_filter(file).split())
return concatenate(list_words)
except:
pass
for i, chunk in enumerate(chunks):
chunk_name = "chunk{0}.wav".format(i)
# Export all of the individual chunks as wav files and feed each chunk to model
chunk.export(f"{folder_name}/{chunk_name}", format="wav")
samples, sample_rate = librosa.load(f'{folder_name}/{chunk_name}', sr=16000)
samples = librosa.resample(samples, sample_rate, 8000)
ipd.Audio(samples, rate=8000)
# here try catch is used because we do not want model to give error when a chunk is less than 1 sec
# ideally last chunk of every file can be shorter than 1 sec which will cause error
try:
# load model
model = load_model('C:\\Users\\Jhony Dev\\Desktop\\a2tc\\sound_model.h5')
# reashape the file
prob = model.predict(samples.reshape(1, 8000, 1))
# convert confidence to one max value of a class
index = np.argmax(prob[0])
# send it to classes list to map the predicted class
print(classes[index])
list_words.append(classes[index])
except:
string = classes[random.randint(0, 29)]
list_words.append(string)
return concatenate(list_words)
| 8.829401 | 107 | 0.795683 | 1,446 | 9,730 | 5.321577 | 0.776625 | 0.007018 | 0.003899 | 0.005458 | 0.023652 | 0.014295 | 0 | 0 | 0 | 0 | 0 | 0.004111 | 0.174923 | 9,730 | 1,101 | 108 | 8.837421 | 0.95441 | 0.091881 | 0 | 0.007533 | 0 | 0 | 0.76552 | 0.015322 | 0 | 1 | 0 | 0 | 0 | 1 | 0.002825 | false | 0.001883 | 0.014124 | 0.000942 | 0.021657 | 0.003766 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
a7f6308b343a30b77a7c1607e5060792c8d9cb9d | 1,990 | py | Python | shop/models.py | ihfazhillah/myshop-django | ccfc079da073f2872a3aac0f632f581025bb4c2c | [
"MIT"
] | null | null | null | shop/models.py | ihfazhillah/myshop-django | ccfc079da073f2872a3aac0f632f581025bb4c2c | [
"MIT"
] | 9 | 2020-06-05T19:01:16.000Z | 2022-03-11T23:29:05.000Z | shop/models.py | ihfazhillah/myshop-django | ccfc079da073f2872a3aac0f632f581025bb4c2c | [
"MIT"
] | null | null | null | from django.db import models
from django.core.urlresolvers import reverse
from parler.models import TranslatableModel, TranslatedFields
from parler.managers import TranslatableQuerySet, TranslatableManager
# Create your models here.
class Category(TranslatableModel):
translations = TranslatedFields(
name = models.CharField(max_length=255,
db_index=True),
slug = models.SlugField(unique=True,
max_length=255,
db_index=True)
)
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('shop:product-list-by-category', args=[self.slug])
class Meta:
# ordering = ('name',)
verbose_name = 'category'
verbose_name_plural = 'categories'
class AvailableProductManager(TranslatableManager):
def all(self):
return self.get_queryset().filter(is_available=True)
class Product(TranslatableModel):
category = models.ForeignKey(Category, related_name='products')
image = models.ImageField(upload_to='products/%Y/%m/%d',
blank=True)
translations = TranslatedFields(
slug = models.CharField(max_length=255,
db_index=True),
name = models.CharField(max_length=255, db_index=True),
description = models.TextField()
)
price = models.DecimalField(max_digits=10, decimal_places=2)
stock = models.PositiveIntegerField()
is_available = models.BooleanField(default=True)
created = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
available = AvailableProductManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('shop:product-detail', args=[self.id, self.slug])
class Meta:
pass
ordering = ('-created', )
# index_together = (('id', 'slug'),)
| 30.151515 | 73 | 0.644724 | 205 | 1,990 | 6.092683 | 0.42439 | 0.040032 | 0.038431 | 0.044836 | 0.226581 | 0.226581 | 0.208167 | 0.208167 | 0.177742 | 0.110488 | 0 | 0.010135 | 0.256281 | 1,990 | 65 | 74 | 30.615385 | 0.833784 | 0.040201 | 0 | 0.266667 | 0 | 0 | 0.051969 | 0.015223 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0.022222 | 0.088889 | 0.111111 | 0.644444 | 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 |
a7ff6c24c9fd205cc6ec40856abdba9560bd1fd1 | 297 | py | Python | pokedex/pokemon/serializers.py | arpradhan/django-pokedex | 77e154bc0b38e6cf9a75dc3cafd0605ea0f0bb8e | [
"MIT"
] | null | null | null | pokedex/pokemon/serializers.py | arpradhan/django-pokedex | 77e154bc0b38e6cf9a75dc3cafd0605ea0f0bb8e | [
"MIT"
] | null | null | null | pokedex/pokemon/serializers.py | arpradhan/django-pokedex | 77e154bc0b38e6cf9a75dc3cafd0605ea0f0bb8e | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import Pokemon
class PokemonSerializer(serializers.ModelSerializer):
class Meta:
model = Pokemon
fields = ('id', 'identifier', 'species_id', 'height',
'weight', 'base_experience', 'order', 'is_default',)
| 27 | 70 | 0.6633 | 29 | 297 | 6.655172 | 0.793103 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.222222 | 297 | 10 | 71 | 29.7 | 0.835498 | 0 | 0 | 0 | 0 | 0 | 0.215488 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.285714 | 0 | 0.571429 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
c5116971e8f23e35ce418f438a83710d53732754 | 1,086 | py | Python | Lib/site-packages/deriva/qt/__init__.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | null | null | null | Lib/site-packages/deriva/qt/__init__.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | Lib/site-packages/deriva/qt/__init__.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | null | null | null | __version__ = "1.5.0"
from deriva.qt.common.async_task import async_execute, Task
from deriva.qt.common.log_widget import QPlainTextEditLogger
from deriva.qt.common.table_widget import TableWidget
from deriva.qt.common.json_editor import JSONEditor
from deriva.qt.auth_agent.ui.auth_window import AuthWindow
from deriva.qt.auth_agent.ui.embedded_auth_window import EmbeddedAuthWindow
from deriva.qt.upload_gui.ui.upload_window import UploadWindow
from deriva.qt.upload_gui.deriva_upload_gui import DerivaUploadGUI
import os
import sys
if sys.platform == "darwin":
if getattr(sys, "frozen", False) and getattr(sys, "executable", False):
executableDir = os.path.join(os.path.dirname(sys.executable))
webEngineProcessLocation = os.path.join(executableDir, 'lib', 'PyQt5', 'Qt5', 'lib',
'QtWebEngineCore.framework', 'Helpers', 'QtWebEngineProcess.app',
'Contents', 'MacOS', 'QtWebEngineProcess')
os.environ['QTWEBENGINEPROCESS_PATH'] = webEngineProcessLocation
| 45.25 | 113 | 0.719153 | 128 | 1,086 | 5.945313 | 0.445313 | 0.105125 | 0.12615 | 0.094612 | 0.115637 | 0.060447 | 0 | 0 | 0 | 0 | 0 | 0.005643 | 0.184162 | 1,086 | 23 | 114 | 47.217391 | 0.853273 | 0 | 0 | 0 | 0 | 0 | 0.137201 | 0.064457 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.555556 | 0 | 0.555556 | 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 |
c523a6569db03d3c2b4a3ca02ec0f8ef631fb9fa | 491 | py | Python | traffic_control/migrations/0006_remove_has_rumble_strips.py | City-of-Helsinki/city-infrastructure-platform | c14513a9e54405412085f1047f91ec58b263eac0 | [
"CC0-1.0"
] | 2 | 2020-11-23T22:08:58.000Z | 2022-03-02T13:13:20.000Z | traffic_control/migrations/0006_remove_has_rumble_strips.py | City-of-Helsinki/city-infrastructure-platform | c14513a9e54405412085f1047f91ec58b263eac0 | [
"CC0-1.0"
] | 170 | 2019-12-31T13:37:04.000Z | 2022-03-12T14:03:35.000Z | traffic_control/migrations/0006_remove_has_rumble_strips.py | City-of-Helsinki/city-infrastructure-platform | c14513a9e54405412085f1047f91ec58b263eac0 | [
"CC0-1.0"
] | 3 | 2020-05-08T05:58:02.000Z | 2022-03-15T16:07:25.000Z | # Generated by Django 2.2.13 on 2020-06-29 08:26
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("traffic_control", "0005_trafficcontroldevicetype_type"),
]
operations = [
migrations.RemoveField(
model_name="roadmarkingplan",
name="has_rumble_strips",
),
migrations.RemoveField(
model_name="roadmarkingreal",
name="has_rumble_strips",
),
]
| 22.318182 | 66 | 0.613035 | 46 | 491 | 6.347826 | 0.695652 | 0.143836 | 0.178082 | 0.205479 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.057143 | 0.287169 | 491 | 21 | 67 | 23.380952 | 0.777143 | 0.093686 | 0 | 0.4 | 1 | 0 | 0.255079 | 0.076749 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.066667 | 0 | 0.266667 | 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 |
c5412ccdab7d0c125562ec2ec1a52c06d757052f | 255 | py | Python | Python/Sets/Set .difference() Operation/solution.py | oleg-cherednik/hackerrank | a76580e300ad7af248ad7c7d6839777e554cc379 | [
"Apache-2.0"
] | 7 | 2020-04-02T16:18:46.000Z | 2021-02-12T14:06:44.000Z | Python/Sets/Set .difference() Operation/solution.py | oleg-cherednik/HackerRank | a76580e300ad7af248ad7c7d6839777e554cc379 | [
"Apache-2.0"
] | null | null | null | Python/Sets/Set .difference() Operation/solution.py | oleg-cherednik/HackerRank | a76580e300ad7af248ad7c7d6839777e554cc379 | [
"Apache-2.0"
] | 11 | 2020-05-06T08:28:43.000Z | 2021-12-08T17:25:45.000Z | #!/bin/python3
if __name__ == '__main__':
n = int(input())
english = list(map(int, input().split(' ')))
b = int(input())
french = list(map(int, input().split(' ')))
students = set(english).difference(french)
print(len(students))
| 23.181818 | 48 | 0.584314 | 31 | 255 | 4.548387 | 0.612903 | 0.22695 | 0.141844 | 0.212766 | 0.283688 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004902 | 0.2 | 255 | 10 | 49 | 25.5 | 0.686275 | 0.05098 | 0 | 0 | 0 | 0 | 0.041494 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.142857 | 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 |
c567080cc8ddfadc575578236d8a17250575a51f | 97 | py | Python | file extension.py | shuraj123/radius-program | 1c5b89245f27e99adac916820b3dbb779b8d01c6 | [
"MIT"
] | 2 | 2021-05-28T16:46:35.000Z | 2021-05-28T16:46:37.000Z | file extension.py | shuraj123/radius-program | 1c5b89245f27e99adac916820b3dbb779b8d01c6 | [
"MIT"
] | null | null | null | file extension.py | shuraj123/radius-program | 1c5b89245f27e99adac916820b3dbb779b8d01c6 | [
"MIT"
] | null | null | null | file=input("enter the file name:")
t = file.split(".")
print("extension of file is:" + t[-1])
| 24.25 | 39 | 0.608247 | 16 | 97 | 3.6875 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012346 | 0.164948 | 97 | 3 | 40 | 32.333333 | 0.716049 | 0 | 0 | 0 | 0 | 0 | 0.446809 | 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 |
c56f140898b143e2b7867b6f096e8318b8e34f68 | 630 | py | Python | Pacote download/Exercicios/Operadores aritimeticos.py | Henrique-GM/Exercicios_de_Python | 8cbbcaa31fc19e467576ab21ba3458d67052c40b | [
"Unlicense"
] | null | null | null | Pacote download/Exercicios/Operadores aritimeticos.py | Henrique-GM/Exercicios_de_Python | 8cbbcaa31fc19e467576ab21ba3458d67052c40b | [
"Unlicense"
] | null | null | null | Pacote download/Exercicios/Operadores aritimeticos.py | Henrique-GM/Exercicios_de_Python | 8cbbcaa31fc19e467576ab21ba3458d67052c40b | [
"Unlicense"
] | null | null | null | nome = input('Qual é o seu nome: ')
print('Prazer em te conhecer {:20}!'.format(nome))
print('Prazer em te conhecer {:>20}!'.format(nome))
print('Prazer em te conhecer {:<20}!'.format(nome))
print('Prazer em te conhecer {:=^20}!'.format(nome))
n1 = float(input('Digite o primeiro número '))
n2 = float(input('Digite o segundo número '))
soma = n1 + n2
multiplicacao = n1 * n2
divisao = n1 / n2
divisaoInteira = n1 // n2
esponenciacao = n1**n2
print('A soma vale: {:.3f} o produto {:.3f} e a divisão {:.3f}'.format(soma, multiplicacao, divisao), end=' ')
print('Divisão {:.3f} e potencia {:.3f}'.format(divisao, esponenciacao))
| 35 | 110 | 0.665079 | 94 | 630 | 4.457447 | 0.351064 | 0.047733 | 0.143198 | 0.162291 | 0.343675 | 0.343675 | 0.343675 | 0.343675 | 0.343675 | 0.343675 | 0 | 0.046211 | 0.14127 | 630 | 17 | 111 | 37.058824 | 0.728281 | 0 | 0 | 0 | 0 | 0 | 0.432432 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.428571 | 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 |
c570d73800bed76483b4d40b787e85063112930c | 8,401 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/customtopologynode_8129a1649705353aa11e5c05b0e43d74.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/customtopologynode_8129a1649705353aa11e5c05b0e43d74.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/customtopologynode_8129a1649705353aa11e5c05b0e43d74.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class CustomTopologyNode(Base):
"""NOT DEFINED
The CustomTopologyNode class encapsulates a list of customTopologyNode resources that are managed by the user.
A list of resources can be retrieved from the server using the CustomTopologyNode.find() method.
The list can be managed by using the CustomTopologyNode.add() and CustomTopologyNode.remove() methods.
"""
__slots__ = ()
_SDM_NAME = 'customTopologyNode'
_SDM_ATT_MAP = {
'BridgePriority': 'bridgePriority',
'EdgeBridge': 'edgeBridge',
'Enabled': 'enabled',
'Nickname': 'nickname',
'Priority': 'priority',
'SpSrcId': 'spSrcId',
}
def __init__(self, parent):
super(CustomTopologyNode, self).__init__(parent)
@property
def CustomNetworkTopologyLinks(self):
"""
Returns
-------
- obj(ixnetwork_restpy.testplatform.sessions.ixnetwork.vport.protocols.customnetworktopologylinks_e143f8e730b0fc3b2ee1e5a030493093.CustomNetworkTopologyLinks): An instance of the CustomNetworkTopologyLinks class
Raises
------
- ServerError: The server has encountered an uncategorized error condition
"""
from ixnetwork_restpy.testplatform.sessions.ixnetwork.vport.protocols.customnetworktopologylinks_e143f8e730b0fc3b2ee1e5a030493093 import CustomNetworkTopologyLinks
if self._properties.get('CustomNetworkTopologyLinks', None) is None:
return CustomNetworkTopologyLinks(self)
else:
return self._properties.get('CustomNetworkTopologyLinks')
@property
def BridgePriority(self):
"""
Returns
-------
- number: NOT DEFINED
"""
return self._get_attribute(self._SDM_ATT_MAP['BridgePriority'])
@BridgePriority.setter
def BridgePriority(self, value):
self._set_attribute(self._SDM_ATT_MAP['BridgePriority'], value)
@property
def EdgeBridge(self):
"""
Returns
-------
- bool: NOT DEFINED
"""
return self._get_attribute(self._SDM_ATT_MAP['EdgeBridge'])
@EdgeBridge.setter
def EdgeBridge(self, value):
self._set_attribute(self._SDM_ATT_MAP['EdgeBridge'], value)
@property
def Enabled(self):
"""
Returns
-------
- bool: NOT DEFINED
"""
return self._get_attribute(self._SDM_ATT_MAP['Enabled'])
@Enabled.setter
def Enabled(self, value):
self._set_attribute(self._SDM_ATT_MAP['Enabled'], value)
@property
def Nickname(self):
"""
Returns
-------
- number: NOT DEFINED
"""
return self._get_attribute(self._SDM_ATT_MAP['Nickname'])
@Nickname.setter
def Nickname(self, value):
self._set_attribute(self._SDM_ATT_MAP['Nickname'], value)
@property
def Priority(self):
"""
Returns
-------
- number: NOT DEFINED
"""
return self._get_attribute(self._SDM_ATT_MAP['Priority'])
@Priority.setter
def Priority(self, value):
self._set_attribute(self._SDM_ATT_MAP['Priority'], value)
@property
def SpSrcId(self):
"""
Returns
-------
- number: NOT DEFINED
"""
return self._get_attribute(self._SDM_ATT_MAP['SpSrcId'])
@SpSrcId.setter
def SpSrcId(self, value):
self._set_attribute(self._SDM_ATT_MAP['SpSrcId'], value)
def update(self, BridgePriority=None, EdgeBridge=None, Enabled=None, Nickname=None, Priority=None, SpSrcId=None):
"""Updates customTopologyNode resource on the server.
Args
----
- BridgePriority (number): NOT DEFINED
- EdgeBridge (bool): NOT DEFINED
- Enabled (bool): NOT DEFINED
- Nickname (number): NOT DEFINED
- Priority (number): NOT DEFINED
- SpSrcId (number): NOT DEFINED
Raises
------
- ServerError: The server has encountered an uncategorized error condition
"""
return self._update(self._map_locals(self._SDM_ATT_MAP, locals()))
def add(self, BridgePriority=None, EdgeBridge=None, Enabled=None, Nickname=None, Priority=None, SpSrcId=None):
"""Adds a new customTopologyNode resource on the server and adds it to the container.
Args
----
- BridgePriority (number): NOT DEFINED
- EdgeBridge (bool): NOT DEFINED
- Enabled (bool): NOT DEFINED
- Nickname (number): NOT DEFINED
- Priority (number): NOT DEFINED
- SpSrcId (number): NOT DEFINED
Returns
-------
- self: This instance with all currently retrieved customTopologyNode resources using find and the newly added customTopologyNode resources available through an iterator or index
Raises
------
- ServerError: The server has encountered an uncategorized error condition
"""
return self._create(self._map_locals(self._SDM_ATT_MAP, locals()))
def remove(self):
"""Deletes all the contained customTopologyNode resources in this instance from the server.
Raises
------
- NotFoundError: The requested resource does not exist on the server
- ServerError: The server has encountered an uncategorized error condition
"""
self._delete()
def find(self, BridgePriority=None, EdgeBridge=None, Enabled=None, Nickname=None, Priority=None, SpSrcId=None):
"""Finds and retrieves customTopologyNode resources from the server.
All named parameters are evaluated on the server using regex. The named parameters can be used to selectively retrieve customTopologyNode resources from the server.
To retrieve an exact match ensure the parameter value starts with ^ and ends with $
By default the find method takes no parameters and will retrieve all customTopologyNode resources from the server.
Args
----
- BridgePriority (number): NOT DEFINED
- EdgeBridge (bool): NOT DEFINED
- Enabled (bool): NOT DEFINED
- Nickname (number): NOT DEFINED
- Priority (number): NOT DEFINED
- SpSrcId (number): NOT DEFINED
Returns
-------
- self: This instance with matching customTopologyNode resources retrieved from the server available through an iterator or index
Raises
------
- ServerError: The server has encountered an uncategorized error condition
"""
return self._select(self._map_locals(self._SDM_ATT_MAP, locals()))
def read(self, href):
"""Retrieves a single instance of customTopologyNode data from the server.
Args
----
- href (str): An href to the instance to be retrieved
Returns
-------
- self: This instance with the customTopologyNode resources from the server available through an iterator or index
Raises
------
- NotFoundError: The requested resource does not exist on the server
- ServerError: The server has encountered an uncategorized error condition
"""
return self._read(href)
| 36.68559 | 219 | 0.662064 | 924 | 8,401 | 5.905844 | 0.233766 | 0.045813 | 0.026388 | 0.035734 | 0.509621 | 0.458127 | 0.438336 | 0.438336 | 0.438336 | 0.334799 | 0 | 0.00794 | 0.250446 | 8,401 | 228 | 220 | 36.846491 | 0.858663 | 0.526604 | 0 | 0.102941 | 0 | 0 | 0.091725 | 0.016677 | 0 | 0 | 0 | 0 | 0 | 1 | 0.279412 | false | 0 | 0.044118 | 0 | 0.558824 | 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 |
3d686f45418e374f3309295141943e757a25198c | 2,148 | py | Python | students/k3342/laboratory_works/Kataeva_Veronika/laboratory_work_1/scoreboard/board/migrations/0001_initial.py | KataevaVeronika/ITMO_ICT_WebProgramming_2020 | d8cf1d0479519bbafd34d4678e9eda2eabaeb0cf | [
"MIT"
] | null | null | null | students/k3342/laboratory_works/Kataeva_Veronika/laboratory_work_1/scoreboard/board/migrations/0001_initial.py | KataevaVeronika/ITMO_ICT_WebProgramming_2020 | d8cf1d0479519bbafd34d4678e9eda2eabaeb0cf | [
"MIT"
] | null | null | null | students/k3342/laboratory_works/Kataeva_Veronika/laboratory_work_1/scoreboard/board/migrations/0001_initial.py | KataevaVeronika/ITMO_ICT_WebProgramming_2020 | d8cf1d0479519bbafd34d4678e9eda2eabaeb0cf | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2020-04-17 15:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Car',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('car_number', models.CharField(max_length=7)),
('car_description', models.CharField(max_length=20)),
],
options={
'db_table': 'Car',
},
),
migrations.CreateModel(
name='Team',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('team_name', models.CharField(max_length=20)),
('team_country', models.CharField(max_length=20)),
],
options={
'db_table': 'Team',
},
),
migrations.CreateModel(
name='Racer',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('first_name', models.CharField(max_length=20)),
('middle_name', models.CharField(max_length=20)),
('last_name', models.CharField(max_length=20)),
('experience', models.IntegerField()),
('grade_of_license', models.CharField(choices=[('A', 'Grade A'), ('B', 'Grade B'), ('C', 'Grade C'), ('IA', 'International Grade A'), ('IB', 'International Grade B'), ('IC', 'International Grade C')], max_length=2)),
('description', models.CharField(max_length=50)),
('car', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='board.Car')),
('team_name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='board.Team')),
],
options={
'db_table': 'Racer',
},
),
]
| 39.054545 | 232 | 0.539572 | 215 | 2,148 | 5.237209 | 0.339535 | 0.119893 | 0.127886 | 0.170515 | 0.507105 | 0.466252 | 0.35968 | 0.35968 | 0.288632 | 0.21048 | 0 | 0.020819 | 0.306797 | 2,148 | 54 | 233 | 39.777778 | 0.735393 | 0.02095 | 0 | 0.382979 | 1 | 0 | 0.141361 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.042553 | 0 | 0.12766 | 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 |
3d78bd979c066b4eb44b32cf5ba3857952364555 | 695 | py | Python | release/stubs.min/Grasshopper/Kernel/Geometry/ConvexHull.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/Grasshopper/Kernel/Geometry/ConvexHull.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/Grasshopper/Kernel/Geometry/ConvexHull.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | # encoding: utf-8
# module Grasshopper.Kernel.Geometry.ConvexHull calls itself ConvexHull
# from Grasshopper,Version=1.0.0.20,Culture=neutral,PublicKeyToken=dda4f5ec2cd80803
# by generator 1.145
""" NamespaceTracker represent a CLS namespace. """
# no imports
# no functions
# classes
class Solver(object):
# no doc
@staticmethod
def Compute(nodes,hull):
""" Compute(nodes: Node2List,hull: List[int]) -> bool """
pass
@staticmethod
def ComputeHull(*__args):
"""
ComputeHull(pts: Node2List) -> Polyline
ComputeHull(GH_pts: IEnumerable[GH_Point],plane: Plane) -> (Polyline,Plane)
ComputeHull(GH_pts: IEnumerable[GH_Point]) -> Polyline
"""
pass
| 24.821429 | 84 | 0.702158 | 80 | 695 | 6.025 | 0.6625 | 0.062241 | 0.06639 | 0.112033 | 0.141079 | 0.141079 | 0 | 0 | 0 | 0 | 0 | 0.034722 | 0.171223 | 695 | 27 | 85 | 25.740741 | 0.802083 | 0.71223 | 0 | 0.571429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0.285714 | 0 | 0 | 0.428571 | 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 |
3d850d483aa3eb3ec1e7978821969fe9199270ca | 678 | py | Python | products/viewsets.py | Bilal815/ecommerce_storee | 45e61f1d865a65b4c52d74502b4fcab7ee6c1adf | [
"MIT"
] | null | null | null | products/viewsets.py | Bilal815/ecommerce_storee | 45e61f1d865a65b4c52d74502b4fcab7ee6c1adf | [
"MIT"
] | null | null | null | products/viewsets.py | Bilal815/ecommerce_storee | 45e61f1d865a65b4c52d74502b4fcab7ee6c1adf | [
"MIT"
] | null | null | null | """ Here write a code of viewsets """
from rest_framework import viewsets
from drf_haystack.viewsets import HaystackViewSet
from .models import Product
from .serializers import ProductIndexSerializer
class ProductSearchView(HaystackViewSet):
# `index_models` is an optional list of which models you would like to include
# in the search result. You might have several models indexed, and this provides
# a way to filter out those of no interest for this particular view.
# (Translates to `SearchQuerySet().models(*index_models)` behind the scenes.
index_models = Product
serializer_class = ProductIndexSerializer
queryset = Product.objects.all()
| 37.666667 | 84 | 0.772861 | 87 | 678 | 5.954023 | 0.666667 | 0.063707 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.171091 | 678 | 17 | 85 | 39.882353 | 0.921708 | 0.485251 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 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 |
3d90b2410a390563a8d6acf73ba4bfd6c29b5ed4 | 479 | py | Python | Modulo-01/Tratando dados e fazendo contas/Ex004.py | Kaduh15/Curso-de-Python | bb82ef1856feff95656520b362ec5189c8841cfb | [
"MIT"
] | null | null | null | Modulo-01/Tratando dados e fazendo contas/Ex004.py | Kaduh15/Curso-de-Python | bb82ef1856feff95656520b362ec5189c8841cfb | [
"MIT"
] | null | null | null | Modulo-01/Tratando dados e fazendo contas/Ex004.py | Kaduh15/Curso-de-Python | bb82ef1856feff95656520b362ec5189c8841cfb | [
"MIT"
] | null | null | null | """Exercício Python 4: Faça um programa que leia algo pelo teclado e mostre na tela o seu tipo primitivo e todas as informações possíveis sobre ele."""
n = input('Digite algo: ')
print(f'O tipo primitivo desse valor é {type(n)}')
print(f'Só tem espaços? {n.isspace()}')
print(f'É um número? {n.isnumeric()}')
print(f'É alfabético? {n.isalpha()}')
print(f'Está em maiúsculas? {n.isupper()}')
print(f'Está em minúsculas? {n.islower()}')
print(f'está caítalizada? {n.istitle()}')
| 39.916667 | 151 | 0.699374 | 80 | 479 | 4.1875 | 0.625 | 0.125373 | 0.089552 | 0.071642 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002398 | 0.129436 | 479 | 11 | 152 | 43.545455 | 0.800959 | 0.302714 | 0 | 0 | 0 | 0 | 0.713415 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.875 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
3da8b6ef3420c9985c435374a294b961ca948109 | 1,478 | py | Python | yantragene/events/models.py | brijeshgzp05/techfest-yantragene | 98efdaefede9ea0e4fb7241e97272f0079673863 | [
"MIT"
] | 5 | 2018-08-04T19:07:46.000Z | 2020-02-28T16:33:43.000Z | yantragene/events/models.py | brijeshgzp05/techfest-yantragene | 98efdaefede9ea0e4fb7241e97272f0079673863 | [
"MIT"
] | null | null | null | yantragene/events/models.py | brijeshgzp05/techfest-yantragene | 98efdaefede9ea0e4fb7241e97272f0079673863 | [
"MIT"
] | null | null | null | from django.db import models
from accounts.models import Profile
class Department(models.Model):
did = models.IntegerField()
dname = models.CharField(max_length=50)
dimage = models.ImageField(upload_to='images/departments', blank=True)
def __str__(self):
return self.dname
class Events(models.Model):
eid = models.IntegerField()
ename = models.CharField(max_length=30)
department = models.ForeignKey(Department, on_delete=models.SET_NULL, null=True)
def __str__(self):
return self.ename
class Coordinator(models.Model):
cname = models.CharField(max_length=20)
cmobile = models.CharField(max_length=13)
cemail = models.EmailField()
cimage = models.ImageField(upload_to='images/coordinators', blank=True)
events = models.ForeignKey(Events, on_delete=models.SET_NULL, null=True)
def __str__(self):
return self.cname
class Participant(models.Model):
events = models.ForeignKey(Events, on_delete=models.CASCADE, null=True)
profile = models.ForeignKey(Profile, on_delete=models.CASCADE, null=True)
team_name = models.CharField(max_length=30, blank=True, null=True)
events_name = models.CharField(max_length=30, blank=True, null=True)
member2 = models.CharField(max_length=50, blank=True, null=True)
member3 = models.CharField(max_length=50, blank=True, null=True)
member4 = models.CharField(max_length=50, blank=True, null=True)
member5 = models.CharField(max_length=50, blank=True, null=True)
def __str__(self):
return self.team_name
| 30.163265 | 81 | 0.772666 | 206 | 1,478 | 5.364078 | 0.26699 | 0.135747 | 0.162896 | 0.217195 | 0.573756 | 0.472398 | 0.41086 | 0.329412 | 0.329412 | 0.173756 | 0 | 0.018209 | 0.108254 | 1,478 | 48 | 82 | 30.791667 | 0.820182 | 0 | 0 | 0.121212 | 0 | 0 | 0.025051 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.121212 | false | 0 | 0.060606 | 0.121212 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
3dacb80d8ffe4f5fecf8b6fc9b3e82bddc23abc6 | 133 | py | Python | Python Basics/exceptions.py | vsuren86/Python | 90799cc4c846c65890a143a3275a7acd6497db20 | [
"MIT"
] | null | null | null | Python Basics/exceptions.py | vsuren86/Python | 90799cc4c846c65890a143a3275a7acd6497db20 | [
"MIT"
] | null | null | null | Python Basics/exceptions.py | vsuren86/Python | 90799cc4c846c65890a143a3275a7acd6497db20 | [
"MIT"
] | null | null | null | try:
count = int(input("Give me a number: "))
except ValueError:
print("That's not a number!")
else:
print("Hi " * count) | 22.166667 | 44 | 0.609023 | 20 | 133 | 4.05 | 0.8 | 0.17284 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.225564 | 133 | 6 | 45 | 22.166667 | 0.786408 | 0 | 0 | 0 | 0 | 0 | 0.30597 | 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 |
3db01e4b57cb48aa8f3d4e996139d57741271585 | 10,534 | py | Python | clusteror/plot.py | enfeizhan/datacycle | 461ae9de96a441c70799b5aa74946085dd2aa6a2 | [
"MIT"
] | null | null | null | clusteror/plot.py | enfeizhan/datacycle | 461ae9de96a441c70799b5aa74946085dd2aa6a2 | [
"MIT"
] | null | null | null | clusteror/plot.py | enfeizhan/datacycle | 461ae9de96a441c70799b5aa74946085dd2aa6a2 | [
"MIT"
] | null | null | null | '''
Plotting tools relevant for illustrating and comparing clustering results
can be found in this module.
'''
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
def scatter_plot_two_dim_group_data(
two_dim_data,
labels,
markers=None,
colors=None,
figsize=(10, 6),
xlim=None,
ylim=None,
alpha=0.8,
bbox_to_anchor=(1.01, 1),
loc=2,
grid=True,
show=True,
filepath=None,
**kwargs
):
'''
Plot the distribution of a two dimensional data against clustering groups
in a scatter plot.
A point represents an instance in the dataset. Points in a same cluster
are painted with a same colour.
This tool is useful to check the clustering impact in this two-dimensional
sub-space.
Parameters
----------
two_dim_data: Pandas DataFrame
A dataframe with two columns. The first column goes to the x-axis,
and the second column goes to the y-axis.
labels: list, Pandas Series, Numpy Array, or any iterable
The segment label for each sample in ``two_dim_data``.
markers: list
Marker names for each group.
bbox_to_anchor: tuple
Instruction to placing the legend box relative to the axes. Details
refer to ``Matplotlib`` document.
colors: list, default None
Colours for each group. Use equally distanced colours on colour map
if not supplied.
figsize: tuple
Figure size (width, height).
xlim: tuple
X-axis limits.
ylim: tuple
Y-axis limits.
alpha: float, between 0 and 1
Marker transparency. From 0 to 1: from transparent to opaque.
loc: int
The corner of the legend box to anchor. Details refer to ``Matplotlib``
document.
grid: boolean, default True
Show grid.
show: boolean, default True
Show figure in pop-up windows if true. Save to files if False.
filepath: str
File name to saving the plot. Must be assigned a valid filepath if
``show`` is False.
**kwargs: keyword arguments
Other keyword arguemnts passed on to ``matplotlib.pyplot.scatter``.
Note
----
Instances in a same cluster does not necessarily assemble together in
all two dimensional sub-spaces. There can be possibly no clustering
capaility for certain features. Additionally certain features play a
secondary role in clustering as having less importance in
``field_importance`` in ``clusteror`` module.
'''
assert isinstance(two_dim_data, pd.core.frame.DataFrame)
assert two_dim_data.shape[1] == 2, 'Two_dim_data must have two columns!'
if isinstance(labels, pd.core.series.Series):
labels = labels.values
grouped = two_dim_data.groupby(labels)
n_groups = grouped.ngroups
# there should be enough markers
if markers is not None:
error_msg = 'There should be one marker for each group!'
assert len(markers) == n_groups, error_msg
# get color for each group from the spectrum
if colors is None:
colors = plt.cm.Spectral(np.linspace(0, 1, n_groups))
plt.figure(figsize=figsize)
ax = plt.subplot(111)
if markers is None:
# do a for loop to plot one by one
# if markers not given, default circles
for (name, group), color in zip(grouped, colors):
ax.scatter(
x=group.values[:, 0],
y=group.values[:, 1],
color=color,
label=str(name),
alpha=alpha,
**kwargs)
else:
for (name, group), color, marker in zip(grouped, colors, markers):
ax.scatter(
x=group.values[:, 0],
y=group.values[:, 1],
color=color,
marker=marker,
label=str(name),
alpha=alpha,
ax=ax,
**kwargs)
# place the legend at the right hand side of the chart
plt.legend(bbox_to_anchor=bbox_to_anchor, loc=loc)
# get the axes names
x_label, y_label = tuple(two_dim_data.columns)
plt.xlabel(x_label, size=17)
plt.ylabel(y_label, size=17)
# get lim for x and y axes
if xlim is None:
xlim = (two_dim_data.iloc[:, 0].min(), two_dim_data.iloc[:, 0].max())
if ylim is None:
ylim = (two_dim_data.iloc[:, 1].min(), two_dim_data.iloc[:, 1].max())
plt.xlim(xlim)
plt.ylim(ylim)
if grid:
plt.grid()
if show:
plt.show()
else:
assert filepath
plt.savefig(filepath)
def hist_plot_one_dim_group_data(
one_dim_data,
labels,
bins=11,
colors=None,
figsize=(10, 6),
xlabel='Dimension Reduced Data',
ylabel='Occurance',
bbox_to_anchor=(1.01, 1),
loc=2,
grid=True,
show=True,
filepath=None,
**kwargs):
'''
Plot the distribution of a one dimensional numerical data in a histogram.
This tool is useful to check the clustering impact in this one-dimensional
sub-space.
Parameters
----------
one_dim_data: list, Pandas Series, Numpy Array, or any iterable
A sequence of data. Each element if for an instance.
labels: list, Pandas Series, Numpy Array, or any iterable
The segment label for each sample in ``one_dim_data``.
bins: int or iterable
If an integer, bins - 1 bins created or a list of the delimiters.
colors: list, default None
Colours for each group. Use equally distanced colours on colour map
if not supplied.
figsize: tuple
Figure size (width, height).
xlabel: str
Plot xlabel.
ylabel: str
Plot ylabel.
bbox_to_anchor: tuple
Instruction to placing the legend box relative to the axes. Details
refer to ``Matplotlib`` document.
loc: int
The corner of the legend box to anchor. Details refer to ``Matplotlib``
document.
grid: boolean, default True
Show grid.
show: boolean, default True
Show figure in pop-up windows if true. Save to files if False.
filepath: str
File name to saving the plot. Must be assigned a valid filepath if
``show`` is False.
**kwargs: keyword arguments
Other keyword arguemnts passed on to ``matplotlib.pyplot.scatter``.
Note
----
Instances in a same cluster does not necessarily assemble together in
all one dimensional sub-spaces. There can be possibly no clustering
capaility for certain features. Additionally certain features play a
secondary role in clustering as having less importance in
``field_importance`` in ``clusteror`` module.
'''
if not isinstance(one_dim_data, pd.core.series.Series):
one_dim_data = pd.Series(one_dim_data)
if isinstance(labels, pd.core.series.Series):
labels = labels.values
grouped = one_dim_data.groupby(labels)
n_groups = grouped.ngroups
# get color for each group from the spectrum
if colors is None:
colors = plt.cm.Spectral(np.linspace(0, 1, n_groups))
plt.figure(figsize=figsize)
ax = plt.subplot(111)
# do a for loop to plot one by one
for (name, group), color in zip(grouped, colors):
ax.hist(
group.values,
bins=bins,
color=color,
label=str(name),
alpha=0.5,
**kwargs
)
# place the legend at the right hand side of the chart
plt.legend(bbox_to_anchor=bbox_to_anchor, loc=loc)
plt.xlabel(xlabel, size=17)
plt.ylabel(ylabel, size=17)
if grid:
plt.grid()
if show:
plt.show()
else:
assert filepath
plt.savefig(filepath)
def group_occurance_plot(
one_dim_data,
cat_label,
labels,
group_label,
colors=None,
figsize=(10, 6),
bbox_to_anchor=(1.01, 1),
loc=2,
grid=True,
show=True,
filepath=None,
**kwargs):
'''
Plot the distribution of a one dimensional **ordinal or categorical** data
in a bar chart. This tool is useful to check the clustering impact in this
one-dimensional sub-space.
Parameters
----------
one_dim_data: list, Pandas Series, Numpy Array, or any iterable
A sequence of data. Each element if for an instance.
cat_label: str
Field name will be used for the one dimensional data.
labels: list, Pandas Series, Numpy Array, or any iterable
The segment label for each sample in one_dim_data.
group_label: str
Field name will be used for the cluster ID.
colors: list, default None
Colours for each category existing in this one dimensional data.
Default colour scheme used if not supplied.
figsize: tuple
Figure size (width, height).
bbox_to_anchor: tuple
Instruction to placing the legend box relative to the axes. Details
refer to ``Matplotlib`` document.
loc: int
The corner of the legend box to anchor. Details refer to ``Matplotlib``
document.
grid: boolean, default True
Show grid.
show: boolean, default True
Show figure in pop-up windows if true. Save to files if False.
filepath: str
File name to saving the plot. Must be assigned a valid filepath if
``show`` is False.
**kwargs: keyword arguments
Other keyword arguemnts passed on to ``matplotlib.pyplot.scatter``.
Note
----
Instances in a same cluster does not necessarily assemble together in
all one dimensional sub-spaces. There can be possibly no clustering
capaility for certain features. Additionally certain features play a
secondary role in clustering as having less importance in
``field_importance`` in ``clusteror`` module.
'''
if not isinstance(one_dim_data, pd.core.series.Series):
one_dim_data = pd.Series(one_dim_data)
df = pd.DataFrame({cat_label: one_dim_data, group_label: labels})
df_to_plot = df.pivot_table(
index=group_label,
columns=cat_label,
aggfunc=len
)
plt.figure(figsize=figsize)
ax = plt.subplot(111)
df_to_plot.plot.bar(color=colors, ax=ax, **kwargs)
plt.legend(bbox_to_anchor=bbox_to_anchor, loc=loc)
if grid:
plt.grid()
if show:
plt.show()
else:
assert filepath
plt.savefig(filepath)
| 33.44127 | 79 | 0.631384 | 1,446 | 10,534 | 4.520055 | 0.175657 | 0.027846 | 0.02142 | 0.022032 | 0.731487 | 0.704253 | 0.697521 | 0.692166 | 0.673807 | 0.638311 | 0 | 0.008822 | 0.289823 | 10,534 | 314 | 80 | 33.547771 | 0.864858 | 0.53408 | 0 | 0.645833 | 0 | 0 | 0.024896 | 0 | 0 | 0 | 0 | 0 | 0.041667 | 1 | 0.020833 | false | 0 | 0.020833 | 0 | 0.041667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
3dbf82ff5878607ae3646d6995115871e9fc167e | 492 | py | Python | codigos100/variaveis.py | rosacarla/100-days-of-python-code | 3db9e35f861ce933e952cff2dd3a505dfce1b440 | [
"MIT"
] | 1 | 2021-09-26T09:17:36.000Z | 2021-09-26T09:17:36.000Z | codigos100/variaveis.py | rosacarla/100-days-of-python-code | 3db9e35f861ce933e952cff2dd3a505dfce1b440 | [
"MIT"
] | null | null | null | codigos100/variaveis.py | rosacarla/100-days-of-python-code | 3db9e35f861ce933e952cff2dd3a505dfce1b440 | [
"MIT"
] | null | null | null | #Codigo: Variaveis
#Autora: Carla Edila Silveira
#Finalidade: exemplo de parte do codigo de um jogo da forca - curso Python Quick Start
#Data: 21/09/2021
#começo do jogo da forca
tentativas = 10 #variavel representa quantidade total de tentativas do jogo
print(tentativas)
#jogador 2 faz 1a tentativa
tentativas -= 1 #variavel atualizada com subtracao de 1
print(tentativas)
#jogador tenta de novo
tentativas -= 1 #variavel atualizada com subtracao de 1
print(tentativas)
#fim do codigo | 27.333333 | 86 | 0.78252 | 74 | 492 | 5.202703 | 0.581081 | 0.116883 | 0.057143 | 0.150649 | 0.306494 | 0.306494 | 0.306494 | 0.306494 | 0.306494 | 0.306494 | 0 | 0.038647 | 0.158537 | 492 | 18 | 87 | 27.333333 | 0.891304 | 0.737805 | 0 | 0.833333 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
3dc05a2dbf8b19fa6b940f257965e8e396b5fa6a | 756 | py | Python | server/app/users/serializers/users.py | catvitalio/personal-budget | b4470115ebbfd185a8a781a2024787cbfe822639 | [
"MIT"
] | null | null | null | server/app/users/serializers/users.py | catvitalio/personal-budget | b4470115ebbfd185a8a781a2024787cbfe822639 | [
"MIT"
] | null | null | null | server/app/users/serializers/users.py | catvitalio/personal-budget | b4470115ebbfd185a8a781a2024787cbfe822639 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import User
from rest_framework.authtoken.models import Token
from rest_framework.serializers import ModelSerializer
from rest_framework.serializers import SerializerMethodField
class UserSerializer(ModelSerializer):
token = SerializerMethodField()
def get_token(self, instance):
self.token = Token.objects.get(user=instance).key
return self.token
def create(self, validated_data):
user = User(username=validated_data['username'])
user.set_password(validated_data['password'])
user.save()
return user
class Meta:
model = User
fields = ('id', 'username', 'password', 'token', )
extra_kwargs = {'password': {'write_only': True}}
| 31.5 | 60 | 0.69709 | 83 | 756 | 6.228916 | 0.46988 | 0.046422 | 0.098646 | 0.108317 | 0.131528 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.202381 | 756 | 23 | 61 | 32.869565 | 0.85738 | 0 | 0 | 0 | 0 | 0 | 0.075397 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0.166667 | 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 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
3dc33a89a0c2b0697a67177917238ad3e0f0efb1 | 2,262 | py | Python | apps/zblog/models.py | zhengze/zblogsite | c58ce366c73e4e3526734508dcc6a25f40d91db8 | [
"MIT"
] | 3 | 2015-07-16T07:36:40.000Z | 2015-07-16T07:36:45.000Z | apps/zblog/models.py | zhengze/zblogsite | c58ce366c73e4e3526734508dcc6a25f40d91db8 | [
"MIT"
] | 10 | 2017-06-05T05:15:20.000Z | 2022-03-11T23:26:23.000Z | apps/zblog/models.py | zhengze/zblogsite | c58ce366c73e4e3526734508dcc6a25f40d91db8 | [
"MIT"
] | null | null | null | #coding: utf8
from django.db import models
class Category(models.Model):
name = models.CharField(max_length=20)
class Meta:
verbose_name_plural = verbose_name = u'分类'
def __str__(self):
return self.name
class Tag(models.Model):
name = models.CharField(max_length=20, verbose_name=u"标签")
class Meta:
verbose_name_plural = verbose_name = u'标签'
def __str__(self):
return self.name
class Article(models.Model):
title = models.CharField(max_length=50, verbose_name=u"标题")
content = models.TextField(verbose_name=u"正文", blank=True)
created_time = models.DateTimeField(auto_now_add=True, verbose_name=u"创建时间")
updated_time = models.DateTimeField(auto_now=True, verbose_name=u"修改时间")
category = models.ForeignKey(Category, related_name="articles", verbose_name=u"分类", on_delete=models.CASCADE)
tags = models.ManyToManyField(Tag, related_name="articles", blank=True, verbose_name=u"标签")
hits = models.PositiveIntegerField(u"浏览量", default=0)
class Meta:
ordering = ['-created_time']
verbose_name_plural = verbose_name = u'文章'
def __str__(self):
return self.title
class Album(models.Model):
name = models.CharField(max_length=50)
cover = models.ImageField(upload_to='images/covers/%Y/%m/%d', blank=True)
created_time = models.DateTimeField(auto_now_add=True)
class Meta:
verbose_name_plural = verbose_name = u'封面'
def __str__(self):
return self.name
class Photo(models.Model):
photo = models.ImageField(upload_to='images/%Y/%m/%d')
description = models.CharField(max_length=255, null=True)
created_time = models.DateTimeField(auto_now_add=True)
album = models.ForeignKey(Album)
class Meta:
ordering = ['-created_time']
verbose_name_plural = verbose_name = u'相册'
def __str__(self):
return self.description
class Music(models.Model):
title = models.CharField(max_length=50)
mp3 = models.FileField(upload_to='music/%Y/%m/%d')
created_time = models.DateTimeField(auto_now_add=True)
class Meta:
ordering = ['-created_time']
verbose_name_plural = verbose_name = u'音乐'
def __str__(self):
return self.title
| 28.275 | 113 | 0.689655 | 301 | 2,262 | 4.923588 | 0.262458 | 0.141026 | 0.105263 | 0.097166 | 0.632254 | 0.55668 | 0.522942 | 0.437922 | 0.255061 | 0.222672 | 0 | 0.008772 | 0.193634 | 2,262 | 79 | 114 | 28.632911 | 0.803728 | 0.005305 | 0 | 0.433962 | 0 | 0 | 0.061805 | 0.009782 | 0 | 0 | 0 | 0 | 0 | 1 | 0.113208 | false | 0 | 0.018868 | 0.113208 | 0.830189 | 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 |
3dd0176e3b2158006ffedabda84c09ede0344476 | 2,096 | py | Python | ormcache/managers.py | educreations/django-ormcache | 01459f6be4c191c2f9c04f77660897d752e89d35 | [
"MIT"
] | 5 | 2015-01-09T10:57:32.000Z | 2018-11-26T03:10:58.000Z | ormcache/managers.py | educreations/django-ormcache | 01459f6be4c191c2f9c04f77660897d752e89d35 | [
"MIT"
] | 12 | 2015-01-29T22:37:12.000Z | 2016-10-23T12:13:50.000Z | ormcache/managers.py | educreations/django-ormcache | 01459f6be4c191c2f9c04f77660897d752e89d35 | [
"MIT"
] | 1 | 2020-03-05T08:47:32.000Z | 2020-03-05T08:47:32.000Z | from django.db.models.signals import class_prepared, post_delete, post_save
from django.utils.functional import cached_property
from ormcache.queryset import CachedQuerySet
class CachedManagerMixin(object):
@cached_property
def __cache_enabled(self):
return getattr(self.model, "cache_enabled", False)
def __require_cache(func):
def wrapper(self, *args, **kwargs):
if not self.__cache_enabled:
error = "Caching is not enabled on {}".format(str(type(self)))
raise RuntimeError(error)
return func(self, *args, **kwargs)
return wrapper
@__require_cache
def from_ids(self, ids, lookup='pk__in', **kwargs):
queryset = self.get_queryset()
return queryset.from_ids(ids, lookup=lookup, **kwargs)
@__require_cache
def invalidate(self, *args, **kwargs):
return self.get_queryset().invalidate(*args, **kwargs)
@__require_cache
def cache_key(self, *args, **kwargs):
return self.get_queryset().cache_key(*args, **kwargs)
# Django overrides
def contribute_to_class(self, model, name):
"""Override Django builtin"""
super(CachedManagerMixin, self).contribute_to_class(model, name)
class_prepared.connect(self.__class_prepared_cache, sender=model)
def get_queryset(self):
"""Override Django builtin"""
if self.__cache_enabled:
return CachedQuerySet(self.model)
else:
return super(CachedManagerMixin, self).get_queryset()
# Signals
def __class_prepared_cache(self, sender, **kwargs):
if self.__cache_enabled:
post_save.connect(self.__post_save_cache,
sender=self.model, weak=False)
post_delete.connect(self.__post_delete_cache,
sender=self.model, weak=False)
def __post_save_cache(self, instance, created, **kwargs):
self.invalidate(instance.pk, recache=True)
def __post_delete_cache(self, instance, **kwargs):
self.invalidate(instance.pk)
| 33.806452 | 78 | 0.656011 | 239 | 2,096 | 5.451883 | 0.276151 | 0.046048 | 0.042978 | 0.046048 | 0.144282 | 0.098235 | 0.053722 | 0 | 0 | 0 | 0 | 0 | 0.240458 | 2,096 | 61 | 79 | 34.360656 | 0.818467 | 0.034828 | 0 | 0.166667 | 0 | 0 | 0.023371 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.261905 | false | 0 | 0.071429 | 0.071429 | 0.547619 | 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 |
3de7c76cb082ce1487eec0507b561e450301bbfe | 2,866 | py | Python | src/openalea/SQ_Energy_Balance/Soilheatflux.py | Crop2ML-Catalog/SQ_Energy_Balance | db6a8ba30940b6527e3ae82c325319454ff8a224 | [
"BSD-3-Clause"
] | 1 | 2018-12-06T07:54:31.000Z | 2018-12-06T07:54:31.000Z | src/openalea/SQ_Energy_Balance/Soilheatflux.py | Crop2ML-Catalog/SQ_Energy_Balance | db6a8ba30940b6527e3ae82c325319454ff8a224 | [
"BSD-3-Clause"
] | 2 | 2018-12-07T17:00:22.000Z | 2020-11-13T06:45:51.000Z | src/openalea/SQ_Energy_Balance/Soilheatflux.py | Crop2ML-Catalog/SQ_Energy_Balance | db6a8ba30940b6527e3ae82c325319454ff8a224 | [
"BSD-3-Clause"
] | 7 | 2019-01-15T04:33:23.000Z | 2021-12-09T07:29:46.000Z | # coding: utf8
import numpy
from math import *
def model_soilheatflux(netRadiationEquivalentEvaporation = 638.142,
tau = 0.9983,
soilEvaporation = 448.24):
"""
- Description:
* Title: SoilHeatFlux Model
* Author: Pierre Martre
* Reference: Modelling energy balance in the wheat crop model SiriusQuality2:
Evapotranspiration and canopy and soil temperature calculations
* Institution: INRA/LEPSE Montpellier
* Abstract: The available energy in the soil
- inputs:
* name: netRadiationEquivalentEvaporation
** min : 0
** default : 638.142
** max : 5000
** uri : http://www1.clermont.inra.fr/siriusquality/?page_id=547
** variablecategory : state
** datatype : DOUBLE
** inputtype : variable
** unit : g m-2 d-1
** description : net Radiation Equivalent Evaporation
* name: tau
** parametercategory : species
** min : 0
** datatype : DOUBLE
** max : 100
** uri : http://www1.clermont.inra.fr/siriusquality/?page_id=547
** default : 0.9983
** inputtype : parameter
** unit :
** description : plant cover factor
* name: soilEvaporation
** min : 0
** default : 448.240
** max : 10000
** uri : http://www1.clermont.inra.fr/siriusquality/?page_id=547
** variablecategory : state
** datatype : DOUBLE
** inputtype : variable
** unit : g m-2 d-1
** description : soil Evaporation
- outputs:
* name: soilHeatFlux
** min : 0
** variablecategory : rate
** max : 10000
** uri : http://www1.clermont.inra.fr/siriusquality/?page_id=547
** datatype : DOUBLE
** unit : g m-2 d-1
** description : soil Heat Flux
"""
soilHeatFlux = tau * netRadiationEquivalentEvaporation - soilEvaporation
return soilHeatFlux | 48.576271 | 95 | 0.402652 | 192 | 2,866 | 5.984375 | 0.463542 | 0.013925 | 0.038294 | 0.066144 | 0.327241 | 0.327241 | 0.327241 | 0.327241 | 0.302872 | 0.302872 | 0 | 0.057607 | 0.527565 | 2,866 | 59 | 96 | 48.576271 | 0.79099 | 0.820656 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.285714 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
3dee39217b0e8a2691f239044d8c9f04cf486f25 | 2,484 | py | Python | tests/snapshots/snap_test_holidata/test_holidata_produces_holidays_for_locale_and_year[pt_PT-2018] 1.py | gour/holidata | 89c7323f9c5345a3ecbf5cd5a835b0e08cfebc13 | [
"MIT"
] | 32 | 2019-04-12T08:01:34.000Z | 2022-02-28T04:41:50.000Z | tests/snapshots/snap_test_holidata/test_holidata_produces_holidays_for_locale_and_year[pt_PT-2018] 1.py | gour/holidata | 89c7323f9c5345a3ecbf5cd5a835b0e08cfebc13 | [
"MIT"
] | 74 | 2019-07-09T16:35:20.000Z | 2022-03-09T16:41:34.000Z | tests/snapshots/snap_test_holidata/test_holidata_produces_holidays_for_locale_and_year[pt_PT-2018] 1.py | gour/holidata | 89c7323f9c5345a3ecbf5cd5a835b0e08cfebc13 | [
"MIT"
] | 20 | 2019-01-28T07:41:02.000Z | 2022-02-16T02:38:57.000Z | [
{
'date': '2018-01-01',
'description': 'Ano Novo',
'locale': 'pt-PT',
'notes': '',
'region': '',
'type': 'NF'
},
{
'date': '2018-02-13',
'description': 'Carnaval',
'locale': 'pt-PT',
'notes': '',
'region': '',
'type': 'NRV'
},
{
'date': '2018-03-30',
'description': 'Sexta-feira Santa',
'locale': 'pt-PT',
'notes': '',
'region': '',
'type': 'NRV'
},
{
'date': '2018-04-01',
'description': 'Páscoa',
'locale': 'pt-PT',
'notes': '',
'region': '',
'type': 'NRV'
},
{
'date': '2018-04-25',
'description': 'Dia da Liberdade',
'locale': 'pt-PT',
'notes': '',
'region': '',
'type': 'NF'
},
{
'date': '2018-05-01',
'description': 'Dia do Trabalhador',
'locale': 'pt-PT',
'notes': '',
'region': '',
'type': 'NF'
},
{
'date': '2018-05-31',
'description': 'Corpo de Deus',
'locale': 'pt-PT',
'notes': '',
'region': '',
'type': 'NRV'
},
{
'date': '2018-06-10',
'description': 'Dia de Portugal',
'locale': 'pt-PT',
'notes': '',
'region': '',
'type': 'NF'
},
{
'date': '2018-08-15',
'description': 'Assunção de Nossa Senhora',
'locale': 'pt-PT',
'notes': '',
'region': '',
'type': 'NF'
},
{
'date': '2018-10-05',
'description': 'Implantação da República',
'locale': 'pt-PT',
'notes': '',
'region': '',
'type': 'NF'
},
{
'date': '2018-11-01',
'description': 'Dia de Todos os Santos',
'locale': 'pt-PT',
'notes': '',
'region': '',
'type': 'NF'
},
{
'date': '2018-12-01',
'description': 'Restauração da Independência',
'locale': 'pt-PT',
'notes': '',
'region': '',
'type': 'NF'
},
{
'date': '2018-12-08',
'description': 'Imaculada Conceição',
'locale': 'pt-PT',
'notes': '',
'region': '',
'type': 'NF'
},
{
'date': '2018-12-25',
'description': 'Natal',
'locale': 'pt-PT',
'notes': '',
'region': '',
'type': 'NF'
}
] | 21.789474 | 54 | 0.364332 | 205 | 2,484 | 4.414634 | 0.263415 | 0.123757 | 0.154696 | 0.232044 | 0.552486 | 0.552486 | 0.552486 | 0.522652 | 0.522652 | 0.288398 | 0 | 0.075625 | 0.403784 | 2,484 | 114 | 55 | 21.789474 | 0.535449 | 0 | 0 | 0.491228 | 0 | 0 | 0.390342 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 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 |
9a9a6eab21dbe4d3040baa916e703819996f955c | 145,927 | py | Python | pysnmp-with-texts/NNCFRINTSTATISTICS-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/NNCFRINTSTATISTICS-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/NNCFRINTSTATISTICS-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 NNCFRINTSTATISTICS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NNCFRINTSTATISTICS-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:23:02 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")
ValueRangeConstraint, ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsUnion", "SingleValueConstraint", "ConstraintsIntersection", "ValueSizeConstraint")
ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex")
NncExtIntvlStateType, = mibBuilder.importSymbols("NNC-INTERVAL-STATISTICS-TC-MIB", "NncExtIntvlStateType")
nncExtensions, NncExtCounter64 = mibBuilder.importSymbols("NNCGNI0001-SMI", "nncExtensions", "NncExtCounter64")
ObjectGroup, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "NotificationGroup", "ModuleCompliance")
TimeTicks, Integer32, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, ObjectIdentity, Unsigned32, ModuleIdentity, MibIdentifier, NotificationType, Bits, Counter64, iso, Gauge32 = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "Integer32", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "ObjectIdentity", "Unsigned32", "ModuleIdentity", "MibIdentifier", "NotificationType", "Bits", "Counter64", "iso", "Gauge32")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
nncFrIntStatistics = ModuleIdentity((1, 3, 6, 1, 4, 1, 123, 3, 30))
if mibBuilder.loadTexts: nncFrIntStatistics.setLastUpdated('9803031200Z')
if mibBuilder.loadTexts: nncFrIntStatistics.setOrganization('Newbridge Networks Corporation')
if mibBuilder.loadTexts: nncFrIntStatistics.setContactInfo('Newbridge Networks Corporation Postal: 600 March Road Kanata, Ontario Canada K2K 2E6 Phone: +1 613 591 3600 Fax: +1 613 591 3680')
if mibBuilder.loadTexts: nncFrIntStatistics.setDescription('This module contains definitions for performance monitoring of Frame Relay Streams')
nncFrIntStatisticsObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 123, 3, 30, 1))
nncFrIntStatisticsTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 123, 3, 30, 2))
nncFrIntStatisticsGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 123, 3, 30, 3))
nncFrIntStatisticsCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 123, 3, 30, 4))
nncFrStrStatCurrentTable = MibTable((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1), )
if mibBuilder.loadTexts: nncFrStrStatCurrentTable.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentTable.setDescription('The nncFrStrStatCurrentTable contains objects for monitoring the performance of a frame relay stream during the current 1hr interval.')
nncFrStrStatCurrentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: nncFrStrStatCurrentEntry.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentEntry.setDescription('An entry in the 1hr current statistics table. Each conceptual row contains current interval statistics for a particular frame relay stream.')
nncFrStrStatCurrentState = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 1), NncExtIntvlStateType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentState.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentState.setDescription('The state of the current interval. The object provides a status for those entries which have been reset by the user or have been subject to a wall-clock time change.')
nncFrStrStatCurrentAbsoluteIntervalNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 96))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentAbsoluteIntervalNumber.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentAbsoluteIntervalNumber.setDescription('The absolute interval number of this interval.')
nncFrStrStatCurrentInOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 3), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentInOctets.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentInOctets.setDescription('Number of bytes received on this stream.')
nncFrStrStatCurrentOutOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 4), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentOutOctets.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentOutOctets.setDescription('Number of bytes transmitted on this stream.')
nncFrStrStatCurrentInUCastPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 5), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentInUCastPackets.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentInUCastPackets.setDescription('Number of unerrored, unicast frames received.')
nncFrStrStatCurrentOutUCastPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 6), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentOutUCastPackets.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentOutUCastPackets.setDescription('Number of unerrored, unicast frames transmitted.')
nncFrStrStatCurrentInDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 7), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentInDiscards.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentInDiscards.setDescription('Number of incoming frames discarded due to these reasons: policing, congestion.')
nncFrStrStatCurrentOutDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 8), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentOutDiscards.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentOutDiscards.setDescription('Number of outgoing frames discarded due to these reasons: policing, congestion.')
nncFrStrStatCurrentInErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 9), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentInErrors.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentInErrors.setDescription('Number of incoming frames discarded due to errors: invalid lengths, non-integral bytes, CRC errors, bad encapsulation, invalid EA, reserved DLCI')
nncFrStrStatCurrentOutErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 10), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentOutErrors.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentOutErrors.setDescription('Number of outgoing frames discarded due to errors: eg. bad encapsulation.')
nncFrStrStatCurrentSigUserProtErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 11), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentSigUserProtErrors.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentSigUserProtErrors.setDescription('Number of user-side local in-channel signalling protocol errors (protocol discriminator, message type, call reference & mandatory information eleement errors) for this uni/nni stream. If the stream is not perfor- ming user-side procedures, this value is equal to noSuchName.')
nncFrStrStatCurrentSigNetProtErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 12), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentSigNetProtErrors.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentSigNetProtErrors.setDescription('Number of network-side local in-channel signalling protocol errors (protocol discriminator, message type, call reference & mandatory information eleement errors) for this uni/nni stream. If the stream is not perfor- ming network-side procedures, this value is equal to noSuchName.')
nncFrStrStatCurrentSigUserLinkRelErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 13), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentSigUserLinkRelErrors.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentSigUserLinkRelErrors.setDescription('Number of user-side local in-channel signalling link reliability errors (non receipt of Enq/Status messages or invalid sequence numbers in a link integrity verifi- cation information element) for this stream. If the stream is not performing user-side procedures, this value is equal to noSuchName.')
nncFrStrStatCurrentSigNetLinkRelErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 14), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentSigNetLinkRelErrors.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentSigNetLinkRelErrors.setDescription('Number of network-side local in-channel signalling link reliability errors (non receipt of Enq/Status messages or invalid sequence numbers in a link integrity verification information element) for this stream. If the stream is not performing network-side procedures, this value is equal to noSuchName.')
nncFrStrStatCurrentSigUserChanInactive = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 15), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentSigUserChanInactive.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentSigUserChanInactive.setDescription('Number of times the user-side channel was declared inactive (N2 errors in N3 events) for this stream. If the stream is not performing user-side procedures, this value is equal to noSuchName.')
nncFrStrStatCurrentSigNetChanInactive = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 16), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentSigNetChanInactive.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentSigNetChanInactive.setDescription('Number of times the network-side channel was declared inactive (N2 errors in N3 events) for this stream. If the stream is not performing network-side procedures, this value is equal to noSuchName.')
nncFrStrStatCurrentStSCAlarms = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 17), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStSCAlarms.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStSCAlarms.setDescription('Number of one second intervals for which the stream entered the severely congested state.')
nncFrStrStatCurrentStTimeSC = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 18), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStTimeSC.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStTimeSC.setDescription("Period of time the stream was in the severely congested state during the current interval (expressed in 10's of milliseconds). Divide into the entire length of the interval to get a ratio.")
nncFrStrStatCurrentStMaxDurationRED = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 19), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStMaxDurationRED.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStMaxDurationRED.setDescription('Longest period of time the stream spent in the Red (severely congested) state, expressed in seconds.')
nncFrStrStatCurrentStMCAlarms = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 20), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStMCAlarms.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStMCAlarms.setDescription('Number of one second intervals for which the stream entered the mildly congested state.')
nncFrStrStatCurrentStTimeMC = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 21), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStTimeMC.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStTimeMC.setDescription("Period of time the stream was in the mildly congested state during the current interval (expressed in 10's of milliseconds). Divide into the entire length of the interval to get a ratio.")
nncFrStrStatCurrentOutLinkUtilization = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 22), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentOutLinkUtilization.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentOutLinkUtilization.setDescription('The percentage utilization on the outgoing link during the current interval.')
nncFrStrStatCurrentInLinkUtilization = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 23), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentInLinkUtilization.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentInLinkUtilization.setDescription('The percentage utilization on the incoming link during the current interval.')
nncFrStrStatCurrentInInvdLength = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 24), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentInInvdLength.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentInInvdLength.setDescription('Number of frames discarded because there was no data in the frame, or because the frame exceeded the maximum allowed length.')
nncFrStrStatCurrentStLastErroredDLCI = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 25), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 8388607))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStLastErroredDLCI.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStLastErroredDLCI.setDescription('DLCI of the most recent DLC to receive invalid frames on this frame stream.')
nncFrStrStatCurrentInDiscdOctetsCOS = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 26), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentInDiscdOctetsCOS.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentInDiscdOctetsCOS.setDescription('Number of ingress bytes discarded due to receive Class-of-Service procedures.')
nncFrStrStatCurrentInDiscdCOSDESet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 27), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentInDiscdCOSDESet.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentInDiscdCOSDESet.setDescription('Number of ingress frames discarded due to receive Class-of-Service procedures, in which the DE bit was set.')
nncFrStrStatCurrentInDiscdCOSDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 28), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentInDiscdCOSDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentInDiscdCOSDEClr.setDescription('Number of ingress frames discarded due to receive Class-of-Service procedures, in which the DE bit was not set.')
nncFrStrStatCurrentInDiscdBadEncaps = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 29), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentInDiscdBadEncaps.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentInDiscdBadEncaps.setDescription('Number of ingress frames discarded due to having a bad RFC1490 encapsulation header.')
nncFrStrStatCurrentOutDiscdBadEncaps = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 30), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentOutDiscdBadEncaps.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentOutDiscdBadEncaps.setDescription('Number of egress frames discarded due to having a bad RFC1483 encapsulation header.')
nncFrStrStatCurrentInDiscdUnsupEncaps = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 31), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentInDiscdUnsupEncaps.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentInDiscdUnsupEncaps.setDescription('Number of ingress frames discarded due to having an unsupported RFC1490 encapsulation header.')
nncFrStrStatCurrentOutDiscdUnsupEncaps = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 32), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentOutDiscdUnsupEncaps.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentOutDiscdUnsupEncaps.setDescription('Number of egress frames discarded due to having an unsupported RFC1483 encapsulation header.')
nncFrStrStatCurrentOutDiscdDESet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 33), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentOutDiscdDESet.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentOutDiscdDESet.setDescription('Number of egress frames discarded due to transmit congestion procedures, in which the DE bit was set.')
nncFrStrStatCurrentOutDiscdDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 34), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentOutDiscdDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentOutDiscdDEClr.setDescription('Number of egress frames discarded due to transmit congestion procedures, in which the DE bit was not set.')
nncFrStrStatCurrentInDiscdDESet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 35), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentInDiscdDESet.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentInDiscdDESet.setDescription('Number of ingress frames discarded due to receive congestion procedures, in which the DE bit was set.')
nncFrStrStatCurrentInDiscdDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 36), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentInDiscdDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentInDiscdDEClr.setDescription('Number of ingress frames discarded due to receive congestion procedures, in which the DE bit was not set.')
nncFrStrStatCurrentStLMSigInvldField = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 37), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMSigInvldField.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMSigInvldField.setDescription('Number of Status signalling frames with incorrect values for the Unnumbered Information Frame field, Protocol Discrimator field, or Call Reference Field.')
nncFrStrStatCurrentStLMSigUnsupMsgType = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 38), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMSigUnsupMsgType.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMSigUnsupMsgType.setDescription('Number of Status signalling frames that are not a Status or Status Enquiry messsage (Unsupported message type).')
nncFrStrStatCurrentStLMSigInvldEID = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 39), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMSigInvldEID.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMSigInvldEID.setDescription('Number of Status signalling frames with an IEID that is not a Report Type IEID, Keep Alive Sequence IEID, or a PVC Status IEID.')
nncFrStrStatCurrentStLMSigInvldIELen = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 40), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMSigInvldIELen.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMSigInvldIELen.setDescription('Number of Status signalling frames with an IE length field size that does not conform with the Frame Relay status signalling protocol.')
nncFrStrStatCurrentStLMSigInvldRepType = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 41), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMSigInvldRepType.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMSigInvldRepType.setDescription('Number of Status signalling frames with a Report Type IE that were not a Full Report Type or a Keep Alive Confirmation.')
nncFrStrStatCurrentStLMSigFrmWithNoIEs = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 42), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMSigFrmWithNoIEs.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMSigFrmWithNoIEs.setDescription('Number of Status signalling frames that terminate before the IE appears.')
nncFrStrStatCurrentStUserSequenceErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 43), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStUserSequenceErrs.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStUserSequenceErrs.setDescription('Number of status signalling frames received with a Last Received Sequence number that is inconsistent with the expected value, the last transmitted Current Sequence Number. If the stream is not performing user-side procedures, this value is equal to noSuchName.')
nncFrStrStatCurrentStNetSequenceErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 44), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStNetSequenceErrs.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStNetSequenceErrs.setDescription('Number of status signalling frames received with a Last Received Sequence number that is inconsistent with the expected value, the last transmitted Current Sequence Number. If the stream is not performing network-side procedures, this value is equal to noSuchName.')
nncFrStrStatCurrentStLMUTimeoutsnT1 = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 45), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMUTimeoutsnT1.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMUTimeoutsnT1.setDescription('Number of times the link integrity verification interval has been exceeded without receiving a Status message. If the stream is not performing user-side procedures, this value is equal to noSuchName.')
nncFrStrStatCurrentStLMUStatusMsgsRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 46), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMUStatusMsgsRcvd.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMUStatusMsgsRcvd.setDescription('Number of Status messages received. If the stream is not performing user-side procedures, this value is equal to noSuchName.')
nncFrStrStatCurrentStLMUStatusENQMsgsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 47), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMUStatusENQMsgsSent.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMUStatusENQMsgsSent.setDescription('Number of Status Enquiry messages sent. If the stream is not performing user-side procedures, this value is equal to noSuchName.')
nncFrStrStatCurrentStLMUAsyncStatusRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 48), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMUAsyncStatusRcvd.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMUAsyncStatusRcvd.setDescription('Number of asynchronous Update Status messages received. If the stream is not performing user-side procedures, this value is equal to noSuchName.')
nncFrStrStatCurrentStLMNTimeoutsnT2 = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 49), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMNTimeoutsnT2.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMNTimeoutsnT2.setDescription('Number of times the polling verification interval was exceeded without receivung a Keep Alive Sequence. If the stream is not performing network-side procedures, this value is equal to noSuchName.')
nncFrStrStatCurrentStLMNStatusMsgsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 50), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMNStatusMsgsSent.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMNStatusMsgsSent.setDescription('Number of Status messages sent. If the stream is not performing network-side procedures, this value is equal to noSuchName.')
nncFrStrStatCurrentStLMNStatusENQMsgsRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 51), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMNStatusENQMsgsRcvd.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMNStatusENQMsgsRcvd.setDescription('Number of Status Enquiry messages received. If the stream is not performing network-side procedures, this value is equal to noSuchName.')
nncFrStrStatCurrentStLMNAsyncStatusSent = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 52), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMNAsyncStatusSent.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStLMNAsyncStatusSent.setDescription('Number of asynchronous Update Status messages transmitted. If the stream is not performing network-side procedures, this value is equal to noSuchName.')
nncFrStrStatCurrentInCRCErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 53), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentInCRCErrors.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentInCRCErrors.setDescription('Number of frames with an incorrect CRC-16 value.')
nncFrStrStatCurrentInNonIntegral = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 54), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentInNonIntegral.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentInNonIntegral.setDescription('Number of frames with a non-integral number of octets between the delimiting HDLC flags.')
nncFrStrStatCurrentInReservedDLCI = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 55), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentInReservedDLCI.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentInReservedDLCI.setDescription('Number of frames with a DLCI that cannot be assigned to user connections.')
nncFrStrStatCurrentInInvldEA = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 56), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentInInvldEA.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentInInvldEA.setDescription('Number of frames with the EA (extended address) bit incorrectly set.')
nncFrStrStatCurrentStFrmTooSmall = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 57), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStFrmTooSmall.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStFrmTooSmall.setDescription('Number of frames that are smaller than the allowed minimum size.')
nncFrStrStatCurrentInAborts = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 58), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentInAborts.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentInAborts.setDescription('Number of aborted frames.')
nncFrStrStatCurrentInSumOfDisagremnts = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 59), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentInSumOfDisagremnts.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentInSumOfDisagremnts.setDescription('Total number of frames discarded because: the frame relay UNI or ICI was unavailable to accept frame traffic, the frame had a DLCI not available for end-user connections, the DLCI was inactive, the frame exceeded the maximum configured frame length (but its length was legal within the frame relay protocol), the frame violated the configured address field size (but had a legal address field size with the frame relay protocol), or was an unexpected status signalling frame.')
nncFrStrStatCurrentInOverRuns = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 60), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentInOverRuns.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentInOverRuns.setDescription('Number of times the receiver was forced to overrun.')
nncFrStrStatCurrentOutUnderRuns = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 61), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentOutUnderRuns.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentOutUnderRuns.setDescription('Number of times the transmitter was forced to underrun.')
nncFrStrStatCurrentStIntervalDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 62), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentStIntervalDuration.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentStIntervalDuration.setDescription('Duration of the statistics accumulation interval.')
nncFrStrStatCurrentBestEffortPeakDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 63), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(1, 60000))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentBestEffortPeakDelay.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentBestEffortPeakDelay.setDescription('The largest delay experienced by any frame that was transmitted on the stream in service category Best Effort.')
nncFrStrStatCurrentCommittedPeakDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 64), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(1, 60000))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentCommittedPeakDelay.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentCommittedPeakDelay.setDescription('The largest delay experienced by any frame that was transmitted on the stream in service category: Committed Throughptut.')
nncFrStrStatCurrentLowDelayPeakDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 65), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(1, 60000))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentLowDelayPeakDelay.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentLowDelayPeakDelay.setDescription('The largest delay experienced by any frame that was transmitted on the stream in service category: Low Delay.')
nncFrStrStatCurrentRealTimePeakDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 66), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(1, 60000))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentRealTimePeakDelay.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentRealTimePeakDelay.setDescription('The largest delay experienced by any frame that was transmitted on the stream in service category Real Time.')
nncFrStrStatCurrentBestEffortAccDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 67), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentBestEffortAccDelay.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentBestEffortAccDelay.setDescription('The accumulated delay experienced by all frames in a stream transmitted in service category Best Effort. Combined with the Out Ucast Packets for service category Best Effort, the average delay per frame can be calculated.')
nncFrStrStatCurrentCommittedAccDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 68), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentCommittedAccDelay.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentCommittedAccDelay.setDescription('The accumulated delay experienced by all frames in a stream transmitted in service category Committed Throughput. Combined with the Out Ucast Packets for service category Committed Throughput, the average delay per frame can be calculated.')
nncFrStrStatCurrentLowDelayAccDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 69), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentLowDelayAccDelay.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentLowDelayAccDelay.setDescription('The accumulated delay experienced by all frames in a stream transmitted in service category Low Delay. Combined with the Out Ucast Packets for service category Low Delay, the average delay per frame can be calculated.')
nncFrStrStatCurrentRealTimeAccDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 70), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentRealTimeAccDelay.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentRealTimeAccDelay.setDescription('The accumulated delay experienced by all frames in a stream transmitted in service category Real Time. Combined with the Out Ucast Packets for service category Real Time, the average delay per frame can be calculated.')
nncFrStrStatCurrentBestEffortOutUCastPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 71), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentBestEffortOutUCastPackets.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentBestEffortOutUCastPackets.setDescription('Number of unerrored, unicast frames transmitted in service category Best Effort.')
nncFrStrStatCurrentCommittedOutUCastPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 72), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentCommittedOutUCastPackets.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentCommittedOutUCastPackets.setDescription('Number of unerrored, unicast frames transmitted in service category Committed Throughput.')
nncFrStrStatCurrentLowDelayOutUCastPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 73), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentLowDelayOutUCastPackets.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentLowDelayOutUCastPackets.setDescription('Number of unerrored, unicast frames transmitted in service category Low Delay.')
nncFrStrStatCurrentRealTimeOutUCastPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 74), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentRealTimeOutUCastPackets.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentRealTimeOutUCastPackets.setDescription('Number of unerrored, unicast frames transmitted in service category Real Time.')
nncFrStrStatCurrentBestEffortUCastPacketsDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 75), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentBestEffortUCastPacketsDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentBestEffortUCastPacketsDEClr.setDescription('Number of unerrored, unicast frames with the DE bit not set transmitted in service category Best Effort.')
nncFrStrStatCurrentCommittedUCastPacketsDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 76), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentCommittedUCastPacketsDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentCommittedUCastPacketsDEClr.setDescription('Number of unerrored, unicast frames with the DE bit not set transmitted in service category Committed Throughput.')
nncFrStrStatCurrentLowDelayUCastPacketsDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 77), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentLowDelayUCastPacketsDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentLowDelayUCastPacketsDEClr.setDescription('Number of unerrored, unicast frames with the DE bit not set transmitted in service category Low Delay.')
nncFrStrStatCurrentRealTimeUCastPacketsDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 78), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentRealTimeUCastPacketsDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentRealTimeUCastPacketsDEClr.setDescription('Number of unerrored, unicast frames with the DE bit not set, transmitted in service category Real Time.')
nncFrStrStatCurrentBestEffortDiscdDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 79), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentBestEffortDiscdDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentBestEffortDiscdDEClr.setDescription('Number of unerrored, unicast frames with the DE bit not set, discarded by QoS procedures in service category Best Effort.')
nncFrStrStatCurrentCommittedDiscdDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 80), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentCommittedDiscdDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentCommittedDiscdDEClr.setDescription('Number of unerrored, unicast frames with the DE bit not set, discarded by QoS procedures in service category Committed Throughput.')
nncFrStrStatCurrentLowDelayDiscdDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 81), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentLowDelayDiscdDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentLowDelayDiscdDEClr.setDescription('Number of unerrored, unicast frames with the DE bit not set, discarded by QoS procedures in service category Low Delay.')
nncFrStrStatCurrentRealTimeDiscdDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 1, 1, 82), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatCurrentRealTimeDiscdDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentRealTimeDiscdDEClr.setDescription('Number of unerrored, unicast frames with the DE bit not set, discarded by QoS procedures in service category Real Time.')
nncFrStrStatIntervalTable = MibTable((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2), )
if mibBuilder.loadTexts: nncFrStrStatIntervalTable.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalTable.setDescription('The nncFrStrStatIntervalTable contains objects for monitoring the performance of a frame relay stream over M historical intervals of 1hr each.')
nncFrStrStatIntervalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalNumber"))
if mibBuilder.loadTexts: nncFrStrStatIntervalEntry.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalEntry.setDescription('An entry in the 1hr interval statistics table. Each conceptual row contains interval statistics for a par- ticular interval on a particular stream.')
nncFrStrStatIntervalNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 96)))
if mibBuilder.loadTexts: nncFrStrStatIntervalNumber.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalNumber.setDescription('The interval number (N) of the statistics in this row.')
nncFrStrStatIntervalState = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 2), NncExtIntvlStateType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalState.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalState.setDescription('The state of the interval represented by this row. The object provides a status for those entries which have been reset by the user or subject to a wall-clock time change.')
nncFrStrStatIntervalAbsoluteIntervalNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 96)))
if mibBuilder.loadTexts: nncFrStrStatIntervalAbsoluteIntervalNumber.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalAbsoluteIntervalNumber.setDescription('The absolute interval number of this interval.')
nncFrStrStatIntervalInOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 4), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalInOctets.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalInOctets.setDescription('Number of bytes received on this stream.')
nncFrStrStatIntervalOutOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 5), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalOutOctets.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalOutOctets.setDescription('Number of bytes transmitted on this stream.')
nncFrStrStatIntervalInUCastPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 6), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalInUCastPackets.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalInUCastPackets.setDescription('Number of unerrored, unicast frames received.')
nncFrStrStatIntervalOutUCastPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 7), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalOutUCastPackets.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalOutUCastPackets.setDescription('Number of unerrored, unicast frames transmitted.')
nncFrStrStatIntervalInDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 8), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalInDiscards.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalInDiscards.setDescription('Number of incoming frames discarded due to these reasons: policing, congestion.')
nncFrStrStatIntervalOutDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 9), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalOutDiscards.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalOutDiscards.setDescription('Number of outgoing frames discarded due to these reasons: policing, congestion.')
nncFrStrStatIntervalInErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 10), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalInErrors.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalInErrors.setDescription('Number of incoming frames discarded due to errors: eg. invalid lengths, non-integral bytes...')
nncFrStrStatIntervalOutErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 11), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalOutErrors.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalOutErrors.setDescription('Number of outgoing frames discarded due to errors: eg. bad encapsulation.')
nncFrStrStatIntervalSigUserProtErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 12), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalSigUserProtErrors.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalSigUserProtErrors.setDescription('Number of user-side local in-channel signalling protocol errors (protocol discriminator, message type, call reference & mandatory information eleement errors) for this uni/nni stream. If the stream is not perfor- ming user-side procedures, this value is equal to noSuchName.')
nncFrStrStatIntervalSigNetProtErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 13), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalSigNetProtErrors.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalSigNetProtErrors.setDescription('Number of network-side local in-channel signalling protocol errors (protocol discriminator, message type, call reference & mandatory information eleement errors) for this uni/nni stream. If the stream is not perfor- ming network-side procedures, this value is equal to noSuchName.')
nncFrStrStatIntervalSigUserLinkRelErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 14), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalSigUserLinkRelErrors.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalSigUserLinkRelErrors.setDescription('Number of user-side local in-channel signalling link reliability errors (non receipt of Enq/Status messages or invalid sequence numbers in a link integrity verifi- cation information element) for this stream. If the stream is not performing user-side procedures, this value is equal to noSuchName.')
nncFrStrStatIntervalSigNetLinkRelErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 15), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalSigNetLinkRelErrors.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalSigNetLinkRelErrors.setDescription('Number of network-side local in-channel signalling link reliability errors (non receipt of Enq/Status messages or invalid sequence numbers in a link integrity verification information element) for this stream. If the stream is not performing network-side procedures, this value is equal to noSuchName.')
nncFrStrStatIntervalSigUserChanInactive = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 16), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalSigUserChanInactive.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalSigUserChanInactive.setDescription('Number of times the user-side channel was declared inactive (N2 errors in N3 events) for this stream. If the stream is not performing user-side procedures, this value is equal to noSuchName.')
nncFrStrStatIntervalSigNetChanInactive = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 17), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalSigNetChanInactive.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalSigNetChanInactive.setDescription('Number of times the network-side channel was declared inactive (N2 errors in N3 events) for this stream. If the stream is not performing network-side procedures, this value is equal to noSuchName.')
nncFrStrStatIntervalStSCAlarms = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 18), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStSCAlarms.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStSCAlarms.setDescription('Number of one second intervals for which the stream entered the severely congested state.')
nncFrStrStatIntervalStTimeSC = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 19), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStTimeSC.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStTimeSC.setDescription("Period of time the stream was in the severely congested state during the designated interval (expressed in 10's of milliseconds). Divide into the entire length of the interval to get a ratio.")
nncFrStrStatIntervalStMaxDurationRED = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 20), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStMaxDurationRED.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStMaxDurationRED.setDescription('Longest period of time the stream spent in the Red (severely congested) state, expressed in seconds.')
nncFrStrStatIntervalStMCAlarms = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 21), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStMCAlarms.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStMCAlarms.setDescription('Number of one second intervals for which the stream entered the mildly congested state.')
nncFrStrStatIntervalStTimeMC = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 22), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStTimeMC.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStTimeMC.setDescription("Period of time the stream was in the mildly congested state during the designated interval (expressed in 10's of milliseconds). Divide into the entire length of the interval to get a ratio.")
nncFrStrStatIntervalOutLinkUtilization = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 23), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalOutLinkUtilization.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalOutLinkUtilization.setDescription('The percentage utilization on the outgoing link during the designated interval.')
nncFrStrStatIntervalInLinkUtilization = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 24), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalInLinkUtilization.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalInLinkUtilization.setDescription('The percentage utilization on the incoming link during the designated interval.')
nncFrStrStatIntervalInInvdLength = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 25), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalInInvdLength.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalInInvdLength.setDescription('Number of frames discarded because there was no data in the frame, or because the frame exceeded the maximum allowed length.')
nncFrStrStatIntervalStLastErroredDLCI = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 26), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 8388607))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStLastErroredDLCI.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStLastErroredDLCI.setDescription('DLCI of the most recent DLC to receive invalid frames on this frame stream.')
nncFrStrStatIntervalInDiscdOctetsCOS = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 27), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalInDiscdOctetsCOS.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalInDiscdOctetsCOS.setDescription('Number of ingress bytes discarded due to receive Class-of-Service procedures.')
nncFrStrStatIntervalInDiscdCOSDESet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 28), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalInDiscdCOSDESet.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalInDiscdCOSDESet.setDescription('Number of ingress frames discarded due to receive Class-of-Service procedures, in which the DE bit was set.')
nncFrStrStatIntervalInDiscdCOSDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 29), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalInDiscdCOSDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalInDiscdCOSDEClr.setDescription('Number of ingress frames discarded due to receive Class-of-Service procedures, in which the DE bit was not set.')
nncFrStrStatIntervalInDiscdBadEncaps = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 30), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalInDiscdBadEncaps.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalInDiscdBadEncaps.setDescription('Number of ingress frames discarded due to having a bad RFC1490 encapsulation header.')
nncFrStrStatIntervalOutDiscdBadEncaps = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 31), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalOutDiscdBadEncaps.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalOutDiscdBadEncaps.setDescription('Number of egress frames discarded due to having a bad RFC1483 encapsulation header.')
nncFrStrStatIntervalInDiscdUnsupEncaps = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 32), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalInDiscdUnsupEncaps.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalInDiscdUnsupEncaps.setDescription('Number of ingress frames discarded due to having an unsupported RFC1490 encapsulation header.')
nncFrStrStatIntervalOutDiscdUnsupEncaps = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 33), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalOutDiscdUnsupEncaps.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalOutDiscdUnsupEncaps.setDescription('Number of egress frames discarded due to having an unsupported RFC1483 encapsulation header.')
nncFrStrStatIntervalOutDiscdDESet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 34), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalOutDiscdDESet.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalOutDiscdDESet.setDescription('Number of egress frames discarded due to transmit congestion procedures, in which the DE bit was set.')
nncFrStrStatIntervalOutDiscdDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 35), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalOutDiscdDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalOutDiscdDEClr.setDescription('Number of egress frames discarded due to transmit congestion procedures, in which the DE bit was not set.')
nncFrStrStatIntervalInDiscdDESet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 36), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalInDiscdDESet.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalInDiscdDESet.setDescription('Number of ingress frames discarded due to receive congestion procedures, in which the DE bit was set.')
nncFrStrStatIntervalInDiscdDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 37), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalInDiscdDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalInDiscdDEClr.setDescription('Number of ingress frames discarded due to receive congestion procedures, in which the DE bit was not set.')
nncFrStrStatIntervalStLMSigInvldField = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 38), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMSigInvldField.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMSigInvldField.setDescription('Number of Status signalling frames with incorrect values for the Unnumbered Information Frame field, Protocol Discriminator field, or Call Reference Field.')
nncFrStrStatIntervalStLMSigUnsupMsgType = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 39), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMSigUnsupMsgType.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMSigUnsupMsgType.setDescription('Number of Status signalling frames that are not a Status or Status Enquiry messsage (Unsupported message type).')
nncFrStrStatIntervalStLMSigInvldEID = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 40), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMSigInvldEID.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMSigInvldEID.setDescription('Number of Status signalling frames with an IEID that is not a Report Type IEID, Keep Alive Sequence IEID, or a PVC Status IEID.')
nncFrStrStatIntervalStLMSigInvldIELen = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 41), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMSigInvldIELen.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMSigInvldIELen.setDescription('Number of Status signalling frames with an IE length field size that does not conform with the Frame Relay status signalling protocol.')
nncFrStrStatIntervalStLMSigInvldRepType = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 42), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMSigInvldRepType.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMSigInvldRepType.setDescription('Number of Status signalling frames with a Report Type IE that were not a Full Report Type or a Keep Alive Confirmation.')
nncFrStrStatIntervalStLMSigFrmWithNoIEs = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 43), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMSigFrmWithNoIEs.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMSigFrmWithNoIEs.setDescription('Number of Status signalling frames that terminate before the IE appears.')
nncFrStrStatIntervalStUserSequenceErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 44), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStUserSequenceErrs.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStUserSequenceErrs.setDescription('Number of status signalling frames received with a Last Received Sequence number that is inconsistent with the expected value, the last transmitted Interval Sequence Number. If the stream is not performing user-side procedures, this value is equal to noSuchName.')
nncFrStrStatIntervalStNetSequenceErrs = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 45), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStNetSequenceErrs.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStNetSequenceErrs.setDescription('Number of status signalling frames received with a Last Received Sequence number that is inconsistent with the expected value, the last transmitted Interval Sequence Number. If the stream is not performing network-side procedures, this value is equal to noSuchName.')
nncFrStrStatIntervalStLMUTimeoutsnT1 = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 46), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMUTimeoutsnT1.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMUTimeoutsnT1.setDescription('Number of times the link integrity verification interval has been exceeded without receiving a Status message. If the stream is not performing user-side procedures, this value is equal to noSuchName.')
nncFrStrStatIntervalStLMUStatusMsgsRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 47), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMUStatusMsgsRcvd.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMUStatusMsgsRcvd.setDescription('Number of Status messages received. If the stream is not performing user-side procedures, this value is equal to noSuchName.')
nncFrStrStatIntervalStLMUStatusENQMsgsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 48), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMUStatusENQMsgsSent.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMUStatusENQMsgsSent.setDescription('Number of Status Enquiry messages sent. If the stream is not performing user-side procedures, this value is equal to noSuchName.')
nncFrStrStatIntervalStLMUAsyncStatusRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 49), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMUAsyncStatusRcvd.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMUAsyncStatusRcvd.setDescription('Number of asynchronous Update Status messages received. If the stream is not performing user-side procedures, this value is equal to noSuchName.')
nncFrStrStatIntervalStLMNTimeoutsnT2 = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 50), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMNTimeoutsnT2.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMNTimeoutsnT2.setDescription('Number of times the polling verification interval was exceeded without receivung a Keep Alive Sequence. If the stream is not performing network-side procedures, this value is equal to noSuchName.')
nncFrStrStatIntervalStLMNStatusMsgsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 51), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMNStatusMsgsSent.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMNStatusMsgsSent.setDescription('Number of Status messages sent. If the stream is not performing network-side procedures, this value is equal to noSuchName.')
nncFrStrStatIntervalStLMNStatusENQMsgsRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 52), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMNStatusENQMsgsRcvd.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMNStatusENQMsgsRcvd.setDescription('Number of Status Enquiry messages received. If the stream is not performing network-side procedures, this value is equal to noSuchName.')
nncFrStrStatIntervalStLMNAsyncStatusSent = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 53), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMNAsyncStatusSent.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStLMNAsyncStatusSent.setDescription('Number of asynchronous Update Status messages transmitted. If the stream is not performing network-side procedures, this value is equal to noSuchName.')
nncFrStrStatIntervalInCRCErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 54), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalInCRCErrors.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalInCRCErrors.setDescription('Number of frames with an incorrect CRC-16 value.')
nncFrStrStatIntervalInNonIntegral = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 55), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalInNonIntegral.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalInNonIntegral.setDescription('Number of frames with a non-integral number of octets between the delimiting HDLC flags.')
nncFrStrStatIntervalInReservedDLCI = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 56), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalInReservedDLCI.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalInReservedDLCI.setDescription('Number of frames with a DLCI that cannot be assigned to user connections.')
nncFrStrStatIntervalInInvldEA = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 57), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalInInvldEA.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalInInvldEA.setDescription('Number of frames with the EA (extended address) bit incorrectly set.')
nncFrStrStatIntervalStFrmTooSmall = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 58), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStFrmTooSmall.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStFrmTooSmall.setDescription('Number of frames that are smaller than the allowed minimum size.')
nncFrStrStatIntervalInAborts = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 59), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalInAborts.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalInAborts.setDescription('Number of aborted frames.')
nncFrStrStatIntervalInSumOfDisagremnts = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 60), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalInSumOfDisagremnts.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalInSumOfDisagremnts.setDescription('Total number of frames discarded because: the frame relay UNI or ICI was unavailable to accept frame traffic, the frame had a DLCI not available for end-user connections, the DLCI was inactive, the frame exceeded the maximum configured frame length (but its length was legal within the frame relay protocol), the frame violated the configured address field size (but had a legal address field size with the frame relay protocol), or was an unexpected status signalling frame.')
nncFrStrStatIntervalInOverRuns = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 61), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalInOverRuns.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalInOverRuns.setDescription('Number of times the receiver was forced to overrun.')
nncFrStrStatIntervalOutUnderRuns = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 62), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalOutUnderRuns.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalOutUnderRuns.setDescription('Number of times the transmitter was forced to underrun.')
nncFrStrStatIntervalStIntervalDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 63), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalStIntervalDuration.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalStIntervalDuration.setDescription('Duration of the statistics accumulation interval.')
nncFrStrStatIntervalBestEffortPeakDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 64), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(1, 60000))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalBestEffortPeakDelay.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalBestEffortPeakDelay.setDescription('The largest delay experienced by any frame that was transmitted on the stream in service category Best Effort.')
nncFrStrStatIntervalCommittedPeakDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 65), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(1, 60000))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalCommittedPeakDelay.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalCommittedPeakDelay.setDescription('The largest delay experienced by any frame that was transmitted on the stream in service category: Committed Throughptut.')
nncFrStrStatIntervalLowDelayPeakDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 66), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(1, 60000))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalLowDelayPeakDelay.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalLowDelayPeakDelay.setDescription('The largest delay experienced by any frame that was transmitted on the stream in service category: Low Delay.')
nncFrStrStatIntervalRealTimePeakDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 67), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(1, 60000))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalRealTimePeakDelay.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalRealTimePeakDelay.setDescription('The largest delay experienced by any frame that was transmitted on the stream in service category Real Time.')
nncFrStrStatIntervalBestEffortAccDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 68), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalBestEffortAccDelay.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalBestEffortAccDelay.setDescription('The accumulated delay experienced by all frames in a stream transmitted in service category Best Effort. Combined with the Out Ucast Packets for service category Best Effort, the average delay per frame can be calculated.')
nncFrStrStatIntervalCommittedAccDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 69), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalCommittedAccDelay.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalCommittedAccDelay.setDescription('The accumulated delay experienced by all frames in a stream transmitted in service category Committed Throughput. Combined with the Out Ucast Packets for service category Committed Throughput, the average delay per frame can be calculated.')
nncFrStrStatIntervalLowDelayAccDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 70), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalLowDelayAccDelay.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalLowDelayAccDelay.setDescription('The accumulated delay experienced by all frames in a stream transmitted in service category Low Delay. Combined with the Out Ucast Packets for service category Low Delay, the average delay per frame can be calculated.')
nncFrStrStatIntervalRealTimeAccDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 71), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalRealTimeAccDelay.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalRealTimeAccDelay.setDescription('The accumulated delay experienced by all frames in a stream transmitted in service category Real Time. Combined with the Out Ucast Packets for service category Real Time, the average delay per frame can be calculated.')
nncFrStrStatIntervalBestEffortOutUCastPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 72), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalBestEffortOutUCastPackets.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalBestEffortOutUCastPackets.setDescription('Number of unerrored, unicast frames transmitted in service category Best Effort.')
nncFrStrStatIntervalCommittedOutUCastPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 73), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalCommittedOutUCastPackets.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalCommittedOutUCastPackets.setDescription('Number of unerrored, unicast frames transmitted in service category Committed Throughput.')
nncFrStrStatIntervalLowDelayOutUCastPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 74), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalLowDelayOutUCastPackets.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalLowDelayOutUCastPackets.setDescription('Number of unerrored, unicast frames transmitted in service category Low Delay.')
nncFrStrStatIntervalRealTimeOutUCastPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 75), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalRealTimeOutUCastPackets.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalRealTimeOutUCastPackets.setDescription('Number of unerrored, unicast frames transmitted in service category Real Time.')
nncFrStrStatIntervalBestEffortUCastPacketsDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 76), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalBestEffortUCastPacketsDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalBestEffortUCastPacketsDEClr.setDescription('Number of unerrored, unicast frames with the DE bit not set transmitted in service category Best Effort.')
nncFrStrStatIntervalCommittedUCastPacketsDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 77), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalCommittedUCastPacketsDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalCommittedUCastPacketsDEClr.setDescription('Number of unerrored, unicast frames with the DE bit not set transmitted in service category Committed Throughput.')
nncFrStrStatIntervalLowDelayUCastPacketsDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 78), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalLowDelayUCastPacketsDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalLowDelayUCastPacketsDEClr.setDescription('Number of unerrored, unicast frames with the DE bit not set transmitted in service category Low Delay.')
nncFrStrStatIntervalRealTimeUCastPacketsDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 79), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalRealTimeUCastPacketsDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalRealTimeUCastPacketsDEClr.setDescription('Number of unerrored, unicast frames with the DE bit not set, transmitted in service category Real Time.')
nncFrStrStatIntervalBestEffortDiscdDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 80), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalBestEffortDiscdDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalBestEffortDiscdDEClr.setDescription('Number of unerrored, unicast frames with the DE bit not set, discarded by QoS procedures in service category Best Effort.')
nncFrStrStatIntervalCommittedDiscdDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 81), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalCommittedDiscdDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalCommittedDiscdDEClr.setDescription('Number of unerrored, unicast frames with the DE bit not set, discarded by QoS procedures in service category Committed Throughput.')
nncFrStrStatIntervalLowDelayDiscdDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 82), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalLowDelayDiscdDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalLowDelayDiscdDEClr.setDescription('Number of unerrored, unicast frames with the DE bit not set, discarded by QoS procedures in service category Low Delay.')
nncFrStrStatIntervalRealTimeDiscdDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 2, 1, 83), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrStatIntervalRealTimeDiscdDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalRealTimeDiscdDEClr.setDescription('Number of unerrored, unicast frames with the DE bit not set, discarded by QoS procedures in service category Real Time.')
nncFrPVCEndptStatCurrentTable = MibTable((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3), )
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentTable.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentTable.setDescription('The nncFrPVCEndptStatCurrentTable contains objects for monitoring performance of a frame relay endpoint during the current 1hr interval.')
nncFrPVCEndptStatCurrentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentDLCINumber"))
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentEntry.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentEntry.setDescription('An entry in the 1hr current statistics table. Each conceptual row contains current interval statistics for a particular PVC Endpoint.')
nncFrPVCEndptStatCurrentDLCINumber = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1024)))
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentDLCINumber.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentDLCINumber.setDescription('The DLCI number of the stream to which statistics in this row belong.')
nncFrPVCEndptStatCurrentState = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 2), NncExtIntvlStateType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentState.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentState.setDescription('The state of the current interval. The object provides a status for those entries which have been reset by the user or have been subject to a wall-clock time change.')
nncFrPVCEndptStatCurrentAbsoluteIntervalNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 96)))
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentAbsoluteIntervalNumber.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentAbsoluteIntervalNumber.setDescription('The absolute interval number of this interval.')
nncFrPVCEndptStatCurrentInFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 4), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInFrames.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInFrames.setDescription('Number of frames received on this PVC Endpoint.')
nncFrPVCEndptStatCurrentOutFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 5), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutFrames.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutFrames.setDescription('Number of frames transmitted on this PVC Endpoint.')
nncFrPVCEndptStatCurrentInOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 6), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInOctets.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInOctets.setDescription('Number of bytes received on this PVC Endpoint.')
nncFrPVCEndptStatCurrentOutOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 7), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutOctets.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutOctets.setDescription('Number of bytes transmitted on this PVC Endpoint.')
nncFrPVCEndptStatCurrentInDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 8), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInDiscards.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInDiscards.setDescription('Number of frames received by the network (ingress) that were discarded due to traffic enforcement for this PVC Endpoint.')
nncFrPVCEndptStatCurrentOutExcessFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 9), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutExcessFrames.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutExcessFrames.setDescription('Number of frames transmitted by the network (egress) for this PVC Endpoint that were treated as excess traffic (the DE bit may be set to one).')
nncFrPVCEndptStatCurrentInDEFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 10), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInDEFrames.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInDEFrames.setDescription('Number of frames received by the network (ingress) with the DE bit set to (1) for the PVC Endpoint.')
nncFrPVCEndptStatCurrentInCosTagDeFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 11), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInCosTagDeFrames.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInCosTagDeFrames.setDescription('Number of frames received by the network (ingress) for this PVC Endpoint that were policed from normal to excess traffic (the DE bit was set to one) and transmitted.')
nncFrPVCEndptStatCurrentInOctetsDESet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 12), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInOctetsDESet.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInOctetsDESet.setDescription('Number of bytes received on this PVC Endpoint with the DE bit set.')
nncFrPVCEndptStatCurrentInFramesBECNSet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 13), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInFramesBECNSet.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInFramesBECNSet.setDescription('Number of frames received by the network (ingress) for this PVC Endpoint that had the BECN bit set.')
nncFrPVCEndptStatCurrentInFramesFECNSet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 14), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInFramesFECNSet.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInFramesFECNSet.setDescription('Number of frames received by the network (ingress) for this PVC Endpoint that had the FECN bit set.')
nncFrPVCEndptStatCurrentInInvdLength = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 15), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInInvdLength.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInInvdLength.setDescription('Number of frames received by the network (ingress) for this PVC Endpoint that were discarded because the frame had no data, or the data exceeded the maximum allowed length.')
nncFrPVCEndptStatCurrentOutOctetsDESet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 16), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutOctetsDESet.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutOctetsDESet.setDescription('Number of bytes transmitted on this PVC Endpoint with the DE bit set.')
nncFrPVCEndptStatCurrentOutFramesBECNSet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 17), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutFramesBECNSet.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutFramesBECNSet.setDescription('Number of frames transmitted by the network (egress) for this PVC Endpoint that had the BECN bit set.')
nncFrPVCEndptStatCurrentOutFramesFECNSet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 18), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutFramesFECNSet.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutFramesFECNSet.setDescription('Number of frames transmitted by the network (egress) for this PVC Endpoint that had the FECN bit set.')
nncFrPVCEndptStatCurrentOutFramesInRed = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 19), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutFramesInRed.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutFramesInRed.setDescription('Number of frames transmitted by the network (egress) for this PVC Endpoint when the frame stream was in Red State.')
nncFrPVCEndptStatCurrentInDiscdOctetsCOS = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 20), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInDiscdOctetsCOS.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInDiscdOctetsCOS.setDescription('Number of bytes discarded because of receive class-of-service enforcement on the PVC Endpoint.')
nncFrPVCEndptStatCurrentInDiscdDESet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 21), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInDiscdDESet.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInDiscdDESet.setDescription('Number of frames discarded because of receive congestion procedures, in which the DE bit was set.')
nncFrPVCEndptStatCurrentInDiscdDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 22), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInDiscdDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInDiscdDEClr.setDescription('Number of frames discarded because of receive congestion procedures, in which the DE bit was not set.')
nncFrPVCEndptStatCurrentInDiscdBadEncaps = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 23), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInDiscdBadEncaps.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInDiscdBadEncaps.setDescription('Number of frames discarded on this PVC Endpoint because of a bad receive RFC1490 encapsulation header.')
nncFrPVCEndptStatCurrentInDiscdUnsupEncaps = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 24), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInDiscdUnsupEncaps.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInDiscdUnsupEncaps.setDescription('Number of frames discarded on this PVC Endpoint because of an unsupported receive RFC1490 encapsulation header.')
nncFrPVCEndptStatCurrentInDiscdCOSDESet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 25), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInDiscdCOSDESet.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInDiscdCOSDESet.setDescription('Number of frames discarded due to receive class of service procedures, in which the DE bit was set.')
nncFrPVCEndptStatCurrentInDiscdCOSDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 26), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInDiscdCOSDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentInDiscdCOSDEClr.setDescription('Number of frames discarded for the PVC Endpoint due to receive class of service procedures, in which the DE bit was not set.')
nncFrPVCEndptStatCurrentOutDiscdDESet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 27), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutDiscdDESet.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutDiscdDESet.setDescription('Number of frames discarded for the PVC Endpoint due to transmit congestion procedures, in which the DE bit was set.')
nncFrPVCEndptStatCurrentOutDiscdDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 28), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutDiscdDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutDiscdDEClr.setDescription('Number of frames discarded for the PVC Endpoint due to transmit congestion procedures, in which the DE bit was not set.')
nncFrPVCEndptStatCurrentOutDiscdBadEncaps = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 29), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutDiscdBadEncaps.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutDiscdBadEncaps.setDescription('Number of frames discarded for the PVC Endpoint due to having a bad RFC1483 encapsulation header.')
nncFrPVCEndptStatCurrentOutDiscdUnsupEncaps = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 30), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutDiscdUnsupEncaps.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentOutDiscdUnsupEncaps.setDescription('Number of frames discarded for the PVC Endpoint due to having an unsupported RFC1483 encapsulation header.')
nncFrPVCEndptStatCurrentStReasDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 3, 1, 31), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentStReasDiscards.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentStReasDiscards.setDescription('Number of frames discarded for the PVC Endpoint due to any reassembly errors.')
nncFrPVCEndptStatIntervalTable = MibTable((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4), )
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalTable.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalTable.setDescription('The nncFrPVCEndptStatIntervalTable contains objects for monitoring performance of a frame relay endpoint over M 1hr historical intervals.')
nncFrPVCEndptStatIntervalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalDLCINumber"), (0, "NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalNumber"))
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalEntry.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalEntry.setDescription('An entry in the 1hr interval statistics table. Each conceptual row contains statistics for a particular PVC Endpoint and interval.')
nncFrPVCEndptStatIntervalDLCINumber = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1024)))
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalDLCINumber.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalDLCINumber.setDescription('The DLCI number of the stream to which statistics in this row belong.')
nncFrPVCEndptStatIntervalNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 96)))
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalNumber.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalNumber.setDescription('The interval number (N) of the statistics in this row.')
nncFrPVCEndptStatIntervalState = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 3), NncExtIntvlStateType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalState.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalState.setDescription('The state of the interval represented by this row. The object provides a status for those entries which have been reset by the user or have been subject to a wall- clock time change.')
nncFrPVCEndptStatIntervalAbsoluteIntervalNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 96)))
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalAbsoluteIntervalNumber.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalAbsoluteIntervalNumber.setDescription('The absolute interval number of this interval.')
nncFrPVCEndptStatIntervalInFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 5), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInFrames.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInFrames.setDescription('Number of frames received on this PVC Endpoint.')
nncFrPVCEndptStatIntervalOutFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 6), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutFrames.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutFrames.setDescription('Number of frames transmitted on this PVC Endpoint.')
nncFrPVCEndptStatIntervalInOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 7), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInOctets.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInOctets.setDescription('Number of bytes received on this PVC Endpoint.')
nncFrPVCEndptStatIntervalOutOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 8), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutOctets.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutOctets.setDescription('Number of bytes transmitted on this PVC Endpoint.')
nncFrPVCEndptStatIntervalInDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 9), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInDiscards.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInDiscards.setDescription('Number of frames received by the network (ingress) that were discarded due to traffic enforcement for this PVC Endpoint.')
nncFrPVCEndptStatIntervalOutExcessFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 10), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutExcessFrames.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutExcessFrames.setDescription('Number of frames transmitted by the network (egress) for this PVC Endpoint that were treated as excess traffic (the DE bit may be set to one).')
nncFrPVCEndptStatIntervalInDEFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 11), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInDEFrames.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInDEFrames.setDescription('Number of frames received by the network (ingress) with the DE bit set to (1) for the PVC Endpoint.')
nncFrPVCEndptStatIntervalInCosTagDeFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 12), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInCosTagDeFrames.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInCosTagDeFrames.setDescription('Number of frames received by the network (ingress) for this PVC Endpoint that were policed to be excess traffic (the DE bit was set to one) and transmitted.')
nncFrPVCEndptStatIntervalInOctetsDESet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 13), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInOctetsDESet.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInOctetsDESet.setDescription('Number of bytes received on this PVC Endpoint with the DE bit set.')
nncFrPVCEndptStatIntervalInFramesBECNSet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 14), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInFramesBECNSet.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInFramesBECNSet.setDescription('Number of frames received by the network (ingress) for this PVC Endpoint that had the BECN bit set.')
nncFrPVCEndptStatIntervalInFramesFECNSet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 15), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInFramesFECNSet.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInFramesFECNSet.setDescription('Number of frames received by the network (ingress) for this PVC Endpoint that had the FECN bit set.')
nncFrPVCEndptStatIntervalInInvdLength = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 16), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInInvdLength.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInInvdLength.setDescription('Number of frames received by the network (ingress) for this PVC Endpoint that were discarded because the frame had no data, or the data exceeded the maximum allowed length.')
nncFrPVCEndptStatIntervalOutOctetsDESet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 17), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutOctetsDESet.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutOctetsDESet.setDescription('Number of bytes transmitted on this PVC Endpoint with the DE bit set.')
nncFrPVCEndptStatIntervalOutFramesBECNSet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 18), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutFramesBECNSet.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutFramesBECNSet.setDescription('Number of frames transmitted by the network (egress) for this PVC Endpoint that had the BECN bit set.')
nncFrPVCEndptStatIntervalOutFramesFECNSet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 19), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutFramesFECNSet.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutFramesFECNSet.setDescription('Number of frames transmitted by the network (egress) for this PVC Endpoint that had the FECN bit set.')
nncFrPVCEndptStatIntervalOutFramesInRed = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 20), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutFramesInRed.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutFramesInRed.setDescription('Number of frames transmitted by the network (egress) for this PVC Endpoint when the frame stream was in Red State.')
nncFrPVCEndptStatIntervalInDiscdOctetsCOS = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 21), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInDiscdOctetsCOS.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInDiscdOctetsCOS.setDescription('Number of bytes discarded because of receive class-of-service enforcement on the PVC Endpoint.')
nncFrPVCEndptStatIntervalInDiscdDESet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 22), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInDiscdDESet.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInDiscdDESet.setDescription('Number of frames discarded because of receive congestion procedures, in which the DE bit was set.')
nncFrPVCEndptStatIntervalInDiscdDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 23), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInDiscdDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInDiscdDEClr.setDescription('Number of frames discarded because of receive congestion procedures, in which the DE bit was not set.')
nncFrPVCEndptStatIntervalInDiscdBadEncaps = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 24), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInDiscdBadEncaps.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInDiscdBadEncaps.setDescription('Number of frames discarded on this PVC Endpoint because of a bad receive RFC1490 encapsulation header.')
nncFrPVCEndptStatIntervalInDiscdUnsupEncaps = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 25), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInDiscdUnsupEncaps.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInDiscdUnsupEncaps.setDescription('Number of frames discarded on this PVC Endpoint because of an unsupported receive RFC1490 encapsulation header.')
nncFrPVCEndptStatIntervalInDiscdCOSDESet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 26), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInDiscdCOSDESet.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInDiscdCOSDESet.setDescription('Number of frames discarded due to receive class of service procedures, in which the DE bit was set.')
nncFrPVCEndptStatIntervalInDiscdCOSDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 27), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInDiscdCOSDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalInDiscdCOSDEClr.setDescription('Number of frames discarded for the PVC Endpoint due to receive class of service procedures, in which the DE bit was not set.')
nncFrPVCEndptStatIntervalOutDiscdDESet = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 28), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutDiscdDESet.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutDiscdDESet.setDescription('Number of frames discarded for the PVC Endpoint due to transmit congestion procedures, in which the DE bit was set.')
nncFrPVCEndptStatIntervalOutDiscdDEClr = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 29), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutDiscdDEClr.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutDiscdDEClr.setDescription('Number of frames discarded for the PVC Endpoint due to transmit congestion procedures, in which the DE bit was not set.')
nncFrPVCEndptStatIntervalOutDiscdBadEncaps = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 30), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutDiscdBadEncaps.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutDiscdBadEncaps.setDescription('Number of frames discarded for the PVC Endpoint due to having a bad RFC1483 encapsulation header.')
nncFrPVCEndptStatIntervalOutDiscdUnsupEncaps = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 31), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutDiscdUnsupEncaps.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalOutDiscdUnsupEncaps.setDescription('Number of frames discarded for the PVC Endpoint due to having an unsupported RFC1483 encapsulation header.')
nncFrPVCEndptStatIntervalStReasDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 4, 1, 32), NncExtCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalStReasDiscards.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalStReasDiscards.setDescription('Number of frames discarded for the PVC Endpoint due to any reassembly errors.')
nncFrDepthOfHistoricalStrata = MibScalar((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 96))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrDepthOfHistoricalStrata.setStatus('current')
if mibBuilder.loadTexts: nncFrDepthOfHistoricalStrata.setDescription('Depth of historical strata of FR interval statistics.')
nncFrStrBertStatTable = MibTable((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 6), )
if mibBuilder.loadTexts: nncFrStrBertStatTable.setStatus('current')
if mibBuilder.loadTexts: nncFrStrBertStatTable.setDescription('The nncFrStrBertStatTable contains objects for reporting the current statistics of a BERT being performed on a frame relay stream. This feature is introduced in Rel 2.2 frame relay cards.')
nncFrStrBertStatEntry = MibTableRow((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 6, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: nncFrStrBertStatEntry.setStatus('current')
if mibBuilder.loadTexts: nncFrStrBertStatEntry.setDescription('An entry in the BERT statistics table. Each conceptual row contains statistics related to the BERT being performed on a specific DLCI within a particular frame relay stream.')
nncFrStrBertDlci = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 6, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrBertDlci.setStatus('current')
if mibBuilder.loadTexts: nncFrStrBertDlci.setDescription('This object indicates if there is a BERT active on the frame relay stream, and when active on which DLCI the BERT is active on. WHERE: 0 = BERT not active, non-zero = DLCI')
nncFrStrBertStatStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 6, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1))).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrBertStatStatus.setStatus('current')
if mibBuilder.loadTexts: nncFrStrBertStatStatus.setDescription('The current status of the BERT when the BERT is activated: where 0 = Loss of pattern sync. 1 = Pattern Sync.')
nncFrStrBertStatTxFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 6, 1, 3), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrBertStatTxFrames.setStatus('current')
if mibBuilder.loadTexts: nncFrStrBertStatTxFrames.setDescription('The number of Frames transmitted onto the stream by BERT Task. Each BERT Frame is of a fixed size and contains a fixed pattern.')
nncFrStrBertStatRxFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 6, 1, 4), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrBertStatRxFrames.setStatus('current')
if mibBuilder.loadTexts: nncFrStrBertStatRxFrames.setDescription('The number of Frames received while the BERT is in pattern sync. The Rx Frame count will only be incremented when in pattern sync and the received packet is the correct size and contains the DLCI being BERTED.')
nncFrStrBertStatRxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 6, 1, 5), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrBertStatRxBytes.setStatus('current')
if mibBuilder.loadTexts: nncFrStrBertStatRxBytes.setDescription('The number of Bytes transmitted onto the stream by BERT Task. Each BERT packet is of a fixed size and contains a fixed pattern.')
nncFrStrBertStatTxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 6, 1, 6), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrBertStatTxBytes.setStatus('current')
if mibBuilder.loadTexts: nncFrStrBertStatTxBytes.setDescription('The number of Bytes transmitted while the BERT is in pattern sync. The Tx Byte count will only be incremented when in pattern sync.')
nncFrStrBertStatRxErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 6, 1, 7), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrBertStatRxErrors.setStatus('current')
if mibBuilder.loadTexts: nncFrStrBertStatRxErrors.setDescription('The number of errors detected in the received packets while the BERT is in pattern sync. Packets flagged as having CRC errors that contain the DLCI being BERTED and the correct packet size being BERTED will be scanned for errors and the number of errors accumulated in this counter.')
nncFrStrBertStatEstErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 123, 3, 30, 1, 6, 1, 8), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: nncFrStrBertStatEstErrors.setStatus('current')
if mibBuilder.loadTexts: nncFrStrBertStatEstErrors.setDescription('The estimated number of errors encountered by the packets being transmitted while the BERT is in pattern sync based on the fact that the packets are not returned, and pattern sync is maintained.')
nncFrStrStatCurrentGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 123, 3, 30, 3, 1)).setObjects(("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentState"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentAbsoluteIntervalNumber"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentInOctets"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentOutOctets"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentInUCastPackets"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentOutUCastPackets"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentInDiscards"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentOutDiscards"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentInErrors"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentOutErrors"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentSigUserProtErrors"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentSigNetProtErrors"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentSigUserLinkRelErrors"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentSigNetLinkRelErrors"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentSigUserChanInactive"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentSigNetChanInactive"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStSCAlarms"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStTimeSC"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStMaxDurationRED"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStMCAlarms"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStTimeMC"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentOutLinkUtilization"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentInLinkUtilization"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentInInvdLength"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStLastErroredDLCI"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentInDiscdOctetsCOS"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentInDiscdCOSDESet"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentInDiscdCOSDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentInDiscdBadEncaps"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentOutDiscdBadEncaps"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentInDiscdUnsupEncaps"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentOutDiscdUnsupEncaps"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentOutDiscdDESet"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentOutDiscdDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentInDiscdDESet"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentInDiscdDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStLMSigInvldField"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStLMSigUnsupMsgType"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStLMSigInvldEID"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStLMSigInvldIELen"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStLMSigInvldRepType"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStLMSigFrmWithNoIEs"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStUserSequenceErrs"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStNetSequenceErrs"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStLMUTimeoutsnT1"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStLMUStatusMsgsRcvd"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStLMUStatusENQMsgsSent"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStLMUAsyncStatusRcvd"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStLMNTimeoutsnT2"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStLMNStatusMsgsSent"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStLMNStatusENQMsgsRcvd"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStLMNAsyncStatusSent"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentInCRCErrors"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentInNonIntegral"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentInReservedDLCI"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentInInvldEA"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStFrmTooSmall"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentInAborts"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentInSumOfDisagremnts"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentInOverRuns"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentOutUnderRuns"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentStIntervalDuration"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentBestEffortPeakDelay"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentCommittedPeakDelay"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentLowDelayPeakDelay"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentRealTimePeakDelay"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentBestEffortAccDelay"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentCommittedAccDelay"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentLowDelayAccDelay"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentRealTimeAccDelay"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentBestEffortOutUCastPackets"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentCommittedOutUCastPackets"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentLowDelayOutUCastPackets"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentRealTimeOutUCastPackets"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentBestEffortUCastPacketsDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentCommittedUCastPacketsDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentLowDelayUCastPacketsDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentRealTimeUCastPacketsDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentBestEffortDiscdDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentCommittedDiscdDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentLowDelayDiscdDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentRealTimeDiscdDEClr"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
nncFrStrStatCurrentGroup = nncFrStrStatCurrentGroup.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatCurrentGroup.setDescription('Collection of objects providing 1hr current statistics for a FR stream.')
nncFrStrStatIntervalGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 123, 3, 30, 3, 2)).setObjects(("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalNumber"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalState"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalAbsoluteIntervalNumber"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalInOctets"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalOutOctets"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalInUCastPackets"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalOutUCastPackets"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalInDiscards"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalOutDiscards"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalInErrors"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalOutErrors"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalSigUserProtErrors"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalSigNetProtErrors"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalSigUserLinkRelErrors"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalSigNetLinkRelErrors"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalSigUserChanInactive"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalSigNetChanInactive"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStSCAlarms"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStTimeSC"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStMaxDurationRED"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStMCAlarms"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStTimeMC"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalOutLinkUtilization"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalInLinkUtilization"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalInInvdLength"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStLastErroredDLCI"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalInDiscdOctetsCOS"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalInDiscdCOSDESet"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalInDiscdCOSDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalInDiscdBadEncaps"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalOutDiscdBadEncaps"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalInDiscdUnsupEncaps"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalOutDiscdUnsupEncaps"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalOutDiscdDESet"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalOutDiscdDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalInDiscdDESet"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalInDiscdDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStLMSigInvldField"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStLMSigUnsupMsgType"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStLMSigInvldEID"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStLMSigInvldIELen"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStLMSigInvldRepType"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStLMSigFrmWithNoIEs"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStUserSequenceErrs"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStNetSequenceErrs"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStLMUTimeoutsnT1"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStLMUStatusMsgsRcvd"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStLMUStatusENQMsgsSent"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStLMUAsyncStatusRcvd"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStLMNTimeoutsnT2"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStLMNStatusMsgsSent"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStLMNStatusENQMsgsRcvd"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStLMNAsyncStatusSent"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalInCRCErrors"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalInNonIntegral"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalInReservedDLCI"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalInInvldEA"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStFrmTooSmall"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalInAborts"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalInSumOfDisagremnts"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalInOverRuns"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalOutUnderRuns"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalStIntervalDuration"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalBestEffortPeakDelay"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalCommittedPeakDelay"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalLowDelayPeakDelay"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalRealTimePeakDelay"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalBestEffortAccDelay"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalCommittedAccDelay"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalLowDelayAccDelay"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalRealTimeAccDelay"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalBestEffortOutUCastPackets"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalCommittedOutUCastPackets"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalLowDelayOutUCastPackets"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalRealTimeOutUCastPackets"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalBestEffortUCastPacketsDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalCommittedUCastPacketsDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalLowDelayUCastPacketsDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalRealTimeUCastPacketsDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalBestEffortDiscdDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalCommittedDiscdDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalLowDelayDiscdDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrStatIntervalRealTimeDiscdDEClr"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
nncFrStrStatIntervalGroup = nncFrStrStatIntervalGroup.setStatus('current')
if mibBuilder.loadTexts: nncFrStrStatIntervalGroup.setDescription('Collection of objects providing 1hr interval statistics for a FR stream.')
nncFrPVCEndptStatCurrentGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 123, 3, 30, 3, 3)).setObjects(("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentDLCINumber"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentState"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentAbsoluteIntervalNumber"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentInFrames"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentOutFrames"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentInOctets"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentOutOctets"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentInDiscards"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentOutExcessFrames"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentInDEFrames"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentInCosTagDeFrames"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentInOctetsDESet"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentInFramesBECNSet"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentInFramesFECNSet"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentInInvdLength"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentOutOctetsDESet"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentOutFramesBECNSet"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentOutFramesFECNSet"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentOutFramesInRed"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentInDiscdOctetsCOS"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentInDiscdDESet"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentInDiscdDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentInDiscdBadEncaps"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentInDiscdUnsupEncaps"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentInDiscdCOSDESet"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentInDiscdCOSDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentOutDiscdDESet"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentOutDiscdDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentOutDiscdBadEncaps"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentOutDiscdUnsupEncaps"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentStReasDiscards"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
nncFrPVCEndptStatCurrentGroup = nncFrPVCEndptStatCurrentGroup.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatCurrentGroup.setDescription('Collection of objects providing 1hr current statistics for a FR PVC Endpoint.')
nncFrPVCEndptStatIntervalGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 123, 3, 30, 3, 4)).setObjects(("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalDLCINumber"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalNumber"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalState"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalAbsoluteIntervalNumber"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalInFrames"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalOutFrames"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalInOctets"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalOutOctets"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalInDiscards"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalOutExcessFrames"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalInDEFrames"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalInCosTagDeFrames"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalInOctetsDESet"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalInFramesBECNSet"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalInFramesFECNSet"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalInInvdLength"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalOutOctetsDESet"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalOutFramesBECNSet"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalOutFramesFECNSet"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalOutFramesInRed"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalInDiscdOctetsCOS"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalInDiscdDESet"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalInDiscdDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalInDiscdBadEncaps"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalInDiscdUnsupEncaps"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalInDiscdCOSDESet"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalInDiscdCOSDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalOutDiscdDESet"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalOutDiscdDEClr"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalOutDiscdBadEncaps"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalOutDiscdUnsupEncaps"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatIntervalStReasDiscards"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
nncFrPVCEndptStatIntervalGroup = nncFrPVCEndptStatIntervalGroup.setStatus('current')
if mibBuilder.loadTexts: nncFrPVCEndptStatIntervalGroup.setDescription('Collection of objects providing 1hr current statistics for a FR PVC Endpoint.')
nncFrStrBertStatGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 123, 3, 30, 3, 6)).setObjects(("NNCFRINTSTATISTICS-MIB", "nncFrStrBertDlci"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrBertStatStatus"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrBertStatTxFrames"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrBertStatRxFrames"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrBertStatTxBytes"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrBertStatRxBytes"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrBertStatRxErrors"), ("NNCFRINTSTATISTICS-MIB", "nncFrStrBertStatEstErrors"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
nncFrStrBertStatGroup = nncFrStrBertStatGroup.setStatus('current')
if mibBuilder.loadTexts: nncFrStrBertStatGroup.setDescription('Collection of objects providing BERT statistics for a BERT performed on a Frame Relay stream.')
nncFrIntStatisticsCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 123, 3, 30, 4, 1)).setObjects(("NNCFRINTSTATISTICS-MIB", "nncFrStrStatCurrentGroup"), ("NNCFRINTSTATISTICS-MIB", "nncFrPVCEndptStatCurrentGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
nncFrIntStatisticsCompliance = nncFrIntStatisticsCompliance.setStatus('current')
if mibBuilder.loadTexts: nncFrIntStatisticsCompliance.setDescription('The compliance statement for Newbridge SNMP entities which have FR streams and endpoints.')
mibBuilder.exportSymbols("NNCFRINTSTATISTICS-MIB", nncFrStrStatIntervalInDiscdOctetsCOS=nncFrStrStatIntervalInDiscdOctetsCOS, nncFrStrStatCurrentStMCAlarms=nncFrStrStatCurrentStMCAlarms, nncFrStrStatCurrentTable=nncFrStrStatCurrentTable, nncFrPVCEndptStatCurrentOutDiscdBadEncaps=nncFrPVCEndptStatCurrentOutDiscdBadEncaps, nncFrPVCEndptStatCurrentStReasDiscards=nncFrPVCEndptStatCurrentStReasDiscards, nncFrStrStatIntervalStLMUStatusENQMsgsSent=nncFrStrStatIntervalStLMUStatusENQMsgsSent, nncFrStrStatCurrentSigNetLinkRelErrors=nncFrStrStatCurrentSigNetLinkRelErrors, nncFrStrStatIntervalOutDiscdUnsupEncaps=nncFrStrStatIntervalOutDiscdUnsupEncaps, nncFrStrStatCurrentInDiscdOctetsCOS=nncFrStrStatCurrentInDiscdOctetsCOS, nncFrStrStatCurrentCommittedOutUCastPackets=nncFrStrStatCurrentCommittedOutUCastPackets, nncFrPVCEndptStatCurrentGroup=nncFrPVCEndptStatCurrentGroup, nncFrStrStatIntervalStTimeMC=nncFrStrStatIntervalStTimeMC, nncFrPVCEndptStatIntervalInOctets=nncFrPVCEndptStatIntervalInOctets, nncFrStrBertStatTxBytes=nncFrStrBertStatTxBytes, nncFrStrStatCurrentCommittedPeakDelay=nncFrStrStatCurrentCommittedPeakDelay, nncFrPVCEndptStatCurrentInFrames=nncFrPVCEndptStatCurrentInFrames, nncFrStrStatCurrentInInvldEA=nncFrStrStatCurrentInInvldEA, nncFrStrStatCurrentInOverRuns=nncFrStrStatCurrentInOverRuns, nncFrPVCEndptStatIntervalNumber=nncFrPVCEndptStatIntervalNumber, nncFrStrStatIntervalLowDelayOutUCastPackets=nncFrStrStatIntervalLowDelayOutUCastPackets, nncFrPVCEndptStatCurrentOutOctets=nncFrPVCEndptStatCurrentOutOctets, nncFrPVCEndptStatIntervalInInvdLength=nncFrPVCEndptStatIntervalInInvdLength, nncFrStrStatIntervalSigUserLinkRelErrors=nncFrStrStatIntervalSigUserLinkRelErrors, nncFrPVCEndptStatCurrentInFramesFECNSet=nncFrPVCEndptStatCurrentInFramesFECNSet, nncFrIntStatisticsGroups=nncFrIntStatisticsGroups, nncFrStrBertStatTxFrames=nncFrStrBertStatTxFrames, nncFrStrStatIntervalStUserSequenceErrs=nncFrStrStatIntervalStUserSequenceErrs, nncFrPVCEndptStatCurrentOutOctetsDESet=nncFrPVCEndptStatCurrentOutOctetsDESet, nncFrPVCEndptStatIntervalInDiscdOctetsCOS=nncFrPVCEndptStatIntervalInDiscdOctetsCOS, nncFrStrBertStatEstErrors=nncFrStrBertStatEstErrors, nncFrStrStatCurrentAbsoluteIntervalNumber=nncFrStrStatCurrentAbsoluteIntervalNumber, nncFrStrStatCurrentStLMSigInvldRepType=nncFrStrStatCurrentStLMSigInvldRepType, nncFrPVCEndptStatIntervalInOctetsDESet=nncFrPVCEndptStatIntervalInOctetsDESet, nncFrStrStatCurrentInDiscdUnsupEncaps=nncFrStrStatCurrentInDiscdUnsupEncaps, nncFrStrStatIntervalInDiscards=nncFrStrStatIntervalInDiscards, nncFrIntStatistics=nncFrIntStatistics, nncFrStrStatCurrentCommittedDiscdDEClr=nncFrStrStatCurrentCommittedDiscdDEClr, nncFrStrStatIntervalInDiscdCOSDESet=nncFrStrStatIntervalInDiscdCOSDESet, nncFrPVCEndptStatIntervalInFramesFECNSet=nncFrPVCEndptStatIntervalInFramesFECNSet, nncFrStrStatCurrentInSumOfDisagremnts=nncFrStrStatCurrentInSumOfDisagremnts, nncFrPVCEndptStatIntervalInDiscdCOSDESet=nncFrPVCEndptStatIntervalInDiscdCOSDESet, nncFrPVCEndptStatIntervalStReasDiscards=nncFrPVCEndptStatIntervalStReasDiscards, nncFrStrStatCurrentSigNetChanInactive=nncFrStrStatCurrentSigNetChanInactive, nncFrStrStatCurrentInInvdLength=nncFrStrStatCurrentInInvdLength, nncFrStrStatCurrentStTimeMC=nncFrStrStatCurrentStTimeMC, nncFrStrStatCurrentRealTimePeakDelay=nncFrStrStatCurrentRealTimePeakDelay, nncFrStrStatIntervalInDiscdUnsupEncaps=nncFrStrStatIntervalInDiscdUnsupEncaps, nncFrStrStatIntervalStIntervalDuration=nncFrStrStatIntervalStIntervalDuration, nncFrPVCEndptStatCurrentInDiscdOctetsCOS=nncFrPVCEndptStatCurrentInDiscdOctetsCOS, nncFrStrStatCurrentStUserSequenceErrs=nncFrStrStatCurrentStUserSequenceErrs, nncFrPVCEndptStatIntervalOutDiscdDESet=nncFrPVCEndptStatIntervalOutDiscdDESet, nncFrStrBertStatRxFrames=nncFrStrBertStatRxFrames, nncFrStrStatCurrentInErrors=nncFrStrStatCurrentInErrors, nncFrStrStatIntervalStLMSigUnsupMsgType=nncFrStrStatIntervalStLMSigUnsupMsgType, nncFrStrStatIntervalRealTimeOutUCastPackets=nncFrStrStatIntervalRealTimeOutUCastPackets, nncFrStrStatIntervalLowDelayUCastPacketsDEClr=nncFrStrStatIntervalLowDelayUCastPacketsDEClr, nncFrStrStatCurrentState=nncFrStrStatCurrentState, nncFrStrStatIntervalOutDiscards=nncFrStrStatIntervalOutDiscards, nncFrStrStatIntervalRealTimeDiscdDEClr=nncFrStrStatIntervalRealTimeDiscdDEClr, nncFrStrStatCurrentStLMUStatusENQMsgsSent=nncFrStrStatCurrentStLMUStatusENQMsgsSent, nncFrStrStatIntervalBestEffortOutUCastPackets=nncFrStrStatIntervalBestEffortOutUCastPackets, nncFrStrStatCurrentInDiscdDEClr=nncFrStrStatCurrentInDiscdDEClr, nncFrIntStatisticsCompliances=nncFrIntStatisticsCompliances, nncFrStrStatCurrentBestEffortPeakDelay=nncFrStrStatCurrentBestEffortPeakDelay, nncFrStrStatIntervalStTimeSC=nncFrStrStatIntervalStTimeSC, nncFrStrBertStatRxErrors=nncFrStrBertStatRxErrors, nncFrStrStatCurrentLowDelayOutUCastPackets=nncFrStrStatCurrentLowDelayOutUCastPackets, nncFrStrStatCurrentInUCastPackets=nncFrStrStatCurrentInUCastPackets, nncFrStrStatIntervalStLMSigInvldIELen=nncFrStrStatIntervalStLMSigInvldIELen, nncFrStrStatIntervalRealTimeAccDelay=nncFrStrStatIntervalRealTimeAccDelay, nncFrStrStatCurrentOutUnderRuns=nncFrStrStatCurrentOutUnderRuns, nncFrStrStatIntervalOutDiscdDESet=nncFrStrStatIntervalOutDiscdDESet, nncFrStrStatIntervalOutUnderRuns=nncFrStrStatIntervalOutUnderRuns, nncFrPVCEndptStatIntervalState=nncFrPVCEndptStatIntervalState, nncFrStrStatCurrentStLastErroredDLCI=nncFrStrStatCurrentStLastErroredDLCI, nncFrStrStatIntervalTable=nncFrStrStatIntervalTable, nncFrStrStatCurrentInCRCErrors=nncFrStrStatCurrentInCRCErrors, nncFrStrStatCurrentStLMUTimeoutsnT1=nncFrStrStatCurrentStLMUTimeoutsnT1, nncFrStrStatIntervalStMaxDurationRED=nncFrStrStatIntervalStMaxDurationRED, nncFrStrStatIntervalLowDelayAccDelay=nncFrStrStatIntervalLowDelayAccDelay, nncFrStrStatIntervalAbsoluteIntervalNumber=nncFrStrStatIntervalAbsoluteIntervalNumber, nncFrStrStatIntervalStNetSequenceErrs=nncFrStrStatIntervalStNetSequenceErrs, nncFrStrStatIntervalStFrmTooSmall=nncFrStrStatIntervalStFrmTooSmall, nncFrStrStatCurrentStLMUAsyncStatusRcvd=nncFrStrStatCurrentStLMUAsyncStatusRcvd, nncFrPVCEndptStatCurrentDLCINumber=nncFrPVCEndptStatCurrentDLCINumber, nncFrPVCEndptStatCurrentOutFramesBECNSet=nncFrPVCEndptStatCurrentOutFramesBECNSet, nncFrStrStatCurrentInAborts=nncFrStrStatCurrentInAborts, nncFrStrStatIntervalCommittedOutUCastPackets=nncFrStrStatIntervalCommittedOutUCastPackets, nncFrPVCEndptStatIntervalDLCINumber=nncFrPVCEndptStatIntervalDLCINumber, nncFrStrStatIntervalOutDiscdBadEncaps=nncFrStrStatIntervalOutDiscdBadEncaps, nncFrPVCEndptStatCurrentEntry=nncFrPVCEndptStatCurrentEntry, nncFrStrStatCurrentStLMNStatusENQMsgsRcvd=nncFrStrStatCurrentStLMNStatusENQMsgsRcvd, nncFrStrStatIntervalSigUserProtErrors=nncFrStrStatIntervalSigUserProtErrors, nncFrIntStatisticsObjects=nncFrIntStatisticsObjects, nncFrStrStatIntervalStLMNStatusENQMsgsRcvd=nncFrStrStatIntervalStLMNStatusENQMsgsRcvd, nncFrStrStatCurrentStIntervalDuration=nncFrStrStatCurrentStIntervalDuration, nncFrPVCEndptStatIntervalInDiscards=nncFrPVCEndptStatIntervalInDiscards, nncFrDepthOfHistoricalStrata=nncFrDepthOfHistoricalStrata, nncFrPVCEndptStatCurrentOutDiscdDESet=nncFrPVCEndptStatCurrentOutDiscdDESet, nncFrStrStatCurrentInDiscdCOSDESet=nncFrStrStatCurrentInDiscdCOSDESet, nncFrStrStatCurrentInNonIntegral=nncFrStrStatCurrentInNonIntegral, nncFrStrStatCurrentStLMSigInvldIELen=nncFrStrStatCurrentStLMSigInvldIELen, nncFrStrStatCurrentStFrmTooSmall=nncFrStrStatCurrentStFrmTooSmall, nncFrStrStatIntervalNumber=nncFrStrStatIntervalNumber, nncFrPVCEndptStatIntervalOutOctets=nncFrPVCEndptStatIntervalOutOctets, nncFrStrStatCurrentInDiscdDESet=nncFrStrStatCurrentInDiscdDESet, nncFrPVCEndptStatIntervalOutDiscdBadEncaps=nncFrPVCEndptStatIntervalOutDiscdBadEncaps, nncFrStrStatIntervalOutUCastPackets=nncFrStrStatIntervalOutUCastPackets, nncFrStrStatIntervalInDiscdDESet=nncFrStrStatIntervalInDiscdDESet, nncFrPVCEndptStatCurrentInDiscdCOSDESet=nncFrPVCEndptStatCurrentInDiscdCOSDESet, nncFrPVCEndptStatCurrentInCosTagDeFrames=nncFrPVCEndptStatCurrentInCosTagDeFrames, nncFrStrStatIntervalSigNetProtErrors=nncFrStrStatIntervalSigNetProtErrors, nncFrStrStatIntervalInCRCErrors=nncFrStrStatIntervalInCRCErrors, nncFrPVCEndptStatIntervalOutFramesFECNSet=nncFrPVCEndptStatIntervalOutFramesFECNSet, nncFrStrStatIntervalSigNetChanInactive=nncFrStrStatIntervalSigNetChanInactive, nncFrStrStatCurrentOutOctets=nncFrStrStatCurrentOutOctets, nncFrStrStatIntervalInDiscdDEClr=nncFrStrStatIntervalInDiscdDEClr, nncFrStrStatCurrentSigUserProtErrors=nncFrStrStatCurrentSigUserProtErrors, nncFrStrStatIntervalInNonIntegral=nncFrStrStatIntervalInNonIntegral, nncFrPVCEndptStatIntervalAbsoluteIntervalNumber=nncFrPVCEndptStatIntervalAbsoluteIntervalNumber, nncFrPVCEndptStatIntervalInDiscdDESet=nncFrPVCEndptStatIntervalInDiscdDESet, nncFrStrStatCurrentRealTimeAccDelay=nncFrStrStatCurrentRealTimeAccDelay, nncFrStrStatIntervalInDiscdBadEncaps=nncFrStrStatIntervalInDiscdBadEncaps, nncFrStrStatIntervalStLMUTimeoutsnT1=nncFrStrStatIntervalStLMUTimeoutsnT1, nncFrStrStatIntervalStLMUStatusMsgsRcvd=nncFrStrStatIntervalStLMUStatusMsgsRcvd, nncFrPVCEndptStatIntervalGroup=nncFrPVCEndptStatIntervalGroup, nncFrPVCEndptStatIntervalTable=nncFrPVCEndptStatIntervalTable, nncFrStrStatIntervalLowDelayPeakDelay=nncFrStrStatIntervalLowDelayPeakDelay, nncFrStrStatIntervalInLinkUtilization=nncFrStrStatIntervalInLinkUtilization, nncFrStrStatCurrentOutErrors=nncFrStrStatCurrentOutErrors, nncFrPVCEndptStatCurrentInDiscards=nncFrPVCEndptStatCurrentInDiscards, nncFrStrStatCurrentLowDelayPeakDelay=nncFrStrStatCurrentLowDelayPeakDelay, nncFrStrStatCurrentCommittedAccDelay=nncFrStrStatCurrentCommittedAccDelay, nncFrStrStatIntervalOutDiscdDEClr=nncFrStrStatIntervalOutDiscdDEClr, nncFrStrStatCurrentSigUserLinkRelErrors=nncFrStrStatCurrentSigUserLinkRelErrors, nncFrStrStatCurrentStLMSigInvldField=nncFrStrStatCurrentStLMSigInvldField, nncFrPVCEndptStatCurrentInFramesBECNSet=nncFrPVCEndptStatCurrentInFramesBECNSet, nncFrPVCEndptStatIntervalInCosTagDeFrames=nncFrPVCEndptStatIntervalInCosTagDeFrames, nncFrStrStatCurrentStTimeSC=nncFrStrStatCurrentStTimeSC, nncFrPVCEndptStatIntervalEntry=nncFrPVCEndptStatIntervalEntry, nncFrStrStatIntervalOutOctets=nncFrStrStatIntervalOutOctets, nncFrStrStatCurrentLowDelayUCastPacketsDEClr=nncFrStrStatCurrentLowDelayUCastPacketsDEClr, nncFrStrStatIntervalInSumOfDisagremnts=nncFrStrStatIntervalInSumOfDisagremnts, nncFrStrStatCurrentOutLinkUtilization=nncFrStrStatCurrentOutLinkUtilization, nncFrStrStatIntervalCommittedUCastPacketsDEClr=nncFrStrStatIntervalCommittedUCastPacketsDEClr, nncFrIntStatisticsCompliance=nncFrIntStatisticsCompliance, nncFrStrStatIntervalStLMSigInvldRepType=nncFrStrStatIntervalStLMSigInvldRepType, nncFrStrStatIntervalInReservedDLCI=nncFrStrStatIntervalInReservedDLCI, nncFrStrStatIntervalBestEffortUCastPacketsDEClr=nncFrStrStatIntervalBestEffortUCastPacketsDEClr, nncFrPVCEndptStatIntervalInFrames=nncFrPVCEndptStatIntervalInFrames, nncFrStrStatCurrentStLMSigFrmWithNoIEs=nncFrStrStatCurrentStLMSigFrmWithNoIEs, nncFrPVCEndptStatCurrentInDiscdCOSDEClr=nncFrPVCEndptStatCurrentInDiscdCOSDEClr, nncFrPVCEndptStatIntervalInFramesBECNSet=nncFrPVCEndptStatIntervalInFramesBECNSet, nncFrStrBertStatGroup=nncFrStrBertStatGroup, nncFrPVCEndptStatCurrentInDEFrames=nncFrPVCEndptStatCurrentInDEFrames, nncFrPVCEndptStatCurrentOutDiscdUnsupEncaps=nncFrPVCEndptStatCurrentOutDiscdUnsupEncaps, nncFrStrStatCurrentBestEffortOutUCastPackets=nncFrStrStatCurrentBestEffortOutUCastPackets, nncFrStrStatIntervalBestEffortDiscdDEClr=nncFrStrStatIntervalBestEffortDiscdDEClr, nncFrPVCEndptStatCurrentOutExcessFrames=nncFrPVCEndptStatCurrentOutExcessFrames, nncFrStrStatIntervalInDiscdCOSDEClr=nncFrStrStatIntervalInDiscdCOSDEClr, nncFrStrStatCurrentGroup=nncFrStrStatCurrentGroup, nncFrStrStatCurrentRealTimeDiscdDEClr=nncFrStrStatCurrentRealTimeDiscdDEClr, nncFrStrStatIntervalOutLinkUtilization=nncFrStrStatIntervalOutLinkUtilization, nncFrPVCEndptStatCurrentAbsoluteIntervalNumber=nncFrPVCEndptStatCurrentAbsoluteIntervalNumber, nncFrIntStatisticsTraps=nncFrIntStatisticsTraps, nncFrPVCEndptStatCurrentInInvdLength=nncFrPVCEndptStatCurrentInInvdLength, nncFrStrStatIntervalBestEffortPeakDelay=nncFrStrStatIntervalBestEffortPeakDelay, nncFrStrStatCurrentInDiscdBadEncaps=nncFrStrStatCurrentInDiscdBadEncaps, nncFrStrStatCurrentStLMSigUnsupMsgType=nncFrStrStatCurrentStLMSigUnsupMsgType, nncFrStrStatCurrentStNetSequenceErrs=nncFrStrStatCurrentStNetSequenceErrs, nncFrPVCEndptStatCurrentInDiscdUnsupEncaps=nncFrPVCEndptStatCurrentInDiscdUnsupEncaps, nncFrStrStatCurrentInDiscdCOSDEClr=nncFrStrStatCurrentInDiscdCOSDEClr, nncFrPVCEndptStatIntervalInDiscdDEClr=nncFrPVCEndptStatIntervalInDiscdDEClr, nncFrStrStatIntervalStLMSigFrmWithNoIEs=nncFrStrStatIntervalStLMSigFrmWithNoIEs, nncFrStrStatIntervalState=nncFrStrStatIntervalState, nncFrStrStatCurrentOutUCastPackets=nncFrStrStatCurrentOutUCastPackets, nncFrPVCEndptStatIntervalOutFramesBECNSet=nncFrPVCEndptStatIntervalOutFramesBECNSet, nncFrStrStatIntervalInInvldEA=nncFrStrStatIntervalInInvldEA, nncFrStrStatCurrentStLMUStatusMsgsRcvd=nncFrStrStatCurrentStLMUStatusMsgsRcvd, nncFrPVCEndptStatCurrentInOctets=nncFrPVCEndptStatCurrentInOctets, nncFrStrStatCurrentInDiscards=nncFrStrStatCurrentInDiscards, nncFrPVCEndptStatIntervalInDEFrames=nncFrPVCEndptStatIntervalInDEFrames, nncFrStrStatIntervalStLMSigInvldEID=nncFrStrStatIntervalStLMSigInvldEID, nncFrPVCEndptStatCurrentTable=nncFrPVCEndptStatCurrentTable, nncFrStrBertStatStatus=nncFrStrBertStatStatus, nncFrStrStatIntervalEntry=nncFrStrStatIntervalEntry, nncFrStrStatIntervalInUCastPackets=nncFrStrStatIntervalInUCastPackets, nncFrStrStatCurrentRealTimeOutUCastPackets=nncFrStrStatCurrentRealTimeOutUCastPackets, nncFrPVCEndptStatCurrentInOctetsDESet=nncFrPVCEndptStatCurrentInOctetsDESet, nncFrPVCEndptStatIntervalOutExcessFrames=nncFrPVCEndptStatIntervalOutExcessFrames, nncFrPVCEndptStatIntervalOutFramesInRed=nncFrPVCEndptStatIntervalOutFramesInRed, nncFrStrStatIntervalGroup=nncFrStrStatIntervalGroup, nncFrStrStatCurrentBestEffortUCastPacketsDEClr=nncFrStrStatCurrentBestEffortUCastPacketsDEClr, nncFrStrStatCurrentOutDiscdBadEncaps=nncFrStrStatCurrentOutDiscdBadEncaps, nncFrStrStatCurrentStLMSigInvldEID=nncFrStrStatCurrentStLMSigInvldEID, nncFrPVCEndptStatIntervalOutDiscdDEClr=nncFrPVCEndptStatIntervalOutDiscdDEClr, nncFrStrStatIntervalOutErrors=nncFrStrStatIntervalOutErrors, nncFrPVCEndptStatCurrentOutFramesFECNSet=nncFrPVCEndptStatCurrentOutFramesFECNSet, nncFrPVCEndptStatIntervalInDiscdCOSDEClr=nncFrPVCEndptStatIntervalInDiscdCOSDEClr, nncFrStrStatCurrentBestEffortAccDelay=nncFrStrStatCurrentBestEffortAccDelay, nncFrStrStatIntervalStLastErroredDLCI=nncFrStrStatIntervalStLastErroredDLCI, nncFrPVCEndptStatIntervalInDiscdUnsupEncaps=nncFrPVCEndptStatIntervalInDiscdUnsupEncaps, nncFrStrStatCurrentBestEffortDiscdDEClr=nncFrStrStatCurrentBestEffortDiscdDEClr, nncFrStrStatIntervalStLMSigInvldField=nncFrStrStatIntervalStLMSigInvldField, nncFrStrStatCurrentLowDelayAccDelay=nncFrStrStatCurrentLowDelayAccDelay, nncFrStrStatCurrentInReservedDLCI=nncFrStrStatCurrentInReservedDLCI, nncFrPVCEndptStatCurrentOutDiscdDEClr=nncFrPVCEndptStatCurrentOutDiscdDEClr, nncFrStrStatCurrentOutDiscdDESet=nncFrStrStatCurrentOutDiscdDESet, nncFrPVCEndptStatIntervalInDiscdBadEncaps=nncFrPVCEndptStatIntervalInDiscdBadEncaps, nncFrStrStatIntervalCommittedDiscdDEClr=nncFrStrStatIntervalCommittedDiscdDEClr, nncFrStrStatIntervalBestEffortAccDelay=nncFrStrStatIntervalBestEffortAccDelay, nncFrStrStatIntervalStMCAlarms=nncFrStrStatIntervalStMCAlarms, nncFrStrStatCurrentInOctets=nncFrStrStatCurrentInOctets, nncFrStrStatCurrentStLMNTimeoutsnT2=nncFrStrStatCurrentStLMNTimeoutsnT2, nncFrStrStatIntervalSigNetLinkRelErrors=nncFrStrStatIntervalSigNetLinkRelErrors, nncFrStrStatIntervalLowDelayDiscdDEClr=nncFrStrStatIntervalLowDelayDiscdDEClr, nncFrStrStatIntervalStLMUAsyncStatusRcvd=nncFrStrStatIntervalStLMUAsyncStatusRcvd, nncFrStrStatCurrentOutDiscards=nncFrStrStatCurrentOutDiscards, nncFrPVCEndptStatCurrentInDiscdBadEncaps=nncFrPVCEndptStatCurrentInDiscdBadEncaps, nncFrPVCEndptStatIntervalOutFrames=nncFrPVCEndptStatIntervalOutFrames, nncFrPVCEndptStatCurrentInDiscdDEClr=nncFrPVCEndptStatCurrentInDiscdDEClr, nncFrStrStatCurrentStLMNAsyncStatusSent=nncFrStrStatCurrentStLMNAsyncStatusSent, nncFrPVCEndptStatIntervalOutOctetsDESet=nncFrPVCEndptStatIntervalOutOctetsDESet, nncFrPVCEndptStatCurrentOutFramesInRed=nncFrPVCEndptStatCurrentOutFramesInRed, nncFrStrBertDlci=nncFrStrBertDlci, nncFrStrStatCurrentCommittedUCastPacketsDEClr=nncFrStrStatCurrentCommittedUCastPacketsDEClr, nncFrStrStatCurrentLowDelayDiscdDEClr=nncFrStrStatCurrentLowDelayDiscdDEClr, nncFrStrStatIntervalCommittedAccDelay=nncFrStrStatIntervalCommittedAccDelay, nncFrStrStatIntervalSigUserChanInactive=nncFrStrStatIntervalSigUserChanInactive, nncFrStrStatCurrentStSCAlarms=nncFrStrStatCurrentStSCAlarms, nncFrStrStatIntervalStLMNTimeoutsnT2=nncFrStrStatIntervalStLMNTimeoutsnT2, nncFrStrStatIntervalInErrors=nncFrStrStatIntervalInErrors, nncFrStrBertStatRxBytes=nncFrStrBertStatRxBytes, nncFrStrStatCurrentOutDiscdDEClr=nncFrStrStatCurrentOutDiscdDEClr, nncFrStrBertStatEntry=nncFrStrBertStatEntry, nncFrStrStatIntervalInOctets=nncFrStrStatIntervalInOctets, nncFrStrStatCurrentInLinkUtilization=nncFrStrStatCurrentInLinkUtilization, nncFrStrStatIntervalCommittedPeakDelay=nncFrStrStatIntervalCommittedPeakDelay, nncFrStrBertStatTable=nncFrStrBertStatTable, nncFrStrStatIntervalInOverRuns=nncFrStrStatIntervalInOverRuns, nncFrStrStatIntervalInInvdLength=nncFrStrStatIntervalInInvdLength, nncFrPVCEndptStatCurrentOutFrames=nncFrPVCEndptStatCurrentOutFrames, nncFrStrStatIntervalRealTimeUCastPacketsDEClr=nncFrStrStatIntervalRealTimeUCastPacketsDEClr, nncFrStrStatIntervalStLMNAsyncStatusSent=nncFrStrStatIntervalStLMNAsyncStatusSent, nncFrStrStatCurrentStMaxDurationRED=nncFrStrStatCurrentStMaxDurationRED, nncFrStrStatIntervalStLMNStatusMsgsSent=nncFrStrStatIntervalStLMNStatusMsgsSent, nncFrPVCEndptStatCurrentState=nncFrPVCEndptStatCurrentState, nncFrPVCEndptStatIntervalOutDiscdUnsupEncaps=nncFrPVCEndptStatIntervalOutDiscdUnsupEncaps, nncFrStrStatIntervalRealTimePeakDelay=nncFrStrStatIntervalRealTimePeakDelay, nncFrStrStatCurrentSigNetProtErrors=nncFrStrStatCurrentSigNetProtErrors, PYSNMP_MODULE_ID=nncFrIntStatistics, nncFrStrStatCurrentStLMNStatusMsgsSent=nncFrStrStatCurrentStLMNStatusMsgsSent, nncFrStrStatIntervalStSCAlarms=nncFrStrStatIntervalStSCAlarms, nncFrStrStatCurrentRealTimeUCastPacketsDEClr=nncFrStrStatCurrentRealTimeUCastPacketsDEClr)
mibBuilder.exportSymbols("NNCFRINTSTATISTICS-MIB", nncFrStrStatCurrentOutDiscdUnsupEncaps=nncFrStrStatCurrentOutDiscdUnsupEncaps, nncFrPVCEndptStatCurrentInDiscdDESet=nncFrPVCEndptStatCurrentInDiscdDESet, nncFrStrStatCurrentEntry=nncFrStrStatCurrentEntry, nncFrStrStatIntervalInAborts=nncFrStrStatIntervalInAborts, nncFrStrStatCurrentSigUserChanInactive=nncFrStrStatCurrentSigUserChanInactive)
| 183.787154 | 18,556 | 0.828764 | 13,911 | 145,927 | 8.693624 | 0.057293 | 0.05001 | 0.087517 | 0.008533 | 0.488213 | 0.404442 | 0.391948 | 0.387466 | 0.292309 | 0.282577 | 0 | 0.038155 | 0.07684 | 145,927 | 793 | 18,557 | 184.018916 | 0.859577 | 0.002316 | 0 | 0.007643 | 0 | 0.146497 | 0.335362 | 0.097479 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.011465 | 0 | 0.011465 | 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 |
9aa3c2a917dd258b0ef5ae70ab853c1c86948a99 | 421 | py | Python | package/schema.py | roni712/packages | 24a174e979d72c9ec0f9a8496a33764fe400d016 | [
"MIT"
] | null | null | null | package/schema.py | roni712/packages | 24a174e979d72c9ec0f9a8496a33764fe400d016 | [
"MIT"
] | null | null | null | package/schema.py | roni712/packages | 24a174e979d72c9ec0f9a8496a33764fe400d016 | [
"MIT"
] | null | null | null | from typing import List, Optional
from pydantic import BaseModel
class Product(BaseModel):
p_name: str =None
p_price: float=None
p_dec:str =None
class Config:
orm_mode=True
class Productcreate(Product):
category_id: int=None
class Config:
orm_mode=True
class Category(BaseModel):
category: str = None
cat_desc:str = None
class Config:
orm_mode=True
| 19.136364 | 33 | 0.667458 | 56 | 421 | 4.875 | 0.464286 | 0.102564 | 0.164835 | 0.197802 | 0.344322 | 0.344322 | 0.344322 | 0 | 0 | 0 | 0 | 0 | 0.266033 | 421 | 22 | 34 | 19.136364 | 0.883495 | 0 | 0 | 0.352941 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.117647 | 0 | 0.823529 | 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 |
9aa568fc722fb23a6e2123864fbedd7488f9605b | 676 | py | Python | stubs.min/System/Windows/Input/__init___parts/StylusButtonEventArgs.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | 1 | 2017-07-25T14:30:18.000Z | 2017-07-25T14:30:18.000Z | stubs.min/System/Windows/Input/__init___parts/StylusButtonEventArgs.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | stubs.min/System/Windows/Input/__init___parts/StylusButtonEventArgs.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | class StylusButtonEventArgs(StylusEventArgs):
"""
Provides data for the System.Windows.UIElement.StylusButtonDown and System.Windows.UIElement.StylusButtonUp events.
StylusButtonEventArgs(stylusDevice: StylusDevice,timestamp: int,button: StylusButton)
"""
@staticmethod
def __new__(self,stylusDevice,timestamp,button):
""" __new__(cls: type,stylusDevice: StylusDevice,timestamp: int,button: StylusButton) """
pass
StylusButton=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the System.Windows.Input.StylusButton that raises this event.
Get: StylusButton(self: StylusButtonEventArgs) -> StylusButton
"""
| 35.578947 | 118 | 0.761834 | 68 | 676 | 7.455882 | 0.558824 | 0.076923 | 0.063116 | 0.142012 | 0.213018 | 0.213018 | 0 | 0 | 0 | 0 | 0 | 0 | 0.131657 | 676 | 18 | 119 | 37.555556 | 0.863714 | 0.423077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0.2 | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
9aabbed720a674e98e153f695296b57126d845c2 | 23,017 | py | Python | server/src/weblab/core/reservation_processor.py | zstars/weblabdeusto | 09bd9d93d483671bca67ee5c70a9c412eb5d352f | [
"BSD-2-Clause"
] | null | null | null | server/src/weblab/core/reservation_processor.py | zstars/weblabdeusto | 09bd9d93d483671bca67ee5c70a9c412eb5d352f | [
"BSD-2-Clause"
] | null | null | null | server/src/weblab/core/reservation_processor.py | zstars/weblabdeusto | 09bd9d93d483671bca67ee5c70a9c412eb5d352f | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# listed below:
#
# Author: Pablo Orduña <pablo@ordunya.com>
# Luis Rodriguez <luis.rodriguez@opendeusto.es>
#
import random
import time as time_module
import voodoo.log as log
import weblab.configuration_doc as configuration_doc
import weblab.data.server_type as ServerType
import weblab.data.command as Command
import weblab.core.exc as core_exc
import weblab.core.reservations as Reservation
from weblab.core.file_storer import FileStorer
import weblab.core.coordinator.exc as coord_exc
import weblab.core.coordinator.status as scheduling_status
import weblab.core.coordinator.store as TemporalInformationStore
import weblab.lab.exc as LaboratoryErrors
DEFAULT_EXPERIMENT_POLL_TIME = 350 # seconds
EXPERIMENT_POLL_TIME = 'core_experiment_poll_time'
class ReservationProcessor(object):
""" This class encapsulates the methods of the user dependent on the
interaction with the experiment. This is a middle step before moving
this class to the proxy server. Previously, all these methods were
implemented in the UserProcessor class, but all methods here only
rely on the reservation_id (instead of relying on the session_id).
The difference is that it will be possible to handle more than one
concurrent reservation with the same session (which is desirable
when using calendars), and it will be possible to provide a
reservation_id (that can interact with the experiment) without
compromising the rest of the session. """
EXPIRATION_TIME_NOT_SET=-1234
def __init__(self, cfg_manager, reservation_id, reservation_session, coordinator, locator, commands_store):
self._cfg_manager = cfg_manager
self._reservation_session_id = reservation_id
self._reservation_id = reservation_id.id
self._reservation_session = reservation_session
self._coordinator = coordinator
self._locator = locator
self._commands_store = commands_store
self.time_module = time_module
# The response to asynchronous commands is not immediately available, so we need to
# use this map to store the ids of the usage objects (commands sent), identified through
# their request_ids (which are not the same). As their responses become available, we will
# use the request_ids to find the ids of the usage objects, and update them.
#
# It seems that the UserProcessor is re-created rather often, so we cannot store
# usage-related information locally. We will store it in the session object instead.
# TODO: As of now, if the async_commands_ids is not in session we will initialize it.
# Probably that initialization should be moved to wherever session is initialized.
if not "async_commands_ids" in self._reservation_session:
self._reservation_session["async_commands_ids"] = {}
def get_session(self):
return self._reservation_session
def get_reservation_session_id(self):
return self._reservation_session_id
def get_reservation_id(self):
return self._reservation_id
def get_info(self):
return self._reservation_session['experiment_id']
##############################################################################
#
#
# STATUS MANAGEMENT
#
#
def get_status(self):
""" get_status() -> Reservation
It returns the state of the reservation (such as "you're waiting in a queue",
"the experiment is being initialized", "you have the reservation available", etc.)
"""
try:
status = self._coordinator.get_reservation_status( self._reservation_id )
except coord_exc.ExpiredSessionError as e:
log.log(ReservationProcessor, log.level.Debug, "reason for rejecting:")
log.log_exc(ReservationProcessor, log.level.Debug)
human = self._cfg_manager.get_doc_value(configuration_doc.CORE_UNIVERSAL_IDENTIFIER_HUMAN)
core_id = self._cfg_manager.get_doc_value(configuration_doc.CORE_UNIVERSAL_IDENTIFIER)
raise core_exc.NoCurrentReservationError("get_reservation_status at %s (%s) called but coordinator rejected reservation id (%s). Reason: %s" % (human, core_id, self._reservation_id, str(e)))
else:
if status.status == scheduling_status.WebLabSchedulingStatus.RESERVED_LOCAL:
self.process_reserved_status(status)
if status.status == scheduling_status.WebLabSchedulingStatus.RESERVED_REMOTE:
self.process_reserved_remote_status(status)
return Reservation.Reservation.translate_reservation( status )
def process_reserved_status(self, status):
if 'lab_session_id' in self._reservation_session:
return # Already called in the past
self._reservation_session['lab_session_id'] = status.lab_session_id
self._reservation_session['lab_coordaddr'] = status.coord_address
if status.exp_info.get('manages_polling', False):
self.disable_polling()
# TODO: it should not be time_module.time, but retrieve this information
# from the status manager to know when it started
self._renew_expiration_time( self.time_module.time() + status.time )
def process_reserved_remote_status(self, status):
self._reservation_session['federated'] = True
def disable_polling(self):
self._reservation_session['manages_polling'] = True
def finish(self):
"""
Called when the experiment ends, regardless of the way. (That is, it does not matter whether the user finished
it explicitly or not).
"""
# If already finished, exit
if not self.is_polling():
return
self._stop_polling()
self._reservation_session.pop('lab_session_id', None)
try:
self._coordinator.finish_reservation(self._reservation_id)
except Exception as e:
log.log( ReservationProcessor, log.level.Error, "Exception finishing reservation: %s" % e )
log.log_exc( ReservationProcessor, log.level.Warning )
raise core_exc.FailedToFreeReservationError( "There was an error freeing reservation: %s" % e)
def update_latest_timestamp(self):
""" Used in weblab.admin.monitor to check the status of current users """
self._reservation_session['latest_timestamp'] = self._utc_timestamp()
##############################################################################
#
#
# POLLING MANAGEMENT
#
#
# Whenever the experiment finishes, the server notifies the Reservation
# Processor. Polling is therefore only required to kick those users that
# are not using the experiment for a long time.
#
# The variable is created when the reservation is created. It is removed
# when the experiment finishes.
#
# TODO: the reservation system should tell the processor whether this
# experiments expects polling or not.
#
def is_polling(self):
"""
Is this user in a queue or using an experiment, and therefore it should be
continuosly informing that it is alive? Otherwise, weblab will kick him.
"""
return 'session_polling' in self._reservation_session
def is_federated(self):
return self._reservation_session.get('federated', False)
def manages_polling(self):
return self._reservation_session.get('manages_polling', False)
def _renew_expiration_time(self, expiration_time):
if self.is_polling():
self._reservation_session['session_polling'] = (
self.time_module.time(),
expiration_time
)
def poll(self):
"""Inform that it is still online and interested on the reservation"""
if not self.is_polling():
raise core_exc.NoCurrentReservationError("poll called but no current reservation")
latest_poll, expiration_time = self._reservation_session['session_polling']
self._reservation_session['session_polling'] = (
self.time_module.time(),
expiration_time
)
def is_expired(self):
"""Did this reservation's user stay out for a long time without polling?"""
# If it has been assigned to a laboratory that explicitly requests to avoid
# using polling, then it is only expired when the particular laboratory
# states that it is expired.
if self.manages_polling():
return False
# If it has been assigned in a foreign server, then, it is never expired
if self.is_federated():
return False
# If it is not polling, it was expired in the past
if not self.is_polling():
return True
#
# But if it polling and it hasn't polled in some time
#
current_time = self.time_module.time()
latest_poll, expiration_time = self._reservation_session['session_polling']
if current_time - latest_poll > self._cfg_manager.get_value(EXPERIMENT_POLL_TIME, DEFAULT_EXPERIMENT_POLL_TIME):
return True
elif expiration_time != ReservationProcessor.EXPIRATION_TIME_NOT_SET and current_time > expiration_time:
return True
return False
def _stop_polling(self):
if self.is_polling():
self._reservation_session.pop('session_polling')
##############################################################################
#
#
# SENDING COMMANDS AND FILES
#
#########################
#
# Communications
#
def send_file(self, file_content, file_info ):
#
# Check that the reservation is enabled
#
lab_session_id = self._reservation_session.get('lab_session_id')
lab_coordaddr = self._reservation_session.get('lab_coordaddr')
if lab_session_id is None or lab_coordaddr is None:
raise core_exc.NoCurrentReservationError("send_file called but the reservation was not enabled")
#
# Retrieve the laboratory server
#
usage_file_sent = self._store_file(file_content, file_info)
command_id_pack = self._append_file(usage_file_sent)
try:
laboratory_server = self._locator[lab_coordaddr]
response = laboratory_server.send_file( lab_session_id, file_content, file_info )
self._update_command_or_file(command_id_pack, response)
return response
except LaboratoryErrors.SessionNotFoundInLaboratoryServerError:
self._update_command_or_file(command_id_pack, Command.Command("ERROR: SessionNotFound"))
try:
self.finish()
except core_exc.FailedToFreeReservationError:
pass
raise core_exc.NoCurrentReservationError(
'Experiment reservation expired'
)
except LaboratoryErrors.FailedToInteractError as ftie:
self._update_command_or_file(command_id_pack, Command.Command("ERROR: " + str(ftie)))
try:
self.finish()
except core_exc.FailedToFreeReservationError:
pass
raise core_exc.FailedToInteractError(
"Failed to send: %s" % ftie
)
def send_command(self, command):
#
# Check the that the experiment is enabled
#
lab_session_id = self._reservation_session.get('lab_session_id')
lab_coordaddr = self._reservation_session.get('lab_coordaddr')
if lab_session_id is None or lab_coordaddr is None:
raise core_exc.NoCurrentReservationError("send_command called but the reservation is not enabled")
command_id_pack = self._append_command(command)
try:
laboratory_server = self._locator[lab_coordaddr]
# We call the laboratory server's send_command, which will finally
# get the command to be handled by the experiment.
response = laboratory_server.send_command( lab_session_id, command )
# The previous call was executed synchronously and we have
# received the response. Before returning it, we will store it
# locally so that we can log it.
self._update_command_or_file(command_id_pack, response)
return response
except LaboratoryErrors.SessionNotFoundInLaboratoryServerError:
self._update_command_or_file(command_id_pack, Command.Command("ERROR: SessionNotFound: None"))
try:
self.finish()
except core_exc.FailedToFreeReservationError:
pass
raise core_exc.NoCurrentReservationError(
'Experiment reservation expired'
)
except LaboratoryErrors.FailedToInteractError as ftspe:
self._update_command_or_file(command_id_pack, Command.Command("ERROR: " + str(ftspe)))
try:
self.finish()
except core_exc.FailedToFreeReservationError:
pass
raise core_exc.FailedToInteractError(
"Failed to send command: %s" % ftspe
)
def send_async_file(self, file_content, file_info ):
"""
Sends a file asynchronously. Status of the request may be checked through
check_async_command_status.
@param file_content: Content of the file being sent
@param file_info: File information of the file being sent
@see check_async_command_status
"""
lab_session_id = self._reservation_session.get('lab_session_id')
lab_coordaddr = self._reservation_session.get('lab_coordaddr')
if lab_session_id is None or lab_coordaddr is None:
raise core_exc.NoCurrentReservationError("send_async_file called but no current reservation")
usage_file_sent = self._store_file(file_content, file_info)
command_id_pack = self._append_file(usage_file_sent)
try:
laboratory_server = self._locator[lab_coordaddr]
response = laboratory_server.send_async_file( lab_session_id, file_content, file_info )
# TODO: how do we store async files? whenever somebody ask for the status? what if they don't ask for it?
return response
except LaboratoryErrors.SessionNotFoundInLaboratoryServerError:
self._update_command_or_file(command_id_pack, Command.Command("ERROR: SessionNotFound: None"))
try:
self.finish()
except core_exc.FailedToFreeReservationError:
pass
raise core_exc.NoCurrentReservationError(
'Experiment reservation expired'
)
except LaboratoryErrors.FailedToInteractError as ftspe:
self._update_command_or_file(command_id_pack, Command.Command("ERROR: " + str(ftspe)))
try:
self.finish()
except core_exc.FailedToFreeReservationError:
pass
raise core_exc.FailedToInteractError(
"Failed to send file: %s" % ftspe
)
def check_async_command_status(self, request_identifiers):
"""
Checks the status of several asynchronous commands. The request will be
internally forwarded to the lab server. Standard async commands
and file_send commands are treated in the same way.
Commands reported as finished (either successfully or not) will be
removed, so check_async_command_status should not be called on them again.
Before removing the commands, it will also register their response for
logging purposes.
@param request_identifiers: List of the identifiers to check
@return: Dictionary by request-id of tuples: (status, content)
"""
lab_session_id = self._reservation_session.get('lab_session_id')
lab_coordaddr = self._reservation_session.get('lab_coordaddr')
if lab_session_id is None or lab_coordaddr is None:
raise core_exc.NoCurrentReservationError("check_async_command called but no current reservation")
try:
laboratory_server = self._locator[lab_coordaddr]
response = laboratory_server.check_async_command_status( lab_session_id, request_identifiers)
# Within the response map, we might now have the real response to one
# (or more) async commands. We will update the usage object of the
# command with its response, so that once the experiment ends it appears
# in the log as expected.
for req_id, (cmd_status, cmd_response) in response.items(): #@UnusedVariable
if(req_id in self._reservation_session["async_commands_ids"]):
#usage_obj_id = self._reservation_session["async_commands_ids"][req_id]
# TODO: Bug here. async_commands_ids is empty.
# self._update_command_or_file(usage_obj_id, cmd_response)
pass
return response
except LaboratoryErrors.SessionNotFoundInLaboratoryServerError:
# We did not find the specified session in the laboratory server.
# We'll finish the experiment.
#self._update_command(command_id_pack, Command.Command("ERROR: SessionNotFound: None"))
try:
self.finish()
except core_exc.FailedToFreeReservationError:
pass
raise core_exc.NoCurrentReservationError(
'Experiment reservation expired'
)
except LaboratoryErrors.FailedToInteractError as ftspe:
# There was an error while trying to send the command.
# We'll finish the experiment.
#self._update_command(command_id_pack, Command.Command("ERROR: " + str(ftspe)))
try:
self.finish()
except core_exc.FailedToFreeReservationError:
pass
raise core_exc.FailedToInteractError(
"Failed to send command: %s" % ftspe
)
def send_async_command(self, command):
"""
Runs a command asynchronously. Status of the request may be checked
through the check_async_command_status method.
@param command The command to run
@see check_async_command_status
"""
lab_session_id = self._reservation_session.get('lab_session_id')
lab_coordaddr = self._reservation_session.get('lab_coordaddr')
if lab_session_id is None or lab_coordaddr is None:
raise core_exc.NoCurrentReservationError("send_async_command called but no current reservation")
command_id_pack = self._append_command(command)
try:
laboratory_server = self._locator[lab_coordaddr]
# We forward the request to the laboratory server, which
# will forward it to the actual experiment. Because this is
# an asynchronous call, we will not receive the actual response
# to the command, but simply an ID identifying our request. This also
# means that by the time this call returns, the real response to the
# command is most likely not available yet.
request_id = laboratory_server.send_async_command(lab_session_id, command)
# If this was a standard, synchronous send_command, we would now store the response
# we received, so that later, when the experiment finishes, the log is properly
# written. However, the real response is not available yet, so we can't do that here.
# Instead, we will store a reference to our usage object, so that we can later update it
# when the response to the asynchronous command is ready.
self._reservation_session["async_commands_ids"][request_id] = command_id_pack
# TODO: when do we store async commands? whenever user asks for status? what if they don't ever ask?
return request_id
except LaboratoryErrors.SessionNotFoundInLaboratoryServerError:
self._update_command_or_file(command_id_pack, Command.Command("ERROR: SessionNotFound: None"))
try:
self.finish()
except core_exc.FailedToFreeReservationError:
pass
raise core_exc.NoCurrentReservationError(
'Experiment reservation expired'
)
except LaboratoryErrors.FailedToInteractError as ftspe:
self._update_command_or_file(command_id_pack, Command.Command("ERROR: " + str(ftspe)))
try:
self.finish()
except core_exc.FailedToFreeReservationError:
pass
raise core_exc.FailedToInteractError(
"Failed to send command: %s" % ftspe
)
##############################################################################
#
#
# SENDING COMMANDS AND FILES
#
#########################
#
# Storage.
# No reference to session, only to _reservation_id
#
def _append_command(self, command):
return self._append_command_or_file(command, True)
def _append_file(self, command):
return self._append_command_or_file(command, False)
def _append_command_or_file(self, command, command_or_file):
command_id = random.randint(0, 1000 * 1000 * 1000)
timestamp = self._utc_timestamp()
command_entry = TemporalInformationStore.CommandOrFileInformationEntry(self._reservation_id, True, command_or_file, command_id, command, timestamp)
self._commands_store.put(command_entry)
return command_id, command_or_file
def _update_command_or_file(self, (command_id, command_or_file), response):
timestamp = self._utc_timestamp()
command_entry = TemporalInformationStore.CommandOrFileInformationEntry(self._reservation_id, False, command_or_file, command_id, response, timestamp)
self._commands_store.put(command_entry)
def _utc_timestamp(self):
return self.time_module.time()
def _store_file(self, file_content, file_info):
storer = FileStorer(self._cfg_manager, self._reservation_id, self.time_module)
return storer.store_file(file_content, file_info)
| 41.697464 | 202 | 0.656428 | 2,644 | 23,017 | 5.481089 | 0.159985 | 0.044507 | 0.053133 | 0.020701 | 0.457908 | 0.408225 | 0.371032 | 0.338394 | 0.333563 | 0.312241 | 0 | 0.001481 | 0.266759 | 23,017 | 551 | 203 | 41.77314 | 0.857202 | 0.186862 | 0 | 0.498195 | 0 | 0 | 0.087349 | 0.003008 | 0 | 0 | 0 | 0.010889 | 0 | 0 | null | null | 0.039711 | 0.046931 | null | null | 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 | 1 | 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.