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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d86464bd9ee74d8b0b4d1099ebf47409ddf4d200 | 316 | py | Python | python_work/reservando_mesas.py | lucas-jsvd/python_crash_course_2nd | 8404e7769bef7b90b9b0897996c3a3f969bb72bd | [
"Unlicense"
] | null | null | null | python_work/reservando_mesas.py | lucas-jsvd/python_crash_course_2nd | 8404e7769bef7b90b9b0897996c3a3f969bb72bd | [
"Unlicense"
] | null | null | null | python_work/reservando_mesas.py | lucas-jsvd/python_crash_course_2nd | 8404e7769bef7b90b9b0897996c3a3f969bb72bd | [
"Unlicense"
] | null | null | null | num_pessoas = input("Você deseja uma mesa para qunatas pessoas ? ")
if int(num_pessoas) <= 8:
print(f'Nós temos uma mesa para {num_pessoas} pessoas pronta para você.')
else:
print(f'Nós não temos uma mesa para {num_pessoas} pessoas disponivel no momento.')
print('Você precisará espera alguns minutos.')
| 45.142857 | 86 | 0.731013 | 49 | 316 | 4.632653 | 0.530612 | 0.176211 | 0.145374 | 0.140969 | 0.290749 | 0.290749 | 0.290749 | 0 | 0 | 0 | 0 | 0.003817 | 0.170886 | 316 | 6 | 87 | 52.666667 | 0.862595 | 0 | 0 | 0 | 0 | 0 | 0.683544 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
d878b0a258f07ebea240c5e8f4ff1b68713fe57e | 65 | py | Python | select/example_select.py | MaxTurchin/pycopy-lib | d7a69fc2a28031e2ca475c29239f715c1809d8cc | [
"PSF-2.0"
] | 126 | 2019-07-19T14:42:41.000Z | 2022-03-21T22:22:19.000Z | select/example_select.py | MaxTurchin/pycopy-lib | d7a69fc2a28031e2ca475c29239f715c1809d8cc | [
"PSF-2.0"
] | 38 | 2019-08-28T01:46:31.000Z | 2022-03-17T05:46:51.000Z | select/example_select.py | MaxTurchin/pycopy-lib | d7a69fc2a28031e2ca475c29239f715c1809d8cc | [
"PSF-2.0"
] | 55 | 2019-08-02T09:32:33.000Z | 2021-12-22T11:25:51.000Z | import select
res = select.select([0], [], [], 1.1)
print(res)
| 10.833333 | 37 | 0.584615 | 10 | 65 | 3.8 | 0.6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.055556 | 0.169231 | 65 | 5 | 38 | 13 | 0.648148 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
d884798f50876f627adfadd3f7e18cd9c5f87761 | 1,102 | py | Python | stubs.min/System/Windows/Media/__init___parts/BitmapScalingMode.py | ricardyn/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | 1 | 2021-02-02T13:39:16.000Z | 2021-02-02T13:39:16.000Z | stubs.min/System/Windows/Media/__init___parts/BitmapScalingMode.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | stubs.min/System/Windows/Media/__init___parts/BitmapScalingMode.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | class BitmapScalingMode(Enum,IComparable,IFormattable,IConvertible):
"""
Specifies which algorithm is used to scale bitmap images.
enum BitmapScalingMode,values: Fant (2),HighQuality (2),Linear (1),LowQuality (1),NearestNeighbor (3),Unspecified (0)
"""
def __eq__(self,*args):
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """
pass
def __format__(self,*args):
""" __format__(formattable: IFormattable,format: str) -> str """
pass
def __ge__(self,*args):
pass
def __gt__(self,*args):
pass
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __le__(self,*args):
pass
def __lt__(self,*args):
pass
def __ne__(self,*args):
pass
def __reduce_ex__(self,*args):
pass
def __str__(self,*args):
pass
Fant=None
HighQuality=None
Linear=None
LowQuality=None
NearestNeighbor=None
Unspecified=None
value__=None
| 29 | 215 | 0.679673 | 142 | 1,102 | 4.605634 | 0.373239 | 0.122324 | 0.12844 | 0.137615 | 0.197248 | 0.197248 | 0.197248 | 0.172783 | 0.172783 | 0.172783 | 0 | 0.006543 | 0.167877 | 1,102 | 37 | 216 | 29.783784 | 0.706652 | 0.459165 | 0 | 0.357143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.357143 | false | 0.357143 | 0 | 0 | 0.642857 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
d8bef188fa9ed51fcc68e10d3a6c4c0bde95d7fd | 166 | py | Python | settings.py | sixaphone/lego_server | f2f42b2047162882d330c868035570cc62df9d8e | [
"MIT"
] | 1 | 2020-09-17T17:54:10.000Z | 2020-09-17T17:54:10.000Z | settings.py | sixaphone/lego_server | f2f42b2047162882d330c868035570cc62df9d8e | [
"MIT"
] | 2 | 2020-09-22T12:31:05.000Z | 2020-09-24T10:19:40.000Z | settings.py | sixaphone/lego_server | f2f42b2047162882d330c868035570cc62df9d8e | [
"MIT"
] | null | null | null | from os.path import dirname, abspath
from os import getcwd
APP_DIR = dirname(abspath(__file__))
REMOTE_CONF_DIR = "/tmp/config"
REMOTE_SCRIPT_DIR = "/tmp/scripts"
| 18.444444 | 36 | 0.771084 | 25 | 166 | 4.76 | 0.64 | 0.10084 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.126506 | 166 | 8 | 37 | 20.75 | 0.82069 | 0 | 0 | 0 | 0 | 0 | 0.138554 | 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 |
d8ca0a791901c81e054dbddaac91274831f7d7c2 | 275 | py | Python | auto_derby/single_mode/item/__init__.py | gentle-knight-13/auto-derby | 70593fea2c3d803487e6e0d2ce0c40d60bc6304d | [
"MIT"
] | null | null | null | auto_derby/single_mode/item/__init__.py | gentle-knight-13/auto-derby | 70593fea2c3d803487e6e0d2ce0c40d60bc6304d | [
"MIT"
] | null | null | null | auto_derby/single_mode/item/__init__.py | gentle-knight-13/auto-derby | 70593fea2c3d803487e6e0d2ce0c40d60bc6304d | [
"MIT"
] | null | null | null | from . import game_data, label, plan
from .effect import Effect
from .history import History
from .game_data import get
from .globals import g
from .item import Item
from .item_list import ItemList
from .label import from_name_image
from .effect_summary import EffectSummary
| 27.5 | 41 | 0.821818 | 43 | 275 | 5.116279 | 0.418605 | 0.072727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.138182 | 275 | 9 | 42 | 30.555556 | 0.92827 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
d8cb3739ed7b8e266cda3e80cf74e7587cd2bd80 | 325 | py | Python | pde/visualization/__init__.py | lmenou/py-pde | 3899cba0481657ea7b3d5c05e318d0b851bbe8cd | [
"MIT"
] | 163 | 2020-03-30T09:26:32.000Z | 2022-03-31T12:22:18.000Z | pde/visualization/__init__.py | lmenou/py-pde | 3899cba0481657ea7b3d5c05e318d0b851bbe8cd | [
"MIT"
] | 127 | 2020-03-31T15:33:15.000Z | 2022-03-30T19:27:47.000Z | pde/visualization/__init__.py | lmenou/py-pde | 3899cba0481657ea7b3d5c05e318d0b851bbe8cd | [
"MIT"
] | 37 | 2020-03-10T18:54:22.000Z | 2022-03-29T14:45:40.000Z | """
Functions and classes for visualizing simulations.
.. autosummary::
:nosignatures:
movies
plotting
.. codeauthor:: David Zwicker <david.zwicker@ds.mpg.de>
"""
from .movies import movie, movie_multiple, movie_scalar
from .plotting import plot_interactive, plot_kymograph, plot_kymographs, plot_magnitudes
| 20.3125 | 88 | 0.76 | 37 | 325 | 6.513514 | 0.702703 | 0.099585 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.147692 | 325 | 15 | 89 | 21.666667 | 0.870036 | 0.523077 | 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 |
d8ce272cd1d00ead07c2f550144d30d258b4deba | 3,059 | py | Python | example14.py | cgalli/ATMOS_6910_2018 | baff60990bb4cda4c7f469bc3efa4adba185cbb5 | [
"MIT"
] | 2 | 2019-08-19T14:34:51.000Z | 2019-09-11T05:23:36.000Z | example14.py | cgalli/ATMOS_6910_2018 | baff60990bb4cda4c7f469bc3efa4adba185cbb5 | [
"MIT"
] | null | null | null | example14.py | cgalli/ATMOS_6910_2018 | baff60990bb4cda4c7f469bc3efa4adba185cbb5 | [
"MIT"
] | null | null | null | import numpy as np
#Debug me :)
#given an atmospheric temperature profile and surface temperature, lift the parcel dry adibatically
# to find the equilibrium height. If none, then report there is a surface inversion
pressures = np.array([920, 911, 901, 890, 880, 871, 861, 851, 841, 832, 822, 813, 803, 794, 785, 776, 766, 757, 749, 740, 731, 722, 714, 705, 697, 688, 680, 672, 664, 656, 648, 640, 632, 624, 617, 609, 602, 594, 587, 580, 573, 565, 558, 551, 545, 538, 531, 524, 518, 511, 505, 498, 492, 486, 480, 474, 467, 461, 455, 450, 444, 438, 432, 427, 421, 416, 410, 405, 400, 394, 389, 384, 379, 374, 369, 364, 359, 354, 349, 344, 340, 335, 330, 326, 321, 317, 313, 308, 304, 300, 295, 291, 287, 283, 279, 275, 271, 267, 263, 260, 256, 252, 249, 245, 241, 238, 234, 231, 227, 224, 221, 217, 214], dtype=np.float)
heights = np.array([800.0, 900.0, 1000.0, 1100.0, 1200.0, 1300.0, 1400.0, 1500.0, 1600.0, 1700.0, 1800.0, 1900.0, 2000.0, 2100.0, 2200.0, 2300.0, 2400.0, 2500.0, 2600.0, 2700.0, 2800.0, 2900.0, 3000.0, 3100.0, 3200.0, 3300.0, 3400.0, 3500.0, 3600.0, 3700.0, 3800.0, 3900.0, 4000.0, 4100.0, 4200.0, 4300.0, 4400.0, 4500.0, 4600.0, 4700.0, 4800.0, 4900.0, 5000.0, 5100.0, 5200.0, 5300.0, 5400.0, 5500.0, 5600.0, 5700.0, 5800.0, 5900.0, 6000.0, 6100.0, 6200.0, 6300.0, 6400.0, 6500.0, 6600.0, 6700.0, 6800.0, 6900.0, 7000.0, 7100.0, 7200.0, 7300.0, 7400.0, 7500.0, 7600.0, 7700.0, 7800.0, 7900.0, 8000.0, 8100.0, 8200.0, 8300.0, 8400.0, 8500.0, 8600.0, 8700.0, 8800.0, 8900.0, 9000.0, 9100.0, 9200.0, 9300.0, 9400.0, 9500.0, 9600.0, 9700.0, 9800.0, 9900.0, 10000.0, 10100.0, 10200.0, 10300.0, 10400.0, 10500.0, 10600.0, 10700.0, 10800.0, 10900.0, 11000.0, 11100.0, 11200.0, 11300.0, 11400.0, 11500.0, 11600.0, 11700.0, 11800.0, 11900.0, 12000.0])
temps = np.array([30.4, 29.3, 28.2, 27.1, 26.0, 24.9, 23.8, 22.7, 21.6, 20.5, 19.4, 18.3, 17.2, 16.1, 15.0, 13.9, 12.8, 11.7, 10.6, 9.5, 8.4, 7.3, 6.2, 5.1, 4.0, 2.9, 1.8, 0.7, -0.4, -1.5, -2.6, -3.7, -4.8, -5.9, -7.0, -8.1, -9.2, -10.3, -11.4, -12.5, -13.6, -14.7, -15.8, -16.9, -18.0, -19.1, -20.2, -21.3, -22.4, -23.5, -24.6, -25.7, -26.8, -27.9, -29.0, -30.1, -31.2, -32.3, -33.4, -34.5, -35.6, -36.7, -37.8, -38.9, -40.0, -41.1, -42.2, -43.3, -44.4, -45.5, -46.6, -47.7, -48.8, -49.9, -51.0, -52.1, -53.2, -54.3, -55.4, -56.5, -57.6, -58.7, -59.8, -60.9, -62.0, -63.1, -64.2, -65.3, -66.4, -67.5, -68.6, -69.7, -70.8, -71.9, -73.0, -74.1, -75.2, -76.3, -77.4, -78.5, -79.6, -80.7, -81.8, -82.9, -84.0, -85.1, -86.2, -87.3, -88.4, -89.5, -90.6, -91.7, -92.8])
surface = 33.1
#lift parcel adiabatically until we reach equilibrium
dalr = 9.8 / 1000. # per meter
parcel_temp = surface + 0.
i = 0
while parcel_temp > temps[i]:
delta_h = heights[i+1] - heights[i]
parcel_temp -= dalr * (delta_h)
#now let's see if there is a surface inversion or BL depth to use
if i > 0:
print 'height of equilibrium is', heights[i]
print 'which is %s AGL.' % (heights[0] - heights[i])
print 'pressure level', pressures[i]
else:
print 'there is a surface inversion. move on...'
| 95.59375 | 943 | 0.595293 | 697 | 3,059 | 2.605452 | 0.543759 | 0.017621 | 0.013216 | 0.02478 | 0.039648 | 0 | 0 | 0 | 0 | 0 | 0 | 0.49179 | 0.163779 | 3,059 | 31 | 944 | 98.677419 | 0.218139 | 0.103956 | 0 | 0 | 0 | 0 | 0.034369 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.058824 | null | null | 0.235294 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
d8ea751b7ec5a6e2b3df03936e1f1f4adcef58aa | 291 | py | Python | moff/parser/read_table.py | Tikubonn/moff | 1c363f60959138311068177fca177d0f0dc97380 | [
"MIT"
] | null | null | null | moff/parser/read_table.py | Tikubonn/moff | 1c363f60959138311068177fca177d0f0dc97380 | [
"MIT"
] | null | null | null | moff/parser/read_table.py | Tikubonn/moff | 1c363f60959138311068177fca177d0f0dc97380 | [
"MIT"
] | null | null | null |
from moff.builder import TableBuilder
from moff.node import TableSeparatorNode
#
# | ...
#
def read_table(preread, stream, indentation, parser, options):
return TableBuilder()
#
# | ...
#
def read_table_separator(preread, stream, parser, options):
return TableSeparatorNode()
| 14.55 | 62 | 0.721649 | 30 | 291 | 6.9 | 0.566667 | 0.077295 | 0.115942 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.164948 | 291 | 19 | 63 | 15.315789 | 0.851852 | 0.037801 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.333333 | 0.333333 | 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 | 1 | 0 | 0 | 0 | 3 |
d8eafd068c8f3a866aea54a445f610c5308353f9 | 50 | py | Python | Animes/scans/scans.py | alexis51151/FlaskEntrance | d0942467fffecf02e9da3cd49679a16545f24587 | [
"Apache-2.0"
] | null | null | null | Animes/scans/scans.py | alexis51151/FlaskEntrance | d0942467fffecf02e9da3cd49679a16545f24587 | [
"Apache-2.0"
] | null | null | null | Animes/scans/scans.py | alexis51151/FlaskEntrance | d0942467fffecf02e9da3cd49679a16545f24587 | [
"Apache-2.0"
] | null | null | null | from flask import Flask
app = Flask(__name__) | 12.5 | 24 | 0.72 | 7 | 50 | 4.571429 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.22 | 50 | 4 | 25 | 12.5 | 0.820513 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
2b24a87ab04aa66f5fdf8b5a1eb4f3b8b8dcb9ac | 21 | py | Python | src/mathx/gui/__init__.py | wglas85/math | 91b43cac420f554ac4a838ba57c5d171b257066d | [
"Apache-2.0"
] | 3 | 2017-12-18T05:19:05.000Z | 2017-12-19T04:07:51.000Z | src/mathx/gui/__init__.py | wglas85/math | 91b43cac420f554ac4a838ba57c5d171b257066d | [
"Apache-2.0"
] | null | null | null | src/mathx/gui/__init__.py | wglas85/math | 91b43cac420f554ac4a838ba57c5d171b257066d | [
"Apache-2.0"
] | null | null | null | __all__ = ["AstTree"] | 21 | 21 | 0.666667 | 2 | 21 | 5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.095238 | 21 | 1 | 21 | 21 | 0.526316 | 0 | 0 | 0 | 0 | 0 | 0.318182 | 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 |
9914e81bf7a822ae587180827d89d3106a1cd76e | 46 | py | Python | litecord/basics.py | nullpixel/litecord | d3a50b2b53265de8f21f6451749529a2fcb7a502 | [
"MIT"
] | 2 | 2020-07-13T20:54:15.000Z | 2021-03-17T15:32:57.000Z | litecord/basics.py | nullpixel/litecord | d3a50b2b53265de8f21f6451749529a2fcb7a502 | [
"MIT"
] | null | null | null | litecord/basics.py | nullpixel/litecord | d3a50b2b53265de8f21f6451749529a2fcb7a502 | [
"MIT"
] | 2 | 2022-01-17T02:04:56.000Z | 2022-01-22T12:48:01.000Z | SERVER_VERSION = '0.0.1'
GATEWAY_VERSION = 6
| 11.5 | 24 | 0.717391 | 8 | 46 | 3.875 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.102564 | 0.152174 | 46 | 3 | 25 | 15.333333 | 0.692308 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 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 |
991b1f6e068f52768a2764d80f928a24b44ec16f | 415 | py | Python | okie/display/models.py | immortal-zeus/Django-task_dis | 10e99997893d4aabc2305969894e49f2873c17b7 | [
"BSD-3-Clause"
] | 1 | 2021-06-22T06:31:56.000Z | 2021-06-22T06:31:56.000Z | okie/display/models.py | immortal-zeus/Django-task_dis | 10e99997893d4aabc2305969894e49f2873c17b7 | [
"BSD-3-Clause"
] | null | null | null | okie/display/models.py | immortal-zeus/Django-task_dis | 10e99997893d4aabc2305969894e49f2873c17b7 | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from django.utils import timezone
from django.core.exceptions import ValidationError
# Create your models here.
class Dis(models.Model):
sid = models.AutoField(primary_key=True)
title = models.CharField(max_length=100)
ParentID = models.IntegerField(default=None,blank=True, null=True)
def __str__(self):
return f"{self.sid} , {self.title} , {self.ParentID}" | 31.923077 | 70 | 0.737349 | 56 | 415 | 5.357143 | 0.660714 | 0.1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008547 | 0.154217 | 415 | 13 | 71 | 31.923077 | 0.846154 | 0.057831 | 0 | 0 | 0 | 0 | 0.110256 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.333333 | 0.111111 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
99346f5f88f542423556a6f53304dbf1ad4191fc | 176 | py | Python | src/api/__main__.py | street-party/api | 6ad05aa12709e8f7a7cf59f34f2e9b7b188e3486 | [
"Apache-2.0"
] | null | null | null | src/api/__main__.py | street-party/api | 6ad05aa12709e8f7a7cf59f34f2e9b7b188e3486 | [
"Apache-2.0"
] | null | null | null | src/api/__main__.py | street-party/api | 6ad05aa12709e8f7a7cf59f34f2e9b7b188e3486 | [
"Apache-2.0"
] | null | null | null | from src.api.api import connexion_app
from src.api.config import PYTHON_MODULE_PORT
if __name__ == '__main__':
connexion_app.run(host='0.0.0.0', port=PYTHON_MODULE_PORT)
| 25.142857 | 62 | 0.772727 | 30 | 176 | 4.066667 | 0.533333 | 0.04918 | 0.163934 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025641 | 0.113636 | 176 | 6 | 63 | 29.333333 | 0.75641 | 0 | 0 | 0 | 0 | 0 | 0.085227 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
996042f962d7881b57b25440d3ec46ab0d89affb | 130 | py | Python | mmic_cg/components/__init__.py | RlyehAD/mmic_cg | 66344f3b85ce9ccfa43d6e6b35a86183cd4b6400 | [
"BSD-3-Clause"
] | null | null | null | mmic_cg/components/__init__.py | RlyehAD/mmic_cg | 66344f3b85ce9ccfa43d6e6b35a86183cd4b6400 | [
"BSD-3-Clause"
] | 2 | 2021-09-30T23:32:41.000Z | 2021-10-04T18:39:10.000Z | mmic_cg/components/__init__.py | RlyehAD/mmic_cg | 66344f3b85ce9ccfa43d6e6b35a86183cd4b6400 | [
"BSD-3-Clause"
] | 2 | 2021-06-24T22:11:44.000Z | 2021-10-04T17:46:03.000Z | """
mmic_cg
A generic component for coarse-graining
"""
from .cg_component import CoarseComponent
__all__ = ["CoarseComponent"]
| 14.444444 | 41 | 0.769231 | 15 | 130 | 6.266667 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130769 | 130 | 8 | 42 | 16.25 | 0.831858 | 0.361538 | 0 | 0 | 0 | 0 | 0.202703 | 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 |
996210307a719428cf9057357eeccb1a0a565345 | 76 | py | Python | src/test/local-manual/direct-broker/broker_test.py | acatalfano/distributed-systems-assignment-1 | 442510f14f2ae167b95a18bb458c2cf64f5caa87 | [
"MIT"
] | null | null | null | src/test/local-manual/direct-broker/broker_test.py | acatalfano/distributed-systems-assignment-1 | 442510f14f2ae167b95a18bb458c2cf64f5caa87 | [
"MIT"
] | null | null | null | src/test/local-manual/direct-broker/broker_test.py | acatalfano/distributed-systems-assignment-1 | 442510f14f2ae167b95a18bb458c2cf64f5caa87 | [
"MIT"
] | null | null | null | from app.network.direct_broker import DirectBroker
broker = DirectBroker()
| 19 | 50 | 0.828947 | 9 | 76 | 6.888889 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.105263 | 76 | 3 | 51 | 25.333333 | 0.911765 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
997d0801b5cf0bcbad317ad6f74067bbedcc1d2b | 908 | py | Python | hyperfython/parser.py | geraldovictor/TrabalhoFinalCompiladores | 039427cd62f6f8ac96291e03cc13fc6a7acdedb0 | [
"MIT"
] | null | null | null | hyperfython/parser.py | geraldovictor/TrabalhoFinalCompiladores | 039427cd62f6f8ac96291e03cc13fc6a7acdedb0 | [
"MIT"
] | 13 | 2019-12-11T00:40:57.000Z | 2019-12-20T18:33:45.000Z | hyperfython/parser.py | geraldovictor/TrabalhoFinalCompiladores | 039427cd62f6f8ac96291e03cc13fc6a7acdedb0 | [
"MIT"
] | null | null | null | from lark import Lark, InlineTransformer
from pathlib import Path
class SExprTransformer(InlineTransformer):
def funcao(self, *args):
return ['funcao', *args]
def lista(self, *args):
return ['lista', *args]
def tag(self,*args):
return ['tag', *args]
def atributo(self, *args):
return ['atributo', *args]
def nomedentro(self, x):
return ['nomedentro' , str(x)]
def nomefora(self, x):
return ['nomefora' , str(x)]
def parse(src: str):
"""
Compila string de entrada e retorna a S-expression equivalente.
"""
return parser.parse(src)
def _make_grammar():
"""
Retorna uma gramática do Lark inicializada.
"""
path = Path(__file__).parent / 'grammar.lark'
with open(path) as fd:
grammar = Lark(fd, parser='lalr', transformer=SExprTransformer())
return grammar
parser = _make_grammar() | 22.7 | 73 | 0.622247 | 106 | 908 | 5.254717 | 0.443396 | 0.057451 | 0.100539 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.245595 | 908 | 40 | 74 | 22.7 | 0.813139 | 0.117841 | 0 | 0 | 0 | 0 | 0.072633 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.347826 | false | 0 | 0.086957 | 0.26087 | 0.826087 | 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 |
99994e625f22e33f89fdf2cfdd28c632a24ac517 | 241 | py | Python | codegen/__init__.py | mondus/astunparse | be345194ca691f5283ac8eb96b820b35a816bbbd | [
"PSF-2.0"
] | null | null | null | codegen/__init__.py | mondus/astunparse | be345194ca691f5283ac8eb96b820b35a816bbbd | [
"PSF-2.0"
] | null | null | null | codegen/__init__.py | mondus/astunparse | be345194ca691f5283ac8eb96b820b35a816bbbd | [
"PSF-2.0"
] | null | null | null | # coding: utf-8
from six.moves import cStringIO
from .codegen import CodeGenerator
from .codegen import CodeGenException
__version__ = '1.0.0'
def codegen(tree):
v = cStringIO()
CodeGenerator(tree, file=v)
return v.getvalue()
| 18.538462 | 37 | 0.726141 | 32 | 241 | 5.34375 | 0.625 | 0.128655 | 0.19883 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020101 | 0.174274 | 241 | 12 | 38 | 20.083333 | 0.839196 | 0.053942 | 0 | 0 | 0 | 0 | 0.022222 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.375 | 0 | 0.625 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
999fb275cb2662b05ecb75403d05b70eeb77538d | 411 | py | Python | examples/math/pre_compute_distances.py | gugarosa/opfython | 19b467a92d85c7c26d231efec770645096827b4e | [
"Apache-2.0"
] | 26 | 2018-04-24T20:16:18.000Z | 2022-03-09T14:03:28.000Z | examples/math/pre_compute_distances.py | gugarosa/opfython | 19b467a92d85c7c26d231efec770645096827b4e | [
"Apache-2.0"
] | 4 | 2020-12-26T14:57:18.000Z | 2022-03-30T02:34:18.000Z | examples/math/pre_compute_distances.py | gugarosa/opfython | 19b467a92d85c7c26d231efec770645096827b4e | [
"Apache-2.0"
] | 16 | 2019-05-20T15:41:56.000Z | 2022-03-23T17:59:53.000Z | import opfython.math.general as g
import opfython.stream.loader as l
import opfython.stream.parser as p
import opfython.stream.splitter as s
# Loading a .txt file to a numpy array
txt = l.load_txt('data/boat.txt')
# Parsing a pre-loaded numpy array
X, Y = p.parse_loader(txt)
# Creating a file of pre-computed distances
g.pre_compute_distance(X, 'boat_split_distances.txt', distance='log_squared_euclidean')
| 29.357143 | 87 | 0.783455 | 71 | 411 | 4.422535 | 0.549296 | 0.178344 | 0.191083 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.124088 | 411 | 13 | 88 | 31.615385 | 0.872222 | 0.270073 | 0 | 0 | 0 | 0 | 0.195946 | 0.152027 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.571429 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
41d13f16546e73e34efb6565c1b587d2f65c10b7 | 275 | py | Python | src/environment.py | wszenic/rl-continuous-control | 8dd0dc8c30d66abdf3afc3a804b94c964e76f00e | [
"Apache-2.0"
] | null | null | null | src/environment.py | wszenic/rl-continuous-control | 8dd0dc8c30d66abdf3afc3a804b94c964e76f00e | [
"Apache-2.0"
] | null | null | null | src/environment.py | wszenic/rl-continuous-control | 8dd0dc8c30d66abdf3afc3a804b94c964e76f00e | [
"Apache-2.0"
] | null | null | null | from unityagents import UnityEnvironment
from src.config import UNITY_ENV_PATH
class UnityRun:
def __init__(self):
self.env = UnityEnvironment(UNITY_ENV_PATH)
def __enter__(self):
return self.env
def __exit__(self):
self.env.close()
| 17.1875 | 51 | 0.694545 | 34 | 275 | 5.147059 | 0.529412 | 0.12 | 0.137143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.232727 | 275 | 15 | 52 | 18.333333 | 0.829384 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.222222 | 0.111111 | 0.777778 | 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 |
41d7457ec02c77420a9bb8a3f3b825b75905ddff | 88 | py | Python | cdcbackend/modules/apps.py | plmercereau/CDT-server | 87f24334ccb4a1db925adff0cd5285ef9ec4822e | [
"MIT"
] | null | null | null | cdcbackend/modules/apps.py | plmercereau/CDT-server | 87f24334ccb4a1db925adff0cd5285ef9ec4822e | [
"MIT"
] | null | null | null | cdcbackend/modules/apps.py | plmercereau/CDT-server | 87f24334ccb4a1db925adff0cd5285ef9ec4822e | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class ModuleConfig(AppConfig):
name = 'modules'
| 14.666667 | 33 | 0.75 | 10 | 88 | 6.6 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.170455 | 88 | 5 | 34 | 17.6 | 0.90411 | 0 | 0 | 0 | 0 | 0 | 0.079545 | 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 |
41eadb81656c89b1957b475c4bf5c20fc653be5b | 528 | py | Python | lib/utils/transformpipeline/filters.py | WandrilleD/ncov-ingest | edb4092e6be70c0cffd5402038940268ac27f9ab | [
"MIT"
] | 1 | 2020-10-31T22:17:15.000Z | 2020-10-31T22:17:15.000Z | lib/utils/transformpipeline/filters.py | WandrilleD/ncov-ingest | edb4092e6be70c0cffd5402038940268ac27f9ab | [
"MIT"
] | 1 | 2020-06-04T20:47:11.000Z | 2020-06-05T02:45:28.000Z | lib/utils/transformpipeline/filters.py | WandrilleD/ncov-ingest | edb4092e6be70c0cffd5402038940268ac27f9ab | [
"MIT"
] | null | null | null | from typing import Container
from . import LINE_NUMBER_KEY
from ._base import Filter
class SequenceLengthFilter(Filter):
def __init__(self, min_length: int):
self.min_length = min_length
def test_value(self, inp: dict) -> bool:
return inp['length'] >= self.min_length
class LineNumberFilter(Filter):
def __init__(self, line_numbers: Container[int]):
self.line_numbers = line_numbers
def test_value(self, inp: dict) -> bool:
return inp[LINE_NUMBER_KEY] in self.line_numbers
| 25.142857 | 56 | 0.710227 | 71 | 528 | 4.957746 | 0.366197 | 0.102273 | 0.110795 | 0.096591 | 0.204545 | 0.204545 | 0.204545 | 0.204545 | 0.204545 | 0 | 0 | 0 | 0.198864 | 528 | 20 | 57 | 26.4 | 0.832151 | 0 | 0 | 0.153846 | 0 | 0 | 0.011364 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.307692 | false | 0 | 0.230769 | 0.153846 | 0.846154 | 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 |
41ee6f8dd898c6fa943d6e4380c724545bf5bc9f | 2,052 | py | Python | test/test_core_notes.py | andersdellien/pyelftools | d60d952075c8120a1f7f22d0463c8cbeaba9d6ff | [
"Unlicense"
] | 2 | 2018-12-13T06:21:08.000Z | 2018-12-14T08:40:58.000Z | test/test_core_notes.py | andersdellien/pyelftools | d60d952075c8120a1f7f22d0463c8cbeaba9d6ff | [
"Unlicense"
] | 1 | 2018-05-27T11:49:25.000Z | 2018-05-27T11:49:25.000Z | test/test_core_notes.py | andersdellien/pyelftools | d60d952075c8120a1f7f22d0463c8cbeaba9d6ff | [
"Unlicense"
] | 4 | 2018-06-17T00:20:33.000Z | 2020-01-09T07:51:41.000Z | #------------------------------------------------------------------------------
# elftools tests
#
# Maxim Akhmedov (max42@yandex-team.ru)
# This code is in the public domain
#------------------------------------------------------------------------------
import unittest
import os
from elftools.elf.elffile import ELFFile
from elftools.elf.segments import NoteSegment
class TestCoreNotes(unittest.TestCase):
""" This test makes sure than core dump specific
sections are properly analyzed.
"""
def test_core_prpsinfo(self):
with open(os.path.join('test',
'testfiles_for_unittests', 'core_linux64.elf'),
'rb') as f:
elf = ELFFile(f)
for segment in elf.iter_segments():
if not isinstance(segment, NoteSegment):
continue
notes = list(segment.iter_notes())
for note in segment.iter_notes():
if note['n_type'] != 'NT_PRPSINFO':
continue
desc = note['n_desc']
self.assertEquals(desc['pr_state'], 0)
self.assertEquals(desc['pr_sname'], b'R')
self.assertEquals(desc['pr_zomb'], 0)
self.assertEquals(desc['pr_nice'], 0)
self.assertEquals(desc['pr_flag'], 0x400600)
self.assertEquals(desc['pr_uid'], 1000)
self.assertEquals(desc['pr_gid'], 1000)
self.assertEquals(desc['pr_pid'], 23395)
self.assertEquals(desc['pr_ppid'], 23187)
self.assertEquals(desc['pr_pgrp'], 23395)
self.assertEquals(desc['pr_sid'], 23187)
self.assertEquals(
desc['pr_fname'],
b'coredump_self\x00\x00\x00')
self.assertEquals(
desc['pr_psargs'],
b'./coredump_self foo bar 42 ' + b'\x00' * (80 - 27))
| 42.75 | 79 | 0.476608 | 197 | 2,052 | 4.832487 | 0.472081 | 0.218487 | 0.273109 | 0.30042 | 0.240546 | 0 | 0 | 0 | 0 | 0 | 0 | 0.041791 | 0.346979 | 2,052 | 47 | 80 | 43.659574 | 0.668657 | 0.155945 | 0 | 0.114286 | 0 | 0 | 0.127124 | 0.02812 | 0 | 0 | 0.004687 | 0 | 0.371429 | 1 | 0.028571 | false | 0 | 0.114286 | 0 | 0.171429 | 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 |
41efd097502e5d95beeb3b41580b739dc261ad97 | 1,326 | py | Python | poop/hfdp/facade/home_theater/cd_player.py | cassiobotaro/poop | fc218fbf638c50da8ea98dab7de26ad2a52e83f5 | [
"MIT"
] | 37 | 2020-12-27T00:13:07.000Z | 2022-01-31T19:30:18.000Z | poop/hfdp/facade/home_theater/cd_player.py | cassiobotaro/poop | fc218fbf638c50da8ea98dab7de26ad2a52e83f5 | [
"MIT"
] | null | null | null | poop/hfdp/facade/home_theater/cd_player.py | cassiobotaro/poop | fc218fbf638c50da8ea98dab7de26ad2a52e83f5 | [
"MIT"
] | 7 | 2020-12-26T22:33:47.000Z | 2021-11-07T01:29:59.000Z | from poop.hfdp.facade.home_theater.amplifier import Amplifier
class CDPlayer:
def __init__(self, description: str, amplifier: Amplifier) -> None:
self._description = description
self._amplifier = amplifier
self._current_track: int | None = None
self._title: str | None = None
def on(self) -> None:
print(f"{self._description} on")
def off(self) -> None:
print(f"{self._description} off")
def eject(self) -> None:
self._title = None
print(f"{self._description} eject")
def play_title(self, title: str) -> None:
self._title = title
self._current_track = 0
print(f"{self._description} playing '{self._title}'")
def play_track(self, track: int) -> None:
if self._title is None:
print(
f"{self._description} can't play track {track} "
", no cd inserted"
)
else:
self._current_track = track
print(f"{self._description} playing track {self._current_track}")
def stop(self) -> None:
self._current_track = 0
print(f"{self._description} stopped")
def pause(self) -> None:
print(f"{self._description} paused {self._title}")
def __str__(self) -> str:
return self._description
| 29.466667 | 77 | 0.593514 | 156 | 1,326 | 4.801282 | 0.262821 | 0.220294 | 0.106809 | 0.224299 | 0.331108 | 0.217624 | 0.101469 | 0.101469 | 0 | 0 | 0 | 0.002119 | 0.288084 | 1,326 | 44 | 78 | 30.136364 | 0.791314 | 0 | 0 | 0.058824 | 0 | 0 | 0.223228 | 0.015837 | 0 | 0 | 0 | 0 | 0 | 1 | 0.264706 | false | 0 | 0.029412 | 0.029412 | 0.352941 | 0.235294 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
51301c77518da81c06c0627b0d81efecf047041c | 18,349 | py | Python | huntserver/migrations/0042_auto_20200204_2304.py | adenylyl/pi_day_puzzle_hunt | aa01cef427bc5f524e89558da72a2f79b0c78514 | [
"MIT"
] | 18 | 2017-03-07T19:53:03.000Z | 2022-02-24T04:58:47.000Z | huntserver/migrations/0042_auto_20200204_2304.py | adenylyl/pi_day_puzzle_hunt | aa01cef427bc5f524e89558da72a2f79b0c78514 | [
"MIT"
] | 161 | 2016-11-14T00:04:42.000Z | 2021-06-10T17:25:17.000Z | huntserver/migrations/0042_auto_20200204_2304.py | adenylyl/pi_day_puzzle_hunt | aa01cef427bc5f524e89558da72a2f79b0c78514 | [
"MIT"
] | 22 | 2016-09-27T18:00:10.000Z | 2022-03-13T17:51:44.000Z | # Generated by Django 2.2 on 2020-02-05 04:04
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import huntserver.models
class Migration(migrations.Migration):
dependencies = [
('huntserver', '0041_auto_20200110_1408'),
]
operations = [
migrations.AlterField(
model_name='hint',
name='last_modified_time',
field=models.DateTimeField(help_text='Last time of modification'),
),
migrations.AlterField(
model_name='hint',
name='puzzle',
field=models.ForeignKey(help_text='The puzzle that this hint is related to', on_delete=django.db.models.deletion.CASCADE, to='huntserver.Puzzle'),
),
migrations.AlterField(
model_name='hint',
name='request',
field=models.CharField(help_text='The text of the request for the hint', max_length=400),
),
migrations.AlterField(
model_name='hint',
name='request_time',
field=models.DateTimeField(help_text='Hint request time'),
),
migrations.AlterField(
model_name='hint',
name='response',
field=models.CharField(blank=True, help_text='The text of the response to the hint request', max_length=400),
),
migrations.AlterField(
model_name='hint',
name='response_time',
field=models.DateTimeField(blank=True, help_text='Hint response time', null=True),
),
migrations.AlterField(
model_name='hint',
name='team',
field=models.ForeignKey(help_text='The team that requested the hint', on_delete=django.db.models.deletion.CASCADE, to='huntserver.Team'),
),
migrations.AlterField(
model_name='hunt',
name='display_end_date',
field=models.DateTimeField(help_text='The end date/time displayed to users'),
),
migrations.AlterField(
model_name='hunt',
name='display_start_date',
field=models.DateTimeField(help_text='The start date/time displayed to users'),
),
migrations.AlterField(
model_name='hunt',
name='end_date',
field=models.DateTimeField(help_text='The date/time at which a hunt will be archived and available to the public'),
),
migrations.AlterField(
model_name='hunt',
name='extra_data',
field=models.CharField(blank=True, help_text='A misc. field for any extra data to be stored with the hunt.', max_length=200),
),
migrations.AlterField(
model_name='hunt',
name='hunt_name',
field=models.CharField(help_text='The name of the hunt as the public will see it', max_length=200),
),
migrations.AlterField(
model_name='hunt',
name='hunt_number',
field=models.IntegerField(help_text='A number used internally for hunt sorting, must be unique', unique=True),
),
migrations.AlterField(
model_name='hunt',
name='location',
field=models.CharField(help_text='Starting location of the puzzlehunt', max_length=100),
),
migrations.AlterField(
model_name='hunt',
name='resource_link',
field=models.URLField(blank=True, help_text='The full link (needs http://) to a folder of additional resources.'),
),
migrations.AlterField(
model_name='hunt',
name='start_date',
field=models.DateTimeField(help_text='The date/time at which a hunt will become visible to registered users'),
),
migrations.AlterField(
model_name='hunt',
name='template',
field=models.TextField(default='', help_text='The template string to be rendered to HTML on the hunt page'),
),
migrations.AlterField(
model_name='huntassetfile',
name='file',
field=models.FileField(storage=huntserver.models.OverwriteStorage(), upload_to='hunt/assets/'),
),
migrations.AlterField(
model_name='message',
name='is_response',
field=models.BooleanField(help_text='A boolean representing whether or not the message is from the staff'),
),
migrations.AlterField(
model_name='message',
name='team',
field=models.ForeignKey(help_text='The team that this message is being sent to/from', on_delete=django.db.models.deletion.CASCADE, to='huntserver.Team'),
),
migrations.AlterField(
model_name='message',
name='text',
field=models.CharField(help_text='Message text', max_length=400),
),
migrations.AlterField(
model_name='message',
name='time',
field=models.DateTimeField(help_text='Message send time'),
),
migrations.AlterField(
model_name='person',
name='allergies',
field=models.CharField(blank=True, help_text='Allergy information for the person', max_length=400),
),
migrations.AlterField(
model_name='person',
name='comments',
field=models.CharField(blank=True, help_text='Comments or other notes about the person', max_length=400),
),
migrations.AlterField(
model_name='person',
name='is_shib_acct',
field=models.BooleanField(help_text='A boolean to indicate if the person uses shibboleth authentication for login'),
),
migrations.AlterField(
model_name='person',
name='phone',
field=models.CharField(blank=True, help_text="Person's phone number, no particular formatting", max_length=20),
),
migrations.AlterField(
model_name='person',
name='teams',
field=models.ManyToManyField(blank=True, help_text='Teams that the person is on', to='huntserver.Team'),
),
migrations.AlterField(
model_name='person',
name='user',
field=models.OneToOneField(help_text='The corresponding user to this person', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='prepuzzle',
name='answer',
field=models.CharField(help_text='The answer to the puzzle, not case sensitive', max_length=100),
),
migrations.AlterField(
model_name='prepuzzle',
name='hunt',
field=models.OneToOneField(blank=True, help_text='The hunt that this puzzle is a part of, leave blank for no associated hunt.', null=True, on_delete=django.db.models.deletion.CASCADE, to='huntserver.Hunt'),
),
migrations.AlterField(
model_name='prepuzzle',
name='puzzle_name',
field=models.CharField(help_text='The name of the puzzle as it will be seen by hunt participants', max_length=200),
),
migrations.AlterField(
model_name='prepuzzle',
name='resource_link',
field=models.URLField(blank=True, help_text='The full link (needs http://) to a folder of additional resources.'),
),
migrations.AlterField(
model_name='prepuzzle',
name='response_string',
field=models.TextField(default='', help_text='Data returned to the webpage for use upon solving.'),
),
migrations.AlterField(
model_name='prepuzzle',
name='template',
field=models.TextField(default='{% extends "prepuzzle.html" %}\r\n{% load prepuzzle_tags %}\r\n\r\n{% block content %}\r\n{% endblock content %}', help_text='The template string to be rendered to HTML on the hunt page'),
),
migrations.AlterField(
model_name='puzzle',
name='answer',
field=models.CharField(help_text='The answer to the puzzle, not case sensitive', max_length=100),
),
migrations.AlterField(
model_name='puzzle',
name='extra_data',
field=models.CharField(blank=True, help_text='A misc. field for any extra data to be stored with the puzzle.', max_length=200),
),
migrations.AlterField(
model_name='puzzle',
name='hunt',
field=models.ForeignKey(help_text='The hunt that this puzzle is a part of', on_delete=django.db.models.deletion.CASCADE, to='huntserver.Hunt'),
),
migrations.AlterField(
model_name='puzzle',
name='is_html_puzzle',
field=models.BooleanField(default=False, help_text="Does this puzzle use an HTML folder as it's source?"),
),
migrations.AlterField(
model_name='puzzle',
name='is_meta',
field=models.BooleanField(default=False, help_text='Is this puzzle a meta-puzzle?'),
),
migrations.AlterField(
model_name='puzzle',
name='link',
field=models.URLField(blank=True, help_text='The full link (needs http://) to a publicly accessible PDF of the puzzle'),
),
migrations.AlterField(
model_name='puzzle',
name='num_pages',
field=models.IntegerField(help_text='Number of pages in the PDF for this puzzle. Set automatically upon download'),
),
migrations.AlterField(
model_name='puzzle',
name='num_required_to_unlock',
field=models.IntegerField(default=1, help_text='Number of prerequisite puzzles that need to be solved to unlock this puzzle'),
),
migrations.AlterField(
model_name='puzzle',
name='puzzle_id',
field=models.CharField(help_text='A 3-5 character hex string that uniquely identifies the puzzle', max_length=8, unique=True),
),
migrations.AlterField(
model_name='puzzle',
name='puzzle_name',
field=models.CharField(help_text='The name of the puzzle as it will be seen by hunt participants', max_length=200),
),
migrations.AlterField(
model_name='puzzle',
name='puzzle_number',
field=models.IntegerField(help_text='The number of the puzzle within the hunt, for sorting purposes'),
),
migrations.AlterField(
model_name='puzzle',
name='resource_link',
field=models.URLField(blank=True, help_text='The full link (needs http://) to a folder of additional resources.'),
),
migrations.AlterField(
model_name='puzzle',
name='solution_link',
field=models.URLField(blank=True, help_text='The full link (needs http://) to a publicly accessible PDF of the solution'),
),
migrations.AlterField(
model_name='puzzle',
name='unlocks',
field=models.ManyToManyField(blank=True, help_text='Puzzles that this puzzle is a possible prerequisite for', to='huntserver.Puzzle'),
),
migrations.AlterField(
model_name='response',
name='puzzle',
field=models.ForeignKey(help_text='The puzzle that this automated response is related to', on_delete=django.db.models.deletion.CASCADE, to='huntserver.Puzzle'),
),
migrations.AlterField(
model_name='response',
name='regex',
field=models.CharField(help_text="The python-style regex that will be checked against the user's response", max_length=400),
),
migrations.AlterField(
model_name='response',
name='text',
field=models.CharField(help_text='The text to use in the submission response if the regex matched', max_length=400),
),
migrations.AlterField(
model_name='solve',
name='puzzle',
field=models.ForeignKey(help_text='The puzzle that this is a solve for', on_delete=django.db.models.deletion.CASCADE, to='huntserver.Puzzle'),
),
migrations.AlterField(
model_name='solve',
name='submission',
field=models.ForeignKey(blank=True, help_text='The submission object that the team submitted to solve the puzzle', on_delete=django.db.models.deletion.CASCADE, to='huntserver.Submission'),
),
migrations.AlterField(
model_name='solve',
name='team',
field=models.ForeignKey(help_text='The team that this solve is from', on_delete=django.db.models.deletion.CASCADE, to='huntserver.Team'),
),
migrations.AlterField(
model_name='submission',
name='modified_date',
field=models.DateTimeField(help_text='Last date/time of response modification'),
),
migrations.AlterField(
model_name='submission',
name='puzzle',
field=models.ForeignKey(help_text='The puzzle that this submission is in response to', on_delete=django.db.models.deletion.CASCADE, to='huntserver.Puzzle'),
),
migrations.AlterField(
model_name='submission',
name='response_text',
field=models.CharField(blank=True, help_text='Response to the given answer. Empty string indicates human response needed', max_length=400),
),
migrations.AlterField(
model_name='submission',
name='team',
field=models.ForeignKey(help_text='The team that made the submission', on_delete=django.db.models.deletion.CASCADE, to='huntserver.Team'),
),
migrations.AlterField(
model_name='team',
name='hunt',
field=models.ForeignKey(help_text='The hunt that the team is a part of', on_delete=django.db.models.deletion.CASCADE, to='huntserver.Hunt'),
),
migrations.AlterField(
model_name='team',
name='join_code',
field=models.CharField(help_text='The 5 character random alphanumeric password needed for a user to join a team', max_length=5),
),
migrations.AlterField(
model_name='team',
name='location',
field=models.CharField(blank=True, help_text='The physical location that the team is solving at', max_length=80),
),
migrations.AlterField(
model_name='team',
name='playtester',
field=models.BooleanField(default=False, help_text='A boolean to indicate if the team is a playtest team and will get early access'),
),
migrations.AlterField(
model_name='team',
name='solved',
field=models.ManyToManyField(blank=True, help_text='The puzzles the team has solved', related_name='solved_for', through='huntserver.Solve', to='huntserver.Puzzle'),
),
migrations.AlterField(
model_name='team',
name='team_name',
field=models.CharField(help_text='The team name as it will be shown to hunt participants', max_length=200),
),
migrations.AlterField(
model_name='team',
name='unlockables',
field=models.ManyToManyField(blank=True, help_text='The unlockables the team has earned', to='huntserver.Unlockable'),
),
migrations.AlterField(
model_name='team',
name='unlocked',
field=models.ManyToManyField(blank=True, help_text='The puzzles the team has unlocked', related_name='unlocked_for', through='huntserver.Unlock', to='huntserver.Puzzle'),
),
migrations.AlterField(
model_name='unlock',
name='puzzle',
field=models.ForeignKey(help_text='The puzzle that this is an unlock for', on_delete=django.db.models.deletion.CASCADE, to='huntserver.Puzzle'),
),
migrations.AlterField(
model_name='unlock',
name='team',
field=models.ForeignKey(help_text='The team that this unlocked puzzle is for', on_delete=django.db.models.deletion.CASCADE, to='huntserver.Team'),
),
migrations.AlterField(
model_name='unlock',
name='time',
field=models.DateTimeField(help_text='The time this puzzle was unlocked for this team'),
),
migrations.AlterField(
model_name='unlockable',
name='content',
field=models.CharField(help_text='The link to the content, files must be externally hosted.', max_length=500),
),
migrations.AlterField(
model_name='unlockable',
name='content_type',
field=models.CharField(choices=[('IMG', 'Image'), ('PDF', 'PDF'), ('TXT', 'Text'), ('WEB', 'Link')], default='TXT', help_text="The type of object that is to be unlocked, can be 'IMG', 'PDF', 'TXT', or 'WEB'", max_length=3),
),
migrations.AlterField(
model_name='unlockable',
name='puzzle',
field=models.ForeignKey(help_text='The puzzle that needs to be solved to unlock this object', on_delete=django.db.models.deletion.CASCADE, to='huntserver.Puzzle'),
),
migrations.CreateModel(
name='HintUnlockPlan',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('unlock_type', models.CharField(choices=[('TIM', 'Exact Time Unlock'), ('INT', 'Interval Based Unlock'), ('SOL', 'Solves Based Unlock')], default='TIM', help_text='The type of hint unlock plan', max_length=3)),
('unlock_parameter', models.IntegerField(help_text='Parameter (Time / Interval / Solves)')),
('num_triggered', models.IntegerField(help_text='Number of times this Unlock Plan has given a hint')),
('hunt', models.ForeignKey(help_text='The hunt that this hint unlock plan refers to', on_delete=django.db.models.deletion.CASCADE, to='huntserver.Hunt')),
],
),
]
| 47.413437 | 235 | 0.61115 | 2,066 | 18,349 | 5.310261 | 0.1394 | 0.05469 | 0.164069 | 0.19032 | 0.726552 | 0.708595 | 0.570686 | 0.437426 | 0.404612 | 0.369337 | 0 | 0.007225 | 0.275873 | 18,349 | 386 | 236 | 47.536269 | 0.818469 | 0.002343 | 0 | 0.668421 | 1 | 0.005263 | 0.300699 | 0.004753 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.002632 | 0.010526 | 0 | 0.018421 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 1 | 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 |
5139f0c3607f155336860087fcd0e5ec536223a4 | 190 | py | Python | scrapers/SBU-south-bucks/councillors.py | DemocracyClub/LGSF | 21c2a049db08575e03db2fb63a8bccc8de0c636b | [
"MIT"
] | 4 | 2018-10-17T13:30:08.000Z | 2021-06-22T13:29:43.000Z | scrapers/SBU-south-bucks/councillors.py | DemocracyClub/LGSF | 21c2a049db08575e03db2fb63a8bccc8de0c636b | [
"MIT"
] | 46 | 2018-10-15T13:47:48.000Z | 2022-03-23T10:26:18.000Z | scrapers/SBU-south-bucks/councillors.py | DemocracyClub/LGSF | 21c2a049db08575e03db2fb63a8bccc8de0c636b | [
"MIT"
] | 1 | 2018-10-15T13:36:03.000Z | 2018-10-15T13:36:03.000Z | from lgsf.councillors.scrapers import ModGovCouncillorScraper
class Scraper(ModGovCouncillorScraper):
base_url = "http://sbdc-spider2.southbucks.gov.uk/democracy/"
disabled = True
| 27.142857 | 65 | 0.789474 | 20 | 190 | 7.45 | 0.95 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005952 | 0.115789 | 190 | 6 | 66 | 31.666667 | 0.880952 | 0 | 0 | 0 | 0 | 0 | 0.252632 | 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 |
515bf59eb971680dddb87e63d073eb7567fc3831 | 519 | py | Python | src/sprite/sprite.py | Dernbu/cat-desktop-pet | 1be143bb8f4523d306f4c83062d82005d6ebbc4a | [
"MIT"
] | null | null | null | src/sprite/sprite.py | Dernbu/cat-desktop-pet | 1be143bb8f4523d306f4c83062d82005d6ebbc4a | [
"MIT"
] | null | null | null | src/sprite/sprite.py | Dernbu/cat-desktop-pet | 1be143bb8f4523d306f4c83062d82005d6ebbc4a | [
"MIT"
] | null | null | null |
class Sprite:
# Getter Functions
def getCurrentFramePath(cls): pass
def getCurrentFrameDelay(cls): pass
def getCurrentPos(cls): pass
# Interface for main to call
def init(cls, xcoord: int, ycoord: int): pass
def update(cls): pass
# Interface to set sprite properties
class SpriteProperties: pass
# Interactivity
def onLeftClick(cls, event): pass
class SpritePos:
x: int
y: int
def __init__(self, x, y) -> None:
self.x = x
self.y = y
| 17.896552 | 49 | 0.630058 | 65 | 519 | 4.969231 | 0.476923 | 0.086687 | 0.06192 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.287091 | 519 | 28 | 50 | 18.535714 | 0.872973 | 0.177264 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0.5 | 0 | 0 | 0.857143 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
5ac048d9480fe94d28714fd566b147759f4f8fa0 | 1,092 | py | Python | gitmouth/protocol.py | openruko/gitmouth | 29e9a11f3e13cd3021557fa3f00d2eb69b38a418 | [
"BSD-2-Clause"
] | 7 | 2015-01-06T03:56:41.000Z | 2019-11-02T04:50:38.000Z | gitmouth/protocol.py | openruko/gitmouth | 29e9a11f3e13cd3021557fa3f00d2eb69b38a418 | [
"BSD-2-Clause"
] | null | null | null | gitmouth/protocol.py | openruko/gitmouth | 29e9a11f3e13cd3021557fa3f00d2eb69b38a418 | [
"BSD-2-Clause"
] | null | null | null | from twisted.internet.protocol import Protocol
from twisted.python import failure
from twisted.internet.error import ProcessDone
class ProcLiteProtocol(Protocol):
def __init__(self):
pass
def connectionMade(self):
pass
def write(self, data):
self.transport.write(data)
def pair(self, clientProto):
self.clientProto = clientProto
def dataReceived(self, data):
if str(data)[0:2] == 'E:':
self.clientProto.errReceived(str(data)[2:])
else:
self.clientProto.write(data)
def connectionLost(self, reason):
self.clientProto.processEnded(failure.Failure(ProcessDone(0)))
def loseConnection(self):
self.transport.abortConnection()
class DumbProtocol(Protocol):
def __init__(self):
pass
def connectionMade(self):
pass
def write(self, data):
pass
def pair(self, clientProto):
pass
def dataReceived(self, data):
pass
def connectionLost(self, reason):
pass
def loseConnection(self):
pass
| 19.854545 | 70 | 0.636447 | 116 | 1,092 | 5.922414 | 0.301724 | 0.081514 | 0.064047 | 0.055313 | 0.186317 | 0.186317 | 0.186317 | 0.186317 | 0.186317 | 0.186317 | 0 | 0.005 | 0.267399 | 1,092 | 54 | 71 | 20.222222 | 0.85375 | 0 | 0 | 0.638889 | 0 | 0 | 0.001832 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.388889 | false | 0.25 | 0.083333 | 0 | 0.527778 | 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 |
51bc104a8b6b165af7c20bebafac8172d7686dcf | 229 | py | Python | song/admin.py | lanstat/drf-example | 572a75df9b65396507389260a6fec97254cfb9d5 | [
"Apache-2.0"
] | null | null | null | song/admin.py | lanstat/drf-example | 572a75df9b65396507389260a6fec97254cfb9d5 | [
"Apache-2.0"
] | null | null | null | song/admin.py | lanstat/drf-example | 572a75df9b65396507389260a6fec97254cfb9d5 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import Track, Genre, PlayList
# Register your models here.
admin.site.register(Track)
admin.site.register(Genre)
admin.site.register(PlayList)
#admin.site.register(PlayListContent) | 22.9 | 42 | 0.80786 | 31 | 229 | 5.967742 | 0.451613 | 0.194595 | 0.367568 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.091703 | 229 | 10 | 43 | 22.9 | 0.889423 | 0.270742 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.4 | 0 | 0.4 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
51bf8fdfb3d40c1ce87add48287f739e8b9e0dc3 | 176 | py | Python | robot_explorers/gui/__init__.py | Nino-SEGALA/HuaweiChallenge | a628f5550063422b095300846bde5680a5e95414 | [
"BSD-3-Clause"
] | null | null | null | robot_explorers/gui/__init__.py | Nino-SEGALA/HuaweiChallenge | a628f5550063422b095300846bde5680a5e95414 | [
"BSD-3-Clause"
] | null | null | null | robot_explorers/gui/__init__.py | Nino-SEGALA/HuaweiChallenge | a628f5550063422b095300846bde5680a5e95414 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Copyright (c) 2020 Huawei Technologies Sweden AB, All rights reserved.
Authors:
Karl Gäfvert
'''
from .gui import GUI
__all__ = ['GUI'] | 19.555556 | 71 | 0.630682 | 22 | 176 | 4.863636 | 0.863636 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.036496 | 0.221591 | 176 | 9 | 72 | 19.555556 | 0.744526 | 0.681818 | 0 | 0 | 0 | 0 | 0.073171 | 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 |
51fff9623ff2b709353665890e94fedd1a74671f | 200 | py | Python | test_fork.py | fengsp/fork | f4f0779be2a92315470220da93b3144ba66d4910 | [
"BSD-3-Clause"
] | 1 | 2015-05-30T11:58:37.000Z | 2015-05-30T11:58:37.000Z | test_fork.py | fengsp/fork | f4f0779be2a92315470220da93b3144ba66d4910 | [
"BSD-3-Clause"
] | null | null | null | test_fork.py | fengsp/fork | f4f0779be2a92315470220da93b3144ba66d4910 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Run tests for Fork.
"""
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
if __name__ == "__main__":
pass
| 15.384615 | 62 | 0.635 | 30 | 200 | 3.833333 | 0.8 | 0.104348 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012048 | 0.17 | 200 | 12 | 63 | 16.666667 | 0.680723 | 0.31 | 0 | 0 | 0 | 0 | 0.064 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.2 | 0.4 | 0 | 0.4 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 3 |
cfcb268629c2c49c9736d181546831c53c757bfa | 1,051 | py | Python | pluto/control/processes/pod_process.py | chalant/pluto | e7bfd35a2c1fc0e0753bd2f840b0a4385b5124fc | [
"Apache-2.0"
] | null | null | null | pluto/control/processes/pod_process.py | chalant/pluto | e7bfd35a2c1fc0e0753bd2f840b0a4385b5124fc | [
"Apache-2.0"
] | null | null | null | pluto/control/processes/pod_process.py | chalant/pluto | e7bfd35a2c1fc0e0753bd2f840b0a4385b5124fc | [
"Apache-2.0"
] | null | null | null | from pluto.control.processes import processes
class PodProcess(process_factory.Process):
pass
class PodProcessFactory(process_factory.ProcessFactory):
def _create_process(self, framework_url, session_id, root_dir):
#todo:
# we can terminate the pod (kubectl delete pod) or through api:
# /api/v1/namespaces/{namespace}/pods/{name}
# when deploying a pod, we should give it a unique name that we can use to make
# delete, exec calls, etc. => The pods shall be named by session_id
# controllables are made such that they can be restarted when they fail, and resume
# from where they left-off
# we will need a "service" to be able to call the pod, since it might restart, it will
# get a new ip address, so we need a service. or we could find the node using its name,
# then get its cluster-ip => this is the preferred approach PROBLEM: we might need to do
# this on each iteration... at least we have more control over the "refresh" frequency
pass | 55.315789 | 96 | 0.693625 | 161 | 1,051 | 4.478261 | 0.639752 | 0.038835 | 0.033287 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001259 | 0.244529 | 1,051 | 19 | 97 | 55.315789 | 0.906801 | 0.669838 | 0 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.052632 | 0 | 1 | 0.166667 | false | 0.333333 | 0.166667 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
cfdb162e683c4f256717669b17121e2de4cb115d | 21 | py | Python | nipype/workflows/fmri/spm/tests/__init__.py | carlohamalainen/nipype | 0c4f587946f48277de471b1801b60bd18fdfb775 | [
"BSD-3-Clause"
] | 1 | 2018-04-18T12:13:37.000Z | 2018-04-18T12:13:37.000Z | nipype/workflows/fmri/spm/tests/__init__.py | ito-takuya/nipype | 9099a5809487b55868cdec82a719030419cbd6ba | [
"BSD-3-Clause"
] | 2 | 2017-10-05T21:08:38.000Z | 2018-10-09T23:01:23.000Z | nipype/workflows/fmri/spm/tests/__init__.py | ito-takuya/nipype | 9099a5809487b55868cdec82a719030419cbd6ba | [
"BSD-3-Clause"
] | 1 | 2021-09-08T14:31:47.000Z | 2021-09-08T14:31:47.000Z | __author__ = 'satra'
| 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 |
cff1b4f7349b01171158c8af17a45a85b2d44c97 | 743 | py | Python | scanpy/api/pp.py | mkmkryu/scanpy2 | f3db32a142dc31c1b628380db1c969a6d0b9dc3a | [
"BSD-3-Clause"
] | 1 | 2021-01-15T22:13:26.000Z | 2021-01-15T22:13:26.000Z | scanpy/api/pp.py | mkmkryu/scanpy2 | f3db32a142dc31c1b628380db1c969a6d0b9dc3a | [
"BSD-3-Clause"
] | 1 | 2020-06-16T17:14:45.000Z | 2020-06-16T17:14:45.000Z | scanpy/api/pp.py | mkmkryu/scanpy2 | f3db32a142dc31c1b628380db1c969a6d0b9dc3a | [
"BSD-3-Clause"
] | 2 | 2020-06-16T16:42:40.000Z | 2020-08-28T16:59:42.000Z | from ..neighbors import neighbors
from ..preprocessing._recipes import recipe_zheng17, recipe_weinreb17, recipe_seurat
from ..preprocessing._simple import filter_cells, filter_genes
from ..preprocessing._deprecated.highly_variable_genes import filter_genes_dispersion
from ..preprocessing._highly_variable_genes import highly_variable_genes
from ..preprocessing._simple import (
log1p,
sqrt,
normalize_per_cell,
regress_out,
scale,
subsample,
downsample_counts,
)
from ..preprocessing._pca import pca
from ..preprocessing._qc import calculate_qc_metrics
from ..preprocessing._combat import combat
from ..preprocessing._normalization import normalize_total
from ..external.pp import mnn_correct, bbknn, dca, magic
| 33.772727 | 85 | 0.816958 | 88 | 743 | 6.556818 | 0.477273 | 0.265165 | 0.098787 | 0.10052 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007634 | 0.118439 | 743 | 21 | 86 | 35.380952 | 0.873282 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.578947 | 0 | 0.578947 | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
3222557f9abcdfb2a22758080f2da9d5e06daa8e | 262 | py | Python | GoogleITAutomation/3 Git/reboot_check_linux.py | RuigerS/Tuturials | 2169f778161933b2739608c3613a684bacdaef80 | [
"MIT"
] | null | null | null | GoogleITAutomation/3 Git/reboot_check_linux.py | RuigerS/Tuturials | 2169f778161933b2739608c3613a684bacdaef80 | [
"MIT"
] | 1 | 2021-01-03T11:38:43.000Z | 2021-01-03T11:38:43.000Z | GoogleITAutomation/3 Git/reboot_check_linux.py | RuigerS/Tuturials | 2169f778161933b2739608c3613a684bacdaef80 | [
"MIT"
] | null | null | null | #!usr/bin/env python3
import os
import sys
def check_reboot():
"""Returns True if the Linux computer has a pending reboot."""
return os.path.exist("/run/reboot-required")
def main():
if check_reboot():
print("Pending reboot.")
sys.exit(1)
main() | 18.714286 | 64 | 0.683206 | 40 | 262 | 4.425 | 0.7 | 0.124294 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009174 | 0.167939 | 262 | 14 | 65 | 18.714286 | 0.802752 | 0.293893 | 0 | 0 | 0 | 0 | 0.194444 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | true | 0 | 0.222222 | 0 | 0.555556 | 0.111111 | 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 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
5c53d87db55354e4d1c705e379b195a5d87ccd0d | 1,428 | py | Python | py/levels/love.py | triffid/kiki | b64b8524063c149a5cc9118f48d80afec1d8a942 | [
"Unlicense"
] | 2 | 2020-01-04T23:44:10.000Z | 2020-07-12T17:10:09.000Z | py/levels/love.py | triffid/kiki | b64b8524063c149a5cc9118f48d80afec1d8a942 | [
"Unlicense"
] | null | null | null | py/levels/love.py | triffid/kiki | b64b8524063c149a5cc9118f48d80afec1d8a942 | [
"Unlicense"
] | 1 | 2022-03-16T05:43:33.000Z | 2022-03-16T05:43:33.000Z | # .................................................................................................................
level_dict["love"] = {
"scheme": "red_scheme",
"size": (13,13,13),
"intro": "love",
"help": (
"$scale(1.5)mission:\nget to the exit!",
),
"player": { "position": (0,1,-4),
"orientation": rot0,
},
"exits": [
{
"name": "peace",
"active": 1,
"position": (0,0,4),
},
],
"create":
"""
heart = [[0,0], [ 1,1], [ 2,1], [ 3,0], [ 3,-1], [ 2,-2], [ 1,-3], [0,-4],
[-1,1], [-2,1], [-3,0], [-3,-1], [-2,-2], [-1,-3]]
for h in heart:
world.addObjectAtPos (KikiBomb(), world.decenter(h[0],h[1]+1,4))
world.addObjectAtPos (KikiStone(), world.decenter(h[0],h[1]+1,-4))
world.addObjectAtPos (KikiMutant(), world.decenter(0,-4,0))
""",
}
| 46.064516 | 115 | 0.232493 | 101 | 1,428 | 3.267327 | 0.39604 | 0.024242 | 0.036364 | 0.036364 | 0.30303 | 0.30303 | 0.30303 | 0.30303 | 0.30303 | 0.30303 | 0 | 0.083082 | 0.536415 | 1,428 | 30 | 116 | 47.6 | 0.415408 | 0.079132 | 0 | 0 | 0 | 0 | 0.141189 | 0.025478 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 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 |
5c5be07dc01613c46356fc97aac7d874f411c60b | 1,296 | py | Python | mqtt/abstract_server.py | 6DammK9/FastMOT | ff5febf4f4bac576db6e5846479bdc0891fa740b | [
"MIT"
] | null | null | null | mqtt/abstract_server.py | 6DammK9/FastMOT | ff5febf4f4bac576db6e5846479bdc0891fa740b | [
"MIT"
] | null | null | null | mqtt/abstract_server.py | 6DammK9/FastMOT | ff5febf4f4bac576db6e5846479bdc0891fa740b | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from queue import Queue
import signal
import os
import json
import time
import calendar
import threading
#import client_config
#import c_log
import logging
logger = logging.getLogger(__name__)
class abstractServer(ABC):
def __init__(self, timer_lapse=200):
super().__init__()
self.queue = Queue()
self.timer_lapse = timer_lapse
self.time_thread = threading.Timer(self.timer_lapse, self.on_timeout)
#signal.signal(signal.SIGINT, self.handler)
def put_msg(self, msg):
# Multiple reading in single message
#for m in msg:
# self.devices[m["nodeId"]].update()
#try:
# n = json.dumps(msg)
#except Exception as e:
# c_log.log_error()
n = msg
self.queue.put(n)
#def handler(self, signum, frame):
# self.stop()
def resetTimer(self, action):
if (action == 'reset'):
self.time_thread.cancel()
self.time_thread = threading.Timer(self.timer_lapse, self.on_timeout)
self.time_thread.start()
def prepare_timeout(self):
self.resetTimer('reset')
@abstractmethod
def on_timeout(self):
pass
def start(self):
pass
def stop(self):
pass
| 23.563636 | 81 | 0.624228 | 161 | 1,296 | 4.838509 | 0.397516 | 0.064185 | 0.071887 | 0.05905 | 0.141207 | 0.141207 | 0.141207 | 0.141207 | 0.141207 | 0.141207 | 0 | 0.003188 | 0.27392 | 1,296 | 54 | 82 | 24 | 0.824655 | 0.214506 | 0 | 0.151515 | 0 | 0 | 0.00994 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.212121 | false | 0.090909 | 0.272727 | 0 | 0.515152 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
5c7119c76f49724200dc164c31398466ba20d4c6 | 159 | py | Python | mtsimple/routing.py | JahanviNShah/inmt | 730faf6dcd24536bbffd0ec463c61d3b0a7819cd | [
"MIT"
] | 39 | 2020-04-14T09:41:41.000Z | 2022-02-21T14:32:06.000Z | mtsimple/routing.py | JahanviNShah/inmt | 730faf6dcd24536bbffd0ec463c61d3b0a7819cd | [
"MIT"
] | 17 | 2020-05-11T23:44:57.000Z | 2021-02-17T10:53:15.000Z | mtsimple/routing.py | JahanviNShah/inmt | 730faf6dcd24536bbffd0ec463c61d3b0a7819cd | [
"MIT"
] | 20 | 2020-04-14T11:22:43.000Z | 2021-11-25T03:57:21.000Z | from django.conf.urls import url
from . import consumers
websocket_urlpatterns = [
url(r'^ws/simple/translation-socket', consumers.TranslationConsumer)
] | 22.714286 | 72 | 0.779874 | 19 | 159 | 6.473684 | 0.789474 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.119497 | 159 | 7 | 73 | 22.714286 | 0.878571 | 0 | 0 | 0 | 0 | 0 | 0.18125 | 0.18125 | 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 |
5c7493853f51571a8d4a7f5ef526eb37d57e555f | 336 | py | Python | flocker/control/test/configurations/configuration_v1.py | wallnerryan/flocker-profiles | bcd3ced8edf4af86a68070ff6a714c45f9f4913b | [
"Apache-2.0"
] | null | null | null | flocker/control/test/configurations/configuration_v1.py | wallnerryan/flocker-profiles | bcd3ced8edf4af86a68070ff6a714c45f9f4913b | [
"Apache-2.0"
] | null | null | null | flocker/control/test/configurations/configuration_v1.py | wallnerryan/flocker-profiles | bcd3ced8edf4af86a68070ff6a714c45f9f4913b | [
"Apache-2.0"
] | null | null | null | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
# Generate a v1 configuration.
# Commit Hash: 7bd476e2fdc7353018ff1fc446b9b4c76e7c7c17
from flocker.control._persistence import wire_encode
from flocker.control.test.test_persistence import TEST_DEPLOYMENT
if __name__ == "__main__":
print wire_encode(TEST_DEPLOYMENT)
| 30.545455 | 65 | 0.821429 | 40 | 336 | 6.55 | 0.725 | 0.083969 | 0.137405 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.084746 | 0.122024 | 336 | 10 | 66 | 33.6 | 0.80339 | 0.419643 | 0 | 0 | 1 | 0 | 0.041885 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.5 | null | null | 0.25 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
5c816678589ebbb4468475e2a1f30d412c1aa9d6 | 817 | py | Python | cms/test_utils/project/pluginapp/plugins/manytomany_rel/models.py | jrief/django-cms | e32eca878be0f0ead9a4fb6713256f4359b3e451 | [
"BSD-3-Clause"
] | 1 | 2015-06-11T19:25:26.000Z | 2015-06-11T19:25:26.000Z | cms/test_utils/project/pluginapp/plugins/manytomany_rel/models.py | damianmoore/django-cms | 2d3e10a01e792ec7da5c1418811c1be5ac84e5e2 | [
"BSD-3-Clause"
] | 5 | 2021-03-19T15:39:27.000Z | 2021-09-08T02:47:21.000Z | cms/test_utils/project/pluginapp/plugins/manytomany_rel/models.py | Acidburn0zzz/django-cms | 5a105a1c75eeb4c8a4c1c34301d93855e6724407 | [
"BSD-3-Clause"
] | null | null | null | from cms.utils.compat.dj import python_2_unicode_compatible
from django.db import models
from cms.models import CMSPlugin
@python_2_unicode_compatible
class Article(models.Model):
title = models.CharField(max_length=50)
section = models.ForeignKey('Section')
def __str__(self):
return u"%s -- %s" % (self.title, self.section)
@python_2_unicode_compatible
class Section(models.Model):
name = models.CharField(max_length=50)
def __str__(self):
return self.name
@python_2_unicode_compatible
class ArticlePluginModel(CMSPlugin):
title = models.CharField(max_length=50)
sections = models.ManyToManyField('Section')
def __str__(self):
return self.title
def copy_relations(self, oldinstance):
self.sections = oldinstance.sections.all()
| 23.342857 | 59 | 0.723378 | 102 | 817 | 5.519608 | 0.372549 | 0.049734 | 0.099467 | 0.170515 | 0.435169 | 0.110124 | 0 | 0 | 0 | 0 | 0 | 0.014925 | 0.179927 | 817 | 34 | 60 | 24.029412 | 0.825373 | 0 | 0 | 0.363636 | 0 | 0 | 0.026928 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.181818 | false | 0 | 0.136364 | 0.136364 | 0.818182 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
5c93ad76b7cd558690cc763f62b9b5819d32e4ac | 52,742 | py | Python | pysnmp-with-texts/Juniper-ERX-Registry.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/Juniper-ERX-Registry.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/Juniper-ERX-Registry.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 Juniper-ERX-Registry (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Juniper-ERX-Registry
# Produced by pysmi-0.3.4 at Wed May 1 14:02:31 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection", "SingleValueConstraint")
juniAdmin, = mibBuilder.importSymbols("Juniper-Registry", "juniAdmin")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
ModuleIdentity, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, NotificationType, MibIdentifier, Counter32, TimeTicks, Counter64, IpAddress, Unsigned32, Gauge32, Bits, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "NotificationType", "MibIdentifier", "Counter32", "TimeTicks", "Counter64", "IpAddress", "Unsigned32", "Gauge32", "Bits", "ObjectIdentity")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
juniErxRegistry = ModuleIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2))
juniErxRegistry.setRevisions(('2006-07-22 05:43', '2006-06-23 16:07', '2006-04-03 10:43', '2006-05-02 14:53', '2006-04-12 13:05', '2006-03-31 13:12', '2006-02-28 08:22', '2005-09-21 15:48', '2004-05-25 18:32', '2003-11-12 20:20', '2003-11-12 19:30', '2003-07-17 21:07', '2002-10-21 15:00', '2002-10-16 18:50', '2002-10-10 18:51', '2002-05-08 12:34', '2002-05-07 14:05', '2001-08-20 16:08', '2001-06-12 18:27', '2001-06-04 20:11',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: juniErxRegistry.setRevisionsDescriptions(('Obsolete erxSrp5Plus SRP.', 'Obsolete line cards: CT1-FULL, ERX-X21-V35-MOD, HSSI-3F, CE1-FULL.', 'changed status of erxSrp5Plus, erxSrp310, erxSrp5g1gEcc, erxSrp5g2gEcc to deprecated.', 'Deprecated line cards: CT1-FULL, ERX-X21-V35-MOD, HSSI-3F, CE1-FULL.', 'Changed the status of the E3-3A board to obsolete.', 'Changed the status of erxSrp5, erxSrp40, erxSrp40Plus, board to obsolete. Added new boards (erxSrp10g1gEcc, erxSrp10g2gEcc, erxSrp5g1gEcc, erxSrp5g2gEcc).', 'Added new board (erxSrp40g2gEc2).', 'Changed the status of the CT3, CT3 I/O, T3-3F, T3-3A, E3-3F, 10/100 FE-2 and 10/100 FE-2 I/O boards to obsolete.', 'Added support for the Fe8 FX IOA.', 'Added Hybrid line module and Hybrid IOA modules. Added GE2 line module and GE2 IOA module.', 'Rebranded the ERX as an E-series product.', 'Added ERX-310 hardware support. Added new Service module.', 'Replaced Unisphere names with Juniper names. Added 256M versions of OCx ATM and GE/FE modules.', 'Added support for OC12 channelized ATM/POS I/O adapters. Added support fo OC48 line card and I/O adapter. Added 12 port T3/E3 redundant midplane support.', 'Added SRP module with 40 gbps plus switch fabric. Added Vitrual Tunneling Server (VTS) module. Added X.21/V.35 Server module and I/O adapter. Added OC12 APS I/O adapters. Added redundant midplane spare I/O adapters.', 'Added GE SFP IOA module.', "Added SRP modules with 5 gbps and 40 gbps 'plus' switch fabrics.", 'Added 12 port T3/E3 channelized modules.', 'Added High Speed Serial Interface (HSSI) modules.', 'Initial version of this SNMP management information module.',))
if mibBuilder.loadTexts: juniErxRegistry.setLastUpdated('200607220543Z')
if mibBuilder.loadTexts: juniErxRegistry.setOrganization('Juniper Networks, Inc.')
if mibBuilder.loadTexts: juniErxRegistry.setContactInfo(' Juniper Networks, Inc. Postal: 10 Technology Park Drive Westford, MA 01886-3146 USA Tel: +1 978 589 5800 Email: mib@Juniper.net')
if mibBuilder.loadTexts: juniErxRegistry.setDescription('Juniper first generation E-series (ERX) edge router product family system-specific object identification values. This module defines AutonomousType (OID) values for all the physical entity types (entPhysicalVendorType). This module will be updated whenever a new type of module or other hardware becomes available in first generation E-series systems.')
juniErxEntPhysicalType = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1))
erxChassis = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 1))
if mibBuilder.loadTexts: erxChassis.setStatus('current')
if mibBuilder.loadTexts: erxChassis.setDescription("The vendor type ID for a generic first generation E-series (ERX) chassis. This identifies an 'overall' physical entity for any ERX system.")
erx700Chassis = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 1, 1))
if mibBuilder.loadTexts: erx700Chassis.setStatus('current')
if mibBuilder.loadTexts: erx700Chassis.setDescription("The vendor type ID for a first generation E-series (ERX) 7-slot chassis. This is the 'overall' physical entity for an ERX-700 or ERX-705 system (Product Code: BASE-7).")
erx1400Chassis = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 1, 2))
if mibBuilder.loadTexts: erx1400Chassis.setStatus('current')
if mibBuilder.loadTexts: erx1400Chassis.setDescription("The vendor type ID for a first generation E-series (ERX) 14-slot chassis. This is the 'overall' physical entity for an ERX-1400 system (Product Code: BASE-14).")
erx1440Chassis = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 1, 3))
if mibBuilder.loadTexts: erx1440Chassis.setStatus('current')
if mibBuilder.loadTexts: erx1440Chassis.setDescription("The vendor type ID for a first generation E-series (ERX) 14-slot chassis. This is the 'overall' physical entity for an ERX-1440 system (Product Code: BASE-1440).")
erx310ACChassis = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 1, 4))
if mibBuilder.loadTexts: erx310ACChassis.setStatus('current')
if mibBuilder.loadTexts: erx310ACChassis.setDescription("The vendor type ID for a first generation E-series (ERX) 3-slot chassis. This is the 'overall' physical entity for an ERX-310 system with AC power (Product Code: EX3-BS310AC-SYS).")
erx310DCChassis = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 1, 5))
if mibBuilder.loadTexts: erx310DCChassis.setStatus('current')
if mibBuilder.loadTexts: erx310DCChassis.setDescription("The vendor type ID for a first generation E-series (ERX) 3-slot chassis. This is the 'overall' physical entity for an ERX-310 system with redundant DC power (Product Code: EX3-BS310DC-SYS).")
erxFanAssembly = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 2))
if mibBuilder.loadTexts: erxFanAssembly.setStatus('current')
if mibBuilder.loadTexts: erxFanAssembly.setDescription('The vendor type ID for an ERX fan assembly.')
erx700FanAssembly = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 2, 1))
if mibBuilder.loadTexts: erx700FanAssembly.setStatus('current')
if mibBuilder.loadTexts: erx700FanAssembly.setDescription('The vendor type ID for an ERX 7-slot fan assembly with four fans and two -12 volt, 15 watt power converters (Product Code: FAN-7).')
erx1400FanAssembly = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 2, 2))
if mibBuilder.loadTexts: erx1400FanAssembly.setStatus('current')
if mibBuilder.loadTexts: erx1400FanAssembly.setDescription('The vendor type ID for an ERX 14-slot fan assembly with six fans and two -24 volt, 50 watt power converters (Product Code: FAN-14).')
erx300FanAssembly = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 2, 3))
if mibBuilder.loadTexts: erx300FanAssembly.setStatus('current')
if mibBuilder.loadTexts: erx300FanAssembly.setDescription('The vendor type ID for an ERX 3-slot fan assembly (Product Code: EX3-FANTRAY-FRU).')
erxPowerInput = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 3))
if mibBuilder.loadTexts: erxPowerInput.setStatus('current')
if mibBuilder.loadTexts: erxPowerInput.setDescription('The vendor type ID for an ERX power distribution unit.')
erxPdu = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 3, 1))
if mibBuilder.loadTexts: erxPdu.setStatus('current')
if mibBuilder.loadTexts: erxPdu.setDescription('The vendor type ID for an ERX-700, ERX-705 or ERX-1400 power distribution unit (Product Code: PDU).')
erx1440Pdu = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 3, 2))
if mibBuilder.loadTexts: erx1440Pdu.setStatus('current')
if mibBuilder.loadTexts: erx1440Pdu.setDescription('The vendor type ID for an ERX-1440 power distribution unit (Product Code: ERX-PDU-40-FRU).')
erx300ACPdu = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 3, 3))
if mibBuilder.loadTexts: erx300ACPdu.setStatus('current')
if mibBuilder.loadTexts: erx300ACPdu.setDescription('The vendor type ID for an ERX 3-slot AC power supply and power distribution unit (Product Code: EX3-ACPWR-FRU).')
erx300DCPdu = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 3, 4))
if mibBuilder.loadTexts: erx300DCPdu.setStatus('current')
if mibBuilder.loadTexts: erx300DCPdu.setDescription('The vendor type ID for an ERX 3-slot DC power distribution unit (Product Code: EX3-DCPSDIST-PNL).')
erxMidplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4))
if mibBuilder.loadTexts: erxMidplane.setStatus('current')
if mibBuilder.loadTexts: erxMidplane.setDescription('The vendor type ID for an ERX midplane.')
erx700Midplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 1))
if mibBuilder.loadTexts: erx700Midplane.setStatus('current')
if mibBuilder.loadTexts: erx700Midplane.setDescription('The vendor type ID for an ERX 7-slot midplane.')
erx1400Midplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 2))
if mibBuilder.loadTexts: erx1400Midplane.setStatus('current')
if mibBuilder.loadTexts: erx1400Midplane.setDescription('The vendor type ID for an ERX-1400 (10G 14-slot) midplane.')
erx1Plus1RedundantT1E1Midplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 3))
if mibBuilder.loadTexts: erx1Plus1RedundantT1E1Midplane.setStatus('deprecated')
if mibBuilder.loadTexts: erx1Plus1RedundantT1E1Midplane.setDescription('The vendor type ID for an ERX 1 + 1 redundant T1/E1 midplane (Product Code: REDMID-T1/E1/1/1). This product has reached End-of-life.')
erx2Plus1RedundantT1E1Midplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 4))
if mibBuilder.loadTexts: erx2Plus1RedundantT1E1Midplane.setStatus('current')
if mibBuilder.loadTexts: erx2Plus1RedundantT1E1Midplane.setDescription('The vendor type ID for an ERX 2 + 1 redundant T1/E1 midplane (Product Code: REDMID-T1/E1/2/1).')
erx3Plus1RedundantT1E1Midplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 5))
if mibBuilder.loadTexts: erx3Plus1RedundantT1E1Midplane.setStatus('current')
if mibBuilder.loadTexts: erx3Plus1RedundantT1E1Midplane.setDescription('The vendor type ID for an ERX 3 + 1 redundant T1/E1 midplane (Product Code: REDMID-T1/E1/3/1).')
erx4Plus1RedundantT1E1Midplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 6))
if mibBuilder.loadTexts: erx4Plus1RedundantT1E1Midplane.setStatus('current')
if mibBuilder.loadTexts: erx4Plus1RedundantT1E1Midplane.setDescription('The vendor type ID for an ERX 4 + 1 redundant T1/E1 midplane (Product Code: REDMID-T1/E1/4/1).')
erx5Plus1RedundantT1E1Midplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 7))
if mibBuilder.loadTexts: erx5Plus1RedundantT1E1Midplane.setStatus('current')
if mibBuilder.loadTexts: erx5Plus1RedundantT1E1Midplane.setDescription('The vendor type ID for an ERX 5 + 1 redundant T1/E1 midplane (Product Code: REDMID-T1/E1/5/1).')
erx1Plus1RedundantT3E3Midplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 8))
if mibBuilder.loadTexts: erx1Plus1RedundantT3E3Midplane.setStatus('deprecated')
if mibBuilder.loadTexts: erx1Plus1RedundantT3E3Midplane.setDescription('The vendor type ID for an ERX 1 + 1 redundant CT3/T3/E3 midplane (Product Code: REDMID-T3/E3/1/1). This product has reached End-of-life.')
erx2Plus1RedundantT3E3Midplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 9))
if mibBuilder.loadTexts: erx2Plus1RedundantT3E3Midplane.setStatus('current')
if mibBuilder.loadTexts: erx2Plus1RedundantT3E3Midplane.setDescription('The vendor type ID for an ERX 2 + 1 redundant CT3/T3/E3 midplane (Product Code: REDMID-T3/E3/2/1).')
erx3Plus1RedundantT3E3Midplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 10))
if mibBuilder.loadTexts: erx3Plus1RedundantT3E3Midplane.setStatus('current')
if mibBuilder.loadTexts: erx3Plus1RedundantT3E3Midplane.setDescription('The vendor type ID for an ERX 3 + 1 redundant CT3/T3/E3 midplane (Product Code: REDMID-T3/E3/3/1).')
erx4Plus1RedundantT3E3Midplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 11))
if mibBuilder.loadTexts: erx4Plus1RedundantT3E3Midplane.setStatus('current')
if mibBuilder.loadTexts: erx4Plus1RedundantT3E3Midplane.setDescription('The vendor type ID for an ERX 4 + 1 redundant CT3/T3/E3 midplane (Product Code: REDMID-T3/E3/4/1).')
erx5Plus1RedundantT3E3Midplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 12))
if mibBuilder.loadTexts: erx5Plus1RedundantT3E3Midplane.setStatus('current')
if mibBuilder.loadTexts: erx5Plus1RedundantT3E3Midplane.setDescription('The vendor type ID for an ERX 5 + 1 redundant CT3/T3/E3 midplane (Product Code: REDMID-T3/E3/5/1).')
erx1Plus1RedundantOcMidplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 13))
if mibBuilder.loadTexts: erx1Plus1RedundantOcMidplane.setStatus('deprecated')
if mibBuilder.loadTexts: erx1Plus1RedundantOcMidplane.setDescription('The vendor type ID for an ERX 1 + 1 redundant OC3/OC12 midplane (Product Code: REDMID-OC/1/1). This product has reached End-of-life.')
erx2Plus1RedundantOcMidplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 14))
if mibBuilder.loadTexts: erx2Plus1RedundantOcMidplane.setStatus('current')
if mibBuilder.loadTexts: erx2Plus1RedundantOcMidplane.setDescription('The vendor type ID for an ERX 2 + 1 redundant OC3/OC12 midplane (Product Code: REDMID-OC/2/1).')
erx3Plus1RedundantOcMidplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 15))
if mibBuilder.loadTexts: erx3Plus1RedundantOcMidplane.setStatus('deprecated')
if mibBuilder.loadTexts: erx3Plus1RedundantOcMidplane.setDescription('The vendor type ID for an ERX 3 + 1 redundant OC3/OC12 midplane (Product Code: REDMID-OC/3/1). This product has reached End-of-life.')
erx4Plus1RedundantOcMidplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 16))
if mibBuilder.loadTexts: erx4Plus1RedundantOcMidplane.setStatus('deprecated')
if mibBuilder.loadTexts: erx4Plus1RedundantOcMidplane.setDescription('The vendor type ID for an ERX 4 + 1 redundant OC3/OC12 midplane (Product Code: REDMID-OC/4/1). This product has reached End-of-life.')
erx5Plus1RedundantOcMidplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 17))
if mibBuilder.loadTexts: erx5Plus1RedundantOcMidplane.setStatus('current')
if mibBuilder.loadTexts: erx5Plus1RedundantOcMidplane.setDescription('The vendor type ID for an ERX 5 + 1 redundant OC3/OC12 midplane (Product Code: REDMID-OC/5/1).')
erx2Plus1Redundant12T3E3Midplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 18))
if mibBuilder.loadTexts: erx2Plus1Redundant12T3E3Midplane.setStatus('current')
if mibBuilder.loadTexts: erx2Plus1Redundant12T3E3Midplane.setDescription('The vendor type ID for an ERX 2 + 1 redundant 12 port T3/E3 midplane (Product Code: ERX-12T3-2-1-RMD).')
erx5Plus1Redundant12T3E3Midplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 19))
if mibBuilder.loadTexts: erx5Plus1Redundant12T3E3Midplane.setStatus('current')
if mibBuilder.loadTexts: erx5Plus1Redundant12T3E3Midplane.setDescription('The vendor type ID for an ERX 5 + 1 redundant 12 port T3/E3 midplane (Product Code: ERX-12T3-5-1-RMD).')
erx1440Midplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 20))
if mibBuilder.loadTexts: erx1440Midplane.setStatus('current')
if mibBuilder.loadTexts: erx1440Midplane.setDescription('The vendor type ID for an ERX-1440 (40G 14-slot) midplane.')
erx300Midplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 21))
if mibBuilder.loadTexts: erx300Midplane.setStatus('current')
if mibBuilder.loadTexts: erx300Midplane.setDescription('The vendor type ID for an ERX 3-slot midplane.')
erx2Plus1RedundantCOcMidplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 22))
if mibBuilder.loadTexts: erx2Plus1RedundantCOcMidplane.setStatus('current')
if mibBuilder.loadTexts: erx2Plus1RedundantCOcMidplane.setDescription('The vendor type ID for an ERX 2 + 1 redundant channelized OC3/OC12 midplane (Product Code: ERX-COCX-2-1-RMD).')
erx5Plus1RedundantCOcMidplane = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 4, 23))
if mibBuilder.loadTexts: erx5Plus1RedundantCOcMidplane.setStatus('current')
if mibBuilder.loadTexts: erx5Plus1RedundantCOcMidplane.setDescription('The vendor type ID for an ERX 5 + 1 redundant channelized OC3/OC12 midplane (Product Code: ERX-COCX-5-1-RMD).')
erxSrpModule = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 5))
if mibBuilder.loadTexts: erxSrpModule.setStatus('current')
if mibBuilder.loadTexts: erxSrpModule.setDescription('The vendor type ID for an ERX Switch and Router Processor (SRP) module.')
erxSrp5 = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 5, 1))
if mibBuilder.loadTexts: erxSrp5.setStatus('obsolete')
if mibBuilder.loadTexts: erxSrp5.setDescription('The vendor type ID for an ERX Switch and Router Processor (SRP) module with 5 Gbps switch fabric (Product Code: SRP-5). This product has reached End-of-life.')
erxSrp10 = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 5, 2))
if mibBuilder.loadTexts: erxSrp10.setStatus('deprecated')
if mibBuilder.loadTexts: erxSrp10.setDescription('The vendor type ID for an ERX Switch and Router Processor (SRP) module with 10 Gbps switch fabric (Product Code: SRP-10). This product has reached End-of-life.')
erxSrp10Ecc = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 5, 3))
if mibBuilder.loadTexts: erxSrp10Ecc.setStatus('current')
if mibBuilder.loadTexts: erxSrp10Ecc.setDescription('The vendor type ID for an ERX Switch and Router Processor (SRP) module with 10 Gbps switch fabric with ECC (Product Code: SRP-10-ECC).')
erxSrp40 = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 5, 4))
if mibBuilder.loadTexts: erxSrp40.setStatus('obsolete')
if mibBuilder.loadTexts: erxSrp40.setDescription('The vendor type ID for an ERX Switch and Router Processor (SRP) module with 40 Gbps switch fabric with ECC (Product Code: SRP-40-ECC). This product has reached End-of-life.')
erxSrp5Plus = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 5, 5))
if mibBuilder.loadTexts: erxSrp5Plus.setStatus('obsolete')
if mibBuilder.loadTexts: erxSrp5Plus.setDescription("The vendor type ID for an ERX Switch and Router Processor (SRP) module with 5 Gbps 'plus' switch fabric (Product Code: ERX-5ECC-SRP).")
erxSrp40Plus = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 5, 6))
if mibBuilder.loadTexts: erxSrp40Plus.setStatus('obsolete')
if mibBuilder.loadTexts: erxSrp40Plus.setDescription("The vendor type ID for an ERX Switch and Router Processor (SRP) module with 40 Gbps 'plus' switch fabric (Product Code: ERX-40EC2-SRP).")
erxSrp310 = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 5, 7))
if mibBuilder.loadTexts: erxSrp310.setStatus('deprecated')
if mibBuilder.loadTexts: erxSrp310.setDescription('The vendor type ID for an ERX Switch and Router Processor (SRP) module for the ERX-310 (Product Code: EX3-SRP-MOD).')
erxSrp40g2gEc2 = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 5, 8))
if mibBuilder.loadTexts: erxSrp40g2gEc2.setStatus('current')
if mibBuilder.loadTexts: erxSrp40g2gEc2.setDescription("The vendor type ID for an ERX Switch and Router Processor (SRP) module with 40 Gbps 'plus' switch fabric and 2GB memory (Product Code: ERX-40G2GEC2-SRP).")
erxSrp10g1gEcc = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 5, 9))
if mibBuilder.loadTexts: erxSrp10g1gEcc.setStatus('current')
if mibBuilder.loadTexts: erxSrp10g1gEcc.setDescription('The vendor type ID for an ERX Switch and Router Processor (SRP) module with 10 Gbps switch fabric and 1GB memory (Product Code: ERX-10G1GECC-SRP).')
erxSrp10g2gEcc = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 5, 10))
if mibBuilder.loadTexts: erxSrp10g2gEcc.setStatus('current')
if mibBuilder.loadTexts: erxSrp10g2gEcc.setDescription('The vendor type ID for an ERX Switch and Router Processor (SRP) module with 10 Gbps switch fabric and 2GB memory (Product Code: ERX-10G2GECC-SRP).')
erxSrp5g1gEcc = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 5, 11))
if mibBuilder.loadTexts: erxSrp5g1gEcc.setStatus('deprecated')
if mibBuilder.loadTexts: erxSrp5g1gEcc.setDescription("The vendor type ID for an ERX Switch and Router Processor (SRP) module with 5 Gbps 'plus' switch fabric and 1GB memory (Product Code: ERX-5G1GECC-SRP).")
erxSrp5g2gEcc = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 5, 12))
if mibBuilder.loadTexts: erxSrp5g2gEcc.setStatus('deprecated')
if mibBuilder.loadTexts: erxSrp5g2gEcc.setDescription("The vendor type ID for an ERX Switch and Router Processor (SRP) module with 5 Gbps 'plus' switch fabric and 2GB memory (Product Code: ERX-5G2GECC-SRP).")
erxSrpIoAdapter = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 6))
if mibBuilder.loadTexts: erxSrpIoAdapter.setStatus('current')
if mibBuilder.loadTexts: erxSrpIoAdapter.setDescription('The vendor type ID for an ERX SRP I/O adapter.')
erxSrpIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 6, 1))
if mibBuilder.loadTexts: erxSrpIoa.setStatus('current')
if mibBuilder.loadTexts: erxSrpIoa.setDescription('The vendor type ID for an ERX-700/705/1400/1440 SRP I/O adapter (Product Code: SRP_I/O).')
erxSrp310Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 6, 2))
if mibBuilder.loadTexts: erxSrp310Ioa.setStatus('current')
if mibBuilder.loadTexts: erxSrp310Ioa.setDescription('The vendor type ID for an ERX-310 SRP I/O adapter (Product Code: EX3-SRP-IOA).')
erxLineModule = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7))
if mibBuilder.loadTexts: erxLineModule.setStatus('current')
if mibBuilder.loadTexts: erxLineModule.setDescription('The vendor type ID for an ERX line module.')
erxCt1 = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 1))
if mibBuilder.loadTexts: erxCt1.setStatus('obsolete')
if mibBuilder.loadTexts: erxCt1.setDescription('The vendor type ID for an ERX 24 port T1 fully channelized line module (Product Code: CT1-FULL).')
erxCe1 = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 2))
if mibBuilder.loadTexts: erxCe1.setStatus('obsolete')
if mibBuilder.loadTexts: erxCe1.setDescription('The vendor type ID for an ERX 20 port E1 fully channelized line module (Product Code: CE1-FULL).')
erxCt3 = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 4))
if mibBuilder.loadTexts: erxCt3.setStatus('obsolete')
if mibBuilder.loadTexts: erxCt3.setDescription('The vendor type ID for an ERX 3 port T3 channelized line module (Product Code: CT3-3). This product has reached End-of-life.')
erxT3Atm = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 5))
if mibBuilder.loadTexts: erxT3Atm.setStatus('obsolete')
if mibBuilder.loadTexts: erxT3Atm.setDescription('The vendor type ID for an ERX 3 port T3 unchannelized cell service line module (Product Code: T3-3A). This product has reached End-of-life.')
erxT3Frame = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 6))
if mibBuilder.loadTexts: erxT3Frame.setStatus('obsolete')
if mibBuilder.loadTexts: erxT3Frame.setDescription('The vendor type ID for an ERX 3 port T3 unchannelized packet service line module (Product Code: T3-3F). This product has reached End-of-life.')
erxE3Atm = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 7))
if mibBuilder.loadTexts: erxE3Atm.setStatus('obsolete')
if mibBuilder.loadTexts: erxE3Atm.setDescription('The vendor type ID for an ERX 3 port E3 unchannelized cell service line module (Product Code: E3-3A).')
erxE3Frame = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 8))
if mibBuilder.loadTexts: erxE3Frame.setStatus('obsolete')
if mibBuilder.loadTexts: erxE3Frame.setDescription('The vendor type ID for an ERX 3 port E3 unchannelized packet service line module (Product Code: E3-3F). This product has reached End-of-life.')
erxOc3 = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 9))
if mibBuilder.loadTexts: erxOc3.setStatus('deprecated')
if mibBuilder.loadTexts: erxOc3.setDescription('The vendor type ID for an ERX dual port Optical Carrier 3 (OC-3/STM-1) SONET/SDH line module (Product Code: OC3-2). This product has reached End-of-life.')
erxOc3Oc12Atm = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 10))
if mibBuilder.loadTexts: erxOc3Oc12Atm.setStatus('current')
if mibBuilder.loadTexts: erxOc3Oc12Atm.setDescription('The vendor type ID for an ERX OC3/OC12 multi-personality cell service line module (Product Code: OC3/OC12-ATM).')
erxOc3Oc12Pos = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 11))
if mibBuilder.loadTexts: erxOc3Oc12Pos.setStatus('current')
if mibBuilder.loadTexts: erxOc3Oc12Pos.setDescription('The vendor type ID for an ERX OC3/OC12 multi-personality packet service line module (Product Code: OC3/OC12-POS).')
erxCOcx = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 12))
if mibBuilder.loadTexts: erxCOcx.setStatus('current')
if mibBuilder.loadTexts: erxCOcx.setDescription('The vendor type ID for an ERX OC3/STM1 and OC12/STM4 channelized line module (Product Code: COCX/STMX-F0).')
erxFe2 = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 13))
if mibBuilder.loadTexts: erxFe2.setStatus('obsolete')
if mibBuilder.loadTexts: erxFe2.setDescription('The vendor type ID for an ERX dual port fast (10/100) Ethernet line module (Product Code: 10/100_FE-2). This product has reached End-of-life.')
erxGeFe = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 14))
if mibBuilder.loadTexts: erxGeFe.setStatus('current')
if mibBuilder.loadTexts: erxGeFe.setDescription('The vendor type ID for an ERX multi-personality gigabit or fast (10/100) Ethernet line module (Product Code: GE/FE-8).')
erxTunnelService = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 15))
if mibBuilder.loadTexts: erxTunnelService.setStatus('current')
if mibBuilder.loadTexts: erxTunnelService.setDescription('The vendor type ID for an ERX L2TP LNS and GRE Tunnel Service line module (Product Code: TUNNEL-SERVICE).')
erxHssi = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 16))
if mibBuilder.loadTexts: erxHssi.setStatus('obsolete')
if mibBuilder.loadTexts: erxHssi.setDescription('The vendor type ID for an ERX 3 port High Speed Serial Interface (HSSI) line module (Product Code: HSSI-3F).')
erxVts = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 17))
if mibBuilder.loadTexts: erxVts.setStatus('current')
if mibBuilder.loadTexts: erxVts.setDescription('The vendor type ID for an ERX Virtual Tunnelling Server (VTS) line module (Product Code: ERX-IPSEC-MOD).')
erxCt3P12 = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 18))
if mibBuilder.loadTexts: erxCt3P12.setStatus('current')
if mibBuilder.loadTexts: erxCt3P12.setDescription('The vendor type ID for an ERX 12 port T3 channelized line module (Product Code: CT3-12-F0).')
erxV35 = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 19))
if mibBuilder.loadTexts: erxV35.setStatus('obsolete')
if mibBuilder.loadTexts: erxV35.setDescription('The vendor type ID for an ERX X.21/V.35 server line module (Product Code: ERX-X21-V35-MOD).')
erxUt3E3Ocx = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 20))
if mibBuilder.loadTexts: erxUt3E3Ocx.setStatus('current')
if mibBuilder.loadTexts: erxUt3E3Ocx.setDescription('The vendor type ID for an ERX OC12, quad OC3 or 12 port T3/E3 server line module (Product Code: ERX-UT3E3OCX-MOD).')
erxOc48 = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 21))
if mibBuilder.loadTexts: erxOc48.setStatus('current')
if mibBuilder.loadTexts: erxOc48.setDescription('The vendor type ID for an ERX single port OC-48/STM-16 SONET/SDH line module (Product Code: ERX-OC48ST16-MOD).')
erxOc3Oc12Atm256M = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 22))
if mibBuilder.loadTexts: erxOc3Oc12Atm256M.setStatus('current')
if mibBuilder.loadTexts: erxOc3Oc12Atm256M.setDescription('The vendor type ID for an ERX OC3/OC12 multi-personality cell service line module with 256mb of memory (Product Code: ERX-OCXA256M-MOD).')
erxGeFe256M = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 23))
if mibBuilder.loadTexts: erxGeFe256M.setStatus('current')
if mibBuilder.loadTexts: erxGeFe256M.setDescription('The vendor type ID for an ERX multi-personality gigabit or fast (10/100) Ethernet line module with 256mb of memory (Product Code: ERX-GEFE256M-MOD).')
erxService = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 24))
if mibBuilder.loadTexts: erxService.setStatus('current')
if mibBuilder.loadTexts: erxService.setDescription('The vendor type ID for an ERX L2TP LNS and GRE Tunnel Service line module with 256mb of memory and NAT and firewall capabilities (Product Code: ERX-SERVICE-MOD).')
erxOc3Hybrid = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 25))
if mibBuilder.loadTexts: erxOc3Hybrid.setStatus('current')
if mibBuilder.loadTexts: erxOc3Hybrid.setDescription('The vendor type ID for an ERX OC3 multi-personality cell service line module (Product Code: [450-00050-00]).')
erxGe2 = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 7, 26))
if mibBuilder.loadTexts: erxGe2.setStatus('current')
if mibBuilder.loadTexts: erxGe2.setDescription('The vendor type ID for an ERX 2 port GE line module (Product Code: [450-00044-00]).')
erxLineIoAdapter = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8))
if mibBuilder.loadTexts: erxLineIoAdapter.setStatus('current')
if mibBuilder.loadTexts: erxLineIoAdapter.setDescription('The vendor type ID for an ERX I/O adapter for a line module.')
erxCt1Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 1))
if mibBuilder.loadTexts: erxCt1Ioa.setStatus('obsolete')
if mibBuilder.loadTexts: erxCt1Ioa.setDescription('The vendor type ID for an ERX 24 port T1/J1 channelized I/O adapter (Product Code: CT1-FULL-I/O).')
erxCe1Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 2))
if mibBuilder.loadTexts: erxCe1Ioa.setStatus('obsolete')
if mibBuilder.loadTexts: erxCe1Ioa.setDescription('The vendor type ID for an ERX 20 port E1 channelized RJ48 I/O adapter (Product Code: CE1-FULL-I/O).')
erxCe1TIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 3))
if mibBuilder.loadTexts: erxCe1TIoa.setStatus('obsolete')
if mibBuilder.loadTexts: erxCe1TIoa.setDescription('The vendor type ID for an ERX 20 port E1 channelized Telco I/O adapter (Product Code: CE1-FULL-I/OT).')
erxCt3Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 4))
if mibBuilder.loadTexts: erxCt3Ioa.setStatus('obsolete')
if mibBuilder.loadTexts: erxCt3Ioa.setDescription('The vendor type ID for an ERX 3 port T3/E3 channelized I/O adapter (Product Code: CT3/T3-3_I/O). This product has reached End-of-life.')
erxE3Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 5))
if mibBuilder.loadTexts: erxE3Ioa.setStatus('current')
if mibBuilder.loadTexts: erxE3Ioa.setDescription('The vendor type ID for an ERX 3 port E3 I/O adapter (Product Code: E3-3_I/O).')
erxOc3Mm2Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 6))
if mibBuilder.loadTexts: erxOc3Mm2Ioa.setStatus('deprecated')
if mibBuilder.loadTexts: erxOc3Mm2Ioa.setDescription('The vendor type ID for an ERX dual port OC3/STM1 multi-mode I/O adapter (Product Code: OC3-2M_I/O). This product has reached End-of-life.')
erxOc3Sm2Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 7))
if mibBuilder.loadTexts: erxOc3Sm2Ioa.setStatus('deprecated')
if mibBuilder.loadTexts: erxOc3Sm2Ioa.setDescription('The vendor type ID for an ERX dual port OC3/STM1 single-mode I/O adapter (Product Code: OC3-2S_I/O). This product has reached End-of-life.')
erxOc3Mm4Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 8))
if mibBuilder.loadTexts: erxOc3Mm4Ioa.setStatus('current')
if mibBuilder.loadTexts: erxOc3Mm4Ioa.setDescription('The vendor type ID for an ERX 4 port OC3/STM1 multi-mode I/O adapter (Product Code: OC3-4MM_I/O).')
erxOc3SmIr4Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 9))
if mibBuilder.loadTexts: erxOc3SmIr4Ioa.setStatus('current')
if mibBuilder.loadTexts: erxOc3SmIr4Ioa.setDescription('The vendor type ID for an ERX 4 port OC3/STM single-mode intermediate- reach I/O adapter (Product Code: OC3-4SM_I/O).')
erxOc3SmLr4Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 10))
if mibBuilder.loadTexts: erxOc3SmLr4Ioa.setStatus('current')
if mibBuilder.loadTexts: erxOc3SmLr4Ioa.setDescription('The vendor type ID for an ERX 4 port OC3/STM1 single-mode long-reach I/O adapter (Product Code: OC3-4LH-I/O).')
erxCOc3Mm4Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 11))
if mibBuilder.loadTexts: erxCOc3Mm4Ioa.setStatus('current')
if mibBuilder.loadTexts: erxCOc3Mm4Ioa.setDescription('The vendor type ID for an ERX 4 port OC3/STM channelized multi-mode I/O adapter (Product Code: COC3F0-MM-I/O).')
erxCOc3SmIr4Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 12))
if mibBuilder.loadTexts: erxCOc3SmIr4Ioa.setStatus('current')
if mibBuilder.loadTexts: erxCOc3SmIr4Ioa.setDescription('The vendor type ID for an ERX 4 port OC3/STM1 channelized single-mode intermediate-reach I/O adapter (Product Code: COC3F0-SM-I/O).')
erxCOc3SmLr4Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 13))
if mibBuilder.loadTexts: erxCOc3SmLr4Ioa.setStatus('current')
if mibBuilder.loadTexts: erxCOc3SmLr4Ioa.setDescription('The vendor type ID for an ERX 4 port OC3/STM1 channelized single-mode long-reach I/O adapter (Product Code: ERX-COC3-4LH-IOA).')
erxOc12Mm1Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 14))
if mibBuilder.loadTexts: erxOc12Mm1Ioa.setStatus('current')
if mibBuilder.loadTexts: erxOc12Mm1Ioa.setDescription('The vendor type ID for an ERX single port OC12/STM4 multi-mode I/O adapter (Product Code: OC12-MM_I/O).')
erxOc12SmIr1Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 15))
if mibBuilder.loadTexts: erxOc12SmIr1Ioa.setStatus('current')
if mibBuilder.loadTexts: erxOc12SmIr1Ioa.setDescription('The vendor type ID for an ERX single port OC12/STM4 single-mode intermediate-reach I/O adapter (Product Code: OC12-SM_I/O).')
erxOc12SmLr1Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 16))
if mibBuilder.loadTexts: erxOc12SmLr1Ioa.setStatus('current')
if mibBuilder.loadTexts: erxOc12SmLr1Ioa.setDescription('The vendor type ID for an ERX single port OC12/STM4 single-mode long-reach I/O adapter (Product Code: OC12-LH-I/O).')
erxCOc12Mm1Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 17))
if mibBuilder.loadTexts: erxCOc12Mm1Ioa.setStatus('current')
if mibBuilder.loadTexts: erxCOc12Mm1Ioa.setDescription('The vendor type ID for an ERX single port OC12/STM4 channelized (OC3/STM1 or OC1/STM0) multi-mode I/O adapter (Product Code: COC12F0-MM-I/O).')
erxCOc12SmIr1Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 18))
if mibBuilder.loadTexts: erxCOc12SmIr1Ioa.setStatus('current')
if mibBuilder.loadTexts: erxCOc12SmIr1Ioa.setDescription('The vendor type ID for an ERX single port OC12/STM4 channelized (OC3/STM1 or OC1/STM0) single-mode intermediate-reach I/O adapter (Product Code: COC12F0-SM-I/O).')
erxCOc12SmLr1Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 19))
if mibBuilder.loadTexts: erxCOc12SmLr1Ioa.setStatus('current')
if mibBuilder.loadTexts: erxCOc12SmLr1Ioa.setDescription('The vendor type ID for an ERX single port OC12/STM4 channelized (OC3/STM1 or OC1/STM0) single-mode long-reach I/O adapter (Product Code: ERX-COC12-LH-IOA).')
erxFe2Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 20))
if mibBuilder.loadTexts: erxFe2Ioa.setStatus('obsolete')
if mibBuilder.loadTexts: erxFe2Ioa.setDescription('The vendor type ID for an ERX dual port 10/100 Fast Ethernet I/O adapter (Product Code: 10/100_FE-2_I/O). This product has reached End-of-life.')
erxFe8Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 21))
if mibBuilder.loadTexts: erxFe8Ioa.setStatus('current')
if mibBuilder.loadTexts: erxFe8Ioa.setDescription('The vendor type ID for an ERX 8 port 10/100 Fast Ethernet I/O adapter (Product Code: FE-8_I/O).')
erxGeMm1Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 22))
if mibBuilder.loadTexts: erxGeMm1Ioa.setStatus('deprecated')
if mibBuilder.loadTexts: erxGeMm1Ioa.setDescription('The vendor type ID for an ERX single port Gigabit Ethernet multi-mode I/O adapter (Product Code: GE_M_I/O). This product has reached End-of-life.')
erxGeSm1Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 23))
if mibBuilder.loadTexts: erxGeSm1Ioa.setStatus('deprecated')
if mibBuilder.loadTexts: erxGeSm1Ioa.setDescription('The vendor type ID for an ERX single port Gigabit Ethernet single-mode I/O adapter (Product Code: GE_S_I/O). This product has reached End-of-life.')
erxHssiIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 24))
if mibBuilder.loadTexts: erxHssiIoa.setStatus('obsolete')
if mibBuilder.loadTexts: erxHssiIoa.setDescription('The vendor type ID for an ERX 3 port High Speed Serial Interface (HSSI) I/O adapter (Product Code: HSSI-3-I/O).')
erxCt3P12Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 25))
if mibBuilder.loadTexts: erxCt3P12Ioa.setStatus('current')
if mibBuilder.loadTexts: erxCt3P12Ioa.setDescription('The vendor type ID for an ERX 12 port T3 channelized and unchannelized I/O adapter (Product Code: T312-F0-F3-I/O).')
erxV35Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 26))
if mibBuilder.loadTexts: erxV35Ioa.setStatus('obsolete')
if mibBuilder.loadTexts: erxV35Ioa.setDescription('The vendor type ID for an ERX X.21/V.35 I/O adapter (Product Code: ERX-X21-V35-IOA).')
erxGeSfpIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 27))
if mibBuilder.loadTexts: erxGeSfpIoa.setStatus('current')
if mibBuilder.loadTexts: erxGeSfpIoa.setDescription('The vendor type ID for an ERX single port Gigabit Ethernet SFP I/O adapter (Product Code: ERX-GIGESFP-IOA).')
erxUe3P12Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 28))
if mibBuilder.loadTexts: erxUe3P12Ioa.setStatus('current')
if mibBuilder.loadTexts: erxUe3P12Ioa.setDescription('The vendor type ID for an ERX 12 port unchannelized E3 I/O adapter (Product Code: E3-12-F3-I/O).')
erxT3Atm4Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 29))
if mibBuilder.loadTexts: erxT3Atm4Ioa.setStatus('current')
if mibBuilder.loadTexts: erxT3Atm4Ioa.setDescription('The vendor type ID for an ERX 4 port T3 I/O adapter (Product Code: ERX-4T3ATM-IOA).')
erxCOc12Mm1ApsIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 30))
if mibBuilder.loadTexts: erxCOc12Mm1ApsIoa.setStatus('current')
if mibBuilder.loadTexts: erxCOc12Mm1ApsIoa.setDescription('The vendor type ID for an ERX single port OC12/STM4 channelized multi-mode with 1+1 Automatic Protection Switching (APS) I/O adapter (Product Code: ERX-COC12-MA-IOA).')
erxCOc12SmIr1ApsIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 31))
if mibBuilder.loadTexts: erxCOc12SmIr1ApsIoa.setStatus('current')
if mibBuilder.loadTexts: erxCOc12SmIr1ApsIoa.setDescription('The vendor type ID for an ERX single port OC12/STM4 channelized single-mode intermediate-reach with 1+1 Automatic Protection Switching (APS) I/O adapter (Product Code: ERX-COC12-SA-IOA).')
erxCOc12SmLr1ApsIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 32))
if mibBuilder.loadTexts: erxCOc12SmLr1ApsIoa.setStatus('current')
if mibBuilder.loadTexts: erxCOc12SmLr1ApsIoa.setDescription('The vendor type ID for an ERX single port OC12/STM4 channelized single-mode long-reach with 1+1 Automatic Protection Switching (APS) I/O adapter (Product Code: ERX-COC12-LA-IOA).')
erxOc12Mm1ApsIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 33))
if mibBuilder.loadTexts: erxOc12Mm1ApsIoa.setStatus('current')
if mibBuilder.loadTexts: erxOc12Mm1ApsIoa.setDescription('The vendor type ID for an ERX single port OC12/STM4 multi-mode with 1+1 Automatic Protection Switching (APS) I/O adapter (Product Code: ERX-OC12MM-A-IOA).')
erxOc12SmIr1ApsIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 34))
if mibBuilder.loadTexts: erxOc12SmIr1ApsIoa.setStatus('current')
if mibBuilder.loadTexts: erxOc12SmIr1ApsIoa.setDescription('The vendor type ID for an ERX single port OC12/STM4 single-mode intermediate-reach with 1+1 Automatic Protection Switching (APS) I/O adapter (Product Code: ERX-OC12SM-A-IOA).')
erxOc12SmLr1ApsIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 35))
if mibBuilder.loadTexts: erxOc12SmLr1ApsIoa.setStatus('current')
if mibBuilder.loadTexts: erxOc12SmLr1ApsIoa.setDescription('The vendor type ID for an ERX single port OC12/STM4 single-mode long-reach with 1+1 Automatic Protection Switching (APS) I/O adapter (Product Code: ERX-OC12LH-A-IOA).')
erxCOc12AtmPosMm1Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 36))
if mibBuilder.loadTexts: erxCOc12AtmPosMm1Ioa.setStatus('current')
if mibBuilder.loadTexts: erxCOc12AtmPosMm1Ioa.setDescription('The vendor type ID for an ERX single port OC12/STM4 channelized multi-mode ATM/POS I/O adapter (Product Code: ERX-1COC12MM-IOA).')
erxCOc12AtmPosSmIr1Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 37))
if mibBuilder.loadTexts: erxCOc12AtmPosSmIr1Ioa.setStatus('current')
if mibBuilder.loadTexts: erxCOc12AtmPosSmIr1Ioa.setDescription('The vendor type ID for an ERX single port OC12/STM4 channelized single-mode intermediate-reach ATM/POS I/O adapter (Product Code: ERX-1COC12SM-IOA).')
erxCOc12AtmPosSmLr1Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 38))
if mibBuilder.loadTexts: erxCOc12AtmPosSmLr1Ioa.setStatus('current')
if mibBuilder.loadTexts: erxCOc12AtmPosSmLr1Ioa.setDescription('The vendor type ID for an ERX single port OC12/STM4 channelized single-mode long-reach ATM/POS I/O adapter (Product Code: ERX-1COC12LH-IOA).')
erxCOc12AtmPosMm1ApsIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 39))
if mibBuilder.loadTexts: erxCOc12AtmPosMm1ApsIoa.setStatus('current')
if mibBuilder.loadTexts: erxCOc12AtmPosMm1ApsIoa.setDescription('The vendor type ID for an ERX single port OC12/STM4 channelized ATM/POS multi-mode with 1+1 Automatic Protection Switching (APS) I/O adapter (Product Code: ERX-2COC12MM-IOA).')
erxCOc12AtmPosSmIr1ApsIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 40))
if mibBuilder.loadTexts: erxCOc12AtmPosSmIr1ApsIoa.setStatus('current')
if mibBuilder.loadTexts: erxCOc12AtmPosSmIr1ApsIoa.setDescription('The vendor type ID for an ERX single port OC12/STM4 channelized ATM/POS single-mode intermediate-reach with 1+1 Automatic Protection Switching (APS) I/O adapter (Product Code: ERX-2COC12SM-IOA).')
erxCOc12AtmPosSmLr1ApsIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 41))
if mibBuilder.loadTexts: erxCOc12AtmPosSmLr1ApsIoa.setStatus('current')
if mibBuilder.loadTexts: erxCOc12AtmPosSmLr1ApsIoa.setDescription('The vendor type ID for an ERX single port OC12/STM4 channelized ATM/POS single-mode long-reach with 1+1 Automatic Protection Switching (APS) I/O adapter (Product Code: ERX-2COC12LH-IOA).')
erxT1E1RedundantIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 42))
if mibBuilder.loadTexts: erxT1E1RedundantIoa.setStatus('current')
if mibBuilder.loadTexts: erxT1E1RedundantIoa.setDescription('The vendor type ID for an ERX T1/E1 redundant midplane spare I/O adapter (Product Code: PNL-RDMD-T1/E1).')
erxT3E3RedundantIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 43))
if mibBuilder.loadTexts: erxT3E3RedundantIoa.setStatus('current')
if mibBuilder.loadTexts: erxT3E3RedundantIoa.setDescription('The vendor type ID for an ERX T3/E3 redundant midplane spare I/O adapter (Product Code: PNL-RDMD-T3/E3).')
erxCt3RedundantIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 44))
if mibBuilder.loadTexts: erxCt3RedundantIoa.setStatus('current')
if mibBuilder.loadTexts: erxCt3RedundantIoa.setDescription('The vendor type ID for an ERX channelized T3 redundant midplane spare I/O adapter (Product Code: ERX-12PT3E3-PNL).')
erxOcxRedundantIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 45))
if mibBuilder.loadTexts: erxOcxRedundantIoa.setStatus('current')
if mibBuilder.loadTexts: erxOcxRedundantIoa.setDescription('The vendor type ID for an ERX OC3/OC12 redundant midplane spare I/O adapter (Product Code: PNL-RDMD-OCX).')
erxCOcxRedundantIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 46))
if mibBuilder.loadTexts: erxCOcxRedundantIoa.setStatus('current')
if mibBuilder.loadTexts: erxCOcxRedundantIoa.setDescription('The vendor type ID for an ERX channelized OC3/OC12 redundant midplane spare I/O adapter (Product Code: ERX-COCXPNL-IOA).')
erxOc3Mm4ApsIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 47))
if mibBuilder.loadTexts: erxOc3Mm4ApsIoa.setStatus('current')
if mibBuilder.loadTexts: erxOc3Mm4ApsIoa.setDescription('The vendor type ID for an ERX 4 port OC3/STM4 multi-mode with 1+1 Automatic Protection Switching (APS) I/O adapter (Product Code: ERX-OC3M-APS-IOA).')
erxOc3SmIr4ApsIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 48))
if mibBuilder.loadTexts: erxOc3SmIr4ApsIoa.setStatus('current')
if mibBuilder.loadTexts: erxOc3SmIr4ApsIoa.setDescription('The vendor type ID for an ERX 4 port OC3/STM4 single-mode intermediate-reach with 1+1 Automatic Protection Switching (APS) I/O adapter (Product Code: ERX-OC3S-APS-IOA).')
erxOc3SmLr4ApsIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 49))
if mibBuilder.loadTexts: erxOc3SmLr4ApsIoa.setStatus('current')
if mibBuilder.loadTexts: erxOc3SmLr4ApsIoa.setDescription('The vendor type ID for an ERX 4 port OC3/STM4 single-mode long-reach with 1+1 Automatic Protection Switching (APS) I/O adapter (Product Code: ERX-OC3L-APS-IOA).')
erxOc48Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 50))
if mibBuilder.loadTexts: erxOc48Ioa.setStatus('current')
if mibBuilder.loadTexts: erxOc48Ioa.setDescription('The vendor type ID for an ERX single port OC48/STM16 I/O adapter (Product Code: ERX-OC48ST16-IOA).')
erxOc3Atm2Ge1Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 51))
if mibBuilder.loadTexts: erxOc3Atm2Ge1Ioa.setStatus('current')
if mibBuilder.loadTexts: erxOc3Atm2Ge1Ioa.setDescription('The vendor type ID for an ERX dual port OC3 ATM plus single port Gigabit Ethernet I/O adapter (Product Code: [450-00057-00]).')
erxOc3Atm2Pos2Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 52))
if mibBuilder.loadTexts: erxOc3Atm2Pos2Ioa.setStatus('current')
if mibBuilder.loadTexts: erxOc3Atm2Pos2Ioa.setDescription('The vendor type ID for an ERX dual port OC3 ATM plus dual port OC3 POS I/O adapter (Product Code: [450-00054-00]).')
erxGe2Ioa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 53))
if mibBuilder.loadTexts: erxGe2Ioa.setStatus('current')
if mibBuilder.loadTexts: erxGe2Ioa.setDescription('The vendor type ID for an ERX dual port Gigabit Ethernet SFP I/O adapter (Product Code: [450-00073-00]).')
erxFe8FxIoa = ObjectIdentity((1, 3, 6, 1, 4, 1, 4874, 4, 2, 2, 1, 8, 54))
if mibBuilder.loadTexts: erxFe8FxIoa.setStatus('current')
if mibBuilder.loadTexts: erxFe8FxIoa.setDescription('The vendor type ID for an ERX 8 port 100 Fast Ethernet SFP optical I/O adapter (Product Code: 450-00081-00).')
mibBuilder.exportSymbols("Juniper-ERX-Registry", erx5Plus1Redundant12T3E3Midplane=erx5Plus1Redundant12T3E3Midplane, erxCt3=erxCt3, erxE3Atm=erxE3Atm, erxSrp310Ioa=erxSrp310Ioa, erxFe2=erxFe2, erx2Plus1Redundant12T3E3Midplane=erx2Plus1Redundant12T3E3Midplane, erx1440Chassis=erx1440Chassis, erxLineIoAdapter=erxLineIoAdapter, erxOc3Mm4ApsIoa=erxOc3Mm4ApsIoa, erxCt1Ioa=erxCt1Ioa, erxSrp10g1gEcc=erxSrp10g1gEcc, erxOc12SmLr1ApsIoa=erxOc12SmLr1ApsIoa, erxCt3RedundantIoa=erxCt3RedundantIoa, erx4Plus1RedundantT3E3Midplane=erx4Plus1RedundantT3E3Midplane, erxOc48Ioa=erxOc48Ioa, erx1Plus1RedundantT3E3Midplane=erx1Plus1RedundantT3E3Midplane, erx700Chassis=erx700Chassis, erxCe1TIoa=erxCe1TIoa, erxOc12SmLr1Ioa=erxOc12SmLr1Ioa, erx5Plus1RedundantCOcMidplane=erx5Plus1RedundantCOcMidplane, erxSrpIoAdapter=erxSrpIoAdapter, erxPowerInput=erxPowerInput, erxCOc12SmLr1Ioa=erxCOc12SmLr1Ioa, erxT3Frame=erxT3Frame, erxSrp5g1gEcc=erxSrp5g1gEcc, erxE3Ioa=erxE3Ioa, erxOc3Sm2Ioa=erxOc3Sm2Ioa, erx2Plus1RedundantCOcMidplane=erx2Plus1RedundantCOcMidplane, erxCOc12AtmPosMm1ApsIoa=erxCOc12AtmPosMm1ApsIoa, erx700FanAssembly=erx700FanAssembly, erxCOc12SmLr1ApsIoa=erxCOc12SmLr1ApsIoa, erx1Plus1RedundantOcMidplane=erx1Plus1RedundantOcMidplane, erxSrp5g2gEcc=erxSrp5g2gEcc, erxGeSm1Ioa=erxGeSm1Ioa, erxCOcx=erxCOcx, erx1400FanAssembly=erx1400FanAssembly, erx310DCChassis=erx310DCChassis, erxPdu=erxPdu, erx1Plus1RedundantT1E1Midplane=erx1Plus1RedundantT1E1Midplane, erx5Plus1RedundantT1E1Midplane=erx5Plus1RedundantT1E1Midplane, erx2Plus1RedundantOcMidplane=erx2Plus1RedundantOcMidplane, erxLineModule=erxLineModule, erxCOcxRedundantIoa=erxCOcxRedundantIoa, erx3Plus1RedundantOcMidplane=erx3Plus1RedundantOcMidplane, erxOc3Atm2Ge1Ioa=erxOc3Atm2Ge1Ioa, erx700Midplane=erx700Midplane, erxOc3Oc12Atm256M=erxOc3Oc12Atm256M, erxSrp10=erxSrp10, erxOc3SmIr4ApsIoa=erxOc3SmIr4ApsIoa, erxT1E1RedundantIoa=erxT1E1RedundantIoa, erxV35Ioa=erxV35Ioa, erx3Plus1RedundantT1E1Midplane=erx3Plus1RedundantT1E1Midplane, erxCt3P12=erxCt3P12, erxUt3E3Ocx=erxUt3E3Ocx, erx310ACChassis=erx310ACChassis, erxSrp5=erxSrp5, erxService=erxService, erxCt1=erxCt1, erx5Plus1RedundantT3E3Midplane=erx5Plus1RedundantT3E3Midplane, erxGeSfpIoa=erxGeSfpIoa, erxCOc12Mm1ApsIoa=erxCOc12Mm1ApsIoa, erxOc3Hybrid=erxOc3Hybrid, erxOc3=erxOc3, erxSrp40g2gEc2=erxSrp40g2gEc2, erxOcxRedundantIoa=erxOcxRedundantIoa, erx5Plus1RedundantOcMidplane=erx5Plus1RedundantOcMidplane, erxSrpIoa=erxSrpIoa, erxSrp5Plus=erxSrp5Plus, erxSrpModule=erxSrpModule, erxOc3Mm4Ioa=erxOc3Mm4Ioa, erxGe2=erxGe2, erxOc3SmLr4ApsIoa=erxOc3SmLr4ApsIoa, erxFanAssembly=erxFanAssembly, erxCt3Ioa=erxCt3Ioa, erxSrp310=erxSrp310, erx3Plus1RedundantT3E3Midplane=erx3Plus1RedundantT3E3Midplane, erx300DCPdu=erx300DCPdu, erxOc48=erxOc48, erxT3Atm=erxT3Atm, erxMidplane=erxMidplane, erx2Plus1RedundantT3E3Midplane=erx2Plus1RedundantT3E3Midplane, erxOc12Mm1ApsIoa=erxOc12Mm1ApsIoa, erxFe8Ioa=erxFe8Ioa, erxCOc3Mm4Ioa=erxCOc3Mm4Ioa, erxOc3Oc12Atm=erxOc3Oc12Atm, erxCOc3SmIr4Ioa=erxCOc3SmIr4Ioa, erx1400Chassis=erx1400Chassis, erxOc3Atm2Pos2Ioa=erxOc3Atm2Pos2Ioa, erx4Plus1RedundantT1E1Midplane=erx4Plus1RedundantT1E1Midplane, erxCe1Ioa=erxCe1Ioa, erxCOc3SmLr4Ioa=erxCOc3SmLr4Ioa, erxFe2Ioa=erxFe2Ioa, erx4Plus1RedundantOcMidplane=erx4Plus1RedundantOcMidplane, erx1440Midplane=erx1440Midplane, erxOc3SmIr4Ioa=erxOc3SmIr4Ioa, erxVts=erxVts, erx1400Midplane=erx1400Midplane, erxCOc12AtmPosSmIr1Ioa=erxCOc12AtmPosSmIr1Ioa, erxGeFe256M=erxGeFe256M, PYSNMP_MODULE_ID=juniErxRegistry, erxCOc12AtmPosSmIr1ApsIoa=erxCOc12AtmPosSmIr1ApsIoa, erxOc12SmIr1Ioa=erxOc12SmIr1Ioa, erxUe3P12Ioa=erxUe3P12Ioa, erxCe1=erxCe1, erxHssiIoa=erxHssiIoa, erxCOc12SmIr1ApsIoa=erxCOc12SmIr1ApsIoa, erxCOc12AtmPosSmLr1ApsIoa=erxCOc12AtmPosSmLr1ApsIoa, erxCOc12SmIr1Ioa=erxCOc12SmIr1Ioa, erx300FanAssembly=erx300FanAssembly, erxChassis=erxChassis, erxCOc12AtmPosMm1Ioa=erxCOc12AtmPosMm1Ioa, erxT3E3RedundantIoa=erxT3E3RedundantIoa, erx300ACPdu=erx300ACPdu, erxFe8FxIoa=erxFe8FxIoa, erx2Plus1RedundantT1E1Midplane=erx2Plus1RedundantT1E1Midplane, erxGeMm1Ioa=erxGeMm1Ioa, erxV35=erxV35, erxE3Frame=erxE3Frame, erxOc3Oc12Pos=erxOc3Oc12Pos, erxOc12Mm1Ioa=erxOc12Mm1Ioa, erxCOc12AtmPosSmLr1Ioa=erxCOc12AtmPosSmLr1Ioa, erxCOc12Mm1Ioa=erxCOc12Mm1Ioa, erxOc12SmIr1ApsIoa=erxOc12SmIr1ApsIoa, erxGe2Ioa=erxGe2Ioa, erxOc3SmLr4Ioa=erxOc3SmLr4Ioa, erxSrp10Ecc=erxSrp10Ecc, erxSrp40Plus=erxSrp40Plus, erx300Midplane=erx300Midplane, erx1440Pdu=erx1440Pdu, erxSrp10g2gEcc=erxSrp10g2gEcc, erxHssi=erxHssi, erxGeFe=erxGeFe, erxOc3Mm2Ioa=erxOc3Mm2Ioa, erxTunnelService=erxTunnelService, erxT3Atm4Ioa=erxT3Atm4Ioa, erxSrp40=erxSrp40, juniErxRegistry=juniErxRegistry, juniErxEntPhysicalType=juniErxEntPhysicalType, erxCt3P12Ioa=erxCt3P12Ioa)
| 121.525346 | 4,690 | 0.767377 | 7,602 | 52,742 | 5.321494 | 0.077874 | 0.082167 | 0.143793 | 0.013645 | 0.568275 | 0.421639 | 0.404336 | 0.388491 | 0.361818 | 0.330598 | 0 | 0.106267 | 0.111998 | 52,742 | 433 | 4,691 | 121.806005 | 0.757489 | 0.006333 | 0 | 0 | 0 | 0.312941 | 0.381858 | 0.001699 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.016471 | 0 | 0.016471 | 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 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5c9b0a3d9f52de21bc5a7245134953c068fddced | 1,240 | py | Python | rest_framework_security/deny_repeat_password/managers.py | RubenEu/django-rest-framework-security | 638cf271c51a5bafd434a6b6a9c25a7c4849b485 | [
"MIT"
] | 7 | 2020-09-01T09:55:25.000Z | 2021-11-04T06:59:04.000Z | rest_framework_security/deny_repeat_password/managers.py | RubenEu/django-rest-framework-security | 638cf271c51a5bafd434a6b6a9c25a7c4849b485 | [
"MIT"
] | 32 | 2020-10-28T17:09:18.000Z | 2022-03-12T00:55:09.000Z | rest_framework_security/deny_repeat_password/managers.py | RubenEu/django-rest-framework-security | 638cf271c51a5bafd434a6b6a9c25a7c4849b485 | [
"MIT"
] | 2 | 2020-12-18T01:26:53.000Z | 2021-11-04T06:59:07.000Z | from django.contrib.auth.hashers import check_password
from django.db import models
from rest_framework_security.deny_repeat_password import config
class UserPasswordQuerySet(models.QuerySet):
def remove_old_passwords(self, user):
user_passwords = self.filter(user=user)
max_passwords = config.DENY_REPEAT_PASSWORD_MAX_SAVED_PASSWORDS
if user_passwords.count() > max_passwords:
user_passwords = user_passwords.order_by("-created_at")
first_last = user_passwords[max_passwords]
to_remove = user_passwords.filter(pk__lte=first_last.pk)
to_remove.delete()
def password_exists(self, password):
last_passwords = self.values_list("password", flat=True)
for last_password in last_passwords:
if check_password(password, last_password):
return True
return False
class UserPasswordManager(models.Manager):
def get_queryset(self):
return UserPasswordQuerySet(self.model, using=self._db)
def remove_old_passwords(self, user):
return self.get_queryset().remove_old_passwords(user)
def password_exists(self, user, password):
return self.get_queryset().password_exists(password)
| 36.470588 | 71 | 0.722581 | 151 | 1,240 | 5.629139 | 0.357616 | 0.091765 | 0.063529 | 0.049412 | 0.068235 | 0.068235 | 0 | 0 | 0 | 0 | 0 | 0 | 0.200806 | 1,240 | 33 | 72 | 37.575758 | 0.857719 | 0 | 0 | 0.08 | 0 | 0 | 0.015323 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0.8 | 0.12 | 0.12 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 3 |
5cad18246d7cfbaf151f03b1ace5f5b690da22e3 | 386 | py | Python | venv/Lib/site-packages/introcs/geom/__init__.py | frankappolonia/SmartPrice | 7b6e1116b3f388623648db43390c7cf3492e8271 | [
"MIT"
] | 1 | 2021-12-26T03:15:59.000Z | 2021-12-26T03:15:59.000Z | venv/Lib/site-packages/introcs/geom/__init__.py | frankappolonia/SmartPrice | 7b6e1116b3f388623648db43390c7cf3492e8271 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/introcs/geom/__init__.py | frankappolonia/SmartPrice | 7b6e1116b3f388623648db43390c7cf3492e8271 | [
"MIT"
] | 2 | 2021-01-20T01:38:08.000Z | 2021-07-17T02:15:37.000Z | """
Module that provides basic point and vector objects.
This module is not meant to be an exhaustive linear algebra packet (though it may be
one day). It is solely for in class demonstrations.
Author: Walker M. White (wmw2)
Date: July 13, 2017 (Python 3 version)
"""
from .point import Point2, Point3, Point
from .vector import Vector2, Vector3, Vector
from .matrix import Matrix | 32.166667 | 85 | 0.756477 | 61 | 386 | 4.786885 | 0.786885 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.037736 | 0.176166 | 386 | 12 | 86 | 32.166667 | 0.880503 | 0.683938 | 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 |
5caed00b2763643bca14366c95ddf7ddba7833b6 | 16,349 | py | Python | flanc/lib.py | sdn-ixp/sdx-parallel | aa7f3d01ac22c56b5882de50884b0473c8bb6ba2 | [
"Apache-2.0"
] | 49 | 2015-11-15T00:02:35.000Z | 2021-02-12T22:03:57.000Z | flanc/lib.py | sdn-ixp/sdx-parallel | aa7f3d01ac22c56b5882de50884b0473c8bb6ba2 | [
"Apache-2.0"
] | 6 | 2016-06-20T06:01:36.000Z | 2019-10-22T19:34:27.000Z | flanc/lib.py | sdn-ixp/sdx-parallel | aa7f3d01ac22c56b5882de50884b0473c8bb6ba2 | [
"Apache-2.0"
] | 21 | 2015-11-22T13:02:07.000Z | 2019-06-06T18:15:11.000Z | # Author:
# Rudiger Birkner (Networked Systems Group ETH Zurich)
import json
import logging
from Queue import Queue
import os
import sys
np = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
if np not in sys.path:
sys.path.append(np)
import util.log
from ofdpa20 import OFDPA20
# COOKIES
NO_COOKIE = 0
class Config(object):
MULTISWITCH = 0
MULTITABLE = 1
ONESWITCH = 2
def __init__(self, config_file):
self.server = None
self.mode = None
self.ofdpa = set()
self.ofv = None
self.tables = None
self.loops = None
self.dpids = None
self.dp_alias = []
self.dpid_2_name = {}
self.datapath_ports = None
self.priorities = None
self.datapaths = {}
self.parser = None
self.ofproto = None
# loading config file
config = json.load(open(config_file, 'r'))
# read from file
if "Mode" in config:
if config["Mode"] == "Multi-Switch":
self.mode = self.MULTISWITCH
elif config["Mode"] == "Multi-Table":
self.mode = self.MULTITABLE
elif config["Mode"] == "One-Switch":
self.mode = self.ONESWITCH
if "RefMon Settings" in config:
if "fabric options" in config["RefMon Settings"]:
if "tables" in config["RefMon Settings"]["fabric options"]:
self.tables = config["RefMon Settings"]["fabric options"]["tables"]
if "dpids" in config["RefMon Settings"]["fabric options"]:
self.dpids = config["RefMon Settings"]["fabric options"]["dpids"]
for k,v in self.dpids.iteritems():
self.dpid_2_name[v] = k
if "loops" in config["RefMon Settings"]["fabric options"]:
self.loops = config["RefMon Settings"]["fabric options"]["loops"]
if "dp alias" in config["RefMon Settings"]["fabric options"]:
self.dp_alias = config["RefMon Settings"]["fabric options"]["dp alias"]
if "OF version" in config["RefMon Settings"]["fabric options"]:
self.ofv = config["RefMon Settings"]["fabric options"]["OF version"]
if "ofdpa" in config["RefMon Settings"]["fabric options"]:
self.ofdpa = set(config["RefMon Settings"]["fabric options"]["ofdpa"])
if "priorities" in config["RefMon Settings"]:
self.priorities = config["RefMon Settings"]["priorities"]
if "fabric connections" in config["RefMon Settings"]:
self.datapath_ports = config["RefMon Settings"]["fabric connections"]
if "RefMon Server" in config:
self.server = config["RefMon Server"]
else:
raise InvalidConfigError(config)
# check if valid config
if self.isMultiSwitchMode():
if not (self.ofv and self.dpids and self.datapath_ports):
raise InvalidConfigError(config)
elif self.isMultiTableMode():
if not (self.ofv == "1.3" and self.tables and self.datapath_ports):
raise InvalidConfigError(config)
elif self.isOneSwitchMode():
if not (self.ofv == "1.3" and self.loops):
raise InvalidConfigError(config)
else:
raise InvalidConfigError(config)
def isMultiSwitchMode(self):
return self.mode == self.MULTISWITCH
def isMultiTableMode(self):
return self.mode == self.MULTITABLE
def isOneSwitchMode(self):
return self.mode == self.ONESWITCH
class InvalidConfigError(Exception):
def __init__(self, flow_mod):
self.flow_mod = flow_mod
def __str__(self):
return repr(self.flow_mod)
class MultiTableController(object):
def __init__(self, config):
self.config = config
self.logger = util.log.getLogger('MultiTableController')
self.logger.info('mt_ctrlr: creating an instance of MultiTableController')
self.fm_queue = Queue()
def init_fabric(self):
# install table-miss flow entry
self.logger.info("mt_ctrlr: init fabric")
match = self.config.parser.OFPMatch()
actions = [self.config.parser.OFPActionOutput(self.config.ofproto.OFPP_CONTROLLER, self.config.ofproto.OFPCML_NO_BUFFER)]
instructions = [self.config.parser.OFPInstructionActions(self.config.ofproto.OFPIT_APPLY_ACTIONS, actions)]
for name, table_id in self.config.tables.iteritems():
mod = self.config.parser.OFPFlowMod(datapath=self.config.datapaths["main"],
cookie=NO_COOKIE, cookie_mask=1,
table_id=table_id,
command=self.config.ofproto.OFPFC_ADD,
priority=self.config.priorities[name]["flow_miss"],
match=match, instructions=instructions)
self.config.datapaths["main"].send_msg(mod)
mod = self.config.parser.OFPFlowMod(datapath=self.config.datapaths["arp"],
cookie=NO_COOKIE, cookie_mask=1,
command=self.config.ofproto.OFPFC_ADD,
priority=self.config.priorities["arp"]["flow_miss"],
match=match, instructions=instructions)
self.config.datapaths["arp"].send_msg(mod)
def switch_connect(self, dp):
dp_name = self.config.dpid_2_name[dp.id]
self.config.datapaths[dp_name] = dp
if self.config.ofproto is None:
self.config.ofproto = dp.ofproto
if self.config.parser is None:
self.config.parser = dp.ofproto_parser
self.logger.info('mt_ctrlr: switch connect: ' + dp_name)
if self.is_ready():
self.init_fabric()
while not self.fm_queue.empty():
self.process_flow_mod(self.fm_queue.get())
def switch_disconnect(self, dp):
if dp.id in self.config.dpid_2_name:
dp_name = self.config.dpid_2_name[dp.id]
self.logger.info('mt_ctrlr: switch disconnect: ' + dp_name)
del self.config.datapaths[dp_name]
def process_flow_mod(self, fm):
if not self.is_ready():
self.fm_queue.put(fm)
else:
mod = fm.get_flow_mod(self.config)
self.config.datapaths[fm.get_dst_dp()].send_msg(mod)
def packet_in(self, ev):
pass
def is_ready(self):
if len(self.config.datapaths) == len(self.config.dpids):
return True
return False
def send_barrier_request(self):
request = self.config.parser.OFPBarrierRequest(self.config.datapaths["main"])
self.config.datapaths["main"].send_msg(request)
def handle_barrier_reply(self, datapath):
if self.config.datapaths["main"] == datapath:
return True
return False
class MultiSwitchController(object):
def __init__(self, config):
self.logger = util.log.getLogger('MultiSwitchController')
self.logger.info('ms_ctrlr: creating an instance of MultiSwitchController')
self.datapaths = {}
self.config = config
self.fm_queue = Queue()
self.last_command_type = {}
def switch_connect(self, dp):
dp_name = self.config.dpid_2_name[dp.id]
self.config.datapaths[dp_name] = dp
if self.config.ofproto is None:
self.config.ofproto = dp.ofproto
if self.config.parser is None:
self.config.parser = dp.ofproto_parser
self.logger.info('ms_ctrlr: switch connect: ' + dp_name)
if self.is_ready():
self.init_fabric()
while not self.fm_queue.empty():
self.process_flow_mod(self.fm_queue.get())
def switch_disconnect(self, dp):
if dp.id in self.config.dpid_2_name:
dp_name = self.config.dpid_2_name[dp.id]
self.logger.info('ms_ctrlr: switch disconnect: ' + dp_name)
del self.config.datapaths[dp_name]
def init_fabric(self):
# install table-miss flow entry
self.logger.info('ms_ctrlr: init fabric')
match = self.config.parser.OFPMatch()
if self.config.ofv == "1.3":
actions = [self.config.parser.OFPActionOutput(self.config.ofproto.OFPP_CONTROLLER, self.config.ofproto.OFPCML_NO_BUFFER)]
instructions = [self.config.parser.OFPInstructionActions(self.config.ofproto.OFPIT_APPLY_ACTIONS, actions)]
else:
actions = [self.config.parser.OFPActionOutput(self.config.ofproto.OFPP_CONTROLLER)]
for name, datapath in self.config.datapaths.iteritems():
if self.config.ofv == "1.3":
mod = self.config.parser.OFPFlowMod(datapath=datapath,
cookie=NO_COOKIE, cookie_mask=3,
command=self.config.ofproto.OFPFC_ADD,
priority=self.config.priorities[name]["flow_miss"],
match=match, instructions=instructions)
else:
mod = self.config.parser.OFPFlowMod(datapath=datapath,
cookie=NO_COOKIE,
command=self.config.ofproto.OFPFC_ADD,
priority=self.config.priorities[name]["flow_miss"],
match=match, actions=actions)
datapath.send_msg(mod)
def process_flow_mod(self, fm):
if not self.is_ready():
self.fm_queue.put(fm)
else:
dp = self.config.datapaths[fm.get_dst_dp()]
if self.config.dpid_2_name[dp.id] in self.config.ofdpa:
ofdpa = OFDPA20(self.config)
flow_mod, group_mods = fm.get_flow_and_group_mods(self.config)
for gm in group_mods:
if not ofdpa.is_group_mod_installed_in_switch(dp, gm):
dp.send_msg(gm)
ofdpa.mark_group_mod_as_installed(dp, gm)
else:
flow_mod = fm.get_flow_mod(self.config)
if (not dp.id in self.last_command_type or (self.last_command_type[dp.id] != flow_mod.command)):
self.logger.info('ms_ctrlr: sending barrier')
self.last_command_type[dp.id] = flow_mod.command
dp.send_msg(self.config.parser.OFPBarrierRequest(dp))
dp.send_msg(flow_mod)
def packet_in(self, ev):
pass
def is_ready(self):
if len(self.config.datapaths) == len(self.config.dpids) or self.config.always_ready:
return True
return False
def send_barrier_request(self):
if self.is_ready():
dp = self.config.datapaths["outbound"]
request = self.config.parser.OFPBarrierRequest(dp)
dp.send_msg(request)
return True
else:
return False
def handle_barrier_reply(self, datapath):
if self.config.datapaths["outbound"] == datapath:
return True
return False
class OneSwitchController(object):
def __init__(self, config):
self.config = config
self.logger = util.log.getLogger('OneSwitchController')
self.logger.info('os_ctrlr: creating an instance of OneSwitchController')
self.fm_queue = Queue()
self.last_command_type = {}
def init_fabric(self):
# install table-miss flow entry
self.logger.info("os_ctrlr: init fabric")
match = self.config.parser.OFPMatch()
actions = [self.config.parser.OFPActionOutput(self.config.ofproto.OFPP_CONTROLLER,
self.config.ofproto.OFPCML_NO_BUFFER)]
instructions = [self.config.parser.OFPInstructionActions(self.config.ofproto.OFPIT_APPLY_ACTIONS, actions)]
mod = self.config.parser.OFPFlowMod(datapath=self.config.datapaths["main"],
cookie=NO_COOKIE, cookie_mask=1,
command=self.config.ofproto.OFPFC_ADD,
priority=self.config.priorities["main-in"]["flow_miss"],
match=match, instructions=instructions)
self.config.datapaths["main"].send_msg(mod)
match = self.config.parser.OFPMatch(in_port=self.config.loops["main-out"][1])
mod = self.config.parser.OFPFlowMod(datapath=self.config.datapaths["main"],
cookie=NO_COOKIE, cookie_mask=1,
command=self.config.ofproto.OFPFC_ADD,
priority=self.config.priorities["main-out"]["flow_miss"],
match=match, instructions=instructions)
self.config.datapaths["main"].send_msg(mod)
match = self.config.parser.OFPMatch()
mod = self.config.parser.OFPFlowMod(datapath=self.config.datapaths["arp"],
cookie=NO_COOKIE, cookie_mask=1,
command=self.config.ofproto.OFPFC_ADD,
priority=self.config.priorities["arp"]["flow_miss"],
match=match, instructions=instructions)
self.config.datapaths["arp"].send_msg(mod)
def switch_connect(self, dp):
if not dp.id in self.config.dpid_2_name:
self.logger.warning('os_ctrlr: ignoring connection from unknown DP id: ' + str(dp.id))
return
dp_name = self.config.dpid_2_name[dp.id]
self.config.datapaths[dp_name] = dp
if self.config.ofproto is None:
self.config.ofproto = dp.ofproto
if self.config.parser is None:
self.config.parser = dp.ofproto_parser
self.logger.info('os_ctrlr: switch connect: ' + dp_name)
if self.is_ready():
self.init_fabric()
while not self.fm_queue.empty():
self.process_flow_mod(self.fm_queue.get())
def switch_disconnect(self, dp):
if dp.id in self.config.dpid_2_name:
dp_name = self.config.dpid_2_name[dp.id]
self.logger.info('os_ctrlr: switch disconnect: ' + dp_name)
del self.config.datapaths[dp_name]
def process_flow_mod(self, fm):
if not self.is_ready():
self.fm_queue.put(fm)
else:
dp = self.config.datapaths[fm.get_dst_dp()]
if self.config.dpid_2_name[dp.id] in self.config.ofdpa:
ofdpa = OFDPA20(self.config)
flow_mod, group_mods = fm.get_flow_and_group_mods(self.config)
for gm in group_mods:
if not ofdpa.is_group_mod_installed_in_switch(dp, gm):
dp.send_msg(gm)
ofdpa.mark_group_mod_as_installed(dp, gm)
else:
flow_mod = fm.get_flow_mod(self.config)
if (not dp.id in self.last_command_type or (self.last_command_type[dp.id] != flow_mod.command)):
self.logger.info('os_ctrlr: sending barrier')
self.last_command_type[dp.id] = flow_mod.command
dp.send_msg(self.config.parser.OFPBarrierRequest(dp))
dp.send_msg(flow_mod)
def packet_in(self, ev):
pass
def is_ready(self):
if len(self.config.datapaths) == len(self.config.dpids) or self.config.always_ready:
return True
return False
def send_barrier_request(self):
request = self.config.parser.OFPBarrierRequest(self.config.datapaths["main"])
self.config.datapaths["main"].send_msg(request)
def handle_barrier_reply(self, datapath):
if self.config.datapaths["main"] == datapath:
return True
return False
| 40.367901 | 133 | 0.57661 | 1,864 | 16,349 | 4.896996 | 0.094421 | 0.140228 | 0.064527 | 0.037029 | 0.778155 | 0.723598 | 0.70837 | 0.676819 | 0.659838 | 0.63968 | 0 | 0.003691 | 0.320631 | 16,349 | 404 | 134 | 40.467822 | 0.818133 | 0.013212 | 0 | 0.621019 | 0 | 0 | 0.086342 | 0.002605 | 0 | 0 | 0 | 0 | 0 | 1 | 0.105096 | false | 0.009554 | 0.022293 | 0.012739 | 0.213376 | 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 |
5caf35f5d1bae7347952bf225f22504af4de66c2 | 6,532 | py | Python | aliyun-python-sdk-smartag/aliyunsdksmartag/request/v20180313/CreateSmartAccessGatewayRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-smartag/aliyunsdksmartag/request/v20180313/CreateSmartAccessGatewayRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-smartag/aliyunsdksmartag/request/v20180313/CreateSmartAccessGatewayRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from aliyunsdkcore.request import RpcRequest
from aliyunsdksmartag.endpoint import endpoint_data
class CreateSmartAccessGatewayRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Smartag', '2018-03-13', 'CreateSmartAccessGateway','smartag')
self.set_method('POST')
if hasattr(self, "endpoint_map"):
setattr(self, "endpoint_map", endpoint_data.getEndpointMap())
if hasattr(self, "endpoint_regional"):
setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional())
def get_ResourceOwnerId(self): # Long
return self.get_query_params().get('ResourceOwnerId')
def set_ResourceOwnerId(self, ResourceOwnerId): # Long
self.add_query_param('ResourceOwnerId', ResourceOwnerId)
def get_ReceiverTown(self): # String
return self.get_query_params().get('ReceiverTown')
def set_ReceiverTown(self, ReceiverTown): # String
self.add_query_param('ReceiverTown', ReceiverTown)
def get_ReceiverDistrict(self): # String
return self.get_query_params().get('ReceiverDistrict')
def set_ReceiverDistrict(self, ReceiverDistrict): # String
self.add_query_param('ReceiverDistrict', ReceiverDistrict)
def get_BuyerMessage(self): # String
return self.get_query_params().get('BuyerMessage')
def set_BuyerMessage(self, BuyerMessage): # String
self.add_query_param('BuyerMessage', BuyerMessage)
def get_ReceiverState(self): # String
return self.get_query_params().get('ReceiverState')
def set_ReceiverState(self, ReceiverState): # String
self.add_query_param('ReceiverState', ReceiverState)
def get_Period(self): # Integer
return self.get_query_params().get('Period')
def set_Period(self, Period): # Integer
self.add_query_param('Period', Period)
def get_OwnerId(self): # Long
return self.get_query_params().get('OwnerId')
def set_OwnerId(self, OwnerId): # Long
self.add_query_param('OwnerId', OwnerId)
def get_ReceiverPhone(self): # String
return self.get_query_params().get('ReceiverPhone')
def set_ReceiverPhone(self, ReceiverPhone): # String
self.add_query_param('ReceiverPhone', ReceiverPhone)
def get_HaType(self): # String
return self.get_query_params().get('HaType')
def set_HaType(self, HaType): # String
self.add_query_param('HaType', HaType)
def get_Name(self): # String
return self.get_query_params().get('Name')
def set_Name(self, Name): # String
self.add_query_param('Name', Name)
def get_ReceiverCountry(self): # String
return self.get_query_params().get('ReceiverCountry')
def set_ReceiverCountry(self, ReceiverCountry): # String
self.add_query_param('ReceiverCountry', ReceiverCountry)
def get_MaxBandWidth(self): # Integer
return self.get_query_params().get('MaxBandWidth')
def set_MaxBandWidth(self, MaxBandWidth): # Integer
self.add_query_param('MaxBandWidth', MaxBandWidth)
def get_Description(self): # String
return self.get_query_params().get('Description')
def set_Description(self, Description): # String
self.add_query_param('Description', Description)
def get_ReceiverAddress(self): # String
return self.get_query_params().get('ReceiverAddress')
def set_ReceiverAddress(self, ReceiverAddress): # String
self.add_query_param('ReceiverAddress', ReceiverAddress)
def get_HardWareSpec(self): # String
return self.get_query_params().get('HardWareSpec')
def set_HardWareSpec(self, HardWareSpec): # String
self.add_query_param('HardWareSpec', HardWareSpec)
def get_ReceiverEmail(self): # String
return self.get_query_params().get('ReceiverEmail')
def set_ReceiverEmail(self, ReceiverEmail): # String
self.add_query_param('ReceiverEmail', ReceiverEmail)
def get_ReceiverCity(self): # String
return self.get_query_params().get('ReceiverCity')
def set_ReceiverCity(self, ReceiverCity): # String
self.add_query_param('ReceiverCity', ReceiverCity)
def get_AutoPay(self): # Boolean
return self.get_query_params().get('AutoPay')
def set_AutoPay(self, AutoPay): # Boolean
self.add_query_param('AutoPay', AutoPay)
def get_CPEVersion(self): # String
return self.get_query_params().get('CPEVersion')
def set_CPEVersion(self, CPEVersion): # String
self.add_query_param('CPEVersion', CPEVersion)
def get_ReceiverMobile(self): # String
return self.get_query_params().get('ReceiverMobile')
def set_ReceiverMobile(self, ReceiverMobile): # String
self.add_query_param('ReceiverMobile', ReceiverMobile)
def get_ResourceOwnerAccount(self): # String
return self.get_query_params().get('ResourceOwnerAccount')
def set_ResourceOwnerAccount(self, ResourceOwnerAccount): # String
self.add_query_param('ResourceOwnerAccount', ResourceOwnerAccount)
def get_OwnerAccount(self): # String
return self.get_query_params().get('OwnerAccount')
def set_OwnerAccount(self, OwnerAccount): # String
self.add_query_param('OwnerAccount', OwnerAccount)
def get_ReceiverName(self): # String
return self.get_query_params().get('ReceiverName')
def set_ReceiverName(self, ReceiverName): # String
self.add_query_param('ReceiverName', ReceiverName)
def get_AlreadyHaveSag(self): # Boolean
return self.get_query_params().get('AlreadyHaveSag')
def set_AlreadyHaveSag(self, AlreadyHaveSag): # Boolean
self.add_query_param('AlreadyHaveSag', AlreadyHaveSag)
def get_ChargeType(self): # String
return self.get_query_params().get('ChargeType')
def set_ChargeType(self, ChargeType): # String
self.add_query_param('ChargeType', ChargeType)
def get_ReceiverZip(self): # String
return self.get_query_params().get('ReceiverZip')
def set_ReceiverZip(self, ReceiverZip): # String
self.add_query_param('ReceiverZip', ReceiverZip)
| 39.829268 | 91 | 0.759645 | 798 | 6,532 | 6.002506 | 0.170426 | 0.032568 | 0.070564 | 0.097704 | 0.325679 | 0.200835 | 0.200835 | 0.200835 | 0 | 0 | 0 | 0.002118 | 0.132578 | 6,532 | 163 | 92 | 40.07362 | 0.843276 | 0.171157 | 0 | 0 | 0 | 0 | 0.137812 | 0.004607 | 0 | 0 | 0 | 0 | 0 | 1 | 0.464912 | false | 0 | 0.017544 | 0.22807 | 0.719298 | 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 |
5cb403f4caca02d4c0af03a7fd8ab1d6317eadec | 201 | py | Python | zgrobot/__init__.py | pylover7/ZgRobot | 7c2f03c551e5155c567d503e1a9b5269983f5a3b | [
"MIT"
] | 3 | 2021-10-18T17:36:05.000Z | 2022-03-01T06:55:21.000Z | zgrobot/__init__.py | pylover7/ZgRobot | 7c2f03c551e5155c567d503e1a9b5269983f5a3b | [
"MIT"
] | 20 | 2021-10-10T07:24:36.000Z | 2022-03-21T07:18:49.000Z | zgrobot/__init__.py | pylover7/ZgRobot | 7c2f03c551e5155c567d503e1a9b5269983f5a3b | [
"MIT"
] | 1 | 2022-02-25T09:47:58.000Z | 2022-02-25T09:47:58.000Z | __version__ = '2.0.3'
__author__ = 'pylover'
__license__ = 'MIT'
__all__ = ["ZgRoBot"]
try:
from zgrobot.robot import ZgRoBot
except ImportError: # pragma: no cover
pass # pragma: no cover
| 18.272727 | 39 | 0.686567 | 25 | 201 | 4.88 | 0.8 | 0.131148 | 0.213115 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018634 | 0.199005 | 201 | 10 | 40 | 20.1 | 0.73913 | 0.164179 | 0 | 0 | 0 | 0 | 0.133333 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.125 | 0.25 | 0 | 0.25 | 0 | 1 | 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 | 0 | 0 | 0 | 3 |
5cb6f92894ff15e631038f0d327b3bd2f3927335 | 16,634 | py | Python | deploy_config_generator/output/kube_servicemonitor.py | ApplauseAQI/applause-deploy-config-generator | 46f957fbfe991677f920d5db74b0670385b6e505 | [
"MIT"
] | 3 | 2019-04-05T14:16:17.000Z | 2021-06-25T20:53:03.000Z | deploy_config_generator/output/kube_servicemonitor.py | ApplauseAQI/applause-deploy-config-generator | 46f957fbfe991677f920d5db74b0670385b6e505 | [
"MIT"
] | 6 | 2019-04-04T20:20:16.000Z | 2021-09-27T21:04:39.000Z | deploy_config_generator/output/kube_servicemonitor.py | ApplauseAQI/applause-deploy-config-generator | 46f957fbfe991677f920d5db74b0670385b6e505 | [
"MIT"
] | null | null | null | import copy
from deploy_config_generator.utils import yaml_dump
from deploy_config_generator.output import kube_common
class OutputPlugin(kube_common.OutputPlugin):
NAME = 'kube_servicemonitor'
DESCR = 'Kubernetes ServiceMonitor output plugin'
FILE_EXT = '.yaml'
DEFAULT_CONFIG = {
'fields': {
'kube_servicemonitors': dict(
metadata=dict(
type='dict',
required=True,
fields=copy.deepcopy(kube_common.METADATA_FIELD_SPEC),
),
spec=dict(
type='dict',
required=True,
fields=dict(
endpoints=dict(
type='list',
subtype='dict',
fields=dict(
basic_auth=dict(
type='dict',
fields=dict(
password=dict(
type='dict',
fields=dict(
key=dict(
type='str',
required=True,
),
name=dict(
type='str',
),
optional=dict(
type='bool',
),
),
),
username=dict(
type='dict',
fields=dict(
key=dict(
type='str',
required=True,
),
name=dict(
type='str',
),
optional=dict(
type='bool',
),
),
),
),
),
bearer_token_file=dict(
type='str',
),
bearer_token_secret=dict(
type='dict',
fields=dict(
key=dict(
type='str',
required=True,
),
name=dict(
type='str',
),
optional=dict(
type='bool',
),
),
),
honor_labels=dict(
type='bool',
),
honor_timestamps=dict(
type='bool',
),
interval=dict(
type='str',
),
metric_relabelings=dict(
type='list',
subtype='dict',
fields=dict(
action=dict(
type='str',
),
modulus=dict(
type='int',
),
regex=dict(
type='str',
),
replacement=dict(
type='str',
),
separator=dict(
type='str',
),
source_labels=dict(
type='list',
subtype='str'
),
target_label=dict(
type='str',
)
),
),
params=dict(
type='dict',
fields=dict(
additional_properties=dict(
type='list',
subtype='str',
)
)
),
path=dict(
type='str',
),
port=dict(
type='str',
),
proxy_url=dict(
type='str',
),
relabelings=dict(
type='list',
subtype='dict',
fields=dict(
action=dict(
type='str',
),
modulus=dict(
type='int',
),
regex=dict(
type='str',
),
replacement=dict(
type='str',
),
separator=dict(
type='str',
),
source_labels=dict(
type='list',
subtype='str'
),
target_label=dict(
type='str',
)
),
),
scheme=dict(
type='str',
),
scrape_timeout=dict(
type='string',
),
target_port=dict(
# No type specified, because this can be 'int' or 'str', and this tool
# doesn't currently support setting multiple allowed types
),
tls_config=dict(
type='dict',
fields=dict(
ca=dict(
type='dict',
fields=dict(
config_map=dict(
type='dict',
fields=dict(
key=dict(
type='str',
required=True,
),
name=dict(
type='str',
),
optional=dict(
type='bool',
),
),
),
secret=dict(
type='dict',
fields=dict(
key=dict(
type='str',
required=True,
),
name=dict(
type='str',
),
optional=dict(
type='bool',
),
),
),
),
),
ca_file=dict(
type='str'
),
cert=dict(
type='dict',
fields=dict(
config_map=dict(
type='dict',
fields=dict(
key=dict(
type='str',
required=True,
),
name=dict(
type='str',
),
optional=dict(
type='bool',
),
),
),
secret=dict(
type='dict',
fields=dict(
key=dict(
type='str',
required=True,
),
name=dict(
type='str',
),
optional=dict(
type='bool',
),
),
),
),
),
cert_file=dict(
type='string',
),
insecure_skip_verify=dict(
type='bool',
),
key_file=dict(
type='str',
),
key_secret=dict(
type='dict',
fields=dict(
key=dict(
type='str',
required=True,
),
name=dict(
type='str',
),
optional=dict(
type='bool',
),
),
),
server_name=dict(
type='str',
),
),
),
),
),
job_label=dict(
type='str',
),
namespace_selector=dict(
type='dict',
fields=dict(
any=dict(
type='bool'
),
match_names=dict(
type='list',
subtype='str',
),
),
),
pod_target_labels=dict(
type='list',
subtype='str',
),
sample_limit=dict(
type='int',
),
selector=dict(
type='dict',
required=True,
fields=copy.deepcopy(kube_common.SELECTOR_FIELD_SPEC),
),
target_labels=dict(
type='list',
subtype='str',
),
target_limit=dict(
type='int'
)
),
),
),
}
}
def generate_output(self, app_vars):
# Basic structure
data = {
'apiVersion': 'monitoring.coreos.com/v1',
'kind': 'ServiceMonitor',
'spec': dict(),
}
data['metadata'] = self.build_metadata(app_vars['APP']['metadata'])
data['spec'] = self.build_generic(app_vars['APP']['spec'], self._plugin_config['fields']['kube_servicemonitors']['spec']['fields'])
data = self._template.render_template(data, app_vars)
output = yaml_dump(data)
return (output, self.get_output_filename_suffix(data))
| 49.653731 | 139 | 0.170554 | 573 | 16,634 | 4.834206 | 0.22164 | 0.231047 | 0.14296 | 0.090975 | 0.544765 | 0.497112 | 0.486282 | 0.447653 | 0.447653 | 0.447653 | 0 | 0.000267 | 0.774799 | 16,634 | 334 | 140 | 49.802395 | 0.739188 | 0.008477 | 0 | 0.777778 | 0 | 0 | 0.031839 | 0.001456 | 0 | 0 | 0 | 0 | 0 | 1 | 0.003086 | false | 0.003086 | 0.009259 | 0 | 0.030864 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 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 |
5cb8e7517bacaf639c6020f2c35fee66185ff795 | 867 | py | Python | src/magic_cards/admin.py | dcollinsn/django-magic-cards | 1f8adb340591f56c82debb356f6d2589f20d01bf | [
"MIT"
] | 5 | 2017-08-10T19:05:37.000Z | 2021-12-14T21:33:47.000Z | src/magic_cards/admin.py | dcollinsn/django-magic-cards | 1f8adb340591f56c82debb356f6d2589f20d01bf | [
"MIT"
] | 51 | 2019-05-13T07:14:22.000Z | 2021-06-11T05:15:32.000Z | src/magic_cards/admin.py | dcollinsn/django-magic-cards | 1f8adb340591f56c82debb356f6d2589f20d01bf | [
"MIT"
] | 3 | 2017-10-26T21:32:25.000Z | 2021-03-18T09:06:48.000Z | from django.contrib import admin
from .models import Card, Set, Printing, CardSupertype, CardType, CardSubtype, Artist
@admin.register(Card)
class CardAdmin(admin.ModelAdmin):
search_fields = ['name']
@admin.register(Set)
class SetAdmin(admin.ModelAdmin):
list_display = ['name', 'code']
search_fields = ['name', 'code']
@admin.register(Printing)
class PrintingAdmin(admin.ModelAdmin):
search_fields = ['card__name']
list_filter = ['set']
@admin.register(Artist)
class ArtistAdmin(admin.ModelAdmin):
search_fields = ['full_name']
@admin.register(CardSupertype)
class CardSupertypeAdmin(admin.ModelAdmin):
search_fields = ['name']
@admin.register(CardType)
class CardTypeAdmin(admin.ModelAdmin):
search_fields = ['name']
@admin.register(CardSubtype)
class CardSubtypeAdmin(admin.ModelAdmin):
search_fields = ['name']
| 21.146341 | 85 | 0.734717 | 95 | 867 | 6.578947 | 0.326316 | 0.1456 | 0.2016 | 0.2592 | 0.2608 | 0.2112 | 0.2112 | 0 | 0 | 0 | 0 | 0 | 0.132641 | 867 | 40 | 86 | 21.675 | 0.831117 | 0 | 0 | 0.16 | 0 | 0 | 0.062284 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.08 | 0 | 0.72 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
5cbedb9db5cd82df16428f46246d9229a1ad2c75 | 1,463 | py | Python | scripts/genpredefinedshaders.py | harsha336/rrt_sig | 1afa8ad45562f20850360d691c2cc29faf18565b | [
"Apache-2.0"
] | null | null | null | scripts/genpredefinedshaders.py | harsha336/rrt_sig | 1afa8ad45562f20850360d691c2cc29faf18565b | [
"Apache-2.0"
] | null | null | null | scripts/genpredefinedshaders.py | harsha336/rrt_sig | 1afa8ad45562f20850360d691c2cc29faf18565b | [
"Apache-2.0"
] | null | null | null | # (c) 2016-2017 Marcelo Kallmann
# Convert shader files to static string definitions
import os
out = open('gl_predef_shaders.inc', 'w')
header = ( "//\n"
"// Default sig shaders - (c) Marcelo Kallmann 2016-2018\n"
"//\n\n" )
out.writelines ( header )
shfolder = "../shaders/"
files = os.listdir(shfolder)
for filename in files:
shname = filename
if shname.find(".txt")>=0 or shname.find("notused")>=0:
print ( shname + " - skipped" )
continue
print ( shname + "..." )
inp = open ( shfolder+filename )
shname = shname.replace('.','_')
out.writelines ( "static const char* pds_" + shname + "=\n" )
for line in inp:
l = len(line);
if l>1 : # a \n counts as 1
nb = line.find("//")
if nb>=0 :
line = line [0:nb]
else:
line = line [0:l-1]
line = line.strip()
line = line.replace(' ',' ')
line = line.replace(' =','=')
line = line.replace('= ','=')
line = line.replace(' *','*')
line = line.replace('* ','*')
line = line.replace(' /','/')
line = line.replace('/ ','/')
line = line.replace(' (','(')
line = line.replace('( ','(')
line = line.replace(' )',')')
line = line.replace(') ',')')
line = line.replace(', ',',')
l = len(line);
if l>0 :
if line[l-1]!=';' and line[l-1]!='{' and line[l-1]!='}' and line[l-1]!=')':
line = line + "\\n"
out.writelines ( "\"" + line + "\"\n" )
out.writelines(";\n")
inp.close()
out.close()
print ( "done." )
| 23.983607 | 79 | 0.532468 | 189 | 1,463 | 4.10582 | 0.322751 | 0.164948 | 0.231959 | 0.26933 | 0.302835 | 0.274485 | 0.274485 | 0.274485 | 0.274485 | 0.274485 | 0 | 0.025664 | 0.227614 | 1,463 | 60 | 80 | 24.383333 | 0.660177 | 0.066302 | 0 | 0.255319 | 0 | 0 | 0.160176 | 0.01543 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.021277 | null | null | 0.06383 | 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 |
5cce259d1cc58f812f16bcadafc4b6171b536877 | 476 | py | Python | NetCatKS/DProtocol/api/public/__init__.py | dimddev/NetCatKS-CP | 2d9e72b2422e344569fd4eb154866b98e9707561 | [
"BSD-2-Clause"
] | null | null | null | NetCatKS/DProtocol/api/public/__init__.py | dimddev/NetCatKS-CP | 2d9e72b2422e344569fd4eb154866b98e9707561 | [
"BSD-2-Clause"
] | null | null | null | NetCatKS/DProtocol/api/public/__init__.py | dimddev/NetCatKS-CP | 2d9e72b2422e344569fd4eb154866b98e9707561 | [
"BSD-2-Clause"
] | null | null | null | __author__ = 'dimd'
from NetCatKS.DProtocol.api.implementors.subscribers import DProtocolSubscriber, DProtocolXMLSubscriber
from NetCatKS.DProtocol.api.public.dynamic import DynamicProtocol
from NetCatKS.DProtocol.api.public.storage import ProtocolStorage
from NetCatKS.DProtocol.api.public.actions import BaseProtocolActions
#
#
__all__ = [
'DynamicProtocol',
'ProtocolStorage',
'BaseProtocolActions',
'DProtocolXMLSubscriber',
'DProtocolSubscriber'
]
| 26.444444 | 103 | 0.804622 | 41 | 476 | 9.146341 | 0.463415 | 0.128 | 0.224 | 0.256 | 0.24 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.113445 | 476 | 17 | 104 | 28 | 0.888626 | 0 | 0 | 0 | 0 | 0 | 0.198312 | 0.046414 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
5ce6e7f10ed2be9aeba3aa1ec5ecdd541d7e46bc | 237 | py | Python | exercicios-treino/exercicio04-06.py | GabrielGustavoMS/programacaoDeComputadores | 4eb3735b2393f241da78e2b259fde30ff2566a4c | [
"MIT"
] | null | null | null | exercicios-treino/exercicio04-06.py | GabrielGustavoMS/programacaoDeComputadores | 4eb3735b2393f241da78e2b259fde30ff2566a4c | [
"MIT"
] | null | null | null | exercicios-treino/exercicio04-06.py | GabrielGustavoMS/programacaoDeComputadores | 4eb3735b2393f241da78e2b259fde30ff2566a4c | [
"MIT"
] | null | null | null | a = int(input('Digite o 1º número: '))
b = int(input('Digite o 2º número: '))
c = int(input('Digite o 3º número: '))
if a>b and a>c:
m = a
elif b>c:
m = b
elif c>b:
m = c
else:
m =a
print(m)
| 13.166667 | 39 | 0.468354 | 44 | 237 | 2.522727 | 0.386364 | 0.216216 | 0.378378 | 0.405405 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020134 | 0.371308 | 237 | 17 | 40 | 13.941176 | 0.724832 | 0 | 0 | 0.166667 | 0 | 0 | 0.272727 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.083333 | 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 |
7a2a3d1c533ef660ff8a479c8a6023ea04caad0e | 1,123 | py | Python | oscar/lib/python2.7/site-packages/treebeard/tests/conftest.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/treebeard/tests/conftest.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/treebeard/tests/conftest.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | """
Py.test configuration file
Maik says: There's some magic in here that I don't fully understand. Normally, one would
use pytest-django to run the tests, which takes care of all the Django-related testcase
set up and tear down. But that doesn't work because the current tests attempt to access the
database not just in tests, but in their set up methods, which trips up the
"can't access database without mark.django_db" no matter if tests are marked as being
allowed to access the database or not.
So instead, we run the tests without pytest-django and make it work ourselves.
"""
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'treebeard.tests.settings'
import django
from django.test.utils import setup_test_environment, teardown_test_environment
from django.db import connection
def pytest_report_header(config):
return 'Django: ' + django.get_version()
def pytest_configure(config):
django.setup()
setup_test_environment()
connection.creation.create_test_db(verbosity=2, autoclobber=True)
def pytest_unconfigure(config):
teardown_test_environment()
| 32.085714 | 92 | 0.762244 | 170 | 1,123 | 4.929412 | 0.582353 | 0.071599 | 0.026253 | 0.045346 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001079 | 0.174533 | 1,123 | 34 | 93 | 33.029412 | 0.902913 | 0.513802 | 0 | 0 | 0 | 0 | 0.107143 | 0.09127 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0 | 0.307692 | 0.076923 | 0.615385 | 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 |
7a44a3f1a4f86d1af9647d85cf1846e258e50ee5 | 773 | py | Python | forty/configuration.py | vikian050194/forty | 7ef68fb06bb22a3008351c5a651eaa46b635d433 | [
"MIT"
] | null | null | null | forty/configuration.py | vikian050194/forty | 7ef68fb06bb22a3008351c5a651eaa46b635d433 | [
"MIT"
] | 7 | 2021-03-15T17:18:36.000Z | 2021-04-26T09:40:53.000Z | forty/configuration.py | vikian050194/forty | 7ef68fb06bb22a3008351c5a651eaa46b635d433 | [
"MIT"
] | null | null | null | import enum
@enum.unique
class OutputFlagValues(str, enum.Enum):
HUMAN = "human"
PLAIN = "plain"
JSON = "json"
class Flag():
def __init__(self, short_name: str, full_name: str, values: enum.Enum):
self.__values__ = values
self.__short_name__ = short_name
self.__full_name__ = full_name
@property
def short_name(self):
return self.__short_name__
@property
def full_name(self):
return self.__full_name__
class Configuration():
def __init__(self, home: str, output: str):
self._home = home
self._output = output if output else OutputFlagValues.HUMAN
@property
def home(self):
return self._home
@property
def output(self):
return self._output
| 20.342105 | 75 | 0.64295 | 94 | 773 | 4.840426 | 0.255319 | 0.098901 | 0.123077 | 0.079121 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.266494 | 773 | 37 | 76 | 20.891892 | 0.802469 | 0 | 0 | 0.148148 | 0 | 0 | 0.018111 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.037037 | 0.148148 | 0.62963 | 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 |
7a45ffba65751da78a5eed9caea07d2d91514b0f | 863 | py | Python | setup.py | echeipesh/wri-list-tools | 0dbdd9d07390618da600f3c796aec7e4d8801786 | [
"MIT"
] | 1 | 2022-02-01T04:28:28.000Z | 2022-02-01T04:28:28.000Z | setup.py | wri/wri-list-tools | 402082125374c9ade3d7be41acd099dbb054632f | [
"MIT"
] | null | null | null | setup.py | wri/wri-list-tools | 402082125374c9ade3d7be41acd099dbb054632f | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
setup(
name="wri-list-tools",
version="0.1.0",
description="Python library for working with GFW input and output TSV files",
author="Eugene Cheipesh",
author_email="echeipesh@gmail.com",
url="https://github.com/wri/wri-list-tools",
license="Apache Software License 2.0",
packages=find_packages(),
install_requires=["geopandas>=0.9.0", "pandas>=1.2.4"],
extras_require={},
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
) | 35.958333 | 81 | 0.628042 | 100 | 863 | 5.37 | 0.64 | 0.141527 | 0.18622 | 0.193669 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.028316 | 0.22248 | 863 | 24 | 82 | 35.958333 | 0.771982 | 0 | 0 | 0 | 0 | 0 | 0.569444 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.043478 | 0 | 0.043478 | 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 |
7a5098604f184afd432c966e1ba271868322108c | 209 | py | Python | vk_iframe/urls.py | smant/django-vkontakte-iframe | 9eafc06c2454754714958d6cf7d116c3eb3dfcaa | [
"MIT"
] | null | null | null | vk_iframe/urls.py | smant/django-vkontakte-iframe | 9eafc06c2454754714958d6cf7d116c3eb3dfcaa | [
"MIT"
] | null | null | null | vk_iframe/urls.py | smant/django-vkontakte-iframe | 9eafc06c2454754714958d6cf7d116c3eb3dfcaa | [
"MIT"
] | 2 | 2017-08-17T12:39:40.000Z | 2021-08-13T01:40:33.000Z | #coding: utf-8
from django.conf.urls.defaults import *
urlpatterns = patterns('vk_iframe.views',
# url('^load-countries$', 'load_countries'),
# url('^load-cities/(?P<country_id>\d+)$', 'load_cities'),
)
| 23.222222 | 60 | 0.674641 | 28 | 209 | 4.892857 | 0.785714 | 0.10219 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005348 | 0.105263 | 209 | 8 | 61 | 26.125 | 0.727273 | 0.559809 | 0 | 0 | 0 | 0 | 0.170455 | 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 |
7a5a2ccd6079060ced7eecf7bcc7597cbce96e42 | 7,369 | py | Python | yolox/utils/visualize_pose.py | TexasInstruments/YOLOX | 493f64b9c0a8595ba79bdda2c076c4a67ce81073 | [
"BSD-3-Clause"
] | 3 | 2022-01-26T13:26:03.000Z | 2022-03-14T09:02:02.000Z | yolox/utils/visualize_pose.py | TexasInstruments/YOLOX | 493f64b9c0a8595ba79bdda2c076c4a67ce81073 | [
"BSD-3-Clause"
] | null | null | null | yolox/utils/visualize_pose.py | TexasInstruments/YOLOX | 493f64b9c0a8595ba79bdda2c076c4a67ce81073 | [
"BSD-3-Clause"
] | 1 | 2022-01-20T05:19:36.000Z | 2022-01-20T05:19:36.000Z | import cv2
import numpy as np
from torch import is_tensor
#Based on code from https://github.com/ybkscht/EfficientPose/blob/main/utils/visualization.py
class_to_cuboid = [
np.array([[-37.9343, -38.7996, 45.8845], [-37.9343, 38.7996, 45.8845], [37.9343, 38.7996, 45.8845], [37.9343, -38.7996, 45.8845],
[-37.9343, -38.7996, -45.8845], [-37.9343, 38.7996, -45.8845], [37.9343, 38.7996, -45.8845], [37.9343, -38.7996, -45.8845]]),
np.array([[-107.835, -60.9279, 109.705], [-107.835, 60.9279, 109.705], [107.835, 60.9279, 109.705], [107.835, -60.9279, 109.705],
[-107.835, -60.9279, -109.705], [-107.835, 60.9279, -109.705], [107.835, 60.9279, -109.705], [107.835, -60.9279, -109.705]]),
np.array([[-83.2162, -82.6591, 37.2364], [-83.2162, 82.6591, 37.2364], [83.2162, 82.6591, 37.2364], [83.2162, -82.6591, 37.2364],
[-83.2162, -82.6591, -37.2364], [-83.2162, 82.6591, -37.2364], [83.2162, 82.6591, -37.2364], [83.2162, -82.6591, -37.2364]]),
np.array([[-68.3297, -71.5151, 50.2485], [-68.3297, 71.5151, 50.2485], [68.3297, 71.5151, 50.2485], [68.3297, -71.5151, 50.2485],
[-68.3297, -71.5151, -50.2485], [-68.3297, 71.5151, -50.2485], [68.3297, 71.5151, -50.2485], [68.3297, -71.5151, -50.2485]]),
np.array([[-50.3958, -90.8979, 96.867], [-50.3958, 90.8979, 96.867], [50.3958, 90.8979, 96.867], [50.3958, -90.8979, 96.867],
[-50.3958, -90.8979, -96.867], [-50.3958, 90.8979, -96.867], [50.3958, 90.8979, -96.867], [50.3958, -90.8979, -96.867]]),
np.array([[-33.5054, -63.8165, 58.7283], [-33.5054, 63.8165, 58.7283], [33.5054, 63.8165, 58.7283], [33.5054, -63.8165, 58.7283],
[-33.5054, -63.8165, -58.7283], [-33.5054, 63.8165, -58.7283], [33.5054, 63.8165, -58.7283], [33.5054, -63.8165, -58.7283]]),
np.array([[-58.7899, -45.7556, 47.3112], [-58.7899, 45.7556, 47.3112], [58.7899, 45.7556, 47.3112], [58.7899, -45.7556, 47.3112],
[-58.7899, -45.7556, -47.3112], [-58.7899, 45.7556, -47.3112], [58.7899, 45.7556, -47.3112], [58.7899, -45.7556, -47.3112]]),
np.array([[-114.738, -37.7357, 104.001], [-114.738, 37.7357, 104.001], [114.738, 37.7357, 104.001], [114.738, -37.7357, 104.001],
[-114.738, -37.7357, -104.001], [-114.738, 37.7357, -104.001], [114.738, 37.7357, -104.001], [114.738, -37.7357, -104.001]]),
np.array([[-52.2146, -38.7038, 42.8485], [-52.2146, 38.7038, 42.8485], [52.2146, 38.7038, 42.8485], [52.2146, -38.7038, 42.8485],
[-52.2146, -38.7038, -42.8485], [-52.2146, 38.7038, -42.8485], [52.2146, 38.7038, -42.8485], [52.2146, -38.7038, -42.8485]]),
np.array([[-75.0923, -53.5375, 34.6207], [-75.0923, 53.5375, 34.6207], [75.0923, 53.5375, 34.6207], [75.0923, -53.5375, 34.6207],
[-75.0923, -53.5375, -34.6207], [-75.0923, 53.5375, -34.6207], [75.0923, 53.5375, -34.6207], [75.0923, -53.5375, -34.6207]]),
np.array([[-18.3605, -38.933, 86.4079], [-18.3605, 38.933, 86.4079], [18.3605, 38.933, 86.4079], [18.3605, -38.933, 86.4079],
[-18.3605, -38.933, -86.4079], [-18.3605, 38.933, -86.4079], [18.3605, 38.933, -86.4079], [18.3605, -38.933, -86.4079]]),
np.array([[-50.4439, -54.2485, 45.4], [-50.4439, 54.2485, 45.4], [50.4439, 54.2485, 45.4], [50.4439, -54.2485, 45.4],
[-50.4439, -54.2485, -45.4], [-50.4439, 54.2485, -45.4], [50.4439, 54.2485, -45.4], [50.4439, -54.2485, -45.4]]),
np.array([[-129.113, -59.241, 70.5662], [-129.113, 59.241, 70.5662], [129.113, 59.241, 70.5662], [129.113, -59.241, 70.5662],
[-129.113, -59.241, -70.5662], [-129.113, 59.241, -70.5662], [129.113, 59.241, -70.5662], [129.113, -59.241, -70.5662]]),
np.array([[-101.573, -58.8763, 106.558], [-101.573, 58.8763, 106.558], [101.573, 58.8763, 106.558], [101.573, -58.8763, 106.558],
[-101.573, -58.8763, -106.558], [-101.573, 58.8763, -106.558], [101.573, 58.8763, -106.558], [101.573, -58.8763, -106.558]]),
np.array([[-46.9591, -73.7167, 92.3737], [-46.9591, 73.7167, 92.3737], [46.9591, 73.7167, 92.3737], [46.9591, -73.7167, 92.3737],
[-46.9591, -73.7167, -92.3737], [-46.9591, 73.7167, -92.3737], [46.9591, 73.7167, -92.3737], [46.9591, -73.7167, -92.3737]])
]
camera_matrix = np.array([572.4114, 0.0, 325.2611, 0.0, 573.57043, 242.04899, 0.0, 0.0, 1.0])
colours = [(255, 0, 0), (0, 0, 255), (255, 255, 0), (255, 0, 255), (0, 255, 255), (0, 125, 255),
(0, 255, 125), (125, 0, 255), (255, 0, 125), (125, 255, 0), (255, 125, 0), (125, 255, 255), (255, 125, 255),
(255, 255, 125), (255, 255, 255)]
def draw_cuboid_2d(img, cuboid_corners, colour = (0, 255, 0), thickness = 2):
box = np.copy(cuboid_corners).astype(np.int32)
#upper level
cv2.line(img, box[0], box[1], colour, thickness)
cv2.line(img, box[1], box[2], colour, thickness)
cv2.line(img, box[2], box[3], colour, thickness)
cv2.line(img, box[0], box[3], colour, thickness)
#lower level
cv2.line(img, box[4], box[5], colour, thickness)
cv2.line(img, box[5], box[6], colour, thickness)
cv2.line(img, box[6], box[7], colour, thickness)
cv2.line(img, box[4], box[7], colour, thickness)
#sides
cv2.line(img, box[0], box[4], colour, thickness)
cv2.line(img, box[1], box[5], colour, thickness)
cv2.line(img, box[2], box[6], colour, thickness)
cv2.line(img, box[3], box[7], colour, thickness)
def project_cuboid(cuboid_corners, rotation_vec, translation_vec, camera_matrix):
cuboid_corners_2d, _ = cv2.projectPoints(
objectPoints=cuboid_corners,
rvec=rotation_vec,
tvec=translation_vec,
cameraMatrix=camera_matrix.reshape((3,3)),
distCoeffs=None
)
cuboid_corners_2d = np.squeeze(cuboid_corners_2d)
return cuboid_corners_2d
def draw_predictions(img, predictions, num_classes, class_to_cuboid=class_to_cuboid, camera_matrix=camera_matrix, colours=colours, conf = 0.5):
if is_tensor(predictions):
predictions = predictions.cpu()
predictions = predictions.numpy()
for prediction in predictions:
if prediction[4]*prediction[-2] < conf:
continue
obj_class = int(prediction[-1])
colour = colours[obj_class]
rotation_vec = prediction[5:8].astype(np.float64)
translation_vec = prediction[8:11].astype(np.float64)
cuboid_corners_2d = project_cuboid(
cuboid_corners=class_to_cuboid[obj_class],
rotation_vec=rotation_vec,
translation_vec=translation_vec,
camera_matrix=camera_matrix
)
draw_cuboid_2d(
img=img,
cuboid_corners=cuboid_corners_2d,
colour=colour
)
def draw_ground_truths(img, ground_truths, class_to_cuboid=class_to_cuboid, camera_matrix=camera_matrix, colour=(0, 255, 0)):
if is_tensor(ground_truths):
ground_truths = ground_truths.numpy()
for ground_truth in ground_truths:
for obj in ground_truth:
obj_class = obj[4] - 1
rotation_vec = obj[5:8]
translation_vec = obj[8:11]
colour = colour
cuboid_corners_2d = project_cuboid(
cuboid_corners=class_to_cuboid[int(obj_class)],
rotation_vec=rotation_vec,
translation_vec=translation_vec,
camera_matrix=camera_matrix
)
draw_cuboid_2d(
img=img,
cuboid_corners=cuboid_corners_2d,
colour=colour
) | 59.427419 | 143 | 0.598182 | 1,225 | 7,369 | 3.521633 | 0.140408 | 0.025962 | 0.027816 | 0.036161 | 0.710478 | 0.688456 | 0.662494 | 0.662494 | 0.602689 | 0.602689 | 0 | 0.38732 | 0.178043 | 7,369 | 124 | 144 | 59.427419 | 0.324913 | 0.016149 | 0 | 0.161905 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.038095 | false | 0 | 0.028571 | 0 | 0.07619 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7a64a7b3922b3b97982f1a7f88883c044412eed1 | 1,439 | py | Python | pythia/pyre/db/Table.py | willic3/pythia | 2657b95a0c07fd3c914ab6b5f7ec89a8edba004c | [
"BSD-3-Clause"
] | 1 | 2015-11-30T08:01:39.000Z | 2015-11-30T08:01:39.000Z | pythia/pyre/db/Table.py | willic3/pythia | 2657b95a0c07fd3c914ab6b5f7ec89a8edba004c | [
"BSD-3-Clause"
] | 27 | 2018-05-24T18:31:25.000Z | 2021-10-16T03:57:52.000Z | pythia/pyre/db/Table.py | willic3/pythia | 2657b95a0c07fd3c914ab6b5f7ec89a8edba004c | [
"BSD-3-Clause"
] | 7 | 2019-07-19T02:30:56.000Z | 2021-06-02T22:00:01.000Z | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2005 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
from pythia.pyre.parsing.locators.Traceable import Traceable
from .Schemer import Schemer
class Table(Traceable, metaclass=Schemer):
def getValues(self):
return [self._priv_columns.get(name) for name in self._columnRegistry]
def getWriteableValues(self):
return [self._priv_columns.get(name) for name in self._writeable]
def getColumnNames(self):
return list(self._columnRegistry.keys())
def getWriteableColumnNames(self):
return self._writeable
def __init__(self):
Traceable.__init__(self)
# local storage for the descriptors created by the various traits
self._priv_columns = {}
return
# the low level interface
def _getColumnValue(self, name):
return self._priv_columns[name]
def _setColumnValue(self, name, value):
self._priv_columns[name] = value
return value
# column registries
_writeable = []
_columnRegistry = {}
# version
__id__ = "$Id: Table.py,v 1.4 2005/04/07 22:16:36 aivazis Exp $"
# End of file
| 23.983333 | 80 | 0.56984 | 146 | 1,439 | 5.410959 | 0.534247 | 0.050633 | 0.094937 | 0.079747 | 0.113924 | 0.113924 | 0.113924 | 0.113924 | 0.113924 | 0.113924 | 0 | 0.021978 | 0.24114 | 1,439 | 59 | 81 | 24.389831 | 0.701465 | 0.33287 | 0 | 0 | 0 | 0.043478 | 0.056204 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.304348 | false | 0 | 0.086957 | 0.217391 | 0.826087 | 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 |
7a6e6243b50e803026f94fe288c0ef11e85f2414 | 107 | py | Python | test/test23.py | zhouyuanmin/MyDemo | 664977a6243992c77931e58b98f5262745759d1a | [
"MIT"
] | null | null | null | test/test23.py | zhouyuanmin/MyDemo | 664977a6243992c77931e58b98f5262745759d1a | [
"MIT"
] | null | null | null | test/test23.py | zhouyuanmin/MyDemo | 664977a6243992c77931e58b98f5262745759d1a | [
"MIT"
] | null | null | null | """23. 写一个程序,键盘输入一个十进制数,将十进制数转换为二进制数,输出到控制台。"""
num = int(input("输入一个十进制数:"))
print("这个数的二进制是" + bin(num))
| 26.75 | 47 | 0.682243 | 13 | 107 | 5.615385 | 0.923077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020202 | 0.074766 | 107 | 3 | 48 | 35.666667 | 0.717172 | 0.383178 | 0 | 0 | 0 | 0 | 0.283333 | 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 |
7aa66ed0e6c23c794a1730b2d572bc5cf31271cd | 271 | py | Python | racks/gunicorn_config.py | 5lunk/racks | 32d46c7e9b46ad0fd65e72e9d597466fa88ec1fe | [
"CC0-1.0"
] | null | null | null | racks/gunicorn_config.py | 5lunk/racks | 32d46c7e9b46ad0fd65e72e9d597466fa88ec1fe | [
"CC0-1.0"
] | 4 | 2022-02-14T13:13:29.000Z | 2022-03-10T05:31:06.000Z | racks/gunicorn_config.py | 5lunk/Racks | 32d46c7e9b46ad0fd65e72e9d597466fa88ec1fe | [
"CC0-1.0"
] | null | null | null | command = '/home/slunk/code/racks_project/env/bin/gunicorn'
pythonpath = '/home/slunk/code/racks_project/racks'
bind = '127.0.0.1:8001'
workers = 5
user = 'slunk'
limit_request_fields = 32000
limit_request_field_size = 0
raw_enw = 'DJANGO_SETTINGS_MODULE=racks.settings'
| 30.111111 | 59 | 0.778598 | 42 | 271 | 4.785714 | 0.690476 | 0.089552 | 0.129353 | 0.179104 | 0.248756 | 0 | 0 | 0 | 0 | 0 | 0 | 0.068826 | 0.088561 | 271 | 8 | 60 | 33.875 | 0.744939 | 0 | 0 | 0 | 0 | 0 | 0.512915 | 0.442804 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8f8a78356bad72adec81b90fbbdfeb8818213c3e | 436 | py | Python | cpab/cpa1d/calcs/_default_params_flow_int.py | freifeld/cpabDiffeo | 22df6cdbd7111b9ae3e7f1c0e31ff85e92d281a6 | [
"MIT"
] | 17 | 2016-03-16T21:35:36.000Z | 2021-11-11T04:16:21.000Z | cpab/cpa1d/calcs/_default_params_flow_int.py | freifeld/cpabDiffeo | 22df6cdbd7111b9ae3e7f1c0e31ff85e92d281a6 | [
"MIT"
] | null | null | null | cpab/cpa1d/calcs/_default_params_flow_int.py | freifeld/cpabDiffeo | 22df6cdbd7111b9ae3e7f1c0e31ff85e92d281a6 | [
"MIT"
] | 4 | 2016-08-12T23:02:09.000Z | 2019-03-14T18:20:36.000Z | #!/usr/bin/env python
"""
Created on Sat Feb 15 10:20:58 2014
Author: Oren Freifeld
Email: freifeld@csail.mit.edu
"""
import copy
from of.utils import Bunch
_params_flow_int = Bunch()
_params_flow_int.dt = 0.01
_params_flow_int.nTimeSteps=1.0 / _params_flow_int.dt
_params_flow_int.nStepsODEsolver = 10
def get_params_flow_int():
return copy.deepcopy(_params_flow_int)
if __name__ == "__main__":
print get_params_flow_int() | 21.8 | 54 | 0.768349 | 72 | 436 | 4.208333 | 0.597222 | 0.264026 | 0.343234 | 0.118812 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 0.12844 | 436 | 20 | 55 | 21.8 | 0.747368 | 0.045872 | 0 | 0 | 0 | 0 | 0.025 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.2 | null | null | 0.1 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8fa11da9d03aedbed462b0960f7d62e6cf9e6309 | 599 | py | Python | diagrams/k8s/controlplane.py | bry-c/diagrams | 4c377a073e0aa8fe41934195da7a0869f31c58eb | [
"MIT"
] | 17,037 | 2020-02-03T01:30:30.000Z | 2022-03-31T18:09:15.000Z | diagrams/k8s/controlplane.py | bry-c/diagrams | 4c377a073e0aa8fe41934195da7a0869f31c58eb | [
"MIT"
] | 529 | 2020-02-03T10:43:41.000Z | 2022-03-31T17:33:08.000Z | diagrams/k8s/controlplane.py | bry-c/diagrams | 4c377a073e0aa8fe41934195da7a0869f31c58eb | [
"MIT"
] | 1,068 | 2020-02-05T11:54:29.000Z | 2022-03-30T23:28:55.000Z | # This module is automatically generated by autogen.sh. DO NOT EDIT.
from . import _K8S
class _Controlplane(_K8S):
_type = "controlplane"
_icon_dir = "resources/k8s/controlplane"
class API(_Controlplane):
_icon = "api.png"
class CCM(_Controlplane):
_icon = "c-c-m.png"
class CM(_Controlplane):
_icon = "c-m.png"
class KProxy(_Controlplane):
_icon = "k-proxy.png"
class Kubelet(_Controlplane):
_icon = "kubelet.png"
class Sched(_Controlplane):
_icon = "sched.png"
# Aliases
APIServer = API
ControllerManager = CM
KubeProxy = KProxy
Scheduler = Sched
| 14.609756 | 68 | 0.692821 | 73 | 599 | 5.438356 | 0.493151 | 0.282116 | 0.085642 | 0.050378 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006224 | 0.195326 | 599 | 40 | 69 | 14.975 | 0.817427 | 0.123539 | 0 | 0 | 1 | 0 | 0.176245 | 0.049808 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.05 | 0 | 0.8 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
8fc9a3e560536049580d9e14dbafd1fc74350229 | 1,779 | py | Python | menu/lambda_function.py | WagJK/alexa-uiuc-main | c83f8ceb06194f851ca8310f011ad985aa785726 | [
"MIT"
] | 2 | 2020-10-08T15:15:56.000Z | 2020-12-02T04:02:25.000Z | menu/lambda_function.py | WagJK/alexa-uiuc-main | c83f8ceb06194f851ca8310f011ad985aa785726 | [
"MIT"
] | null | null | null | menu/lambda_function.py | WagJK/alexa-uiuc-main | c83f8ceb06194f851ca8310f011ad985aa785726 | [
"MIT"
] | 2 | 2018-07-18T18:01:17.000Z | 2018-07-20T19:47:32.000Z | import menu
import logging
from flask import Flask, render_template
from flask_ask import Ask, statement, question, session, request
app = Flask(__name__)
ask = Ask(app, '/')
logging.getLogger("flask_ask").setLevel(logging.DEBUG)
def lambda_handler(event, _context):
return ask.run_aws_lambda(event)
@ask.launch
def welcome():
session.attributes['filter'] = {}
return question(render_template('welcome')) \
.reprompt(render_template("reprompt"))
@ask.intent("AMAZON.HelpIntent")
def help():
return question(render_template('help'))
@ask.intent("AMAZON.FallbackIntent")
def fallback():
return question(render_template('error-not-understand'))
@ask.intent('AMAZON.CancelIntent')
@ask.intent("AMAZON.StopIntent")
def stop():
return statement(render_template('goodbye'))
@ask.intent("DetailIntent")
def detail():
return menu.detail() \
.reprompt(render_template("reprompt"))
@ask.intent('FilterIntent')
def add_filter(filter_name):
return menu.add_filter(filter_name) \
.reprompt(render_template("reprompt"))
@ask.intent("AskMainIntent", mapping={'hall_name': 'hall'})
def ask_main(hall_name, meal, date):
return menu.ask_main(hall_name, meal, date) \
.reprompt(render_template("reprompt"))
@ask.intent("InteractiveIntent")
def interactive():
return menu.interactive()
@ask.intent("AnswerHallIntent", mapping={'hall_name': 'hall'})
def answer_hall(hall_name):
return menu.answer_hall(hall_name)
@ask.intent("AnswerMealIntent", mapping={'meal': 'meal'})
def answer_meal(meal):
return menu.answer_meal(meal)
@ask.intent("AnswerDateIntent", mapping={'date': 'date'})
def answer_date(date):
return menu.answer_date(date)
if __name__ == '__main__':
app.run(debug=True) | 22.807692 | 64 | 0.716133 | 217 | 1,779 | 5.663594 | 0.281106 | 0.080553 | 0.071603 | 0.09764 | 0.200163 | 0.164361 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130972 | 1,779 | 78 | 65 | 22.807692 | 0.794955 | 0 | 0 | 0.08 | 0 | 0 | 0.175281 | 0.011798 | 0 | 0 | 0 | 0 | 0 | 1 | 0.24 | false | 0 | 0.08 | 0.22 | 0.56 | 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 |
8fdee2985f44d6bf67a3d68390d0ffa9e4c35e38 | 355 | py | Python | main/models.py | piratos/longtweet | f5d2376c00b9e495d257fa44a795000ee92a6555 | [
"MIT"
] | null | null | null | main/models.py | piratos/longtweet | f5d2376c00b9e495d257fa44a795000ee92a6555 | [
"MIT"
] | null | null | null | main/models.py | piratos/longtweet | f5d2376c00b9e495d257fa44a795000ee92a6555 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.db import models
class Tweet(models.Model):
content = models.TextField(blank=True)
name = models.CharField(max_length=225)
url = models.CharField(max_length=225, null=True)
created = models.DateTimeField(auto_now_add=True)
def __unicode__(self):
return "tweet created at "+str(self.created)
| 23.666667 | 50 | 0.780282 | 50 | 355 | 5.28 | 0.64 | 0.113636 | 0.136364 | 0.181818 | 0.204545 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019169 | 0.11831 | 355 | 14 | 51 | 25.357143 | 0.824281 | 0 | 0 | 0 | 0 | 0 | 0.047887 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.222222 | 0.111111 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
890d62a538a59b1a7a5533532dba4af7c9e0ad7f | 162 | py | Python | home_application/models.py | wangzishuo111/bk_test | e3c70444500bf25ee50627b8fd3ae75f331039be | [
"MIT"
] | null | null | null | home_application/models.py | wangzishuo111/bk_test | e3c70444500bf25ee50627b8fd3ae75f331039be | [
"MIT"
] | 2 | 2021-02-08T20:50:31.000Z | 2021-06-10T23:01:54.000Z | home_application/models.py | wangzishuo111/bk_test | e3c70444500bf25ee50627b8fd3ae75f331039be | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.db import models
class IndexModel(models.Model):
name = models.TextField(max_length=500)
year = models.DateField()
| 18 | 43 | 0.685185 | 21 | 162 | 5.238095 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.029851 | 0.17284 | 162 | 8 | 44 | 20.25 | 0.791045 | 0.12963 | 0 | 0 | 0 | 0 | 0 | 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 |
891636370abe5fd9fbd1a63ac4c58d264f7fbe41 | 1,713 | py | Python | param_utils.py | taivanbat/gpu-hparam-search-scheduler | 9746820d80c5dbc1b147483f40cf1b45e6c6b7de | [
"MIT"
] | 1 | 2020-06-13T20:27:41.000Z | 2020-06-13T20:27:41.000Z | param_utils.py | taivanbat/gpu-hparam-search-scheduler | 9746820d80c5dbc1b147483f40cf1b45e6c6b7de | [
"MIT"
] | 1 | 2022-01-13T02:51:05.000Z | 2022-01-13T02:51:05.000Z | param_utils.py | tbadamdorj/simple-gpu-scheduler | 9746820d80c5dbc1b147483f40cf1b45e6c6b7de | [
"MIT"
] | null | null | null | def process_flags(all_flags):
"""
Argument:
Return:
list of
"""
fixed_map = {'fixed': True, 'param': False}
flags = [Flags(name, fixed_map[flag_type]) for name, flag_type in all_flags.items()]
return flags
def process_hparams(all_hparams):
"""
Argument:
Return:
"""
hparams = [Hparams(name, values) for name, values in all_hparams.items()]
return hparams
class Hparams:
def __init__(self, hparam_name, values):
self.hparam_name = hparam_name
self.raw_values = values
self.values = [Hparam(hparam_name, value) for value in values]
def __repr__(self):
return f'{self.hparam_name}: {[value for value in self.raw_values]}'
class Hparam:
def __init__(self, hparam_name, value):
self.hparam_name = hparam_name
self.value = value
def get_command(self):
return f'--{self.hparam_name} {self.value}'
def __repr__(self):
return f'{self.hparam_name}: {self.value}'
class Flags:
def __init__(self, flag_name, fixed):
self.flag_name = flag_name
self.fixed = fixed
if fixed:
self.values = [Flag(flag_name, True)]
else:
self.values = [Flag(flag_name, True), Flag(flag_name, False)]
def __repr__(self):
return f'{self.flag_name}: {"fixed" if self.fixed else "param"}'
class Flag:
def __init__(self, flag_name, present):
self.flag_name = flag_name
self.present = present
def get_command(self):
if self.present:
return f'--{self.flag_name}'
else:
return ''
def __repr__(self):
return f'{self.flag_name}: {self.present}'
| 23.465753 | 88 | 0.610041 | 220 | 1,713 | 4.440909 | 0.154545 | 0.09826 | 0.100307 | 0.076766 | 0.472876 | 0.371546 | 0.170931 | 0.170931 | 0 | 0 | 0 | 0 | 0.271454 | 1,713 | 72 | 89 | 23.791667 | 0.782853 | 0.027437 | 0 | 0.27907 | 0 | 0 | 0.146026 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.27907 | false | 0 | 0 | 0.116279 | 0.581395 | 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 |
8f07df9b7d3dbc7df01ae4e6eecae9f7f924966a | 252 | py | Python | src/saleor_app/errors.py | mstrumeck/saleor-app-framework-python | edaae7c35d5e4e80e98c50795c3a63d906998834 | [
"BSD-3-Clause"
] | null | null | null | src/saleor_app/errors.py | mstrumeck/saleor-app-framework-python | edaae7c35d5e4e80e98c50795c3a63d906998834 | [
"BSD-3-Clause"
] | null | null | null | src/saleor_app/errors.py | mstrumeck/saleor-app-framework-python | edaae7c35d5e4e80e98c50795c3a63d906998834 | [
"BSD-3-Clause"
] | null | null | null | class SaleorAppError(Exception):
"""Generic Saleor App Error, all framework errros inherit from this"""
class InstallAppError(SaleorAppError):
"""Install App error"""
class ConfigurationError(SaleorAppError):
"""App is misconfigured"""
| 22.909091 | 74 | 0.738095 | 25 | 252 | 7.44 | 0.72 | 0.086022 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.150794 | 252 | 10 | 75 | 25.2 | 0.869159 | 0.40873 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
8f0b5d4d1dc678cd48c873908e361a55f3ac2e17 | 1,199 | py | Python | mgsolver/sudoku/solver.py | romanstrazanec/mgsolver | 47682114ba20bb5280bd458e9a6c431082394bc8 | [
"MIT"
] | null | null | null | mgsolver/sudoku/solver.py | romanstrazanec/mgsolver | 47682114ba20bb5280bd458e9a6c431082394bc8 | [
"MIT"
] | 3 | 2020-04-01T16:18:03.000Z | 2020-04-02T13:19:06.000Z | mgsolver/sudoku/solver.py | romanstrazanec/mgsolver | 47682114ba20bb5280bd458e9a6c431082394bc8 | [
"MIT"
] | null | null | null | from typing import List, Iterable
class Sudoku:
def __init__(self, grid: List[List[int]]):
self.grid = [row[:] for row in grid]
def row(self, y: int) -> List[int]:
return self.grid[y]
def col(self, x: int) -> Iterable[int]:
return (self.grid[i][x] for i in range(9))
@staticmethod
def __in(n: int, i: int) -> bool:
div = (i // 3) * 3
return div < n < div + 3
def square(self, x: int, y: int) -> Iterable[int]:
return (self.grid[j][i] for j in range(9) for i in range(9) if self.__in(j, y) and self.__in(i, x))
def possible(self, y: int, x: int, n: int) -> bool:
return n not in self.row(y) and n not in self.col(x) and n not in self.square(x, y)
def solve(self) -> bool:
for y in range(9):
for x in range(9):
if self.grid[y][x] == 0:
for n in range(1, 10):
if self.possible(y, x, n):
self.grid[y][x] = n
if self.solve():
return True
self.grid[y][x] = 0
return False
return True
| 31.552632 | 107 | 0.47206 | 183 | 1,199 | 3.038251 | 0.213115 | 0.115108 | 0.071942 | 0.091727 | 0.258993 | 0.100719 | 0 | 0 | 0 | 0 | 0 | 0.017857 | 0.392827 | 1,199 | 37 | 108 | 32.405405 | 0.745879 | 0 | 0 | 0.071429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.035714 | 0.142857 | 0.607143 | 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 |
8f3e7d01204b938feb0d3e27fb33c0c6b0eec859 | 786 | py | Python | layers/output_layer.py | SatvikVejendla/Actor-Critic-Cartpole | bdb9dac585dc7bb12b4d56de835349ae53ad47d2 | [
"MIT"
] | null | null | null | layers/output_layer.py | SatvikVejendla/Actor-Critic-Cartpole | bdb9dac585dc7bb12b4d56de835349ae53ad47d2 | [
"MIT"
] | null | null | null | layers/output_layer.py | SatvikVejendla/Actor-Critic-Cartpole | bdb9dac585dc7bb12b4d56de835349ae53ad47d2 | [
"MIT"
] | null | null | null | from .layer import Layer
from abc import abstractmethod
from memory import Memory
class OutputLayer(Layer):
def __init__(self, type, nodes, activation=None, parent=None):
super().__init__(type, nodes, activation, parent)
self.layer_losses = Memory()
self.values_history = Memory()
def add_history(self, val):
self.values_history.add(val)
def get_history(self):
return self.values_history.data
def clear_history(self):
self.values_history.clear()
def add_loss(self, loss):
self.layer_losses.add(loss)
def get_sum_loss(self):
return self.layer_losses.sum()
@abstractmethod
def compute_loss(self):
return
@abstractmethod
def compute_history_score(self):
return | 23.818182 | 66 | 0.673028 | 98 | 786 | 5.153061 | 0.306122 | 0.079208 | 0.134653 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.235369 | 786 | 33 | 67 | 23.818182 | 0.840266 | 0 | 0 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.125 | 0.166667 | 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 |
8f56571823861cd6411ecb9f9b4776f3f9fa1834 | 443 | py | Python | solutions/week-1/ending.py | bekbolsky/stepik-python | 91613178ef8401019fab01ad18f10ee84f2f4491 | [
"MIT"
] | 1 | 2022-02-23T09:05:47.000Z | 2022-02-23T09:05:47.000Z | solutions/week-1/ending.py | bekbolsky/stepik-python | 91613178ef8401019fab01ad18f10ee84f2f4491 | [
"MIT"
] | null | null | null | solutions/week-1/ending.py | bekbolsky/stepik-python | 91613178ef8401019fab01ad18f10ee84f2f4491 | [
"MIT"
] | null | null | null | n = int(input())
if 0 <= n <= 1000:
if n == 0:
print(n, "программистов", sep=" ")
elif n % 100 >= 10 and n % 100 <= 20:
print(n, "программистов", sep=" ")
elif n % 10 == 1:
print(n, "программист", sep=" ")
elif n % 10 >= 2 and n % 10 <= 4:
print(n, "программиста", sep=" ")
else:
print(n, "программистов", sep=" ")
else:
print("Входные данные должны быть в интервале 0≤n≤1000")
| 27.6875 | 60 | 0.501129 | 64 | 443 | 3.5 | 0.421875 | 0.133929 | 0.254464 | 0.294643 | 0.241071 | 0.241071 | 0 | 0 | 0 | 0 | 0 | 0.098039 | 0.309255 | 443 | 15 | 61 | 29.533333 | 0.627451 | 0 | 0 | 0.357143 | 0 | 0 | 0.257336 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.428571 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
8f7cacea7ac963a3081a7a928e84c2ffba0a2210 | 2,419 | py | Python | src/jose/jwa/hmac.py | hdknr/jose | d872407e9f3b3a0262e6bb1cdb599b5c4c1d9ee4 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | src/jose/jwa/hmac.py | hdknr/jose | d872407e9f3b3a0262e6bb1cdb599b5c4c1d9ee4 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2015-01-23T09:37:17.000Z | 2015-01-23T09:37:17.000Z | src/jose/jwa/hmac.py | hdknr/jose | d872407e9f3b3a0262e6bb1cdb599b5c4c1d9ee4 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | from Crypto.Hash import HMAC, SHA256, SHA384, SHA512
class HmacSigner(object):
@classmethod
def digest(cls, jwk, data):
if isinstance(jwk, basestring):
key = jwk
else:
key = jwk.key.shared_key
mac = HMAC.new(key, digestmod=cls._digester)
mac.update(data)
return mac.digest()
@classmethod
def sign(cls, jwk, data):
assert jwk.key is not None and jwk.key.shared_key
return cls.digest(jwk, data)
@classmethod
def verify(cls, jwk, data, signature):
assert jwk.key is not None and jwk.key.shared_key
return cls.digest(jwk, data) == signature
class HS256(HmacSigner):
_digester = SHA256
class HS384(HmacSigner):
_digester = SHA384
class HS512(HmacSigner):
_digester = SHA512
from jose.base import BaseKey
from jose.utils import _BE, _BD
from jose.jwk import Jwk
from Crypto import Random
class Key(BaseKey):
def init_material(self, length=200, **kwargs):
length = length or 200
self.material = Random.get_random_bytes(length)
@property
def length(self):
return len(self.shared_key)
def to_jwk(self, jwk):
jwk.k = _BE(self.material)
def from_jwk(self, jwk):
self.material = _BD(jwk.k)
@property
def public_tuple(self):
if self.material is None:
return ()
return (self.material, )
@property
def private_tuple(self):
return self.public_tuple()
@property
def private_jwk(self):
jwk = Jwk(
kty="oct",
k=_BE(self.material),
)
return jwk
@property
def public_jwk(self):
return None
@property
def private_key(self):
return self.material
@property
def public_key(self):
return self.material
@property
def is_private(self):
return self.material is not None
@property
def is_public(self):
return self.material is not None
@property
def shared_key(self):
return self.material
def thumbprint_fields(self):
return ['k', 'kty', ]
if __name__ == '__main__':
from jose.jwa.keys import KeyTypeEnum
jwk = Jwk.generate(kty=KeyTypeEnum.create('oct'))
assert len(jwk.key.shared_key) == 200
jwk = Jwk.generate(kty=KeyTypeEnum.create('oct'), length=32)
assert len(jwk.key.shared_key) == 32
| 21.40708 | 64 | 0.620918 | 310 | 2,419 | 4.719355 | 0.241935 | 0.090226 | 0.073821 | 0.051265 | 0.310321 | 0.273411 | 0.240602 | 0.140807 | 0.140807 | 0.08339 | 0 | 0.022989 | 0.280695 | 2,419 | 112 | 65 | 21.598214 | 0.817816 | 0 | 0 | 0.246914 | 0 | 0 | 0.008681 | 0 | 0 | 0 | 0 | 0 | 0.049383 | 1 | 0.209877 | false | 0 | 0.074074 | 0.111111 | 0.567901 | 0.012346 | 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 |
56db11c27717c59ca13ce4cfa9c22d5fc4a77a92 | 4,811 | py | Python | pxr/usd/plugin/usdAbc/testenv/testUsdAbcP_OldEncoding.py | DougRogers-DigitalFish/USD | d8a405a1344480f859f025c4f97085143efacb53 | [
"BSD-2-Clause"
] | 3,680 | 2016-07-26T18:28:11.000Z | 2022-03-31T09:55:05.000Z | pxr/usd/plugin/usdAbc/testenv/testUsdAbcP_OldEncoding.py | DougRogers-DigitalFish/USD | d8a405a1344480f859f025c4f97085143efacb53 | [
"BSD-2-Clause"
] | 1,759 | 2016-07-26T19:19:59.000Z | 2022-03-31T21:24:00.000Z | pxr/usd/plugin/usdAbc/testenv/testUsdAbcP_OldEncoding.py | DougRogers-DigitalFish/USD | d8a405a1344480f859f025c4f97085143efacb53 | [
"BSD-2-Clause"
] | 904 | 2016-07-26T18:33:40.000Z | 2022-03-31T09:55:16.000Z | #!/pxrpythonsubst
#
# Copyright 2018 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
from pxr import Usd, UsdGeom, Gf, Vt
import unittest
class TestUsdAbcUvWrite(unittest.TestCase):
def test_ReadOldP(self):
testFile = 'testUsdAbcP_OldEncoding.abc'
stage = Usd.Stage.Open(testFile)
self.assertTrue(stage)
pCylinderShape1 = UsdGeom.Mesh.Get(stage, '/pCylinder1/pCylinderShape1')
self.assertTrue(pCylinderShape1)
P = pCylinderShape1.GetPrim().GetProperty('points').Get(0)
self.assertEqual(len(P), 42)
knownP = Vt.Vec3fArray(42,
(Gf.Vec3f(3.8914246559143066, -4.887899398803711, -1.2644004821777344),
Gf.Vec3f(3.310243606567383, -4.887899398803711, -2.4050326347351074),
Gf.Vec3f(2.4050326347351074, -4.887899398803711, -3.3102433681488037),
Gf.Vec3f(1.2644003629684448, -4.887899398803711, -3.8914241790771484),
Gf.Vec3f(0.0, -4.887899398803711, -4.0916852951049805),
Gf.Vec3f(-1.2644003629684448, -4.887899398803711, -3.8914239406585693),
Gf.Vec3f(-2.405032157897949, -4.887899398803711, -3.3102426528930664),
Gf.Vec3f(-3.3102424144744873, -4.887899398803711, -2.40503191947937),
Gf.Vec3f(-3.891423225402832, -4.887899398803711, -1.2644000053405762),
Gf.Vec3f(-4.091684341430664, -4.887899398803711, 0.0),
Gf.Vec3f(-3.891423225402832, -4.887899398803711, 1.2644000053405762),
Gf.Vec3f(-3.310242176055908, -4.887899398803711, 2.405031681060791),
Gf.Vec3f(-2.405031681060791, -4.887899398803711, 3.310241937637329),
Gf.Vec3f(-1.2644000053405762, -4.887899398803711, 3.891422748565674),
Gf.Vec3f(-1.21941667430292e-07, -4.887899398803711, 4.091683864593506),
Gf.Vec3f(1.2643996477127075, -4.887899398803711, 3.8914225101470947),
Gf.Vec3f(2.405031204223633, -4.887899398803711, 3.31024169921875),
Gf.Vec3f(3.310241460800171, -4.887899398803711, 2.405031442642212),
Gf.Vec3f(3.8914222717285156, -4.887899398803711, 1.264399766921997),
Gf.Vec3f(4.091683387756348, -4.887899398803711, 0.0),
Gf.Vec3f(3.8914246559143066, 4.887899398803711, -1.2644004821777344),
Gf.Vec3f(3.310243606567383, 4.887899398803711, -2.4050326347351074),
Gf.Vec3f(2.4050326347351074, 4.887899398803711, -3.3102433681488037),
Gf.Vec3f(1.2644003629684448, 4.887899398803711, -3.8914241790771484),
Gf.Vec3f(0.0, 4.887899398803711, -4.0916852951049805),
Gf.Vec3f(-1.2644003629684448, 4.887899398803711, -3.8914239406585693),
Gf.Vec3f(-2.405032157897949, 4.887899398803711, -3.3102426528930664),
Gf.Vec3f(-3.3102424144744873, 4.887899398803711, -2.40503191947937),
Gf.Vec3f(-3.891423225402832, 4.887899398803711, -1.2644000053405762),
Gf.Vec3f(-4.091684341430664, 4.887899398803711, 0.0),
Gf.Vec3f(-3.891423225402832, 4.887899398803711, 1.2644000053405762),
Gf.Vec3f(-3.310242176055908, 4.887899398803711, 2.405031681060791),
Gf.Vec3f(-2.405031681060791, 4.887899398803711, 3.310241937637329),
Gf.Vec3f(-1.2644000053405762, 4.887899398803711, 3.891422748565674),
Gf.Vec3f(-1.21941667430292e-07, 4.887899398803711, 4.091683864593506),
Gf.Vec3f(1.2643996477127075, 4.887899398803711, 3.8914225101470947),
Gf.Vec3f(2.405031204223633, 4.887899398803711, 3.31024169921875),
Gf.Vec3f(3.310241460800171, 4.887899398803711, 2.405031442642212),
Gf.Vec3f(3.8914222717285156, 4.887899398803711, 1.264399766921997),
Gf.Vec3f(4.091683387756348, 4.887899398803711, 0.0),
Gf.Vec3f(0.0, -4.887899398803711, 0.0),
Gf.Vec3f(0.0, 4.887899398803711, 0.0))
)
self.assertEqual(P, knownP)
if __name__ == '__main__':
unittest.main()
| 54.670455 | 80 | 0.713365 | 566 | 4,811 | 6.045936 | 0.287986 | 0.085915 | 0.037405 | 0.03156 | 0.658095 | 0.644652 | 0.644652 | 0.644652 | 0.644652 | 0.644652 | 0 | 0.49313 | 0.167948 | 4,811 | 87 | 81 | 55.298851 | 0.361729 | 0.213885 | 0 | 0 | 0 | 0 | 0.01809 | 0.014366 | 0 | 0 | 0 | 0 | 0.068966 | 1 | 0.017241 | false | 0 | 0.034483 | 0 | 0.068966 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
56ed22fed5b3f9c997d7c468023fda93122dd663 | 765 | py | Python | alshamelah_api/apps/event_history/managers.py | devna-dev/durar-backend | 36ea29bafd4cb95098e4057eb71df211dc923008 | [
"MIT"
] | null | null | null | alshamelah_api/apps/event_history/managers.py | devna-dev/durar-backend | 36ea29bafd4cb95098e4057eb71df211dc923008 | [
"MIT"
] | null | null | null | alshamelah_api/apps/event_history/managers.py | devna-dev/durar-backend | 36ea29bafd4cb95098e4057eb71df211dc923008 | [
"MIT"
] | null | null | null | from django.db import models
class SeminarManager(models.Manager):
def get_queryset(self):
return super(SeminarManager, self).get_queryset().filter(
type='seminar')
class DiscussionManager(models.Manager):
def get_queryset(self):
return super(DiscussionManager, self).get_queryset().filter(
type='discussion')
class SeminarRegistrationManager(models.Manager):
def get_queryset(self):
return super(SeminarRegistrationManager, self).get_queryset().filter(
chat_room__type='seminar')
class DiscussionRegistrationManager(models.Manager):
def get_queryset(self):
return super(DiscussionRegistrationManager, self).get_queryset().filter(
chat_room__type='discussion')
| 29.423077 | 80 | 0.71634 | 77 | 765 | 6.935065 | 0.298701 | 0.164794 | 0.11985 | 0.142322 | 0.531835 | 0.438202 | 0.438202 | 0.314607 | 0 | 0 | 0 | 0 | 0.183007 | 765 | 25 | 81 | 30.6 | 0.8544 | 0 | 0 | 0.235294 | 0 | 0 | 0.044444 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.235294 | false | 0 | 0.058824 | 0.235294 | 0.764706 | 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 |
56faf7c520020525f58004a0a57b15d7848e9f1f | 200 | py | Python | plasmapy/utils/units_definitions.py | haman80/PlasmaPy | 646f7ed52b89a1254be474fe54bdd672f7d27fb3 | [
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-1-Clause",
"BSD-3-Clause"
] | null | null | null | plasmapy/utils/units_definitions.py | haman80/PlasmaPy | 646f7ed52b89a1254be474fe54bdd672f7d27fb3 | [
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-1-Clause",
"BSD-3-Clause"
] | null | null | null | plasmapy/utils/units_definitions.py | haman80/PlasmaPy | 646f7ed52b89a1254be474fe54bdd672f7d27fb3 | [
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-1-Clause",
"BSD-3-Clause"
] | null | null | null | from astropy import units as u
SPEED_UNITS = u.m / u.s
SPEED_DISTRIBUTION_UNITS_1D = SPEED_UNITS ** -1
SPEED_DISTRIBUTION_UNITS_2D = SPEED_UNITS ** -2
SPEED_DISTRIBUTION_UNITS_3D = SPEED_UNITS ** -3
| 28.571429 | 47 | 0.785 | 33 | 200 | 4.363636 | 0.484848 | 0.277778 | 0.458333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.034682 | 0.135 | 200 | 6 | 48 | 33.333333 | 0.797688 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 0 | 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 |
710ea208aab55cf01e5cc7bbf732fa7df1198441 | 235 | py | Python | utils/cogext.py | lochungtin/Sonortiy | 104edc9da4de804a46b97b5db571236274888fbe | [
"MIT"
] | 2 | 2021-06-01T00:01:38.000Z | 2021-06-01T00:01:41.000Z | utils/cogext.py | lochungtin/Sonortiy | 104edc9da4de804a46b97b5db571236274888fbe | [
"MIT"
] | null | null | null | utils/cogext.py | lochungtin/Sonortiy | 104edc9da4de804a46b97b5db571236274888fbe | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
from discord.ext.commands import Bot
class CogExt(commands.Cog):
def __init__(self, bot):
self.bot = bot
def setBot(botIn: commands.Bot):
global bot
bot = botIn
| 19.583333 | 36 | 0.697872 | 33 | 235 | 4.848485 | 0.454545 | 0.1375 | 0.175 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.221277 | 235 | 11 | 37 | 21.363636 | 0.874317 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
71304661896f62d5e78a0c8d83f395fe3a2b4b18 | 1,006 | py | Python | src/dataToCode/languages/toPython/initToPython.py | CoffeeOverflow/drawtocode | 718ab54bb6a35eb471571e1d1b7990dc08e2ca35 | [
"MIT"
] | 9 | 2019-12-18T06:22:19.000Z | 2022-01-09T11:47:31.000Z | src/dataToCode/languages/toPython/initToPython.py | CoffeeOverflow/drawtocode | 718ab54bb6a35eb471571e1d1b7990dc08e2ca35 | [
"MIT"
] | 42 | 2019-11-06T17:46:36.000Z | 2019-12-18T04:08:48.000Z | src/dataToCode/languages/toPython/initToPython.py | CoffeeOverflow/drawtocode | 718ab54bb6a35eb471571e1d1b7990dc08e2ca35 | [
"MIT"
] | 1 | 2020-02-04T03:50:23.000Z | 2020-02-04T03:50:23.000Z | from typing import List
from src.dataToCode.dataClasses.attribute import Attribute
from src.dataToCode.languages.toPython.visibilityToPython import visibility_to_python
class InitToPython:
def __init__(self, class_fields: List[Attribute]):
self.class_fields = class_fields
def get_formatted(self) -> str:
pass_ = '\t\tpass'
return (f"\tdef __init__(self" + self.__formatted_parameters() + "):\n"
f"{self.__formatted_assignments() if self.class_fields else pass_}\n")
def __formatted_parameters(self) -> str:
fields_name = [f"{field.name}"
for field in self.class_fields]
return f", {', '.join(fields_name)}" if self.class_fields else ""
def __formatted_assignments(self) -> str:
class_fields = [f"\t\tself.{visibility_to_python[field.visibility]}"
f"{field.name} = {field.name}"
for field in self.class_fields]
return '\n'.join(class_fields)
| 40.24 | 86 | 0.649105 | 120 | 1,006 | 5.125 | 0.333333 | 0.160976 | 0.146341 | 0.055285 | 0.198374 | 0.130081 | 0.130081 | 0.130081 | 0.130081 | 0 | 0 | 0 | 0.237575 | 1,006 | 24 | 87 | 41.916667 | 0.801825 | 0 | 0 | 0.105263 | 0 | 0 | 0.21173 | 0.079523 | 0 | 0 | 0 | 0 | 0 | 1 | 0.210526 | false | 0.105263 | 0.157895 | 0 | 0.578947 | 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 |
8549212bb74f6e4843b7cdc267130d4ade9f8fa2 | 292 | py | Python | coders/curso_regex/grupos/gruposEspeciais.py | flaviogf/Cursos | 2b120dbcd24a907121f58482fdcdfa01b164872c | [
"MIT"
] | 2 | 2021-02-20T23:50:07.000Z | 2021-08-15T03:04:35.000Z | coders/curso_regex/grupos/gruposEspeciais.py | flaviogf/Cursos | 2b120dbcd24a907121f58482fdcdfa01b164872c | [
"MIT"
] | 18 | 2019-08-07T02:33:00.000Z | 2021-03-18T22:52:38.000Z | coders/curso_regex/grupos/gruposEspeciais.py | flaviogf/Cursos | 2b120dbcd24a907121f58482fdcdfa01b164872c | [
"MIT"
] | 2 | 2020-09-28T13:00:09.000Z | 2021-12-30T12:21:08.000Z | import re
texto = 'Testando, grupos especias!'
texto2 = 'supermercado superacao hiperMERCADO'
# lookahead
print(re.findall(r'\w+(?=,|!)', texto))
# lookbehind
# positive
print(re.findall(r'(?<=super)\w+', texto2))
# negative
print(re.findall(r'(?<!super)mercado', texto2, re.IGNORECASE))
| 19.466667 | 62 | 0.691781 | 36 | 292 | 5.611111 | 0.583333 | 0.10396 | 0.207921 | 0.222772 | 0.19802 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011494 | 0.106164 | 292 | 14 | 63 | 20.857143 | 0.762452 | 0.130137 | 0 | 0 | 0 | 0 | 0.405622 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.166667 | 0.5 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
856599915cd14ce5f62e1dddd33d54c0e05730f4 | 251 | py | Python | output/models/ms_data/datatypes/facets/non_positive_integer/non_positive_integer_enumeration004_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/ms_data/datatypes/facets/non_positive_integer/non_positive_integer_enumeration004_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/ms_data/datatypes/facets/non_positive_integer/non_positive_integer_enumeration004_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.ms_data.datatypes.facets.non_positive_integer.non_positive_integer_enumeration004_xsd.non_positive_integer_enumeration004 import (
FooType,
FooTypeFoo,
Test,
)
__all__ = [
"FooType",
"FooTypeFoo",
"Test",
]
| 20.916667 | 149 | 0.74502 | 27 | 251 | 6.407407 | 0.62963 | 0.190751 | 0.312139 | 0.369942 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.028436 | 0.159363 | 251 | 11 | 150 | 22.818182 | 0.791469 | 0 | 0 | 0 | 0 | 0 | 0.083665 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.1 | 0 | 0.1 | 0 | 1 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
85bee50b754ad4340c2d239f96f593576deaae73 | 188 | py | Python | venv/lib/python3.8/site-packages/arch/tests/utility/test_utility.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | 1 | 2021-11-27T18:15:30.000Z | 2021-11-27T18:15:30.000Z | venv/lib/python3.8/site-packages/arch/tests/utility/test_utility.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/arch/tests/utility/test_utility.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | null | null | null | import pytest
from arch import utility
@pytest.mark.slow
@pytest.mark.parametrize("arg", [["--collect-only"], "--collect-only"])
def test_runner(arg):
utility.test(arg, exit=False)
| 18.8 | 71 | 0.707447 | 26 | 188 | 5.076923 | 0.615385 | 0.151515 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111702 | 188 | 9 | 72 | 20.888889 | 0.790419 | 0 | 0 | 0 | 0 | 0 | 0.164894 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 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 |
a41d247dd75d806c85a974f8352f921796f5c206 | 186 | py | Python | benchmarking/framework/run_all_t.py | coyizumi/nvme-hpe | d2be43668a92891e81150232e17e4fa6a415f398 | [
"MIT"
] | null | null | null | benchmarking/framework/run_all_t.py | coyizumi/nvme-hpe | d2be43668a92891e81150232e17e4fa6a415f398 | [
"MIT"
] | null | null | null | benchmarking/framework/run_all_t.py | coyizumi/nvme-hpe | d2be43668a92891e81150232e17e4fa6a415f398 | [
"MIT"
] | null | null | null | # Authors: Coy Humphrey, Jayden Navarro
# Project: HPE UCSC Senior Design 2016
# Date: 4-7-2016
import ib_send_bw
from framework import setDirectory
setDirectory()
ib_send_bw.run_t()
| 16.909091 | 39 | 0.77957 | 29 | 186 | 4.827586 | 0.793103 | 0.085714 | 0.114286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.062893 | 0.145161 | 186 | 10 | 40 | 18.6 | 0.81761 | 0.478495 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 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 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
a424d9d3418638ce4a3fec0b5e0d0d109a781fee | 141 | py | Python | WWW_Dashboard/apps.py | denysboiko/reach-ukr-un-3w | 2838684348152e2aa5c6a0e794a1059dfbd7d0aa | [
"MIT"
] | null | null | null | WWW_Dashboard/apps.py | denysboiko/reach-ukr-un-3w | 2838684348152e2aa5c6a0e794a1059dfbd7d0aa | [
"MIT"
] | null | null | null | WWW_Dashboard/apps.py | denysboiko/reach-ukr-un-3w | 2838684348152e2aa5c6a0e794a1059dfbd7d0aa | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.apps import AppConfig
class WwwDashboardConfig(AppConfig):
name = 'WWW_Dashboard'
| 17.625 | 39 | 0.808511 | 16 | 141 | 6.75 | 0.8125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.141844 | 141 | 7 | 40 | 20.142857 | 0.892562 | 0 | 0 | 0 | 0 | 0 | 0.092199 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 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 |
a45cf5ba9f9889f98648c8d4d3bcd806f26e81ac | 585 | py | Python | unpacme/apis/__init__.py | kryptoslogic/unpacme-python | 86529853f24ed00afa7e90b87fa64104dfc68dfe | [
"MIT"
] | null | null | null | unpacme/apis/__init__.py | kryptoslogic/unpacme-python | 86529853f24ed00afa7e90b87fa64104dfc68dfe | [
"MIT"
] | null | null | null | unpacme/apis/__init__.py | kryptoslogic/unpacme-python | 86529853f24ed00afa7e90b87fa64104dfc68dfe | [
"MIT"
] | null | null | null |
# flake8: noqa
# Import all APIs into this package.
# If you have many APIs here with many many models used in each API this may
# raise a `RecursionError`.
# In order to avoid this, import only the API that you directly need like:
#
# from .api.feed_api import FeedApi
#
# or import this package, but before doing it, use:
#
# import sys
# sys.setrecursionlimit(n)
# Import APIs into API package:
from unpacme.api.feed_api import FeedApi
from unpacme.api.public_api import PublicApi
from unpacme.api.unpacking_api import UnpackingApi
from unpacme.api.user_api import UserApi
| 27.857143 | 76 | 0.765812 | 94 | 585 | 4.712766 | 0.542553 | 0.10158 | 0.126411 | 0.072235 | 0.103837 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002062 | 0.17094 | 585 | 20 | 77 | 29.25 | 0.91134 | 0.644444 | 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 |
a497ae9321d1f303e148f5d7114988bcbaafa758 | 1,178 | py | Python | webapp/models.py | vdmitriyev/mta-system | 03129eecf17929d2c61468c7ece9fd3f47b774a3 | [
"MIT"
] | 3 | 2021-05-26T08:17:25.000Z | 2021-12-15T21:50:16.000Z | webapp/models.py | vdmitriyev/mta-system | 03129eecf17929d2c61468c7ece9fd3f47b774a3 | [
"MIT"
] | null | null | null | webapp/models.py | vdmitriyev/mta-system | 03129eecf17929d2c61468c7ece9fd3f47b774a3 | [
"MIT"
] | null | null | null | from flask import current_app, redirect, url_for
from flask_login import UserMixin, AnonymousUserMixin
from flask_login import current_user, login_user, login_required, logout_user
from . import db, login_manager
class Users(db.Model):
''' Mapping to database table here '''
__tablename__ = 'users'
# make object "subscriptable"
def __getitem__(self, field):
return self.__dict__[field]
class User(UserMixin):
''' Handles user'''
pass
class AnonymousUser(AnonymousUserMixin):
''' Handles anonymous user'''
def can(self, permissions):
return False
def is_administrator(self):
return False
def check_role(self, role):
return False
login_manager.anonymous_user = AnonymousUser
@login_manager.user_loader
def load_user(uHash):
# user = Users.query.get(int(user_id))
# user.is_admin = user.check_admin()
# return user
user = User()
user.id = uHash
return user
@login_manager.unauthorized_handler
def unauth_handler():
return redirect(url_for('auth.loginView'))
def create_auth_session(u_hash):
user = User()
user.id = u_hash
login_user(user, remember=True)
| 22.653846 | 77 | 0.705433 | 149 | 1,178 | 5.308725 | 0.42953 | 0.060683 | 0.045512 | 0.050569 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.20034 | 1,178 | 51 | 78 | 23.098039 | 0.839703 | 0.152801 | 0 | 0.166667 | 0 | 0 | 0.019467 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.233333 | false | 0.033333 | 0.133333 | 0.166667 | 0.7 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
a4986a9ae838351c3041ba86c17a20fa2778b910 | 439 | py | Python | pyautospell/math_utils.py | adam-faulkner/PyAutoSpell | 9fb6e519d0f09c1971de99a80297d6a0205371c8 | [
"MIT"
] | 6 | 2018-09-18T12:44:19.000Z | 2021-05-04T15:51:52.000Z | pyautospell/math_utils.py | adam-faulkner/PyAutoSpell | 9fb6e519d0f09c1971de99a80297d6a0205371c8 | [
"MIT"
] | 1 | 2018-09-18T12:31:26.000Z | 2018-09-30T16:00:24.000Z | pyautospell/math_utils.py | adam-faulkner/PyAutoSpell | 9fb6e519d0f09c1971de99a80297d6a0205371c8 | [
"MIT"
] | null | null | null | import math
def normalize_by_column_L2_norm(feature_val):
'''
:param feature_val:
:return:
'''
if feature_val == None:
return
if len(feature_val) == 0:
return
for j in range(len(feature_val)):
column_sum = 0
for i in range(len(feature_val)):
column_sum +=feature_val[i] * feature_val[i]
column_sum = math.sqrt(column_sum)
for i in range(len(feature_val)):
feature_val[i] /= column_sum
return feature_val[i]
| 19.954545 | 47 | 0.699317 | 72 | 439 | 3.986111 | 0.319444 | 0.383275 | 0.181185 | 0.1777 | 0.439024 | 0.299652 | 0.299652 | 0 | 0 | 0 | 0 | 0.00831 | 0.177677 | 439 | 21 | 48 | 20.904762 | 0.786704 | 0.063781 | 0 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.071429 | false | 0 | 0.071429 | 0 | 0.357143 | 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 |
a4a173b16a07853f9c540da03b072b674b95d7ca | 132 | py | Python | handeler.py | rzr1r/PhonebookBot | ffc6c34d83ef906018a760d4e693a723e3c65bcf | [
"MIT"
] | null | null | null | handeler.py | rzr1r/PhonebookBot | ffc6c34d83ef906018a760d4e693a723e3c65bcf | [
"MIT"
] | null | null | null | handeler.py | rzr1r/PhonebookBot | ffc6c34d83ef906018a760d4e693a723e3c65bcf | [
"MIT"
] | null | null | null | import json
def readfile():
with open('data.txt') as file_data:
new_data = json.load(file_data)
return new_data | 26.4 | 40 | 0.651515 | 20 | 132 | 4.1 | 0.65 | 0.195122 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 132 | 5 | 41 | 26.4 | 0.828283 | 0 | 0 | 0 | 0 | 0 | 0.06015 | 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 |
8ef629f2e6e998e675732e92dbd9ff0cc2f97e17 | 152 | py | Python | lists_dictionary/Repeat String.py | vasetousa/Python-fundamentals | 3180c03de28b4f4d36d966221719069a7e18e521 | [
"MIT"
] | null | null | null | lists_dictionary/Repeat String.py | vasetousa/Python-fundamentals | 3180c03de28b4f4d36d966221719069a7e18e521 | [
"MIT"
] | null | null | null | lists_dictionary/Repeat String.py | vasetousa/Python-fundamentals | 3180c03de28b4f4d36d966221719069a7e18e521 | [
"MIT"
] | null | null | null | def repeat_string(string, times):
return string * times
text = input()
number = int(input())
result = repeat_string(text, number)
print(result)
| 13.818182 | 36 | 0.703947 | 20 | 152 | 5.25 | 0.55 | 0.228571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.171053 | 152 | 10 | 37 | 15.2 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0 | 0.166667 | 0.333333 | 0.166667 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
f11566cf2eda82e932b1e92ccaa3a04e8d125357 | 79 | py | Python | awareutils/__init__.py | dancollins/awareutils | 6f6db57d5ed796bd48ae072f0f6be16b0d9f7f8e | [
"MIT"
] | null | null | null | awareutils/__init__.py | dancollins/awareutils | 6f6db57d5ed796bd48ae072f0f6be16b0d9f7f8e | [
"MIT"
] | null | null | null | awareutils/__init__.py | dancollins/awareutils | 6f6db57d5ed796bd48ae072f0f6be16b0d9f7f8e | [
"MIT"
] | 2 | 2022-01-20T03:11:05.000Z | 2022-03-28T00:37:08.000Z | from loguru import logger
__version__ = "0.0.6"
logger.disable("awareutils")
| 13.166667 | 28 | 0.746835 | 11 | 79 | 5 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.043478 | 0.126582 | 79 | 5 | 29 | 15.8 | 0.753623 | 0 | 0 | 0 | 0 | 0 | 0.189873 | 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 |
f1464ce79d728bdbcbb9002d56331ed75e3efeb6 | 243 | py | Python | data-hub-api/apps/core/lib_models.py | uktrade/data-hub-api-old | 5ecf093d88692870982a638ced45de6a82d55672 | [
"MIT"
] | null | null | null | data-hub-api/apps/core/lib_models.py | uktrade/data-hub-api-old | 5ecf093d88692870982a638ced45de6a82d55672 | [
"MIT"
] | 18 | 2016-04-04T12:42:45.000Z | 2016-09-01T07:21:05.000Z | data-hub-api/apps/core/lib_models.py | uktrade/data-hub-api-old | 5ecf093d88692870982a638ced45de6a82d55672 | [
"MIT"
] | 1 | 2016-06-01T15:45:21.000Z | 2016-06-01T15:45:21.000Z | from django.db import models
from .fields import AutoCreatedField, AutoLastModifiedField
class TimeStampedModel(models.Model):
created = AutoCreatedField()
modified = AutoLastModifiedField()
class Meta:
abstract = True
| 20.25 | 59 | 0.748971 | 22 | 243 | 8.272727 | 0.727273 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1893 | 243 | 11 | 60 | 22.090909 | 0.923858 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.285714 | 0 | 0.857143 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
f17a42b14114624c3618ba2040d389ce8d2dd881 | 168 | py | Python | home/pedrosenarego/zorba/gestures/bicepup.py | rv8flyboy/pyrobotlab | 4e04fb751614a5cb6044ea15dcfcf885db8be65a | [
"Apache-2.0"
] | 63 | 2015-02-03T18:49:43.000Z | 2022-03-29T03:52:24.000Z | home/pedrosenarego/zorba/gestures/bicepup.py | hirwaHenryChristian/pyrobotlab | 2debb381fc2db4be1e7ea6e5252a50ae0de6f4a9 | [
"Apache-2.0"
] | 16 | 2016-01-26T19:13:29.000Z | 2018-11-25T21:20:51.000Z | home/pedrosenarego/zorba/gestures/bicepup.py | hirwaHenryChristian/pyrobotlab | 2debb381fc2db4be1e7ea6e5252a50ae0de6f4a9 | [
"Apache-2.0"
] | 151 | 2015-01-03T18:55:54.000Z | 2022-03-04T07:04:23.000Z | def bicepup():
i01.setArmSpeed("right", 1.0, 1.0, 1.0, 1.0)
i01.rightArm.bicep.attach()
i01.rightArm.bicep.moveTo(180)
sleep(1)
i01.rightArm.bicep.detach()
| 24 | 46 | 0.666667 | 28 | 168 | 4 | 0.5 | 0.071429 | 0.080357 | 0.107143 | 0.071429 | 0.071429 | 0 | 0 | 0 | 0 | 0 | 0.137931 | 0.136905 | 168 | 7 | 47 | 24 | 0.634483 | 0 | 0 | 0 | 0 | 0 | 0.029586 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | true | 0 | 0 | 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 |
f1814e534fe7b4e103d6db6849e98bcc07df5719 | 275 | py | Python | Desafios/Desafio64.py | Punkays/Phyton3-Estudos | 047ef62ddaf506fe3f653de3a1b2999874bbf12f | [
"Unlicense"
] | null | null | null | Desafios/Desafio64.py | Punkays/Phyton3-Estudos | 047ef62ddaf506fe3f653de3a1b2999874bbf12f | [
"Unlicense"
] | null | null | null | Desafios/Desafio64.py | Punkays/Phyton3-Estudos | 047ef62ddaf506fe3f653de3a1b2999874bbf12f | [
"Unlicense"
] | null | null | null |
# ! Desafio 64
# ! Crie um programa que leia varios numeros inteiros pelo teclado. O programa só vai para quando o usuario difitar o valor 999, que é a condição de parada. No final, mostre quantos numeros foram digitados e qual foi a soma entre eles (desconsiderando o flag) | 91.666667 | 259 | 0.778182 | 47 | 275 | 4.553191 | 0.851064 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022321 | 0.185455 | 275 | 3 | 259 | 91.666667 | 0.933036 | 0.981818 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f18187a9909fc59457b02919bd779a914a0b1183 | 1,952 | py | Python | quiz/bot/navigation/keyboard.py | shubham-king/guess-the-melody | 1658a17f41b39cfd212175a03e043b3be7bc0e56 | [
"MIT"
] | 4 | 2019-06-15T15:32:43.000Z | 2020-02-21T09:45:36.000Z | quiz/bot/navigation/keyboard.py | shubham-king/guess-the-melody | 1658a17f41b39cfd212175a03e043b3be7bc0e56 | [
"MIT"
] | 4 | 2020-07-05T07:20:26.000Z | 2021-04-25T21:05:53.000Z | quiz/bot/navigation/keyboard.py | shubham-king/guess-the-melody | 1658a17f41b39cfd212175a03e043b3be7bc0e56 | [
"MIT"
] | 7 | 2020-06-13T20:11:41.000Z | 2021-11-09T07:47:02.000Z | from abc import ABC, abstractmethod
from typing import Any
from telebot.types import ReplyKeyboardMarkup, ReplyKeyboardRemove
from quiz.types import Action
class Keyboard(ABC):
"""Abstract interface for a bot keyboard."""
@abstractmethod
def markup(self) -> ReplyKeyboardMarkup:
pass
@abstractmethod
def remove(self) -> ReplyKeyboardRemove:
pass
class MarkUp(ABC):
"""Abstract interface for a keyboard markup."""
@abstractmethod
def add(self, item: str) -> None:
pass
@abstractmethod
def keyboard(self) -> ReplyKeyboardMarkup:
pass
class BotRemoveKeyboard(Action):
"""Bot keyboard removal implementation."""
def __init__(self, selective: Any = None) -> None:
self._remove: ReplyKeyboardRemove = ReplyKeyboardRemove(selective)
def perform(self) -> ReplyKeyboardRemove:
return self._remove
class BotReplyKeyboardMarkup(MarkUp):
"""Bot keyboard markup implementation."""
def __init__(
self, resize_keyboard: bool = None, one_time_keyboard: bool = None, selective: Any = None, row_width: int = 3
) -> None:
self._markup: ReplyKeyboardMarkup = ReplyKeyboardMarkup(
resize_keyboard, one_time_keyboard, selective, row_width
)
def keyboard(self) -> ReplyKeyboardMarkup:
return self._markup
def add(self, item: str) -> None:
self._markup.add(item)
class BotReplyKeyboard(Keyboard):
"""Bot keyboard implementation."""
def __init__(
self, resize_keyboard: bool = False, one_time_keyboard: bool = True, selective: Any = None, row_width: int = 1
) -> None:
self._markup: MarkUp = BotReplyKeyboardMarkup(resize_keyboard, one_time_keyboard, selective, row_width)
self._remove: Action = BotRemoveKeyboard(selective)
def markup(self) -> MarkUp:
return self._markup
def remove(self) -> Action:
return self._remove
| 26.378378 | 118 | 0.68084 | 203 | 1,952 | 6.364532 | 0.236453 | 0.04644 | 0.04644 | 0.05805 | 0.249226 | 0.212074 | 0.137771 | 0.071207 | 0 | 0 | 0 | 0.001323 | 0.22541 | 1,952 | 73 | 119 | 26.739726 | 0.853175 | 0.093238 | 0 | 0.454545 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0.090909 | 0.090909 | 0.090909 | 0.568182 | 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 |
f18e2ecb03c4dc295aadbc41fc9f5445acfc9385 | 752 | py | Python | mozdns/txt/views.py | jlin/inventory | c098c98e570c3bf9fadfd811eb75e1213f6ea428 | [
"BSD-3-Clause"
] | 22 | 2015-01-16T01:36:32.000Z | 2020-06-08T00:46:18.000Z | mozdns/txt/views.py | jlin/inventory | c098c98e570c3bf9fadfd811eb75e1213f6ea428 | [
"BSD-3-Clause"
] | 8 | 2015-12-28T18:56:19.000Z | 2019-04-01T17:33:48.000Z | mozdns/txt/views.py | jlin/inventory | c098c98e570c3bf9fadfd811eb75e1213f6ea428 | [
"BSD-3-Clause"
] | 13 | 2015-01-13T20:56:22.000Z | 2022-02-23T06:01:17.000Z | # Create your views here.
from mozdns.views import MozdnsDeleteView
from mozdns.views import MozdnsCreateView
from mozdns.views import MozdnsDetailView
from mozdns.views import MozdnsUpdateView
from mozdns.views import MozdnsListView
from mozdns.txt.models import TXT
from mozdns.txt.forms import TXTForm
class TXTView(object):
model = TXT
form_class = TXTForm
queryset = TXT.objects.all()
class TXTDeleteView(TXTView, MozdnsDeleteView):
""" """
class TXTDetailView(TXTView, MozdnsDetailView):
""" """
template_name = 'txt/txt_detail.html'
class TXTCreateView(TXTView, MozdnsCreateView):
""" """
class TXTUpdateView(TXTView, MozdnsUpdateView):
""" """
class TXTListView(TXTView, MozdnsListView):
""" """
| 20.888889 | 47 | 0.739362 | 79 | 752 | 7 | 0.417722 | 0.126582 | 0.135624 | 0.189873 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.159574 | 752 | 35 | 48 | 21.485714 | 0.875 | 0.030585 | 0 | 0 | 0 | 0 | 0.027457 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.411765 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
74c46067cf4676a2f493f0beb52ff0044c52a0e0 | 116 | py | Python | curvenote_template/TexFormat.py | curvenote/curvenote-template | 3d2c6049f177369ddcd1ed7f67a8263e447aceab | [
"MIT"
] | 11 | 2021-11-08T14:49:10.000Z | 2022-03-22T10:16:51.000Z | curvenote_template/TexFormat.py | curvenote/curvenote-template | 3d2c6049f177369ddcd1ed7f67a8263e447aceab | [
"MIT"
] | 7 | 2021-11-08T14:36:29.000Z | 2022-01-28T22:19:23.000Z | curvenote_template/TexFormat.py | curvenote/curvenote-template | 3d2c6049f177369ddcd1ed7f67a8263e447aceab | [
"MIT"
] | 2 | 2021-11-08T14:11:29.000Z | 2021-11-10T10:11:00.000Z | from enum import Enum
class TexFormat(str, Enum):
""""""
tex = "tex"
tex_curvenote = "tex:curvenote"
| 12.888889 | 35 | 0.603448 | 14 | 116 | 4.928571 | 0.571429 | 0.173913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 116 | 8 | 36 | 14.5 | 0.793103 | 0 | 0 | 0 | 0 | 0 | 0.145455 | 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 |
74c87c03b633954b6407919ec06a67ec3ace61e2 | 450 | py | Python | src/data-structures/heaps/test_minHeap.py | Sunhick/csci-2270 | 2a65cf088010b2d508833700da05ed607a84d24c | [
"MIT"
] | 1 | 2017-05-04T05:01:13.000Z | 2017-05-04T05:01:13.000Z | src/data-structures/heaps/test_minHeap.py | Sunhick/csci-2270 | 2a65cf088010b2d508833700da05ed607a84d24c | [
"MIT"
] | null | null | null | src/data-structures/heaps/test_minHeap.py | Sunhick/csci-2270 | 2a65cf088010b2d508833700da05ed607a84d24c | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
minHeaps
Pythonic implementation of Heaps
"""
__author__ = "Sunil"
__email__ = "suba5417@colorado.edu"
import unittest
from minHeap import MinHeap
class test_MinHeap(unittest.TestCase):
"""
Test heap create, delete, insert
"""
heap = None
def __init__(self):
self.heap = MinHeap()
def setUp(self):
pass
def tearDown(self):
pass
def testCase(self):
pass | 13.636364 | 38 | 0.626667 | 50 | 450 | 5.38 | 0.64 | 0.089219 | 0.081784 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015152 | 0.266667 | 450 | 33 | 39 | 13.636364 | 0.8 | 0.206667 | 0 | 0.214286 | 0 | 0 | 0.077612 | 0.062687 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0.214286 | 0.142857 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
74d4091561ae9354fd0b099f89fd07fd885304f7 | 5,312 | py | Python | bootcamp/wiki/managers.py | basiltiger/easy_bootcamp | 875b9ed287f1a7824bb38f142dbe2f3b1ce54389 | [
"MIT"
] | null | null | null | bootcamp/wiki/managers.py | basiltiger/easy_bootcamp | 875b9ed287f1a7824bb38f142dbe2f3b1ce54389 | [
"MIT"
] | null | null | null | bootcamp/wiki/managers.py | basiltiger/easy_bootcamp | 875b9ed287f1a7824bb38f142dbe2f3b1ce54389 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.db import models
from django.db.models import Q, Count
from django.db.models.query import EmptyQuerySet, QuerySet
from mptt.managers import TreeManager
class ArticleQuerySet(QuerySet):
def can_read(self, user):
"""Filter objects so only the ones with a user's reading access
are included"""
if user.has_perm('wiki.moderator'):
return self
if user.is_anonymous():
q = self.filter(other_read=True)
else:
q = self.filter(Q(other_read=True) |
Q(owner=user) |
(Q(group__user=user) & Q(group_read=True))
).annotate(Count('id'))
return q
def can_write(self, user):
"""Filter objects so only the ones with a user's writing access
are included"""
if user.has_perm('wiki.moderator'):
return self
if user.is_anonymous():
q = self.filter(other_write=True)
else:
q = self.filter(Q(other_write=True) |
Q(owner=user) |
(Q(group__user=user) & Q(group_write=True))
)
return q
def active(self):
return self.filter(current_revision__deleted=False)
class ArticleEmptyQuerySet(EmptyQuerySet):
def can_read(self, user):
return self
def can_write(self, user):
return self
def active(self):
return self
class ArticleFkQuerySetMixin(object):
def can_read(self, user):
"""Filter objects so only the ones with a user's reading access
are included"""
if user.has_perm('wiki.moderate'):
return self
if user.is_anonymous():
q = self.filter(article__other_read=True)
else:
# https://github.com/django-wiki/django-wiki/issues/67
q = self.filter(
Q(article__other_read=True) | Q(article__owner=user) |
(Q(article__group__user=user) & Q(
article__group_read=True))).annotate(Count('id'))
return q
def can_write(self, user):
"""Filter objects so only the ones with a user's writing access
are included"""
if user.has_perm('wiki.moderate'):
return self
if user.is_anonymous():
q = self.filter(article__other_write=True)
else:
# https://github.com/django-wiki/django-wiki/issues/67
q = self.filter(
Q(article__other_write=True) | Q(article__owner=user) |
(Q(article__group__user=user) & Q(
article__group_write=True))).annotate(Count('id'))
return q
def active(self):
return self.filter(article__current_revision__deleted=False)
class ArticleFkEmptyQuerySetMixin(object):
def can_read(self, user):
return self
def can_write(self, user):
return self
def active(self):
return self
class ArticleFkQuerySet(ArticleFkQuerySetMixin, QuerySet):
pass
class ArticleFkEmptyQuerySet(ArticleFkEmptyQuerySetMixin, EmptyQuerySet):
pass
class ArticleManager(models.Manager):
def get_empty_query_set(self):
return self.get_queryset().none()
def get_queryset(self):
return ArticleQuerySet(self.model, using=self._db)
def active(self):
return self.get_queryset().active()
def can_read(self, user):
return self.get_queryset().can_read(user)
def can_write(self, user):
return self.get_queryset().can_write(user)
class ArticleFkManager(models.Manager):
def get_empty_query_set(self):
return self.get_queryset().none()
def get_queryset(self):
return ArticleFkQuerySet(self.model, using=self._db)
def active(self):
return self.get_queryset().active()
def can_read(self, user):
return self.get_queryset().can_read(user)
def can_write(self, user):
return self.get_queryset().can_write(user)
class URLPathEmptyQuerySet(EmptyQuerySet, ArticleFkEmptyQuerySetMixin):
def select_related_common(self):
return self
def default_order(self):
return self
class URLPathQuerySet(QuerySet, ArticleFkQuerySetMixin):
def select_related_common(self):
return self.select_related(
"parent",
"article__current_revision",
"article__owner")
def default_order(self):
"""Returns elements by there article order"""
return self.order_by('article__current_revision__title')
class URLPathManager(TreeManager):
def get_empty_query_set(self):
return self.get_queryset().none()
def get_queryset(self):
"""Return a QuerySet with the same ordering as the TreeManager."""
return URLPathQuerySet(self.model, using=self._db).order_by(
self.tree_id_attr, self.left_attr)
def select_related_common(self):
return self.get_queryset().common_select_related()
def active(self):
return self.get_queryset().active()
def can_read(self, user):
return self.get_queryset().can_read(user)
def can_write(self, user):
return self.get_queryset().can_write(user)
| 27.957895 | 74 | 0.626318 | 638 | 5,312 | 5.003135 | 0.158307 | 0.090852 | 0.061404 | 0.085526 | 0.699248 | 0.669486 | 0.665727 | 0.610276 | 0.587719 | 0.587719 | 0 | 0.00104 | 0.275791 | 5,312 | 189 | 75 | 28.10582 | 0.828698 | 0.094691 | 0 | 0.655738 | 0 | 0 | 0.028873 | 0.012013 | 0 | 0 | 0 | 0 | 0 | 1 | 0.262295 | false | 0.016393 | 0.040984 | 0.213115 | 0.688525 | 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 |
74dc2b288496349efeb54a97ea7505e1b1102560 | 533 | py | Python | pyramda/private/asserts/assert_dicts_equal.py | sergiors/pyramda | 5bf200888809b1bc946e813e29460f204bccd13e | [
"MIT"
] | 124 | 2015-07-30T21:34:25.000Z | 2022-02-19T08:45:50.000Z | pyramda/private/asserts/assert_dicts_equal.py | sergiors/pyramda | 5bf200888809b1bc946e813e29460f204bccd13e | [
"MIT"
] | 37 | 2015-08-31T23:02:20.000Z | 2022-02-04T04:45:28.000Z | ramda/private/asserts/assert_dicts_equal.py | slavaGanzin/pyramda | 4fa7fe28d5eaa798b702d28bdd3948515cb88f48 | [
"MIT"
] | 20 | 2015-08-04T18:59:09.000Z | 2021-12-13T08:08:59.000Z | from .assert_equal import assert_equal, EqualAssertionError
def is_dict(v):
return isinstance(v, dict)
def dicts_equal(dict1, dict2):
return dict1 == dict2 or (
is_dict(dict1) and
is_dict(dict2) and
all(map(lambda x, y: x == y, dict1.keys(), dict2.keys())) and
all(map(dicts_equal, dict1.values(), dict2.values()))
)
def assert_dicts_equal(actual_dict, expected_dict):
if not dicts_equal(actual_dict, expected_dict):
raise EqualAssertionError(actual_dict, expected_dict)
| 26.65 | 69 | 0.686679 | 74 | 533 | 4.72973 | 0.378378 | 0.114286 | 0.154286 | 0.188571 | 0.182857 | 0.182857 | 0 | 0 | 0 | 0 | 0 | 0.023529 | 0.202627 | 533 | 19 | 70 | 28.052632 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.230769 | 1 | 0.230769 | false | 0 | 0.076923 | 0.153846 | 0.461538 | 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 |
74dc66b29ed0465176af3b46c66d98e8762e225c | 270 | py | Python | api/utilities/helpers/generate_token.py | ascii-dev/flight-booking | 3a64951f91d0254402bc5c14e5ef6d1bd2cf372e | [
"MIT"
] | null | null | null | api/utilities/helpers/generate_token.py | ascii-dev/flight-booking | 3a64951f91d0254402bc5c14e5ef6d1bd2cf372e | [
"MIT"
] | 30 | 2019-05-26T09:39:12.000Z | 2021-06-02T00:16:58.000Z | api/utilities/helpers/generate_token.py | ascii-dev/flight-booking | 3a64951f91d0254402bc5c14e5ef6d1bd2cf372e | [
"MIT"
] | null | null | null | from flask_jwt_extended import create_access_token
def generate_token(user):
return create_access_token(identity=dict(
id=user.id,
firstName=user.first_name,
lastName=user.last_name,
email=user.email,
role=user.role.value))
| 24.545455 | 50 | 0.696296 | 36 | 270 | 4.972222 | 0.638889 | 0.134078 | 0.189944 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.218519 | 270 | 10 | 51 | 27 | 0.848341 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.125 | 0.125 | 0.375 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
74e7c5868969adc5123b7e24805af49f99515b8d | 19,176 | py | Python | backend/backend/views.py | aleeekc/dtu_thesis_project | 28407b56a60c3d9a971769a1ba9dc411504b664e | [
"MIT"
] | 1 | 2019-12-04T20:54:42.000Z | 2019-12-04T20:54:42.000Z | backend/backend/views.py | aleeekc/dtu_thesis_project | 28407b56a60c3d9a971769a1ba9dc411504b664e | [
"MIT"
] | null | null | null | backend/backend/views.py | aleeekc/dtu_thesis_project | 28407b56a60c3d9a971769a1ba9dc411504b664e | [
"MIT"
] | null | null | null | from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from django.contrib.auth.models import Group, Permission
from django.views.decorators.csrf import csrf_exempt
from rest_framework.authtoken.models import Token
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import AllowAny, IsAuthenticatedOrReadOnly
from rest_framework.status import (
HTTP_500_INTERNAL_SERVER_ERROR,
HTTP_400_BAD_REQUEST,
HTTP_404_NOT_FOUND,
HTTP_200_OK
)
from rest_framework.response import Response
from django.http import FileResponse
from uuid import uuid4
from .models import *
@csrf_exempt
@api_view(["POST"])
@permission_classes((AllowAny,))
def login(request):
username = request.data.get("username")
password = request.data.get("password")
if username is None or password is None:
return Response({'error': 'Please provide both username and password'},
status=HTTP_400_BAD_REQUEST)
user = authenticate(username=username, password=password)
if not user:
return Response({'error': 'Invalid Credentials'},
status=HTTP_404_NOT_FOUND)
token, _ = Token.objects.get_or_create(user=user)
return Response({'token': token.key}, status=HTTP_200_OK)
@csrf_exempt
@api_view(["POST"])
@permission_classes((AllowAny,))
def login_anon(request):
username = request.data.get("username")
if username is None:
return Response({'error': 'Please provide a username'},
status=HTTP_400_BAD_REQUEST)
try:
user = User.objects.create_user(username=uuid4().__str__().replace("-",''), password=username)
user.is_anonymous = True
except Exception as e:
print(e)
user.set_unusable_password()
if not user:
return Response({'error': 'Invalid Credentials'},
status=HTTP_404_NOT_FOUND)
token, _ = Token.objects.get_or_create(user=user)
return Response({'token': token.key},
status=HTTP_200_OK)
@csrf_exempt
@api_view(["POST"])
@permission_classes((AllowAny,))
def register(request):
username = request.data.get("username")
password = request.data.get("password")
email = request.data.get("email")
if username is None or password is None:
return Response({'error': 'Please provide both username and password'},
status=HTTP_400_BAD_REQUEST)
try:
user = User.objects.get(username=username)
except Exception as e:
user = False
pass
if user:
token, _ = Token.objects.get_or_create(user=user)
if email is None:
email = ""
details = UserDetails(uid=user.id)
details.save()
return Response({'token': token.key}, status=HTTP_200_OK)
else:
if email is None:
email = ""
user = User.objects.create_user(username=username, password=password, email=email)
details = UserDetails(uid=user.id)
details.save()
token, _ = Token.objects.get_or_create(user=user)
return Response({'token': token.key}, status=HTTP_200_OK)
@csrf_exempt
@api_view(["POST"])
@permission_classes((AllowAny,))
def logout(request):
try:
request.user.auth_token.delete()
except Exception as e:
Response("The token doesn't exist", status=HTTP_400_BAD_REQUEST)
return Response("Logout successful", status=HTTP_200_OK)
@csrf_exempt
@api_view(["GET"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def ping(request):
data = {'pong'}
return Response(data, status=HTTP_200_OK)
@csrf_exempt
@api_view(["GET"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def userinfo(request):
if request.user.is_anonymous == True:
return Response('{This is an AnonymousUser!}', status=HTTP_200_OK)
else:
user = request.user
userDetails = UserDetails(uid=user.id)
data = {'username': user.username, 'email': user.email, 'quota': "unlimited", 'registered': user.date_joined.strftime("%Y-%m-%d %H:%M:%S"), "token": user.auth_token.key, "friends": userDetails.friends, "alias": userDetails.userAlias }
return Response(data, status=HTTP_200_OK)
@csrf_exempt
@api_view(["POST"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def fileupload(request):
if request.user.is_anonymous == True:
return Response('{This is an AnonymousUser!}', status=HTTP_200_OK)
else:
name = request.data.get("name")
if name is None or request.FILES['upload_file'] is None:
return Response({'error': 'Please provide a file name and a file'},
status=HTTP_400_BAD_REQUEST)
user = request.user
try:
file = File(owner=user.username, name=name, file=request.FILES['upload_file'])
file.save()
except Exception as e:
print(e)
return Response("Internal server error!", status=HTTP_500_INTERNAL_SERVER_ERROR)
return Response("The file was uploaded", status=HTTP_200_OK)
@csrf_exempt
@api_view(["POST"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def setKey(request):
if request.user.is_anonymous == True:
return Response('{This is an AnonymousUser!}', status=HTTP_200_OK)
else:
key = request.data.get("key")
meant_for = request.data.get("meant_for")
if key is None or meant_for is None:
return Response({'error': 'Please provide a key, owner and intended recipient'},
status=HTTP_400_BAD_REQUEST)
user = request.user
try:
key = Key(key=key, owner=user.username, meant_for=meant_for)
key.save()
except Exception as e:
print(e)
return Response("Internal server error!", status=HTTP_500_INTERNAL_SERVER_ERROR)
return Response({'message': 'The key was saved', 'key': key.id}, status=HTTP_200_OK)
@csrf_exempt
@api_view(["POST"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def downloadLink(request):
if request.user.is_anonymous == True:
return Response('{This is an AnonymousUser!}', status=HTTP_200_OK)
else:
file = request.data.get("file")
if file is None:
return Response({'error': 'Please provide a file name!'},
status=HTTP_400_BAD_REQUEST)
user = request.user
try:
for files in File.objects.all().filter(name=file, owner= user.username).iterator():
fileObj = files
if fileObj is None:
Response({'error': 'Please provide a file name that is in the mounted directory!'},
status=HTTP_400_BAD_REQUEST)
link = Link(owner=user.username, file=fileObj)
link.save()
uid = link.uid
except Exception as e:
print(e)
return Response("Internal server error!", status=HTTP_500_INTERNAL_SERVER_ERROR)
return Response({'message': 'The link was saved', 'key': uid}, status=HTTP_200_OK)
@csrf_exempt
@api_view(["GET"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def getlinks(request):
if request.user.is_anonymous == True:
return Response('{This is an AnonymousUser!}', status=HTTP_200_OK)
else:
user = request.user
links = []
try:
for l in Link.objects.all().iterator():
links.append(l.uid)
except Exception as e:
print(e)
return Response("Internal server error!", status=HTTP_500_INTERNAL_SERVER_ERROR)
return Response(links, status=HTTP_200_OK)
@csrf_exempt
@api_view(["GET"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def getlinkfiles(request):
if request.user.is_anonymous == True:
return Response('{This is an AnonymousUser!}', status=HTTP_200_OK)
else:
linkuid = request.data.get("link")
link = Link.objects.all().filter(uid=linkuid)
return Response(link.files, status=HTTP_200_OK)
@csrf_exempt
@api_view(["POST"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def uploadFolder(request):
if request.user.is_anonymous == True:
return Response('{This is an AnonymousUser!}', status=HTTP_200_OK)
else:
name = request.data.get("name")
if name is None:
return Response({'error': 'Please provide a folder name'},
status=HTTP_400_BAD_REQUEST)
user = request.user
try:
folder = Folder(name=name, owner=user.username)
folder.save()
except Exception as e:
print(e)
return Response("Internal server error!", status=HTTP_500_INTERNAL_SERVER_ERROR)
return Response("The folder was saved", status=HTTP_200_OK)
@csrf_exempt
@api_view(["POST"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def deleteFolder(request):
if request.user.is_anonymous == True:
return Response('{This is an AnonymousUser!}', status=HTTP_200_OK)
else:
name = request.data.get("name")
if name is None:
return Response({'error': 'Please provide a folder name'},
status=HTTP_400_BAD_REQUEST)
try:
folder = Folder.objects.get(name=name)
folder.delete()
except Exception as e:
print(e)
return Response("Internal server error!", status=HTTP_500_INTERNAL_SERVER_ERROR)
return Response("The folder was deleted", status=HTTP_200_OK)
@csrf_exempt
@api_view(["POST"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def renameFolder(request):
if request.user.is_anonymous == True:
return Response('{This is an AnonymousUser!}', status=HTTP_200_OK)
else:
name = request.data.get("name")
old_name = request.data.get("old_name")
if name is None:
return Response({'error': 'Please provide a folder name'},
status=HTTP_400_BAD_REQUEST)
try:
folder = Folder.objects.get(name=old_name)
folder.name = name
folder.save()
except Exception as e:
print(e)
return Response("Internal server error!", status=HTTP_500_INTERNAL_SERVER_ERROR)
return Response("The folder was renamed", status=HTTP_200_OK)
@csrf_exempt
@api_view(["POST"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def renameFile(request):
if request.user.is_anonymous == True:
return Response('{This is an AnonymousUser!}', status=HTTP_200_OK)
else:
name = request.data.get("name")
old_name = request.data.get("old_name")
if name is None:
return Response({'error': 'Please provide a file name'},
status=HTTP_400_BAD_REQUEST)
try:
file = File.objects.get(name=old_name)
file.name = name
file.save()
except Exception as e:
print(e)
return Response("Internal server error!", status=HTTP_500_INTERNAL_SERVER_ERROR)
return Response("The file was renamed", status=HTTP_200_OK)
@csrf_exempt
@api_view(["POST"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def deleteFile(request):
if request.user.is_anonymous == True:
return Response('{This is an AnonymousUser!}', status=HTTP_200_OK)
else:
name = request.data.get("name")
if name is None:
return Response({'error': 'Please provide a file name'},
status=HTTP_400_BAD_REQUEST)
try:
file = File.objects.get(name=name)
file.delete()
except Exception as e:
print(e)
return Response("Internal server error!", status=HTTP_500_INTERNAL_SERVER_ERROR)
return Response("The file was deleted", status=HTTP_200_OK)
@csrf_exempt
@api_view(["Get"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def listFiles(request):
if request.user.is_anonymous == True:
return Response('{This is an AnonymousUser!}', status=HTTP_200_OK)
else:
files = []
for f in File.objects.all().filter(owner=request.user.username).iterator():
files.append(f.name)
return Response(files, status=HTTP_200_OK)
@csrf_exempt
@api_view(["Get"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def listFolders(request):
if request.user.is_anonymous == True:
return Response('{This is an AnonymousUser!}', status=HTTP_200_OK)
else:
folders = []
for f in Folder.objects.all().filter(owner=request.user.username).iterator():
folders.append(f.name)
return Response(folders, status=HTTP_200_OK)
@csrf_exempt
@api_view(["Get"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def downloadFile(request):
if request.user.is_anonymous == True:
return Response('{This is an AnonymousUser!}', status=HTTP_200_OK)
else:
name = request.data.get("name")
for f in File.objects.all().filter(owner=request.user.username, name=name).iterator():
return FileResponse(f.file, status=HTTP_200_OK)
@csrf_exempt
@api_view(["Get"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def downloadLinkFile(request, key):
for l in Link.objects.all().filter(uid=key).iterator():
file = l.file
if file is None:
return Response("Link doesn't exist!", status=HTTP_200_OK)
else:
return FileResponse(file.file, status=HTTP_200_OK)
@csrf_exempt
@api_view(["Get"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def downloadKey(request, key):
for k in Key.objects.all().filter(uid=key).iterator():
savedKey = k.key
if savedKey is None:
return Response("Key doesn't exist!", status=HTTP_200_OK)
else:
return FileResponse(savedKey, status=HTTP_200_OK)
@csrf_exempt
@api_view(["POST"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def shareFolder(request):
if request.user.is_anonymous == True:
return Response('{This is an AnonymousUser!}', status=HTTP_200_OK)
else:
name = request.data.get("name")
user = request.data.get("user")
if user is None or name is None:
return Response('{Please provide a user and a folder name!}', status=HTTP_400_BAD_REQUEST)
else:
username = None
for u in User.objects.all().filter(username=user):
username = u
if username is None:
return Response('{Please provide a valid user!}', status=HTTP_400_BAD_REQUEST)
folder = None
for f in Folder.objects.all().filter(name=name, owner=request.user.username):
folder = f
if folder is None:
return Response('{Please provide a valid folder!}', status=HTTP_400_BAD_REQUEST)
### CREATE SHARE FOLDER ON RECIPIENT ACCOUNT
fol = None
for f in Folder.objects.all().filter(owner=username, name='/shares'):
fol = f
if fol is None:
f = Folder(owner=username, name='/shares')
f.save()
folRecipient = None
for f in Folder.objects.all().filter(owner=username, name='/shares/' + request.user.username):
folRecipient = f
if folRecipient is None:
f = Folder(owner=username, name='/shares/' + request.user.username)
f.save()
folShare = None
for f in Folder.objects.all().filter(owner=username, name='/shares/' + request.user.username + "/" + name):
folShare = f
if folShare is None:
f = Folder(owner=username, name='/shares/' + request.user.username + "/" + name)
f.save()
### COPY ALL FILES IN THE SHARED FOLDER TO THE RECIPENTS ACCOUNT
for f in File.objects.all().filter(owner=request.user.username):
if f.name.startswith(name):
file = File(owner=user, name='/shares/' + request.user.username + "/" + f.name, file=f.file)
file.save()
return Response("Folder was shared!", status=HTTP_200_OK)
@csrf_exempt
@api_view(["POST"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def createGroup(request):
if request.user.is_anonymous == True:
return Response({'message': 'This is an AnonymousUser!'}, status=HTTP_200_OK)
else:
name = request.data.get("name")
if name is None:
return Response({'message': 'Please provide a group name!'}, status=HTTP_400_BAD_REQUEST)
else:
new_group, created = Group.objects.get_or_create(name=name)
if created is None:
return Response({'message': 'Group already exist!'}, status=HTTP_200_OK)
#permission = Permission.objects.create(codename='can_add_users', name='Can add users to the group')
#new_group.permissions.add(permission)
new_group.user_set.add(request.user)
new_group.save()
return Response({'message': 'Group was created!'}, status=HTTP_200_OK)
##################################################################################
############### THIS IS NOT READY; NEEDS TESTING ############################
##################################################################################
@csrf_exempt
@api_view(["POST"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def joinGroup(request):
if request.user.is_anonymous == True:
return Response({'message': 'This is an AnonymousUser!'}, status=HTTP_200_OK)
else:
name = request.data.get("name")
username = request.data.get("user")
if name is None:
return Response({'message': 'Please provide a group name!'}, status=HTTP_400_BAD_REQUEST)
else:
new_group, created = Group.objects.get_or_create(name=name)
if created is None:
return Response({'message': 'Group does not exist!'}, status=HTTP_200_OK)
try:
user = User.objects.get(username=username)
group = Group.objects.get(name=name)
user.groups.add(group)
except Exception as e :
print(e)
return Response({'message': 'User was added to the group!'}, status=HTTP_200_OK)
@csrf_exempt
@api_view(["GET"])
@permission_classes((IsAuthenticatedOrReadOnly,))
def listUsersInGroup(request):
if request.user.is_anonymous == True:
return Response({'message': 'This is an AnonymousUser!'}, status=HTTP_200_OK)
else:
name = request.data.get("name")
if name is None:
return Response({'message': 'Please provide a group name!'}, status=HTTP_400_BAD_REQUEST)
else:
list = []
for u in User.objects.filter(groups__name=name).iterator():
list.append(u.username)
return Response({'users': list}, status=HTTP_200_OK)
| 35.185321 | 242 | 0.629015 | 2,296 | 19,176 | 5.09669 | 0.08493 | 0.066655 | 0.037686 | 0.061528 | 0.764912 | 0.729619 | 0.702017 | 0.687917 | 0.645702 | 0.623569 | 0 | 0.01717 | 0.246767 | 19,176 | 544 | 243 | 35.25 | 0.792994 | 0.014237 | 0 | 0.628378 | 0 | 0 | 0.119171 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.056306 | false | 0.024775 | 0.027027 | 0 | 0.254505 | 0.024775 | 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 |
74f32fec53e2f9a428f91124e41d13de9afedfda | 690 | py | Python | bayesian/preprocess/_feature.py | ctgk/bayesian_playground | 70c63910472a29e15a4fb98e30a34b9ee155152e | [
"MIT"
] | 1 | 2020-10-17T19:09:32.000Z | 2020-10-17T19:09:32.000Z | bayesian/preprocess/_feature.py | ctgk/bayesian | 70c63910472a29e15a4fb98e30a34b9ee155152e | [
"MIT"
] | null | null | null | bayesian/preprocess/_feature.py | ctgk/bayesian | 70c63910472a29e15a4fb98e30a34b9ee155152e | [
"MIT"
] | null | null | null | import abc
from itertools import zip_longest
import numpy as np
class Feature(abc.ABC):
@abc.abstractmethod
def __eq__(self, other):
pass
@abc.abstractmethod
def transform(self, x) -> np.ndarray:
pass
class StackedFeatures(Feature):
def __init__(self, *features: Feature):
self.features = features
def __eq__(self, other):
if not isinstance(other, StackedFeatures):
return False
return all(f1 == f2 for f1, f2 in zip_longest(
self.features, other.features))
def transform(self, x: np.ndarray) -> np.ndarray:
return np.concatenate([f.transform(x) for f in self.features], axis=-1)
| 22.258065 | 79 | 0.644928 | 88 | 690 | 4.897727 | 0.420455 | 0.111369 | 0.092807 | 0.064965 | 0.12065 | 0.12065 | 0 | 0 | 0 | 0 | 0 | 0.009728 | 0.255072 | 690 | 30 | 80 | 23 | 0.828794 | 0 | 0 | 0.3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.1 | 0.15 | 0.05 | 0.65 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
74fc3dfedc3de71f1750a3184efbf694a88acd3b | 21,765 | py | Python | scanner/plugins/cms/cmsmain.py | UgOrange/onlinetools | 06205282965395e37fb3a7fed806682196ad9ccc | [
"MIT"
] | 1,207 | 2018-01-31T06:36:34.000Z | 2022-03-31T07:35:35.000Z | scanner/plugins/cms/cmsmain.py | UgOrange/onlinetools | 06205282965395e37fb3a7fed806682196ad9ccc | [
"MIT"
] | 21 | 2018-07-30T03:01:49.000Z | 2022-03-28T08:20:39.000Z | scanner/plugins/cms/cmsmain.py | UgOrange/onlinetools | 06205282965395e37fb3a7fed806682196ad9ccc | [
"MIT"
] | 310 | 2018-02-22T01:23:20.000Z | 2022-03-28T08:51:37.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
name: cms漏洞库
referer: unknow
author: Lucifer
description: 包含所有cms漏洞类型,封装成一个模块
'''
#泛微
from .weaver_oa.weaver_oa_download_sqli import weaver_oa_download_sqli_BaseVerify
from .weaver_oa.weaver_oa_db_disclosure import weaver_oa_db_disclosure_BaseVerify
from .weaver_oa.weaver_oa_filedownload import weaver_oa_filedownload_BaseVerify
#phpok vulns
from .phpok.phpok_res_action_control_filedownload import phpok_res_action_control_filedownload_BaseVerify
from .phpok.phpok_api_param_sqli import phpok_api_param_sqli_BaseVerify
from .phpok.phpok_remote_image_getshell import phpok_remote_image_getshell_BaseVerify
#typecho vuls
from .typecho.typecho_install_code_exec import typecho_install_code_exec_BaseVerify
#foosun vuls
from .foosun.foosun_City_ajax_sqli import foosun_City_ajax_sqli_BaseVerify
#autoset vuls
from .autoset.autoset_phpmyadmin_unauth import autoset_phpmyadmin_unauth_BaseVerify
#phpstudy vuls
from .phpstudy.phpstudy_probe import phpstudy_probe_BaseVerify
from .phpstudy.phpstudy_phpmyadmin_defaultpwd import phpstudy_phpmyadmin_defaultpwd_BaseVerify
#Hishop vulns
from .Hishop.hishop_productlist_sqli import hishop_productlist_sqli_BaseVerify
#SiteEngine vulns
from .siteengine.siteengine_comments_module_sqli import siteengine_comments_module_sqli_BaseVerify
#zfsoft vulns
from .zfsoft.zfsoft_service_stryhm_sqli import zfsoft_service_stryhm_sqli_BaseVerify
from .zfsoft.zfsoft_database_control import zfsoft_database_control_BaseVerify
from .zfsoft.zfsoft_default3_bruteforce import zfsoft_default3_bruteforce_BaseVerify
#ecshop vulns
from .ecshop.ecshop_uc_code_sqli import ecshop_uc_code_sqli_BaseVerify
from .ecshop.ecshop_flow_orderid_sqli import ecshop_flow_orderid_sqli_BaseVerify
#discuz! vulns
from .discuz.discuz_forum_message_ssrf import discuz_forum_message_ssrf_BaseVerify
from .discuz.discuz_focus_flashxss import discuz_focus_flashxss_BaseVerify
from .discuz.discuz_x25_path_disclosure import discuz_x25_path_disclosure_BaseVerify
from .discuz.discuz_plugin_ques_sqli import discuz_plugin_ques_sqli_BaseVerify
#亿邮 vulns
from .eyou.eyou_weakpass import eyou_weakpass_BaseVerify
from .eyou.eyou_admin_id_sqli import eyou_admin_id_sqli_BaseVerify
from .eyou.eyou_resetpw import eyou_resetpw_BaseVerify
from .eyou.eyou_user_kw_sqli import eyou_user_kw_sqli_BaseVerify
#金蝶 vulns
from .kingdee.kingdee_filedownload import kingdee_filedownload_BaseVerify
from .kingdee.kingdee_resin_dir_path_disclosure import kingdee_resin_dir_path_disclosure_BaseVerify
from .kingdee.kingdee_conf_disclosure import kingdee_conf_disclosure_BaseVerify
from .kingdee.kingdee_logoImgServlet_fileread import kingdee_logoImgServlet_fileread_BaseVerify
#乐语 vulns
from .looyu.looyu_down_filedownload import looyu_down_filedownload_BaseVerify
#smartoa vulns
from .smartoa.smartoa_multi_filedownload import smartoa_multi_filedownload_BaseVerify
#URP vulns
from .urp.urp_query import urp_query_BaseVerify
from .urp.urp_query2 import urp_query2_BaseVerify
from .urp.urp_ReadJavaScriptServlet_fileread import urp_ReadJavaScriptServlet_fileread_BaseVerify
#PKPMBS vulns
from .PKPMBS.pkpmbs_guestbook_sqli import pkpmbs_guestbook_sqli_BaseVerify
from .PKPMBS.pkpmbs_addresslist_keyword_sqli import pkpmbs_addresslist_keyword_sqli_BaseVerify
from .PKPMBS.pkpmbs_MsgList_sqli import pkpmbs_MsgList_sqli_BaseVerify
#帝友 vulns
from .diyou.dyp2p_latesindex_sqli import dyp2p_latesindex_sqli_BaseVerify
from .diyou.dyp2p_url_fileread import dyp2p_url_fileread_BaseVerify
#爱琴斯 vulns
from .iGenus.igenus_code_exec import igenus_code_exec_BaseVerify
from .iGenus.igenus_login_Lang_fileread import igenus_login_Lang_fileread_BaseVerify
from .iGenus.igenus_syslogin_Lang_fileread import igenus_syslogin_Lang_fileread_BaseVerify
#live800 vulns
from .live800.live800_downlog_filedownload import live800_downlog_filedownload_BaseVerify
from .live800.live800_loginAction_sqli import live800_loginAction_sqli_BaseVerify
from .live800.live800_sta_export_sqli import live800_sta_export_sqli_BaseVerify
from .live800.live800_services_xxe import live800_services_xxe_BaseVerify
#thinkphp vulns
from .thinkphp.onethink_category_sqli import onethink_category_sqli_BaseVerify
from .thinkphp.thinkphp_code_exec import thinkphp_code_exec_BaseVerify
#汇思 vulns
from .wizbank.wizbank_download_filedownload import wizbank_download_filedownload_BaseVerify
from .wizbank.wizbank_usr_id_sqli import wizbank_usr_id_sqli_BaseVerify
#汇文 vulns
from .libsys.libsys_ajax_asyn_link_old_fileread import libsys_ajax_asyn_link_old_fileread_BaseVerify
from .libsys.libsys_ajax_asyn_link_fileread import libsys_ajax_asyn_link_fileread_BaseVerify
from .libsys.libsys_ajax_get_file_fileread import libsys_ajax_get_file_fileread_BaseVerify
#通元内容管理系统 vulns
from .gpower.gpower_users_disclosure import gpower_users_disclosure_BaseVerify
#metinfo cms vulns
from .metinfo.metinfo_getpassword_sqli import metinfo_getpassword_sqli_BaseVerify
from .metinfo.metinfo_login_check_sqli import metinfo_login_check_sqli_BaseVerify
#用友 vulns
from .yonyou.yonyou_icc_struts2 import yonyou_icc_struts2_BaseVerify
from .yonyou.yonyou_user_ids_sqli import yonyou_user_ids_sqli_BaseVerify
from .yonyou.yonyou_multi_union_sqli import yonyou_multi_union_sqli_BaseVerify
from .yonyou.yonyou_initData_disclosure import yonyou_initData_disclosure_BaseVerify
from .yonyou.yonyou_createMysql_disclosure import yonyou_createMysql_disclosure_BaseVerify
from .yonyou.yonyou_test_sqli import yonyou_test_sqli_BaseVerify
from .yonyou.yonyou_getemaildata_fileread import yonyou_getemaildata_fileread_BaseVerify
from .yonyou.yonyou_ehr_ELTextFile import yonyou_ehr_ELTextFile_BaseVerify
from .yonyou.yonyou_a8_CmxUser_sqli import yonyou_a8_CmxUser_sqli_BaseVerify
from .yonyou.yonyou_cm_info_content_sqli import yonyou_cm_info_content_sqli_BaseVerify
from .yonyou.yonyou_a8_personService_xxe import yonyou_a8_personService_xxe_BaseVerify
from .yonyou.yonyou_u8_CmxItem_sqli import yonyou_u8_CmxItem_sqli_BaseVerify
from .yonyou.yonyou_fe_treeXml_sqli import yonyou_fe_treeXml_sqli_BaseVerify
from .yonyou.yonyou_ehr_resetpwd_sqli import yonyou_ehr_resetpwd_sqli_BaseVerify
from .yonyou.yonyou_nc_NCFindWeb_fileread import yonyou_nc_NCFindWeb_fileread_BaseVerify
from .yonyou.yonyou_a8_logs_disclosure import yonyou_a8_logs_disclosure_BaseVerify
from .yonyou.yonyou_status_default_pwd import yonyou_status_default_pwd_BaseVerify
#v2tech vulns
from .v2tech.v2Conference_sqli_xxe import v2Conference_sqli_xxe_BaseVerify
#digital campus vulns
from .digital_campus.digital_campus_log_disclosure import digital_campus_log_disclosure_BaseVerify
from .digital_campus.digital_campus_systemcodelist_sqli import digital_campus_systemcodelist_sqli_BaseVerify
#jeecms vulns
from .jeecms.jeecms_fpath_filedownload import jeecms_fpath_filedownload_BaseVerify
#jeecg vulns
from .jeecg.jeecg_pwd_reset import jeecg_pwd_reset_BaseVerify
#shopex vulns
from .shopex.shopex_phpinfo_disclosure import shopex_phpinfo_disclosure_BaseVerify
#FineCMS vulns
from .finecms.finecms_uploadfile import finecms_uploadfile_BaseVerify
#hanweb vulns
from .hanweb.hanweb_readxml_fileread import hanweb_readxml_fileread_BaseVerify
from .hanweb.hanweb_downfile_filedownload import hanweb_downfile_filedownload_BaseVerify
from .hanweb.hanweb_VerifyCodeServlet_install import hanweb_VerifyCodeServlet_install_BaseVerify
#php168 vulns
from .php168.php168_login_getshell import php168_login_getshell_BaseVerify
#dedecms vulns
from .dedecms.dedecms_version import dedecms_version_BaseVerify
from .dedecms.dedecms_recommend_sqli import dedecms_recommend_sqli_BaseVerify
from .dedecms.dedecms_download_redirect import dedecms_download_redirect_BaseVerify
from .dedecms.dedecms_error_trace_disclosure import dedecms_error_trace_disclosure_BaseVerify
from .dedecms.dedecms_search_typeArr_sqli import dedecms_search_typeArr_sqli_BaseVerify
#umail vulns
from .umail.umail_physical_path import umail_physical_path_BaseVerify
from .umail.umail_sessionid_access import umail_sessionid_access_BaseVerify
#fsmcms vulns
from .fsmcms.fsmcms_p_replydetail_sqli import fsmcms_p_replydetail_sqli_BaseVerify
from .fsmcms.fsmcms_setup_reinstall import fsmcms_setup_reinstall_BaseVerify
from .fsmcms.fsmcms_columninfo_sqli import fsmcms_columninfo_sqli_BaseVerify
#qibocms vulns
from .qibocms.qibocms_search_sqli import qibocms_search_sqli_BaseVerify
from .qibocms.qibocms_js_f_id_sqli import qibocms_js_f_id_sqli_BaseVerify
from .qibocms.qibocms_s_fids_sqli import qibocms_s_fids_sqli_BaseVerify
from .qibocms.qibocms_search_code_exec import qibocms_search_code_exec_BaseVerify
#inspur vulns
from .inspur.inspur_multi_sqli import inspur_multi_sqli_BaseVerify
from .inspur.inspur_ecgap_displayNewsPic_sqli import inspur_ecgap_displayNewsPic_sqli_BaseVerify
#gobetters vulns
from .gobetters.gobetters_multi_sqli import gobetters_multi_sqli_BaseVerify
#lbcms vulns
from .lbcms.lbcms_webwsfw_bssh_sqli import lbcms_webwsfw_bssh_sqli_BaseVerify
#dswjcms vulns
from .dswjcms.dswjcms_p2p_multi_sqli import dswjcms_p2p_multi_sqli_BaseVerify
#wordpress vulns
from .wordpress.wordpress_plugin_azonpop_sqli import wordpress_plugin_azonpop_sqli_BaseVerify
from .wordpress.wordpress_plugin_ShortCode_lfi import wordpress_plugin_ShortCode_lfi_BaseVerify
from .wordpress.wordpress_url_redirect import wordpress_url_redirect_BaseVerify
from .wordpress.wordpress_woocommerce_code_exec import wordpress_woocommerce_code_exec_BaseVerify
from .wordpress.wordpress_plugin_mailpress_rce import wordpress_plugin_mailpress_rce_BaseVerify
from .wordpress.wordpress_admin_ajax_filedownload import wordpress_admin_ajax_filedownload_BaseVerify
from .wordpress.wordpress_restapi_sqli import wordpress_restapi_sqli_BaseVerify
from .wordpress.wordpress_display_widgets_backdoor import wordpress_display_widgets_backdoor_BaseVerify
#票友 vulns
from .piaoyou.piaoyou_multi_sqli import piaoyou_multi_sqli_BaseVerify
from .piaoyou.piaoyou_ten_sqli import piaoyou_ten_sqli_BaseVerify
from .piaoyou.piaoyou_six_sqli import piaoyou_six_sqli_BaseVerify
from .piaoyou.piaoyou_six2_sqli import piaoyou_six2_sqli_BaseVerify
from .piaoyou.piaoyou_int_order_sqli import piaoyou_int_order_sqli_BaseVerify
from .piaoyou.piaoyou_newsview_list import piaoyou_newsview_list_BaseVerify
#TCExam vulns
from .tcexam.tcexam_reinstall_getshell import tcexam_reinstall_getshell_BaseVerify
#最土团购 vulns
from .zuitu.zuitu_coupon_id_sqli import zuitu_coupon_id_sqli_BaseVerify
#iwms vulns
from .iwms.iwms_bypass_js_delete import iwms_bypass_js_delete_BaseVerify
#cxplus vulns
from .xplus.xplus_2003_getshell import xplus_2003_getshell_BaseVerify
from .xplus.xplus_mysql_mssql_sqli import xplus_mysql_mssql_sqli_BaseVerify
#东软uniportal vulns
from .uniportal.uniportal_bypass_priv_sqli import uniportal_bypass_priv_sqli_BaseVerify
#pageadmin vulns
from .pageadmin.pageadmin_forge_viewstate import pageadmin_forge_viewstate_BaseVerify
#ruvar vulns
from .ruvar.ruvar_oa_multi_sqli import ruvar_oa_multi_sqli_BaseVerify
from .ruvar.ruvar_oa_multi_sqli2 import ruvar_oa_multi_sqli2_BaseVerify
from .ruvar.ruvar_oa_multi_sqli3 import ruvar_oa_multi_sqli3_BaseVerify
#jumboecms vulns
from .jumboecms.jumboecms_slide_id_sqli import jumboecms_slide_id_sqli_BaseVerify
#joomla vulns
from .joomla.joomla_com_docman_lfi import joomla_com_docman_lfi_BaseVerify
from .joomla.joomla_index_list_sqli import joomla_index_list_sqli_BaseVerify
#360shop vulns
from .shop360.shop360_do_filedownload import shop360_do_filedownload_BaseVerify
#pstar vulns
from .pstar.pstar_warehouse_msg_01_sqli import pstar_warehouse_msg_01_sqli_BaseVerify
from .pstar.pstar_isfLclInfo_sqli import pstar_isfLclInfo_sqli_BaseVerify
from .pstar.pstar_qcustoms_sqli import pstar_qcustoms_sqli_BaseVerify
#trs vulns
from .trs.trs_wcm_pre_as_lfi import trs_wcm_pre_as_lfi_BaseVerify
from .trs.trs_inforadar_disclosure import trs_inforadar_disclosure_BaseVerify
from .trs.trs_lunwen_papercon_sqli import trs_lunwen_papercon_sqli_BaseVerify
from .trs.trs_infogate_xxe import trs_infogate_xxe_BaseVerify
from .trs.trs_infogate_register import trs_infogate_register_BaseVerify
from .trs.trs_was5_config_disclosure import trs_was5_config_disclosure_BaseVerify
from .trs.trs_wcm_default_user import trs_wcm_default_user_BaseVerify
from .trs.trs_wcm_infoview_disclosure import trs_wcm_infoview_disclosure_BaseVerify
from .trs.trs_was40_passwd_disclosure import trs_was40_passwd_disclosure_BaseVerify
from .trs.trs_was40_tree_disclosure import trs_was40_tree_disclosure_BaseVerify
from .trs.trs_ids_auth_disclosure import trs_ids_auth_disclosure_BaseVerify
from .trs.trs_was5_download_templet import trs_was5_download_templet_BaseVerify
from .trs.trs_wcm_service_writefile import trs_wcm_service_writefile_BaseVerify
#易创思 vulns
from .ecscms.ecscms_MoreIndex_sqli import ecscms_MoreIndex_sqli_BaseVerify
#金窗教务系统 vulns
from .gowinsoft_jw.gowinsoft_jw_multi_sqli import gowinsoft_jw_multi_sqli_BaseVerify
#siteserver vulns
from .siteserver.siteserver_background_taskLog_sqli import siteserver_background_taskLog_sqli_BaseVerify
from .siteserver.siteserver_background_log_sqli import siteserver_background_log_sqli_BaseVerify
from .siteserver.siteserver_UserNameCollection_sqli import siteserver_UserNameCollection_sqli_BaseVerify
from .siteserver.siteserver_background_keywordsFilting_sqli import siteserver_background_keywordsFilting_sqli_BaseVerify
from .siteserver.siteserver_background_administrator_sqli import siteserver_background_administrator_sqli_BaseVerify
#nitc vulns
from .nitc.nitc_suggestwordList_sqli import nitc_suggestwordList_sqli_BaseVerify
from .nitc.nitc_index_language_id_sqli import nitc_index_language_id_sqli_BaseVerify
#南大之星 vulns
from .ndstar.ndstar_six_sqli import ndstar_six_sqli_BaseVerify
#安财软件 vulns
from .acsoft.acsoft_GetXMLList_fileread import acsoft_GetXMLList_fileread_BaseVerify
from .acsoft.acsoft_GetFile_fileread import acsoft_GetFile_fileread_BaseVerify
from .acsoft.acsoft_GetFileContent_fileread import acsoft_GetFileContent_fileread_BaseVerify
#英福金银花ETMV9数字化校园平台
from .etmdcp.etmdcp_Load_filedownload import etmdcp_Load_filedownload_BaseVerify
#speedcms vulns
from .speedcms.speedcms_list_cid_sqli import speedcms_list_cid_sqli_BaseVerify
#任我行 vulns
from .weway.weway_PictureView1_filedownload import weway_PictureView1_filedownload_BaseVerify
#esccms vulns
from .esccms.esccms_selectunitmember_unauth import esccms_selectunitmember_unauth_BaseVerify
#wecenter vulns
from .wecenter.wecenter_topic_id_sqli import wecenter_topic_id_sqli_BaseVerify
#shopnum1 vulns
from .shopnum.shopnum_ShoppingCart1_sqli import shopnum_ShoppingCart1_sqli_BaseVerify
from .shopnum.shopnum_ProductListCategory_sqli import shopnum_ProductListCategory_sqli_BaseVerify
from .shopnum.shopnum_GuidBuyList_sqli import shopnum_GuidBuyList_sqli_BaseVerify
from .shopnum.shopnum_ProductDetail_sqli import shopnum_ProductDetail_sqli_BaseVerify
#fastmeeting vulns
from .fastmeeting.fastmeeting_download_filedownload import fastmeeting_download_filedownload_BaseVerify
#远古 vulns
from .viewgood.viewgood_two_sqli import viewgood_two_sqli_BaseVerify
from .viewgood.viewgood_pic_proxy_sqli import viewgood_pic_proxy_sqli_BaseVerify
from .viewgood.viewgood_GetCaption_sqli import viewgood_GetCaption_sqli_BaseVerify
#shop7z vulns
from .shop7z.shop7z_order_checknoprint_sqli import shop7z_order_checknoprint_sqli_BaseVerify
#dreamgallery vulns
from .dreamgallery.dreamgallery_album_id_sqli import dreamgallery_album_id_sqli_BaseVerify
#kxmail vulns
from .kxmail.kxmail_login_server_sqli import kxmail_login_server_sqli_BaseVerify
#shopnc vulns
from .shopnc.shopnc_index_class_id_sqli import shopnc_index_class_id_sqli_BaseVerify
#shadowsit vulns
from .shadowsit.shadowsit_selector_lfi import shadowsit_selector_lfi_BaseVerify
#phpcms vulns
from .phpcms.phpcms_digg_add_sqli import phpcms_digg_add_sqli_BaseVerify
from .phpcms.phpcms_authkey_disclosure import phpcms_authkey_disclosure_BaseVerify
from .phpcms.phpcms_flash_upload_sqli import phpcms_flash_upload_sqli_BaseVerify
from .phpcms.phpcms_product_code_exec import phpcms_product_code_exec_BaseVerify
from .phpcms.phpcms_v96_sqli import phpcms_v96_sqli_BaseVerify
from .phpcms.phpcms_v961_fileread import phpcms_v961_fileread_BaseVerify
from .phpcms.phpcms_v9_flash_xss import phpcms_v9_flash_xss_BaseVerify
#seacms vulns
from .seacms.seacms_search_code_exec import seacms_search_code_exec_BaseVerify
from .seacms.seacms_order_code_exec import seacms_order_code_exec_BaseVerify
from .seacms.seacms_search_jq_code_exec import seacms_search_jq_code_exec_BaseVerify
#cmseasy vulns
from .cmseasy.cmseasy_header_detail_sqli import cmseasy_header_detail_sqli_BaseVerify
#phpmyadmin vulns
from .phpmyadmin.phpmyadmin_setup_lfi import phpmyadmin_setup_lfi_BaseVerify
#opensns vulns
from .opensns.opensns_index_arearank import opensns_index_arearank_BaseVerify
from .opensns.opensns_index_getshell import opensns_index_getshell_BaseVerify
#thinksns vulns
from .thinksns.thinksns_category_code_exec import thinksns_category_code_exec_BaseVerify
#others vulns
from .others.domino_unauth import domino_unauth_BaseVerify
from .others.hjsoft_sqli import hjsoft_sqli_BaseVerify
from .others.hnkj_researchinfo_dan_sqli import hnkj_researchinfo_dan_sqli_BaseVerify
from .others.gpcsoft_ewebeditor_weak import gpcsoft_ewebeditor_weak_BaseVerify
from .others.rap_interface_struts_exec import rap_interface_struts_exec_BaseVerify
from .others.hongan_dlp_struts_exec import hongan_dlp_struts_exec_BaseVerify
from .others.jiuyu_library_struts_exec import jiuyu_library_struts_exec_BaseVerify
from .others.yaojie_steel_struts_exec import yaojie_steel_struts_exec_BaseVerify
from .others.dkcms_database_disclosure import dkcms_database_disclosure_BaseVerify
from .others.damall_selloffer_sqli import damall_selloffer_sqli_BaseVerify
from .others.yeu_disclosure_uid import yeu_disclosure_uid_BaseVerify
from .others.clib_kinweblistaction_download import clib_kinweblistaction_download_BaseVerify
from .others.euse_study_multi_sqli import euse_study_multi_sqli_BaseVerify
from .others.suntown_upfile_fileupload import suntown_upfile_fileupload_BaseVerify
from .others.skytech_bypass_priv import skytech_bypass_priv_BaseVerify
from .others.mallbuilder_change_status_sqli import mallbuilder_change_status_sqli_BaseVerify
from .others.efuture_downloadAct_filedownload import efuture_downloadAct_filedownload_BaseVerify
from .others.kj65n_monitor_sqli import kj65n_monitor_sqli_BaseVerify
from .others.sinda_downloadfile_download import sinda_downloadfile_download_BaseVerify
from .others.lianbang_multi_bypass_priv import lianbang_multi_bypass_priv_BaseVerify
from .others.star_PostSuggestion_sqli import star_PostSuggestion_sqli_BaseVerify
from .others.hezhong_list_id_sqli import hezhong_list_id_sqli_BaseVerify
from .others.cicro_DownLoad_filedownload import cicro_DownLoad_filedownload_BaseVerify
from .others.huaficms_bypass_js import huaficms_bypass_js_BaseVerify
from .others.nongyou_multi_sqli import nongyou_multi_sqli_BaseVerify
from .others.zfcgxt_UserSecurityController_getpass import zfcgxt_UserSecurityController_getpass_BaseVerify
from .others.mainone_b2b_Default_sqli import mainone_b2b_Default_sqli_BaseVerify
from .others.mainone_SupplyList_sqli import mainone_SupplyList_sqli_BaseVerify
from .others.workyi_multi_sqli import workyi_multi_sqli_BaseVerify
from .others.newedos_multi_sqli import newedos_multi_sqli_BaseVerify
from .others.xtcms_download_filedownload import xtcms_download_filedownload_BaseVerify
from .others.gn_consulting_sqli import gn_consulting_sqli_BaseVerify
from .others.caitong_multi_sqli import caitong_multi_sqli_BaseVerify
from .others.anmai_teachingtechnology_sqli import anmai_teachingtechnology_sqli_BaseVerify
from .others.alkawebs_viewnews_sqli import alkawebs_viewnews_sqli_BaseVerify
from .others.caitong_multi_sleep_sqli import caitong_multi_sleep_sqli_BaseVerify
from .others.clib_kindaction_fileread import clib_kindaction_fileread_BaseVerify
from .others.mainone_ProductList_sqli import mainone_ProductList_sqli_BaseVerify
from .others.eis_menu_left_edit_sqli import eis_menu_left_edit_sqli_BaseVerify
from .others.tianbo_Type_List_sqli import tianbo_Type_List_sqli_BaseVerify
from .others.tianbo_TCH_list_sqli import tianbo_TCH_list_sqli_BaseVerify
from .others.tianbo_Class_Info_sqli import tianbo_Class_Info_sqli_BaseVerify
from .others.tianbo_St_Info_sqli import tianbo_St_Info_sqli_BaseVerify
from .others.nongyou_Item2_sqli import nongyou_Item2_sqli_BaseVerify
from .others.gxwssb_fileDownloadmodel_download import gxwssb_fileDownloadmodel_download_BaseVerify
from .others.anmai_grghjl_stuNo_sqli import anmai_grghjl_stuNo_sqli_BaseVerify
from .others.nongyou_ShowLand_sqli import nongyou_ShowLand_sqli_BaseVerify
from .others.nongyou_sleep_sqli import nongyou_sleep_sqli_BaseVerify
from .others.zf_cms_FileDownload import zf_cms_FileDownload_BaseVerify
from .others.shiyou_list_keyWords_sqli import shiyou_list_keyWords_sqli_BaseVerify
from .others.zhuofan_downLoadFile_download import zhuofan_downLoadFile_download_BaseVerify
from .others.gevercms_downLoadFile_filedownload import gevercms_downLoadFile_filedownload_BaseVerify
from .others.ips_community_suite_code_exec import ips_community_suite_code_exec_BaseVerify
from .others.skytech_geren_list_page_sqli import skytech_geren_list_page_sqli_BaseVerify
from .others.xuezi_ceping_unauth import xuezi_ceping_unauth_BaseVerify
from .others.haohan_FileDown_filedownload import haohan_FileDown_filedownload_BaseVerify
from .others.mingteng_cookie_deception import mingteng_cookie_deception_BaseVerify
from .others.jxt1039_unauth import jxt1039_unauth_BaseVerify
from .others.tpshop_eval_stdin_code_exec import tpshop_eval_stdin_code_exec_BaseVerify
| 50.971897 | 120 | 0.913163 | 2,966 | 21,765 | 6.188132 | 0.158463 | 0.130435 | 0.078457 | 0.039229 | 0.209491 | 0.039555 | 0 | 0 | 0 | 0 | 0 | 0.007809 | 0.058626 | 21,765 | 426 | 121 | 51.091549 | 0.887989 | 0.050999 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.035573 | 1 | 0 | 1 | 0.003953 | 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 |
2d182e0f60d96a4cc9ba693945b3a09e87b3dfa0 | 1,831 | py | Python | django_view_permissions/access.py | Ayub-Khan/django-view-permissions | aea3697d2d6304477eed4b79750e1a66f5558587 | [
"Apache-2.0"
] | null | null | null | django_view_permissions/access.py | Ayub-Khan/django-view-permissions | aea3697d2d6304477eed4b79750e1a66f5558587 | [
"Apache-2.0"
] | 10 | 2020-02-29T11:37:43.000Z | 2020-04-10T08:33:11.000Z | django_view_permissions/access.py | Ayub-Khan/django-view-permissions | aea3697d2d6304477eed4b79750e1a66f5558587 | [
"Apache-2.0"
] | null | null | null | """Checks view access for Permissions"""
METHODS = (
'GET',
'POST',
)
# pylint: disable=too-few-public-methods
class CheckAcess:
"""
Checks the permissions for Request.
"""
def __init__(self, request, permissions):
self.request = request
self.permissions = permissions
def have_view_access(self):
"""
Checks if any of the permission is true for request.
"""
method_based = tuple(
filter(
lambda x: bool(x[1](self.request)),
tuple(
filter(
lambda x: x[0] == 'method',
self.permissions
)
)
)
)
class_based = tuple(
filter(
lambda x: bool(x[1](self.request)()),
tuple(
filter(
lambda x: x[0] == 'class',
self.permissions
)
)
)
)
attr_based = tuple(
filter(
lambda x: x[2] == getattr(self.request.user, x[1]),
tuple(
filter(
lambda x: x[0] == 'attr',
self.permissions
)
)
)
)
allowed_permissions = tuple(
filter(
lambda x: self.request.method in (x[3] if len(x) == 4 else METHODS),
attr_based
)
) + tuple(
filter(
lambda x: self.request.method in (x[2] if len(x) == 3 else METHODS),
method_based + class_based
)
)
if any(allowed_permissions):
return True
return False
| 25.430556 | 84 | 0.404697 | 158 | 1,831 | 4.601266 | 0.303797 | 0.121045 | 0.18707 | 0.198074 | 0.348006 | 0.34663 | 0.269601 | 0.269601 | 0.269601 | 0.165062 | 0 | 0.012035 | 0.500819 | 1,831 | 71 | 85 | 25.788732 | 0.78337 | 0.089022 | 0 | 0.25 | 0 | 0 | 0.013547 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.035714 | false | 0 | 0 | 0 | 0.089286 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2d1b223bb17f04c778a405e353a113b0c593409d | 2,001 | py | Python | manga_py/providers/comic_naver_com.py | sonvt1710/manga-py | 848a78e93b890af0c92056a1a9fc7f6ce5707cf6 | [
"MIT"
] | 7 | 2019-07-31T13:50:59.000Z | 2019-08-24T03:04:13.000Z | manga_py/providers/comic_naver_com.py | sonvt1710/manga-py | 848a78e93b890af0c92056a1a9fc7f6ce5707cf6 | [
"MIT"
] | 18 | 2019-07-26T22:27:06.000Z | 2019-08-25T13:45:13.000Z | manga_py/providers/comic_naver_com.py | sonvt1710/manga-py | 848a78e93b890af0c92056a1a9fc7f6ce5707cf6 | [
"MIT"
] | 2 | 2019-08-07T12:38:25.000Z | 2019-08-08T06:53:31.000Z | from manga_py.provider import Provider
from .helpers.std import Std
class ComicNaverCom(Provider, Std):
title_id = 0
url_pattern = 'https://comic.naver.com/webtoon/list.nhn?titleId={}'
def get_archive_name(self) -> str:
return self.get_chapter_index()
def get_chapter_index(self) -> str:
return 'vol_{}-{}'.format(self.chapter_id, self.chapter[1])
def get_content(self):
return self.http_get(self.url_pattern.format(self.title_id))
def get_manga_name(self) -> str:
return self.text_content(self.content, '.comicinfo > .detail > h2')
def _chapters_part(self, content: str):
elements = self._elements('.viewList .title > a', content)
pager = self._elements('.page > .num_page', content)
if len(pager) == 0:
return elements, 1
return elements, int(self.element_text_content_full(pager[-1]))
def get_chapters(self):
self.log('Parse chapters, please wait...')
chapters, max_page = self._chapters_part(self.content)
page = 2
while True:
if page >= max_page:
break
content = self.http_get(self.url_pattern.format(f'{self.title_id}&page={page}'))
_chapters, max_page = self._chapters_part(content)
chapters = [*chapters, *_chapters]
page += 1
n = self.normalize_uri
return [(n(chapter.get('href')), self.element_text_content(chapter)) for chapter in chapters]
def get_files(self):
parser = self.document_fromstring(self.http_get(self.chapter[0]), '#comic_view_area', 0)
return self._images_helper(parser, '.wt_viewer > img')
def get_cover(self) -> str:
return self._cover_from_content('.comicinfo > .thumb > a > img')
def chapter_for_json(self) -> str:
return self.chapter[0]
def prepare_cookies(self):
self.title_id = self.re.search(r'\btitleId=(\d+)', self.get_url()).group(1)
main = ComicNaverCom
| 31.265625 | 101 | 0.637181 | 262 | 2,001 | 4.641221 | 0.351145 | 0.034539 | 0.053454 | 0.055921 | 0.136513 | 0.101974 | 0.050987 | 0 | 0 | 0 | 0 | 0.007807 | 0.231884 | 2,001 | 63 | 102 | 31.761905 | 0.783344 | 0 | 0 | 0 | 0 | 0 | 0.129435 | 0.013493 | 0 | 0 | 0 | 0 | 0 | 1 | 0.238095 | false | 0 | 0.047619 | 0.142857 | 0.595238 | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.