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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bad31635f08436ee2a866d2a03d49721eb7a8118 | 603 | py | Python | discord_key_bot/colours.py | gadogttas/discord-key-bot | 230cbc1ea90cb751cc113b3ad12b3794a9ed162d | [
"Unlicense"
] | 1 | 2021-12-01T05:33:47.000Z | 2021-12-01T05:33:47.000Z | discord_key_bot/colours.py | bayangan1991/discord-key-bot | e1ed7d23d639cc04163c0af7d32a02134c95e930 | [
"Unlicense"
] | null | null | null | discord_key_bot/colours.py | bayangan1991/discord-key-bot | e1ed7d23d639cc04163c0af7d32a02134c95e930 | [
"Unlicense"
] | 1 | 2021-11-06T22:07:40.000Z | 2021-11-06T22:07:40.000Z | from enum import IntEnum, unique
@unique
class Colours(IntEnum):
DEFAULT = 0
AQUA = 1752220
GREEN = 3066993
BLUE = 3447003
PURPLE = 10181046
GOLD = 15844367
ORANGE = 15105570
RED = 15158332
GREY = 9807270
DARKER_GREY = 8359053
NAVY = 3426654
DARK_AQUA = 1146986
DARK_GREEN = 2067276
DARK_BLUE = 2123412
DARK_PURPLE = 7419530
DARK_GOLD = 12745742
DARK_ORANGE = 11027200
DARK_RED = 10038562
DARK_GREY = 9936031
LIGHT_GREY = 12370112
DARK_NAVY = 2899536
LUMINOUS_VIVID_PINK = 16580705
DARK_VIVID_PINK = 12320855
| 20.793103 | 34 | 0.669983 | 70 | 603 | 5.557143 | 0.657143 | 0.046272 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.381944 | 0.283582 | 603 | 28 | 35 | 21.535714 | 0.518519 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.038462 | 0 | 0.961538 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
baea3b2f8575034be19e0d6d559722c78a729f7c | 188 | py | Python | sudkampPython/turingMachAlgs.py | thundergolfer/sudkamp-langs-machines-python | 04e07758464891dd9815a9578cf158638bab8f24 | [
"MIT"
] | 8 | 2016-08-21T10:28:35.000Z | 2017-05-30T12:33:50.000Z | sudkampPython/turingMachAlgs.py | thundergolfer/sudkamp-langs-machines-python | 04e07758464891dd9815a9578cf158638bab8f24 | [
"MIT"
] | 1 | 2018-02-27T05:10:19.000Z | 2018-02-27T05:10:19.000Z | sudkampPython/turingMachAlgs.py | thundergolfer/sudkamp-langs-machines-python | 04e07758464891dd9815a9578cf158638bab8f24 | [
"MIT"
] | null | null | null | import turingMachines
def recursiveSimulationOfNDTM( ndtm, w,
configurations,
constant, s_n ):
raise NotImplementedError
| 26.857143 | 47 | 0.542553 | 12 | 188 | 8.416667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.420213 | 188 | 6 | 48 | 31.333333 | 0.926606 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 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 | 0 | 0 | 0 | 0 | 0 | 2 |
bafbd573e6799db93aad7945d6800b943fd0c309 | 189 | py | Python | keep_alive.py | LeoATX/blackjack-bot | c4067bf590cbc7f61a25b0fb8447b9fae79d280f | [
"MIT"
] | null | null | null | keep_alive.py | LeoATX/blackjack-bot | c4067bf590cbc7f61a25b0fb8447b9fae79d280f | [
"MIT"
] | null | null | null | keep_alive.py | LeoATX/blackjack-bot | c4067bf590cbc7f61a25b0fb8447b9fae79d280f | [
"MIT"
] | null | null | null | import flask
import threading
app = flask.Flask('main.py')
@app.route('/')
def index():
return flask.render_template("index.html")
t = threading.Thread(target=app.run())
t.start()
| 13.5 | 46 | 0.687831 | 27 | 189 | 4.777778 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.132275 | 189 | 13 | 47 | 14.538462 | 0.786585 | 0 | 0 | 0 | 0 | 0 | 0.095238 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.25 | 0.125 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
240e999c966fd2219adea6ecbd775e1f4a9b09ec | 306 | py | Python | 4. RPA Challenge - Json Parsing/libraries/MyLibrary.py | antusystem/Uipath-Challenges-with-Robocorp | a7e91a3954aa1542b3e452b5d2a9690791834eb7 | [
"MIT"
] | 1 | 2021-10-31T19:21:14.000Z | 2021-10-31T19:21:14.000Z | 4. RPA Challenge - Json Parsing/libraries/MyLibrary.py | antusystem/Uipath-Challenges-with-Robocorp | a7e91a3954aa1542b3e452b5d2a9690791834eb7 | [
"MIT"
] | null | null | null | 4. RPA Challenge - Json Parsing/libraries/MyLibrary.py | antusystem/Uipath-Challenges-with-Robocorp | a7e91a3954aa1542b3e452b5d2a9690791834eb7 | [
"MIT"
] | null | null | null | from robot.api import logger
class MyLibrary:
"""Give this library a proper name and document it."""
def example_python_keyword(self):
logger.info("This is Python!")
def Tipo(self, var):
print("La variable es: ", var)
print("El tipo de la variable es: ", type(var))
| 23.538462 | 58 | 0.633987 | 44 | 306 | 4.363636 | 0.727273 | 0.083333 | 0.125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.248366 | 306 | 12 | 59 | 25.5 | 0.834783 | 0.156863 | 0 | 0 | 0 | 0 | 0.230159 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.142857 | 0 | 0.571429 | 0.285714 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
241bc7702cb56affbc662f5ebb938c50e4bb694b | 3,922 | py | Python | cinder/volume/drivers/violin/vxg/vshare/igroup.py | rlucio/cinder-violin-driver-icehouse | 1632bf1bdf67f7e26a586c819dd836f6541c4f3d | [
"Apache-2.0"
] | null | null | null | cinder/volume/drivers/violin/vxg/vshare/igroup.py | rlucio/cinder-violin-driver-icehouse | 1632bf1bdf67f7e26a586c819dd836f6541c4f3d | [
"Apache-2.0"
] | 1 | 2021-01-12T23:22:22.000Z | 2021-01-12T23:22:22.000Z | cinder/volume/drivers/violin/vxg/vshare/igroup.py | rlucio/cinder-violin-driver-icehouse | 1632bf1bdf67f7e26a586c819dd836f6541c4f3d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Violin Memory, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from cinder.volume.drivers.violin.vxg.core.node import XGNode
from cinder.volume.drivers.violin.vxg.core.error import *
"""
Here's an example of how to extend the functionality in this module:
class IGroupManager_1(IGroupManager):
def __init__(self, basic):
super(IGroupManager_1, self).__init__(basic)
def new_function(self, *args):
pass
"""
class IGroupManager(object):
def __init__(self, basic):
self._basic = basic
def create_igroup(self, igroup):
"""Create an igroup.
Arguments:
igroup -- string
Returns:
Action result as a dict.
"""
return self._igroup_create(igroup, False)
def delete_igroup(self, igroup):
"""Deletes an igroup.
Arguments:
igroup -- string
Returns:
Action result as a dict.
"""
return self._igroup_create(igroup, True)
def add_initiators(self, igroup, initiators):
"""Add initiators to an igroup.
Arguments:
igroup -- string
initiators -- string (string or list)
Returns:
Action result as a dict.
"""
return self._igroup_modify(igroup, initiators, False)
def delete_initiators(self, igroup, initiators):
"""Delete initiators to an igroup.
Arguments:
igroup -- string
initiators -- string (string or list)
Returns:
Action result as a dict.
"""
return self._igroup_modify(igroup, initiators, True)
# Begin internal functions
def _igroup_create(self, igroup, delete):
"""Internal work function for:
create_igroup
delete_igroup
"""
nodes = []
nodes.append(XGNode('igroup', 'string', igroup))
nodes.append(XGNode('delete', 'bool', delete))
return self._basic.perform_action('/vshare/actions' +
'/igroup/create', nodes)
def _igroup_modify(self, igroup, initiators, delete):
"""Internal work function for:
add_initiators
delete_initiators
"""
nodes = []
nodes.append(XGNode('igroup', 'string', igroup))
nodes.extend(XGNode.as_node_list('initiators/{0}', 'string',
initiators))
nodes.append(XGNode('delete', 'bool', delete))
return self._basic.perform_action('/vshare/actions' +
'/igroup/modify', nodes)
class IGroupManager_1(IGroupManager):
def __init__(self, basic):
super(IGroupManager_1, self).__init__(basic)
def rename_igroup(self, old_igroup, new_igroup):
"""Renames an igroup.
Arguments:
old_igroup -- string
new_igroup -- string
Returns:
Action result as a dict.
"""
nodes = []
nodes.append(XGNode('old_igroup', 'string', old_igroup))
nodes.append(XGNode('new_igroup', 'string', new_igroup))
return self._basic.perform_action('/vshare/actions' +
'/igroup/rename', nodes)
| 27.619718 | 78 | 0.59536 | 430 | 3,922 | 5.283721 | 0.316279 | 0.044014 | 0.044894 | 0.046215 | 0.465669 | 0.440141 | 0.440141 | 0.408451 | 0.333627 | 0.333627 | 0 | 0.005891 | 0.307496 | 3,922 | 141 | 79 | 27.815603 | 0.830633 | 0.359001 | 0 | 0.333333 | 0 | 0 | 0.095761 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.055556 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
241c932f8d6884657a5776df61573b2c75265623 | 1,062 | py | Python | TWT/apps/challenges/views/__init__.py | avibn/twtcodejam.net | 938b9a536dc6407dd86651697abde4f167fc52a8 | [
"MIT"
] | null | null | null | TWT/apps/challenges/views/__init__.py | avibn/twtcodejam.net | 938b9a536dc6407dd86651697abde4f167fc52a8 | [
"MIT"
] | null | null | null | TWT/apps/challenges/views/__init__.py | avibn/twtcodejam.net | 938b9a536dc6407dd86651697abde4f167fc52a8 | [
"MIT"
] | null | null | null | from .home import HomeView
from .logout import LogoutView
from .new import NewChallengeView
from .view import DetailView
from .test import TestView
from .end import EndView
from .start import StartView
from .stop_team import StopTeams
from .start_submission import StartSubmission
from .stop_submission import StopSubmission
from .start_team import StartTeams
from .unreleased import UnreleasedView
from .delete_challenge import DeleteView
from .start_voting import StartVoting
from .stop_voting import StopVoting
from .custom_page_view import CustomView
start = StartView.as_view()
end = EndView.as_view()
test = TestView.as_view()
logout = LogoutView.as_view()
new = NewChallengeView.as_view()
view = DetailView.as_view()
start_team = StartTeams.as_view()
stop_team = StopTeams.as_view()
start_submission = StartSubmission.as_view()
stop_submission = StopSubmission.as_view()
unreleased_view = UnreleasedView.as_view()
delete_view = DeleteView.as_view()
start_voting = StartVoting.as_view()
stop_voting = StopVoting.as_view()
view_custom = CustomView.as_view() | 34.258065 | 45 | 0.826742 | 142 | 1,062 | 5.950704 | 0.246479 | 0.106509 | 0.039053 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.101695 | 1,062 | 31 | 46 | 34.258065 | 0.885744 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.516129 | 0 | 0.516129 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
241e95009d78fdfb77d3e61f1604105036f0346c | 22,564 | py | Python | tests/test_tokenizer.py | cd109/scrappybara | 691385e3eb18eac4c5bec58950166b4c03c75a4b | [
"MIT"
] | null | null | null | tests/test_tokenizer.py | cd109/scrappybara | 691385e3eb18eac4c5bec58950166b4c03c75a4b | [
"MIT"
] | null | null | null | tests/test_tokenizer.py | cd109/scrappybara | 691385e3eb18eac4c5bec58950166b4c03c75a4b | [
"MIT"
] | 1 | 2020-10-20T03:36:59.000Z | 2020-10-20T03:36:59.000Z | import unittest
from scrappybara.preprocessing.tokenizer import Tokenizer
_TOKENIZE = Tokenizer()
class TestTokenizer(unittest.TestCase):
# BLOCKS
# -------------------------------------------------------------------------->
def test_indirect_speech_blocks(self):
self.assertEqual('Well , he said ༺1༻'.split(), _TOKENIZE('Well, he said ༺1༻'))
self.assertEqual('⦅1⦆ Well , he said ༺1༻'.split(), _TOKENIZE('⦅1⦆ Well, he said ༺1༻'))
# SHORT TEXT
# -------------------------------------------------------------------------->
def test_split_special_words(self):
self.assertEqual('I can not do that .'.split(), _TOKENIZE('I cannot do that.'))
self.assertEqual('Can not do that !'.split(), _TOKENIZE('Cannot do that!'))
def test_links(self):
self.assertEqual('domain.com'.split(), _TOKENIZE('domain.com'))
self.assertEqual('Cellucor.com'.split(), _TOKENIZE('Cellucor.com'))
self.assertEqual('DOMAIN.COM'.split(), _TOKENIZE('DOMAIN.COM'))
self.assertEqual('sub.domain.com.au'.split(), _TOKENIZE('sub.domain.com.au'))
self.assertEqual('sub.domain123.com.au'.split(), _TOKENIZE('sub.domain123.com.au'))
self.assertEqual('data@unicef.org.au'.split(), _TOKENIZE('data@unicef.org.au'))
self.assertEqual('mr.aid@unicef21.org.au'.split(), _TOKENIZE('mr.aid@unicef21.org.au'))
self.assertEqual('tacos.pic.twitter.com/Q4usgzGMHq'.split(), _TOKENIZE('tacos.pic.twitter.com/Q4usgzGMHq'))
def test_dots_single_tokens_nosplit(self):
self.assertEqual('a.'.split(), _TOKENIZE('a.'))
self.assertEqual('.end'.split(), _TOKENIZE('.end'))
self.assertEqual('.End'.split(), _TOKENIZE('.End'))
self.assertEqual('1 .'.split(), _TOKENIZE('1.'))
self.assertEqual('.11'.split(), _TOKENIZE('.11'))
self.assertEqual('1.deliver'.split(), _TOKENIZE('1.deliver'))
self.assertEqual('1.Deliver'.split(), _TOKENIZE('1.Deliver'))
self.assertEqual('deliver.1'.split(), _TOKENIZE('deliver.1'))
self.assertEqual('deliveR.1'.split(), _TOKENIZE('deliveR.1'))
self.assertEqual('.deliver'.split(), _TOKENIZE('.deliver'))
self.assertEqual('.Deliver'.split(), _TOKENIZE('.Deliver'))
self.assertEqual('aaa.deliver'.split(), _TOKENIZE('aaa.deliver'))
self.assertEqual('aaA.Deliver'.split(), _TOKENIZE('aaA.Deliver'))
self.assertEqual('$1.3M'.split(), _TOKENIZE('$1.3M'))
self.assertEqual('1.1'.split(), _TOKENIZE('1.1'))
self.assertEqual('123.123'.split(), _TOKENIZE('123.123'))
self.assertEqual('123.123.1'.split(), _TOKENIZE('123.123.1'))
self.assertEqual('1.1.1.1'.split(), _TOKENIZE('1.1.1.1'))
self.assertEqual('A.B.1.C'.split(), _TOKENIZE('A.B.1.C'))
self.assertEqual('A.B.C'.split(), _TOKENIZE('A.B.C'))
self.assertEqual('A.B.C.'.split(), _TOKENIZE('A.B.C.'))
self.assertEqual('e.g.'.split(), _TOKENIZE('e.g.'))
self.assertEqual('e.g'.split(), _TOKENIZE('e.g'))
self.assertEqual('A.A'.split(), _TOKENIZE('A.A'))
self.assertEqual('U.S.'.split(), _TOKENIZE('U.S.'))
self.assertEqual('u.s.'.split(), _TOKENIZE('u.s.'))
self.assertEqual('1.A'.split(), _TOKENIZE('1.A'))
self.assertEqual('A.1'.split(), _TOKENIZE('A.1'))
self.assertEqual('I1.I0I'.split(), _TOKENIZE('I1.I0I'))
self.assertEqual('items.101'.split(), _TOKENIZE('items.101'))
self.assertEqual('items.I0I.A'.split(), _TOKENIZE('items.I0I.A'))
def test_multiple_dots_split(self):
self.assertEqual('a new ... Sentence'.split(), _TOKENIZE('a new... Sentence'))
self.assertEqual('bla ...'.split(), _TOKENIZE('bla...'))
def test_multiple_sentence_enders(self):
self.assertEqual('a new !!! Sentence'.split(), _TOKENIZE('a new!!! Sentence'))
self.assertEqual('a new ?? Sentence'.split(), _TOKENIZE('a new?? Sentence'))
self.assertEqual('a new ??! Sentence'.split(), _TOKENIZE('a new??! Sentence'))
def test_dots_split(self):
self.assertEqual('a new . Sentence'.split(), _TOKENIZE('a new.Sentence'))
self.assertEqual('December 4 . Sentence'.split(), _TOKENIZE('December 4. Sentence'))
self.assertEqual('try mindfulchef.com . And this .'.split(), _TOKENIZE('try mindfulchef.com. And this.'))
self.assertEqual('a new . Sentence'.split(), _TOKENIZE('a new. Sentence'))
self.assertEqual('Fine Arts . She'.split(), _TOKENIZE('Fine Arts. She'))
self.assertEqual('in june 1962 . Blabla'.split(), _TOKENIZE('in june 1962. Blabla'))
self.assertEqual('information etc . SVN , NN'.split(), _TOKENIZE('information etc. SVN, NN'))
def test_dots_nosplit(self):
self.assertEqual('use .NET'.split(), _TOKENIZE('use .NET'))
self.assertEqual('a new.sentence'.split(), _TOKENIZE('a new.sentence'))
self.assertEqual('a new .sentence'.split(), _TOKENIZE('a new .sentence'))
self.assertEqual('a new. sentence'.split(), _TOKENIZE('a new. sentence'))
self.assertEqual('market in 2015. includes'.split(), _TOKENIZE('market in 2015. includes'))
self.assertEqual('the 69th regt. ,'.split(), _TOKENIZE('the 69th regt.,'))
self.assertEqual('the 69th regt. :'.split(), _TOKENIZE('the 69th regt.:'))
self.assertEqual('the 69th regt. ;'.split(), _TOKENIZE('the 69th regt.;'))
self.assertEqual('the 69th regt . )'.split(), _TOKENIZE('the 69th regt.)'))
self.assertEqual('a srgt . ( born )'.split(), _TOKENIZE('a srgt. (born)'))
self.assertEqual('4. bought'.split(), _TOKENIZE('4. bought'))
self.assertEqual('4 . I bought'.split(), _TOKENIZE('4. I bought'))
self.assertEqual('A. I bought'.split(), _TOKENIZE('A. I bought'))
self.assertEqual('A. I bought A. I bought'.split(), _TOKENIZE('A. I bought A. I bought'))
self.assertEqual('1.A. I bought'.split(), _TOKENIZE('1.A. I bought'))
self.assertEqual('1.A I bought'.split(), _TOKENIZE('1.A I bought'))
self.assertEqual('( 1 . Todo Cambia )'.split(), _TOKENIZE('(1. Todo Cambia)'))
self.assertEqual('( 1. todo )'.split(), _TOKENIZE('(1. todo)'))
self.assertEqual('manuf. comm. strategies'.split(), _TOKENIZE('manuf. comm. strategies'))
self.assertEqual('tech ASP .NET'.split(), _TOKENIZE('tech ASP .NET'))
self.assertEqual('items is N. shore'.split(), _TOKENIZE('items is N. shore'))
self.assertEqual('his name is A. Gray'.split(), _TOKENIZE('his name is A. Gray'))
self.assertEqual('his name is a. gray'.split(), _TOKENIZE('his name is a. gray'))
self.assertEqual('Engage U.S. donors'.split(), _TOKENIZE('Engage U.S. donors'))
self.assertEqual('the min. is 3'.split(), _TOKENIZE('the min. is 3'))
self.assertEqual('the Bld. is'.split(), _TOKENIZE('the Bld. is'))
self.assertEqual('the BLD. is'.split(), _TOKENIZE('the BLD. is'))
self.assertEqual('he is dr. Robin'.split(), _TOKENIZE('he is dr. Robin'))
self.assertEqual('Dr. Robin'.split(), _TOKENIZE('Dr. Robin'))
self.assertEqual('13th ed. New York'.split(), _TOKENIZE('13th ed. New York'))
self.assertEqual('he is Sr. Programmer'.split(), _TOKENIZE('he is Sr. Programmer'))
self.assertEqual('bullet 1. do this'.split(), _TOKENIZE('bullet 1. do this'))
self.assertEqual('bullet 01. do this'.split(), _TOKENIZE('bullet 01. do this'))
self.assertEqual('bullet.2 do this'.split(), _TOKENIZE('bullet.2 do this'))
self.assertEqual('of .20 inch'.split(), _TOKENIZE('of .20 inch'))
self.assertEqual('a. b. ('.split(), _TOKENIZE('a. b. ('))
self.assertEqual('an n. g. :'.split(), _TOKENIZE('an n. g. :'))
self.assertEqual('in u.s. !'.split(), _TOKENIZE('in u.s. !'))
self.assertEqual(', vols. :'.split(), _TOKENIZE(', vols. :'))
self.assertEqual('a volume . "'.split(), _TOKENIZE('a volume. "'))
self.assertEqual("a volume . '".split(), _TOKENIZE("a volume. '"))
self.assertEqual('a volume . ('.split(), _TOKENIZE('a volume. ('))
self.assertEqual('a volume . )'.split(), _TOKENIZE('a volume. )'))
self.assertEqual('a volume . ['.split(), _TOKENIZE('a volume. ['))
self.assertEqual('a volume . ]'.split(), _TOKENIZE('a volume. ]'))
self.assertEqual('a volume . {'.split(), _TOKENIZE('a volume. {'))
self.assertEqual('a volume . }'.split(), _TOKENIZE('a volume. }'))
self.assertEqual('a volume . |'.split(), _TOKENIZE('a volume. |'))
self.assertEqual('a volume . *'.split(), _TOKENIZE('a volume. *'))
def test_exclamation_points_split(self):
self.assertEqual('this is you ! Omg'.split(), _TOKENIZE('this is you! Omg'))
self.assertEqual('this is you !'.split(), _TOKENIZE('this is you!'))
self.assertEqual('this is you !!!'.split(), _TOKENIZE('this is you!!!'))
self.assertEqual('my man ! - marcus'.split(), _TOKENIZE('my man! - marcus'))
def test_exclamation_points_nosplit(self):
self.assertEqual('innovate ! project'.split(), _TOKENIZE('innovate! project'))
def test_non_ambiguous_seperators(self):
self.assertEqual('this [ is ] you'.split(), _TOKENIZE('this [is] you'))
self.assertEqual('this ( is ) you'.split(), _TOKENIZE('this (is) you'))
self.assertEqual('this { is } you'.split(), _TOKENIZE('this {is} you'))
self.assertEqual('this is you ? omg'.split(), _TOKENIZE('this is you? omg'))
self.assertEqual('this is you ???'.split(), _TOKENIZE('this is you???'))
self.assertEqual(r'me \ you'.split(), _TOKENIZE(r'me\you'))
self.assertEqual('me | you'.split(), _TOKENIZE('me|you'))
self.assertEqual('the " cat " jumps'.split(), _TOKENIZE('the "cat" jumps'))
self.assertEqual('the cat ; jumps'.split(), _TOKENIZE('the cat; jumps'))
self.assertEqual('the cat : jumps'.split(), _TOKENIZE('the cat: jumps'))
self.assertEqual('failures : include'.split(), _TOKENIZE('failures :include'))
self.assertEqual('sell > 12'.split(), _TOKENIZE('sell >12'))
self.assertEqual('sell < 12'.split(), _TOKENIZE('sell <12'))
self.assertEqual('ca = breakfast'.split(), _TOKENIZE('ca=breakfast'))
self.assertEqual('targets ='.split(), _TOKENIZE('targets='))
def test_lt_gt(self):
self.assertEqual('sell <-- 12'.split(), _TOKENIZE('sell <-- 12')) # ??
self.assertEqual('sell -> 12'.split(), _TOKENIZE('sell -> 12'))
self.assertEqual('This is < me >'.split(), _TOKENIZE('This is <me>'))
self.assertEqual('Sell > 50%'.split(), _TOKENIZE('Sell >50%'))
self.assertEqual('Sell < 50%'.split(), _TOKENIZE('Sell <50%'))
def test_star(self):
self.assertEqual('discussion * integration'.split(), _TOKENIZE('discussion*integration'))
self.assertEqual('discussion * integration'.split(), _TOKENIZE('discussion****integration'))
self.assertEqual('123*123'.split(), _TOKENIZE('123*123'))
self.assertEqual('123*abc'.split(), _TOKENIZE('123*abc'))
def test_plus(self):
self.assertEqual('responsibilities + timeline'.split(), _TOKENIZE('responsibilities+timeline'))
self.assertEqual('hagen + greg + kris'.split(), _TOKENIZE('hagen+greg+kris'))
self.assertEqual('LTED + Wifi + BLE + Secret'.split(), _TOKENIZE(' LTED+Wifi+BLE+Secret '))
self.assertEqual('3+ at'.split(), _TOKENIZE('3+at'))
self.assertEqual('312+ at'.split(), _TOKENIZE('312+at'))
self.assertEqual('aa+'.split(), _TOKENIZE('aa+'))
def test_ampercases(self):
self.assertEqual('new & old'.split(), _TOKENIZE('new&old'))
self.assertEqual('New & Old'.split(), _TOKENIZE('New&Old'))
self.assertEqual('NEW&OLD'.split(), _TOKENIZE('NEW&OLD'))
self.assertEqual('t&cs'.split(), _TOKENIZE('t&cs'))
self.assertEqual('T&CS'.split(), _TOKENIZE('T&CS'))
self.assertEqual('schedule & provide'.split(), _TOKENIZE('schedule& provide'))
self.assertEqual('schedule & provide'.split(), _TOKENIZE('schedule& provide'))
self.assertEqual('invest R&D'.split(), _TOKENIZE('invest R&D'))
self.assertEqual('invest R&D'.split(), _TOKENIZE('invest R &D'))
self.assertEqual('invest R&D'.split(), _TOKENIZE('invest R& D'))
self.assertEqual('invest R&D'.split(), _TOKENIZE('invest R & D'))
self.assertEqual('invest R & 1'.split(), _TOKENIZE('invest R &1'))
self.assertEqual('invest R & DD'.split(), _TOKENIZE('invest R& DD'))
self.assertEqual('R&D lab'.split(), _TOKENIZE('R&D lab'))
self.assertEqual('R&D lab'.split(), _TOKENIZE('R& D lab'))
self.assertEqual('R&D lab'.split(), _TOKENIZE('R &D lab'))
self.assertEqual('R&D lab'.split(), _TOKENIZE('R & D lab'))
self.assertEqual('invest R&D lab'.split(), _TOKENIZE('invest R&D lab'))
self.assertEqual('invest R&D lab'.split(), _TOKENIZE('invest R &D lab'))
self.assertEqual('invest R&D lab'.split(), _TOKENIZE('invest R& D lab'))
self.assertEqual('invest R&D lab'.split(), _TOKENIZE('invest R & D lab'))
self.assertEqual('invest AR&D lab'.split(), _TOKENIZE('invest A R & D lab'))
self.assertEqual('invest R&DA lab'.split(), _TOKENIZE('invest R & D A lab'))
self.assertEqual('invest RR & R2 A lab'.split(), _TOKENIZE('invest RR & R2 A lab'))
self.assertEqual('kitchen & utility'.split(), _TOKENIZE('kitchen&utility'))
def test_slashes(self):
self.assertEqual('10/10/2010'.split(), _TOKENIZE('10/10/2010'))
self.assertEqual('b2b / b2c'.split(), _TOKENIZE('b2b/b2c'))
self.assertEqual('me / you'.split(), _TOKENIZE('me/you'))
self.assertEqual('me / you'.split(), _TOKENIZE('me /you'))
self.assertEqual('me / you'.split(), _TOKENIZE('me/ you'))
self.assertEqual('/ external'.split(), _TOKENIZE('/external'))
self.assertEqual('p/a'.split(), _TOKENIZE('p/a'))
self.assertEqual('A/B'.split(), _TOKENIZE('A/B'))
self.assertEqual('A/'.split(), _TOKENIZE('A/'))
self.assertEqual('/B'.split(), _TOKENIZE('/B'))
def test_emdashes(self):
self.assertEqual('- this'.split(), _TOKENIZE('–this'))
def test_percentage(self):
self.assertEqual('%12'.split(), _TOKENIZE('%12'))
self.assertEqual('12%'.split(), _TOKENIZE('12%'))
self.assertEqual('% savings'.split(), _TOKENIZE('%savings'))
self.assertEqual('save % savings'.split(), _TOKENIZE('save%savings'))
def test_colon(self):
self.assertEqual('example : bla'.split(), _TOKENIZE('example: bla'))
self.assertEqual('raise Q1 : Raise 1$'.split(), _TOKENIZE('raise Q1: Raise 1$'))
self.assertEqual('support : revise'.split(), _TOKENIZE('support:revise'))
self.assertEqual('payroll : hr'.split(), _TOKENIZE('payroll:hr'))
self.assertEqual('Support : Revise'.split(), _TOKENIZE('Support:Revise'))
self.assertEqual('re:invent'.split(), _TOKENIZE('re:invent'))
self.assertEqual('conduct 1:1s'.split(), _TOKENIZE('conduct 1:1s'))
self.assertEqual('ISO 123:123'.split(), _TOKENIZE('ISO 123:123'))
self.assertEqual('A:B'.split(), _TOKENIZE('A:B'))
self.assertEqual('step : 703'.split(), _TOKENIZE('step:703'))
self.assertEqual('Sell 12 :'.split(), _TOKENIZE('Sell 12:'))
self.assertEqual('Strategy : HR'.split(), _TOKENIZE('Strategy:HR'))
self.assertEqual('2 : HR'.split(), _TOKENIZE('2:HR'))
self.assertEqual('12243 : engage'.split(), _TOKENIZE('12243:engage'))
def test_arrows(self):
self.assertEqual('Sell 12->23'.split(), _TOKENIZE('Sell 12->23'))
self.assertEqual('Sell 12 > 23'.split(), _TOKENIZE('Sell 12>23'))
self.assertEqual('a => b'.split(), _TOKENIZE('a = > b'))
self.assertEqual('x >= 12.5'.split(), _TOKENIZE(' x > = 12.5'))
self.assertEqual('x <= 12.5'.split(), _TOKENIZE(' x < = 12.5'))
def test_comas(self):
self.assertEqual('hello , hi'.split(), _TOKENIZE('hello, hi'))
self.assertEqual('123 , all good'.split(), _TOKENIZE('123, all good'))
self.assertEqual('all good , 123'.split(), _TOKENIZE('all good,123'))
self.assertEqual('123,123'.split(), _TOKENIZE('123,123'))
def test_single_quotes(self):
self.assertEqual("Rocco 's blob".split(), _TOKENIZE("Rocco 's blob"))
self.assertEqual("His name is ' Rob ' bob".split(), _TOKENIZE("His name is 'Rob' bob"))
self.assertEqual("His name is Rob ' bob '".split(), _TOKENIZE("His name is Rob 'bob'"))
self.assertEqual("launch ' go live ' strategy".split(), _TOKENIZE("launch 'go live'strategy"))
self.assertEqual("james o'hare".split(), _TOKENIZE("james o'hare"))
self.assertEqual("' proposal".split(), _TOKENIZE("'proposal"))
self.assertEqual('Deliver 4ft'.split(), _TOKENIZE("Deliver 4'"))
self.assertEqual('Deliver 4in'.split(), _TOKENIZE('Deliver 4"'))
self.assertEqual('Deliver 4ft4in'.split(), _TOKENIZE('Deliver 4\'4"'))
self.assertEqual("' we will run items again '".split(), _TOKENIZE("'we will run items again'"))
self.assertEqual("ceo order ' macbook pro '".split(), _TOKENIZE("ceo order 'macbook pro'"))
self.assertEqual("rock 'n' roll".split(), _TOKENIZE("rock 'n' roll"))
self.assertEqual("rock 'n roll".split(), _TOKENIZE("rock 'n roll"))
self.assertEqual("rock n' roll".split(), _TOKENIZE("rock n' roll"))
def test_clitics(self):
self.assertEqual("Jane 's blob".split(), _TOKENIZE("Jane's blob"))
self.assertEqual("sdo 's".split(), _TOKENIZE("sdo's"))
self.assertEqual("make SOP 's today".split(), _TOKENIZE("make SOP's today"))
self.assertEqual("I 'd eat".split(), _TOKENIZE("I'd eat"))
self.assertEqual("I 'm blob".split(), _TOKENIZE("I'm blob"))
self.assertEqual("They 'll come".split(), _TOKENIZE("They'll come"))
self.assertEqual("They 're blobs".split(), _TOKENIZE("They're blobs"))
self.assertEqual("They 've eaten".split(), _TOKENIZE("They've eaten"))
self.assertEqual("They are n't blobs".split(), _TOKENIZE("They aren't blobs"))
self.assertEqual("They ca n't blobs".split(), _TOKENIZE("They can't blobs"))
self.assertEqual("They have n't blobs".split(), _TOKENIZE("They haven't blobs"))
self.assertEqual("They is n't blobs".split(), _TOKENIZE("They isn't blobs"))
self.assertEqual('ifp \'s'.split(), _TOKENIZE('ifp\'s'))
def test_multi_special_chars(self):
self.assertEqual('bla // bla'.split(), _TOKENIZE('bla // bla'))
self.assertEqual('bla {{ bla }}'.split(), _TOKENIZE('bla {{bla}}'))
self.assertEqual('bla {{ bla }}'.split(), _TOKENIZE('bla {{bla}}'))
def test_bullets(self):
self.assertEqual('year . * introduce'.split(), _TOKENIZE('year. *introduce'))
self.assertEqual('year . - introduce'.split(), _TOKENIZE('year. -introduce'))
def test_special_chars(self):
self.assertEqual('_tag #MenArePigs'.split(), _TOKENIZE('_tag #MenArePigs'))
self.assertEqual('_tag @MenArePigs'.split(), _TOKENIZE('_tag @MenArePigs'))
def test_protected_patterns(self):
self.assertEqual('visit http://bla.com.au'.split(), _TOKENIZE('visit http://bla.com.au'))
self.assertEqual('visit https://bla.com.au/'.split(), _TOKENIZE('visit https://bla.com.au/'))
self.assertEqual('visit www.bla.com.au/bla.pdf'.split(), _TOKENIZE('visit www.bla.com.au/bla.pdf'))
self.assertEqual('visit www.Bla.com and www.Bla2.com'.split(), _TOKENIZE('visit www.Bla.com and www.Bla2.com'))
def test_sentence_parts(self):
self.assertEqual('on Oct. 29 , 2017 .'.split(), _TOKENIZE('on Oct. 29, 2017.'))
self.assertEqual('involve the U.S. ?'.split(), _TOKENIZE('involve the U.S.?'))
self.assertEqual('" Jump " , he said .'.split(), _TOKENIZE('"Jump", he said.'))
self.assertEqual('" Jump . " , he said .'.split(), _TOKENIZE('"Jump.", he said.'))
self.assertEqual('" Jump . " he said .'.split(), _TOKENIZE('"Jump." he said.'))
def test_multi_dots(self):
self.assertEqual('Ms. Dean .'.split(), _TOKENIZE('Ms. Dean.'))
self.assertEqual('Ms. Dean . Mrs Dean .'.split(), _TOKENIZE('Ms. Dean. Mrs Dean.'))
self.assertEqual('Sgt. Pepp. went there'.split(), _TOKENIZE('Sgt. Pepp. went there'))
def test_smileys(self):
self.assertEqual(':-)'.split(), _TOKENIZE(':-)'))
# LONG TEXT
# -------------------------------------------------------------------------->
def test_text_1(self):
self.assertEqual('said Lt. Gov. Brian Calley in a Dec. 19 press release .'.split(),
_TOKENIZE('said Lt. Gov. Brian Calley in a Dec. 19 press release.'))
def test_text_2(self):
self.assertEqual('headquarters in Ghent , Belgium . The company develops'.split(),
_TOKENIZE('headquarters in Ghent, Belgium. The company develops'))
def test_text_3(self):
self.assertEqual('The fastest in the world , by a long margin . Concentrate . Got a picture in mind ?'.split(),
_TOKENIZE('The fastest in the world, by a long margin. Concentrate. Got a picture in mind?'))
def test_text_4(self):
self.assertEqual('" I wrote , \' Making lemonade out of lemons . \' " The post marked the start .'.split(),
_TOKENIZE('"I wrote, \'Making lemonade out of lemons.\' " The post marked the start.'))
def test_text_5(self):
self.assertEqual('" I wrote , " Making lemonade out of lemons . " " The post marked the start .'.split(),
_TOKENIZE('"I wrote, "Making lemonade out of lemons." " The post marked the start.'))
def test_text_6(self):
self.assertEqual("I say , ' Why did I do that ! ' It keeps you inspired !".split(),
_TOKENIZE("I say, 'Why did I do that!' It keeps you inspired!"))
def test_text_7(self):
self.assertEqual("I say , ' Why did I do that ? ' It keeps you inspired !".split(),
_TOKENIZE("I say, 'Why did I do that?' It keeps you inspired!"))
def test_text_8(self):
self.assertEqual("They have become my online ' support ' group .".split(),
_TOKENIZE("They have become my online 'support' group."))
if __name__ == '__main__':
unittest.main()
| 62.15978 | 119 | 0.613056 | 2,811 | 22,564 | 4.803629 | 0.126645 | 0.285492 | 0.05347 | 0.017922 | 0.605939 | 0.561061 | 0.533733 | 0.507221 | 0.450641 | 0.448271 | 0 | 0.019866 | 0.183522 | 22,564 | 362 | 120 | 62.331492 | 0.71237 | 0.011434 | 0 | 0.07767 | 0 | 0.035599 | 0.322361 | 0.010046 | 0 | 0 | 0 | 0 | 0.831715 | 1 | 0.122977 | false | 0 | 0.006472 | 0 | 0.132686 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
242341e9e1bf59a4615a25a30a10f10f8226a2f1 | 3,033 | py | Python | python/tests/test_Board.py | klenium/tetris | ddd51715cc796da9cffef107572a2e24a5b2487a | [
"MIT"
] | 2 | 2021-05-11T17:56:13.000Z | 2021-11-01T23:14:32.000Z | python/tests/test_Board.py | klenium/tetris | ddd51715cc796da9cffef107572a2e24a5b2487a | [
"MIT"
] | 11 | 2018-09-09T11:56:01.000Z | 2019-04-20T13:58:21.000Z | python/tests/test_Board.py | klenium/tetris | ddd51715cc796da9cffef107572a2e24a5b2487a | [
"MIT"
] | 1 | 2020-10-09T03:04:56.000Z | 2020-10-09T03:04:56.000Z | import unittest
import tests.helpers.util as util
from tetris.logic.board.Board import Board
from tetris.logic.tetromino.Tetromino import Tetromino
from tetris.util.containers import Dimension
class BoardTest(unittest.TestCase):
def setUp(self):
self.board = Board(Dimension(5, 4))
def test_new_board_is_empty(self):
util.check_board_state(self, self.board, [
".....",
".....",
".....",
"....."
])
def test_add_tetrominoes(self):
self.add_test_data()
util.check_board_state(self, self.board, [
".....",
"....#",
".#.##",
".####"
])
def test_moving_tetromino_inside_empty_board(self):
tetromino = Tetromino(0, self.board)
self.assertTrue(util.control_tetromino(tetromino, "DADDDSAADSDAD"))
def test_moving_tetromino_outside_board_box(self):
tetromino = Tetromino(0, self.board)
self.assertFalse(util.control_tetromino(tetromino, "A"))
self.assertFalse(util.control_tetromino(tetromino, "DDDD"))
self.assertFalse(util.control_tetromino(tetromino, "SSS"))
def test_invalid_tetromino_move_inside_used_board(self):
self.add_test_data()
tetromino = Tetromino(0, self.board)
self.assertFalse(util.control_tetromino(tetromino, "S"))
self.assertFalse(util.control_tetromino(tetromino, "DDD"))
def test_remove_one_full_row(self):
self.add_test_data()
self.board.remove_full_rows(0, 4)
util.check_board_state(self, self.board, [
".....",
"....#",
".#.##",
".####"
])
tetromino = Tetromino(1, self.board)
self.board.add_tetromino(tetromino)
util.check_board_state(self, self.board, [
"#....",
"#...#",
"##.##",
"#####"
])
self.board.remove_full_rows(0, 4)
util.check_board_state(self, self.board, [
".....",
"#....",
"#...#",
"##.##"
])
def test_remove_multiple_full_rows(self):
self.add_test_data()
self.board.remove_full_rows(0, 4)
tetromino = Tetromino(6, self.board)
util.control_tetromino(tetromino, "DS")
self.board.add_tetromino(tetromino)
tetromino = Tetromino(1, self.board)
self.board.add_tetromino(tetromino)
self.board.remove_full_rows(0, 4)
util.check_board_state(self, self.board, [
".....",
".....",
".....",
"#...."
])
def add_test_data(self):
# .....
# ....#
# .#.##
# .####
tetromino = Tetromino(3, self.board)
util.control_tetromino(tetromino, "WWWDSS")
self.board.add_tetromino(tetromino)
tetromino = Tetromino(6, self.board)
util.control_tetromino(tetromino, "WWDDWDS")
self.board.add_tetromino(tetromino)
| 31.268041 | 75 | 0.553907 | 305 | 3,033 | 5.265574 | 0.193443 | 0.280199 | 0.11208 | 0.162516 | 0.663761 | 0.62142 | 0.515567 | 0.433375 | 0.433375 | 0.311333 | 0 | 0.008372 | 0.291131 | 3,033 | 96 | 76 | 31.59375 | 0.738605 | 0.006924 | 0 | 0.621951 | 0 | 0 | 0.053387 | 0 | 0 | 0 | 0 | 0 | 0.073171 | 1 | 0.109756 | false | 0 | 0.060976 | 0 | 0.182927 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
2424da7f928544695c3b2c6c130e8eb4a39499bb | 317 | py | Python | evaluation_framework/constants.py | mozjay0619/ml-evaluation-framework | ab2ba55e8f4c94dd097b283aa0bce3c2854ed4e4 | [
"BSD-3-Clause"
] | null | null | null | evaluation_framework/constants.py | mozjay0619/ml-evaluation-framework | ab2ba55e8f4c94dd097b283aa0bce3c2854ed4e4 | [
"BSD-3-Clause"
] | null | null | null | evaluation_framework/constants.py | mozjay0619/ml-evaluation-framework | ab2ba55e8f4c94dd097b283aa0bce3c2854ed4e4 | [
"BSD-3-Clause"
] | null | null | null |
EF_UUID_NAME = "__specialEF__float32_UUID"
EF_ORDERBY_NAME = "__specialEF__int32_dayDiff"
EF_PREDICTION_NAME = "__specialEF__float32_predictions"
EF_DUMMY_GROUP_COLUMN_NAME = "__specialEF__dummy_group"
HMF_MEMMAP_MAP_NAME = "__specialHMF__memmapMap"
HMF_GROUPBY_NAME = "__specialHMF__groupByNumericEncoder"
| 24.384615 | 56 | 0.85489 | 37 | 317 | 6.162162 | 0.540541 | 0.22807 | 0.175439 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020761 | 0.088328 | 317 | 12 | 57 | 26.416667 | 0.768166 | 0 | 0 | 0 | 0 | 0 | 0.52381 | 0.52381 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
24599a876589f733a760def95d71230317d3305f | 11,964 | py | Python | pysnmp/Wellfleet-FNTS-ATM-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/Wellfleet-FNTS-ATM-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/Wellfleet-FNTS-ATM-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module Wellfleet-FNTS-ATM-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Wellfleet-FNTS-ATM-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:33:28 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ValueRangeConstraint, ConstraintsUnion, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ConstraintsIntersection", "SingleValueConstraint")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
Gauge32, IpAddress, TimeTicks, Counter64, Bits, ModuleIdentity, Counter32, NotificationType, Unsigned32, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity, Integer32, MibIdentifier = mibBuilder.importSymbols("SNMPv2-SMI", "Gauge32", "IpAddress", "TimeTicks", "Counter64", "Bits", "ModuleIdentity", "Counter32", "NotificationType", "Unsigned32", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity", "Integer32", "MibIdentifier")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
wfFntsAtmGroup, = mibBuilder.importSymbols("Wellfleet-COMMON-MIB", "wfFntsAtmGroup")
wfFntsAtmTable = MibTable((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1), )
if mibBuilder.loadTexts: wfFntsAtmTable.setStatus('mandatory')
wfFntsAtmEntry = MibTableRow((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1), ).setIndexNames((0, "Wellfleet-FNTS-ATM-MIB", "wfFntsAtmSlot"), (0, "Wellfleet-FNTS-ATM-MIB", "wfFntsAtmConnector"))
if mibBuilder.loadTexts: wfFntsAtmEntry.setStatus('mandatory')
wfFntsAtmDelete = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("create", 1), ("delete", 2))).clone('create')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfFntsAtmDelete.setStatus('mandatory')
wfFntsAtmDisable = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('enable')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfFntsAtmDisable.setStatus('mandatory')
wfFntsAtmState = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("init", 3), ("notpresent", 4))).clone('notpresent')).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmState.setStatus('mandatory')
wfFntsAtmSlot = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 14))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmSlot.setStatus('mandatory')
wfFntsAtmConnector = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 44))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmConnector.setStatus('mandatory')
wfFntsAtmCct = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1023))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfFntsAtmCct.setStatus('mandatory')
wfFntsAtmMtu = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(4508))).clone(namedValues=NamedValues(("default", 4508))).clone('default')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfFntsAtmMtu.setStatus('mandatory')
wfFntsAtmMadr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 8), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmMadr.setStatus('mandatory')
wfFntsAtmIpAdr = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 9), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmIpAdr.setStatus('mandatory')
wfFntsAtmAtmState = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 9))).clone(namedValues=NamedValues(("notready", 1), ("init", 2), ("intloop", 3), ("extloop", 4), ("reset", 5), ("down", 6), ("up", 7), ("notpresent", 9))).clone('notpresent')).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmAtmState.setStatus('mandatory')
wfFntsAtmSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(50))).clone(namedValues=NamedValues(("default", 50))).clone('default')).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmSpeed.setStatus('mandatory')
wfFntsAtmRxOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 12), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmRxOctets.setStatus('mandatory')
wfFntsAtmRxFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 13), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmRxFrames.setStatus('mandatory')
wfFntsAtmTxOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 14), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmTxOctets.setStatus('mandatory')
wfFntsAtmTxFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 15), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmTxFrames.setStatus('mandatory')
wfFntsAtmLackRescErrorRx = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 16), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmLackRescErrorRx.setStatus('mandatory')
wfFntsAtmInErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 17), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmInErrors.setStatus('mandatory')
wfFntsAtmOutErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 18), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmOutErrors.setStatus('mandatory')
wfFntsAtmRxLongFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 19), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmRxLongFrames.setStatus('mandatory')
wfFntsAtmTxClipFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 20), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmTxClipFrames.setStatus('mandatory')
wfFntsAtmRxReplenMisses = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 21), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmRxReplenMisses.setStatus('mandatory')
wfFntsAtmRxOverruns = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 22), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmRxOverruns.setStatus('mandatory')
wfFntsAtmRxRingErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 23), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmRxRingErrors.setStatus('mandatory')
wfFntsAtmTxRingErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 24), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmTxRingErrors.setStatus('mandatory')
wfFntsAtmOpErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 25), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmOpErrors.setStatus('mandatory')
wfFntsAtmRxProcessings = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 26), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmRxProcessings.setStatus('mandatory')
wfFntsAtmTxProcessings = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 27), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmTxProcessings.setStatus('mandatory')
wfFntsAtmTxCmplProcessings = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 28), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmTxCmplProcessings.setStatus('mandatory')
wfFntsAtmIntrProcessings = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 29), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmIntrProcessings.setStatus('mandatory')
wfFntsAtmSintProcessings = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 30), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmSintProcessings.setStatus('mandatory')
wfFntsAtmPintProcessings = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 31), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfFntsAtmPintProcessings.setStatus('mandatory')
wfFntsAtmRxRingLength = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(63))).clone(namedValues=NamedValues(("default", 63))).clone('default')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfFntsAtmRxRingLength.setStatus('mandatory')
wfFntsAtmTxRingLength = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 33), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(63))).clone(namedValues=NamedValues(("default", 63))).clone('default')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfFntsAtmTxRingLength.setStatus('mandatory')
wfFntsAtmCfgRxQueueLength = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 34), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(127))).clone(namedValues=NamedValues(("default", 127))).clone('default')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfFntsAtmCfgRxQueueLength.setStatus('mandatory')
wfFntsAtmCfgTxQueueLength = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 35), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(127))).clone(namedValues=NamedValues(("default", 127))).clone('default')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfFntsAtmCfgTxQueueLength.setStatus('mandatory')
wfFntsAtmLineNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 32, 1, 1, 36), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: wfFntsAtmLineNumber.setStatus('mandatory')
mibBuilder.exportSymbols("Wellfleet-FNTS-ATM-MIB", wfFntsAtmTxRingErrors=wfFntsAtmTxRingErrors, wfFntsAtmOpErrors=wfFntsAtmOpErrors, wfFntsAtmIpAdr=wfFntsAtmIpAdr, wfFntsAtmInErrors=wfFntsAtmInErrors, wfFntsAtmSlot=wfFntsAtmSlot, wfFntsAtmTxClipFrames=wfFntsAtmTxClipFrames, wfFntsAtmTxCmplProcessings=wfFntsAtmTxCmplProcessings, wfFntsAtmDisable=wfFntsAtmDisable, wfFntsAtmCct=wfFntsAtmCct, wfFntsAtmRxFrames=wfFntsAtmRxFrames, wfFntsAtmRxOctets=wfFntsAtmRxOctets, wfFntsAtmSintProcessings=wfFntsAtmSintProcessings, wfFntsAtmRxLongFrames=wfFntsAtmRxLongFrames, wfFntsAtmLackRescErrorRx=wfFntsAtmLackRescErrorRx, wfFntsAtmRxRingLength=wfFntsAtmRxRingLength, wfFntsAtmRxProcessings=wfFntsAtmRxProcessings, wfFntsAtmMadr=wfFntsAtmMadr, wfFntsAtmRxReplenMisses=wfFntsAtmRxReplenMisses, wfFntsAtmMtu=wfFntsAtmMtu, wfFntsAtmSpeed=wfFntsAtmSpeed, wfFntsAtmTable=wfFntsAtmTable, wfFntsAtmCfgRxQueueLength=wfFntsAtmCfgRxQueueLength, wfFntsAtmRxRingErrors=wfFntsAtmRxRingErrors, wfFntsAtmLineNumber=wfFntsAtmLineNumber, wfFntsAtmPintProcessings=wfFntsAtmPintProcessings, wfFntsAtmTxProcessings=wfFntsAtmTxProcessings, wfFntsAtmTxFrames=wfFntsAtmTxFrames, wfFntsAtmDelete=wfFntsAtmDelete, wfFntsAtmAtmState=wfFntsAtmAtmState, wfFntsAtmRxOverruns=wfFntsAtmRxOverruns, wfFntsAtmTxRingLength=wfFntsAtmTxRingLength, wfFntsAtmOutErrors=wfFntsAtmOutErrors, wfFntsAtmState=wfFntsAtmState, wfFntsAtmConnector=wfFntsAtmConnector, wfFntsAtmIntrProcessings=wfFntsAtmIntrProcessings, wfFntsAtmCfgTxQueueLength=wfFntsAtmCfgTxQueueLength, wfFntsAtmEntry=wfFntsAtmEntry, wfFntsAtmTxOctets=wfFntsAtmTxOctets)
| 130.043478 | 1,582 | 0.765714 | 1,326 | 11,964 | 6.908748 | 0.137255 | 0.008951 | 0.012444 | 0.016592 | 0.477022 | 0.380635 | 0.271477 | 0.253357 | 0.253357 | 0.238511 | 0 | 0.073241 | 0.0779 | 11,964 | 91 | 1,583 | 131.472527 | 0.757161 | 0.028251 | 0 | 0 | 0 | 0 | 0.122062 | 0.009469 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.083333 | 0 | 0.083333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
24654b29f775cf7531e441acc1b26e8d1235f77b | 524 | py | Python | tartiflette_middleware/middleware.py | daveoconnor/tartiflette-middleware | f7ae1833156ec920703312dd4c10f9815e0de263 | [
"MIT"
] | null | null | null | tartiflette_middleware/middleware.py | daveoconnor/tartiflette-middleware | f7ae1833156ec920703312dd4c10f9815e0de263 | [
"MIT"
] | null | null | null | tartiflette_middleware/middleware.py | daveoconnor/tartiflette-middleware | f7ae1833156ec920703312dd4c10f9815e0de263 | [
"MIT"
] | null | null | null | class Middleware:
def __init__(self, context_manager, server_middleware):
"""
:param BaseMiddleware Your custom middleware
:param package Middleware from the middleware package
"""
self._service = context_manager
self._middleware = server_middleware.get_hooks_service_middleware(
context_service=self.service,
)
@property
def service(self):
return self._service
@property
def middleware(self):
return self._middleware
| 27.578947 | 74 | 0.660305 | 51 | 524 | 6.470588 | 0.392157 | 0.1 | 0.115152 | 0.133333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.274809 | 524 | 18 | 75 | 29.111111 | 0.868421 | 0.187023 | 0 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0.166667 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
246ad5806211abe8d32f41ca908a5744b6021779 | 147 | py | Python | Squaring Spiral.py | Pallav277/Python_Turtle_Graphics | 3e0d4fd6160b0aa5fbde8757051a85a81b7652d9 | [
"Apache-2.0"
] | null | null | null | Squaring Spiral.py | Pallav277/Python_Turtle_Graphics | 3e0d4fd6160b0aa5fbde8757051a85a81b7652d9 | [
"Apache-2.0"
] | null | null | null | Squaring Spiral.py | Pallav277/Python_Turtle_Graphics | 3e0d4fd6160b0aa5fbde8757051a85a81b7652d9 | [
"Apache-2.0"
] | null | null | null | import turtle
turtle.bgcolor("black")
sq = turtle.Turtle()
sq.speed(20)
sq.color("white")
for i in range(500):
sq.forward(i)
sq.left(91)
| 13.363636 | 23 | 0.659864 | 25 | 147 | 3.88 | 0.68 | 0.247423 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.056911 | 0.163265 | 147 | 10 | 24 | 14.7 | 0.731707 | 0 | 0 | 0 | 0 | 0 | 0.068027 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.125 | 0 | 0.125 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
79f43a8f6884032a20fe0a60cced7538e505cc13 | 2,059 | py | Python | tests/test_intset.py | popravich/rdbtools3 | c2b097f58e7d3a3b12e6671aa413c263c1fb96cf | [
"MIT"
] | 3 | 2016-01-12T23:14:47.000Z | 2019-07-10T05:36:22.000Z | tests/test_intset.py | popravich/rdbtools3 | c2b097f58e7d3a3b12e6671aa413c263c1fb96cf | [
"MIT"
] | null | null | null | tests/test_intset.py | popravich/rdbtools3 | c2b097f58e7d3a3b12e6671aa413c263c1fb96cf | [
"MIT"
] | null | null | null | import unittest
from rdbtools3.intset import unpack_intset
from rdbtools3.exceptions import RDBValueError
class TestIntset(unittest.TestCase):
def test_3x2bytes(self):
val = (b'\x02\x00\x00\x00' # int size
b'\x03\x00\x00\x00' # set length
b'\x01\x00' # item 1
b'\x02\x00' # item 2
b'\x00\x01') # item 3
ret = list(unpack_intset(val))
self.assertEqual([
1, 2, 256
], ret)
def test_2x4bytes(self):
val = (b'\x04\x00\x00\x00'
b'\x02\x00\x00\x00'
b'\x01\x00\x00\x00'
b'\x00\x00\x00\x80')
ret = list(unpack_intset(val))
self.assertEqual([
1, 2**31
], ret)
def test_2x8bytes(self):
val = (b'\x08\x00\x00\x00'
b'\x02\x00\x00\x00'
b'\x01\x00\x00\x00\x00\x00\x00\x00'
b'\x00\x00\x00\x00\x00\x00\x00\x80')
ret = list(unpack_intset(val))
self.assertEqual([
1, 2**63
], ret)
def test_bad_length(self):
val = (b'\x02\x00\x00\x00'
b'\x01\x00\x00\x00'
b'\x01\x00'
b'\x02\x00\x00')
test = getattr(self, 'assertRaisesRegex',
getattr(self, 'assertRaisesRegexp'))
with test(RDBValueError, "Bad content size 5 \(expected 2\)"):
list(unpack_intset(val))
def test_bad_size_encoding(self):
val = (b'\x03\x00\x00\x00'
b'\x01\x00\x00\x00'
b'\x00\x00\x00')
test = getattr(self, 'assertRaisesRegex',
getattr(self, 'assertRaisesRegexp'))
with test(RDBValueError, "Unexpected size encoding 0x3"):
list(unpack_intset(val))
def test_zero_len(self):
val = (b'\x02\x00\x00\x00'
b'\x00\x00\x00\x00')
ret = list(unpack_intset(val))
self.assertEqual([], ret)
if __name__ == "__main__":
unittest.main()
| 30.279412 | 70 | 0.507528 | 253 | 2,059 | 4.031621 | 0.221344 | 0.258824 | 0.229412 | 0.107843 | 0.629412 | 0.608824 | 0.551961 | 0.493137 | 0.432353 | 0.394118 | 0 | 0.150376 | 0.354055 | 2,059 | 67 | 71 | 30.731343 | 0.616541 | 0.019427 | 0 | 0.464286 | 0 | 0 | 0.23994 | 0.031793 | 0 | 0 | 0.00149 | 0 | 0.142857 | 1 | 0.107143 | false | 0 | 0.053571 | 0 | 0.178571 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
031c1bbdf2907809a6800767549c8b50f9abcffc | 1,660 | py | Python | api/test/test_authentication/test_authentication.py | ghalonso94/wswallet | 8f1f13a0d646166adad45b3872c2db6558d48f38 | [
"MIT"
] | null | null | null | api/test/test_authentication/test_authentication.py | ghalonso94/wswallet | 8f1f13a0d646166adad45b3872c2db6558d48f38 | [
"MIT"
] | null | null | null | api/test/test_authentication/test_authentication.py | ghalonso94/wswallet | 8f1f13a0d646166adad45b3872c2db6558d48f38 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import User
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from django.contrib.auth import authenticate
class AuthenticationUserTestCase(APITestCase):
def setUp(self):
self.list_url = reverse('Company-list')
self.user = User.objects.create_superuser('root', password='root')
def test_authentication_user_credentials(self):
"""User credentials verification test"""
user = authenticate(username='root', password='root')
self.assertTrue((user is not None) and user.is_authenticated)
def test_get_request_with_not_authenticated_user(self):
"""Verification test of get request to user without authentication"""
response = self.client.get(self.list_url)
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
def test_authentication_incorrect_username(self):
"""Incorrect username verification test"""
user = authenticate(username='rot', password='root')
self.assertFalse((user is not None) and user.is_authenticated)
def test_authentication_incorrect_password(self):
"""Incorrect password verification test"""
user = authenticate(username='root', password='123')
self.assertFalse((user is not None) and user.is_authenticated)
def test_get_request_with_authenticated_user(self):
"""Verification test of get request to user authenticated"""
self.client.force_authenticate(self.user)
response = self.client.get(self.list_url)
self.assertEqual(response.status_code, status.HTTP_200_OK) | 44.864865 | 77 | 0.735542 | 200 | 1,660 | 5.925 | 0.29 | 0.03038 | 0.027848 | 0.081013 | 0.496203 | 0.462447 | 0.462447 | 0.374684 | 0.374684 | 0.374684 | 0 | 0.006545 | 0.171687 | 1,660 | 37 | 78 | 44.864865 | 0.855273 | 0.136747 | 0 | 0.16 | 0 | 0 | 0.02983 | 0 | 0 | 0 | 0 | 0 | 0.2 | 1 | 0.24 | false | 0.2 | 0.2 | 0 | 0.48 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
0321382973833ce42d92bf1b5c63c3c37fe27281 | 1,473 | py | Python | tweet/migrations/0002_auto_20190801_1335.py | destro6984/Twitecs | 9df81fd217107cd3437d15f9b49b6985a909ae14 | [
"MIT"
] | null | null | null | tweet/migrations/0002_auto_20190801_1335.py | destro6984/Twitecs | 9df81fd217107cd3437d15f9b49b6985a909ae14 | [
"MIT"
] | 12 | 2019-10-29T18:55:35.000Z | 2022-02-10T10:04:36.000Z | tweet/migrations/0002_auto_20190801_1335.py | destro6984/Twitecs | 9df81fd217107cd3437d15f9b49b6985a909ae14 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.3 on 2019-08-01 13:35
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('tweet', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.AddField(
model_name='tweet',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='messages',
name='from_user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='SendForm', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='messages',
name='to_user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='SendTo', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='comments',
name='author',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='comments',
name='tweet',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tweet.Tweet'),
),
]
| 33.477273 | 135 | 0.633401 | 162 | 1,473 | 5.598765 | 0.277778 | 0.061742 | 0.092613 | 0.145535 | 0.632856 | 0.632856 | 0.632856 | 0.632856 | 0.632856 | 0.632856 | 0 | 0.01721 | 0.250509 | 1,473 | 43 | 136 | 34.255814 | 0.804348 | 0.03055 | 0 | 0.444444 | 1 | 0 | 0.077139 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.083333 | 0 | 0.194444 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
0321d19423a315e4931f710e342abdee508698ef | 545 | py | Python | iroko/records/marshmallow/__init__.py | tocororo/iroko | e1cf08bbd565178c2d60244719aad6d288b48363 | [
"MIT"
] | null | null | null | iroko/records/marshmallow/__init__.py | tocororo/iroko | e1cf08bbd565178c2d60244719aad6d288b48363 | [
"MIT"
] | 14 | 2021-02-02T22:47:27.000Z | 2021-12-22T18:39:46.000Z | iroko/records/marshmallow/__init__.py | tocororo/iroko | e1cf08bbd565178c2d60244719aad6d288b48363 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021. Universidad de Pinar del Rio
# This file is part of SCEIBA (sceiba.cu).
# SCEIBA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
#
"""Schemas for marshmallow."""
from __future__ import absolute_import, print_function
from .json import MetadataFullSchemaV1, MetadataSchemaV1, RecordFullSchemaV1, RecordSchemaV1
__all__ = ('MetadataSchemaV1', 'RecordSchemaV1', 'RecordFullSchemaV1', 'MetadataFullSchemaV1')
| 32.058824 | 94 | 0.759633 | 66 | 545 | 6.121212 | 0.757576 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.027957 | 0.146789 | 545 | 16 | 95 | 34.0625 | 0.84086 | 0.510092 | 0 | 0 | 0 | 0 | 0.265625 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0.333333 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
032b982d116fea61d2d02e4210388792536137b0 | 113 | py | Python | Q03__/51_Android_Unlock_Patterns/test.py | hsclinical/leetcode | 48a57f6a5d5745199c5685cd2c8f5c4fa293e54a | [
"Apache-2.0"
] | null | null | null | Q03__/51_Android_Unlock_Patterns/test.py | hsclinical/leetcode | 48a57f6a5d5745199c5685cd2c8f5c4fa293e54a | [
"Apache-2.0"
] | null | null | null | Q03__/51_Android_Unlock_Patterns/test.py | hsclinical/leetcode | 48a57f6a5d5745199c5685cd2c8f5c4fa293e54a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
from Solution import Solution
obj = Solution()
A = 1
B = 9
print(obj.numberOfPatterns(A, B)) | 12.555556 | 33 | 0.699115 | 18 | 113 | 4.388889 | 0.722222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.021053 | 0.159292 | 113 | 9 | 33 | 12.555556 | 0.810526 | 0.141593 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 0.2 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
033abf5e8250b0746a37f8b779c20ccb2929c825 | 4,385 | py | Python | dglib/modules/sampler.py | billzhonggz/Transfer-Learning-Library | d7a6e4298e571d5101e05515a2ab1f171160ef89 | [
"MIT"
] | 1,474 | 2020-07-24T02:55:55.000Z | 2022-03-31T12:35:56.000Z | dglib/modules/sampler.py | mxliu/Transfer-Learning-Library | 7b0ccb3a8087ecc65daf4b1e815e5a3f42106641 | [
"MIT"
] | 70 | 2020-08-05T10:47:33.000Z | 2022-03-31T03:48:54.000Z | dglib/modules/sampler.py | mxliu/Transfer-Learning-Library | 7b0ccb3a8087ecc65daf4b1e815e5a3f42106641 | [
"MIT"
] | 312 | 2020-08-01T11:08:39.000Z | 2022-03-30T06:03:47.000Z | """
@author: Baixu Chen
@contact: cbx_99_hasta@outlook.com
"""
import random
import copy
import numpy as np
from torch.utils.data.dataset import ConcatDataset
from torch.utils.data.sampler import Sampler
class DefaultSampler(Sampler):
r"""Traverse all :math:`N` domains, randomly select :math:`K` samples in each domain to form a mini-batch of size
:math:`N\times K`.
Args:
data_source (ConcatDataset): dataset that contains data from multiple domains
batch_size (int): mini-batch size (:math:`N\times K` here)
"""
def __init__(self, data_source: ConcatDataset, batch_size: int):
super(Sampler, self).__init__()
self.num_all_domains = len(data_source.cumulative_sizes)
self.sample_idxes_per_domain = []
start = 0
for end in data_source.cumulative_sizes:
idxes = [idx for idx in range(start, end)]
self.sample_idxes_per_domain.append(idxes)
start = end
assert batch_size % self.num_all_domains == 0
self.batch_size_per_domain = batch_size // self.num_all_domains
self.length = len(list(self.__iter__()))
def __iter__(self):
sample_idxes_per_domain = copy.deepcopy(self.sample_idxes_per_domain)
final_idxes = []
stop_flag = False
while not stop_flag:
for domain in range(self.num_all_domains):
sample_idxes = sample_idxes_per_domain[domain]
selected_idxes = random.sample(sample_idxes, self.batch_size_per_domain)
final_idxes.extend(selected_idxes)
for idx in selected_idxes:
sample_idxes_per_domain[domain].remove(idx)
remaining_size = len(sample_idxes_per_domain[domain])
if remaining_size < self.batch_size_per_domain:
stop_flag = True
return iter(final_idxes)
def __len__(self):
return self.length
class RandomDomainSampler(Sampler):
r"""Randomly sample :math:`N` domains, then randomly select :math:`K` samples in each domain to form a mini-batch of
size :math:`N\times K`.
Args:
data_source (ConcatDataset): dataset that contains data from multiple domains
batch_size (int): mini-batch size (:math:`N\times K` here)
n_domains_per_batch (int): number of domains to select in a single mini-batch (:math:`N` here)
"""
def __init__(self, data_source: ConcatDataset, batch_size: int, n_domains_per_batch: int):
super(Sampler, self).__init__()
self.n_domains_in_dataset = len(data_source.cumulative_sizes)
self.n_domains_per_batch = n_domains_per_batch
assert self.n_domains_in_dataset >= self.n_domains_per_batch
self.sample_idxes_per_domain = []
start = 0
for end in data_source.cumulative_sizes:
idxes = [idx for idx in range(start, end)]
self.sample_idxes_per_domain.append(idxes)
start = end
assert batch_size % n_domains_per_batch == 0
self.batch_size_per_domain = batch_size // n_domains_per_batch
self.length = len(list(self.__iter__()))
def __iter__(self):
sample_idxes_per_domain = copy.deepcopy(self.sample_idxes_per_domain)
domain_idxes = [idx for idx in range(self.n_domains_in_dataset)]
final_idxes = []
stop_flag = False
while not stop_flag:
selected_domains = random.sample(domain_idxes, self.n_domains_per_batch)
for domain in selected_domains:
sample_idxes = sample_idxes_per_domain[domain]
if len(sample_idxes) < self.batch_size_per_domain:
selected_idxes = np.random.choice(sample_idxes, self.batch_size_per_domain, replace=True)
else:
selected_idxes = random.sample(sample_idxes, self.batch_size_per_domain)
final_idxes.extend(selected_idxes)
for idx in selected_idxes:
if idx in sample_idxes_per_domain[domain]:
sample_idxes_per_domain[domain].remove(idx)
remaining_size = len(sample_idxes_per_domain[domain])
if remaining_size < self.batch_size_per_domain:
stop_flag = True
return iter(final_idxes)
def __len__(self):
return self.length
| 38.464912 | 120 | 0.65496 | 574 | 4,385 | 4.646341 | 0.165505 | 0.077615 | 0.07874 | 0.112486 | 0.816648 | 0.748406 | 0.673416 | 0.648669 | 0.591676 | 0.56243 | 0 | 0.001863 | 0.26545 | 4,385 | 113 | 121 | 38.80531 | 0.826141 | 0.16488 | 0 | 0.64 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 1 | 0.08 | false | 0 | 0.066667 | 0.026667 | 0.226667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
034307386c24988a91f1bd8dccaf719175b5c671 | 217 | py | Python | pypay/interfaces/PayInterface.py | huangxingx/pypay | 4f854554f14593c060d13dc00dfc894f24e60a2c | [
"MIT"
] | 1 | 2019-05-28T09:04:34.000Z | 2019-05-28T09:04:34.000Z | pypay/interfaces/PayInterface.py | huangxingx/pypay | 4f854554f14593c060d13dc00dfc894f24e60a2c | [
"MIT"
] | null | null | null | pypay/interfaces/PayInterface.py | huangxingx/pypay | 4f854554f14593c060d13dc00dfc894f24e60a2c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @author: x.huang
# @date:29/05/19
import abc
class PayInterface(metaclass=abc.ABCMeta):
@abc.abstractmethod
def pay(self, endpoint, payload):
pass
| 13.5625 | 42 | 0.635945 | 29 | 217 | 4.758621 | 0.931034 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.040462 | 0.202765 | 217 | 15 | 43 | 14.466667 | 0.757225 | 0.341014 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0.2 | 0.2 | 0 | 0.6 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
034c61f2ec91791e279171ab1057dcc1dc8de021 | 315 | py | Python | restapi/project/urls.py | shuvro/docker-django-postgres-pgadmin | 75c03739345a8cc03b9ec25a2773edbe327bab23 | [
"MIT"
] | 1 | 2022-02-15T02:08:26.000Z | 2022-02-15T02:08:26.000Z | restapi/project/urls.py | shuvro/docker-django-postgres-pgadmin | 75c03739345a8cc03b9ec25a2773edbe327bab23 | [
"MIT"
] | null | null | null | restapi/project/urls.py | shuvro/docker-django-postgres-pgadmin | 75c03739345a8cc03b9ec25a2773edbe327bab23 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path
# See: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf
admin.autodiscover()
# See: https://docs.djangoproject.com/en/dev/topics/http/urls/
urlpatterns = [
path('admin/', admin.site.urls),
]
| 24.230769 | 109 | 0.752381 | 44 | 315 | 5.386364 | 0.590909 | 0.084388 | 0.101266 | 0.21097 | 0.278481 | 0.278481 | 0.278481 | 0 | 0 | 0 | 0 | 0 | 0.092063 | 315 | 12 | 110 | 26.25 | 0.828671 | 0.530159 | 0 | 0 | 0 | 0 | 0.041667 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
034c768e8ff9942fe59487947e87279a28ca2e45 | 1,795 | py | Python | alipay/aop/api/domain/AntMerchantExpandIndirectTiansuoBindModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AntMerchantExpandIndirectTiansuoBindModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AntMerchantExpandIndirectTiansuoBindModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.TiansuoIsvBindVO import TiansuoIsvBindVO
class AntMerchantExpandIndirectTiansuoBindModel(object):
def __init__(self):
self._tiansuo_isv_bind_list = None
@property
def tiansuo_isv_bind_list(self):
return self._tiansuo_isv_bind_list
@tiansuo_isv_bind_list.setter
def tiansuo_isv_bind_list(self, value):
if isinstance(value, list):
self._tiansuo_isv_bind_list = list()
for i in value:
if isinstance(i, TiansuoIsvBindVO):
self._tiansuo_isv_bind_list.append(i)
else:
self._tiansuo_isv_bind_list.append(TiansuoIsvBindVO.from_alipay_dict(i))
def to_alipay_dict(self):
params = dict()
if self.tiansuo_isv_bind_list:
if isinstance(self.tiansuo_isv_bind_list, list):
for i in range(0, len(self.tiansuo_isv_bind_list)):
element = self.tiansuo_isv_bind_list[i]
if hasattr(element, 'to_alipay_dict'):
self.tiansuo_isv_bind_list[i] = element.to_alipay_dict()
if hasattr(self.tiansuo_isv_bind_list, 'to_alipay_dict'):
params['tiansuo_isv_bind_list'] = self.tiansuo_isv_bind_list.to_alipay_dict()
else:
params['tiansuo_isv_bind_list'] = self.tiansuo_isv_bind_list
return params
@staticmethod
def from_alipay_dict(d):
if not d:
return None
o = AntMerchantExpandIndirectTiansuoBindModel()
if 'tiansuo_isv_bind_list' in d:
o.tiansuo_isv_bind_list = d['tiansuo_isv_bind_list']
return o
| 33.867925 | 93 | 0.643454 | 221 | 1,795 | 4.837104 | 0.230769 | 0.196445 | 0.275023 | 0.353602 | 0.445276 | 0.334892 | 0.188962 | 0.188962 | 0.145931 | 0.086062 | 0 | 0.00154 | 0.276323 | 1,795 | 52 | 94 | 34.519231 | 0.821401 | 0.023398 | 0 | 0.051282 | 0 | 0 | 0.064037 | 0.048027 | 0 | 0 | 0 | 0 | 0 | 1 | 0.128205 | false | 0 | 0.076923 | 0.025641 | 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 | 0 | 0 | 0 | 0 | 0 | 2 |
0350b1c01f134ae5fd6651b2be6c408686aa20ca | 271 | py | Python | pytimize/programs/__init__.py | TerrayTM/pytimize | 5d3508e8da4d2e6c8e52d3386b580bc300dc52d5 | [
"Apache-2.0"
] | 10 | 2020-02-24T01:52:20.000Z | 2022-03-12T02:50:58.000Z | pytimize/programs/__init__.py | TerrayTM/pytimize | 5d3508e8da4d2e6c8e52d3386b580bc300dc52d5 | [
"Apache-2.0"
] | null | null | null | pytimize/programs/__init__.py | TerrayTM/pytimize | 5d3508e8da4d2e6c8e52d3386b580bc300dc52d5 | [
"Apache-2.0"
] | 2 | 2021-10-03T22:18:47.000Z | 2021-10-03T22:19:27.000Z | from ._linear import LinearProgram
from ._integer import IntegerProgram
from ._nonlinear import NonlinearProgram
from ._unconstrained import UnconstrainedProgram
__all__ = [
"LinearProgram",
"IntegerProgram",
"NonlinearProgram",
"UnconstrainedProgram"
]
| 22.583333 | 48 | 0.782288 | 21 | 271 | 9.714286 | 0.52381 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.151292 | 271 | 11 | 49 | 24.636364 | 0.886957 | 0 | 0 | 0 | 0 | 0 | 0.232472 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
035a3527627af4d6489387bc138be77681de609c | 387 | py | Python | bireme/account/admin.py | bireme/feedback | 118018a846afcb373451593cea1c2200e44e2057 | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | bireme/account/admin.py | bireme/feedback | 118018a846afcb373451593cea1c2200e44e2057 | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | bireme/account/admin.py | bireme/feedback | 118018a846afcb373451593cea1c2200e44e2057 | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin
from models import UserProfile
admin.site.unregister(User)
class UserProfileInline(admin.StackedInline):
model = UserProfile
extra = 1
class UserProfileAdmin(UserAdmin):
inlines = [ UserProfileInline, ]
admin.site.register(User, UserProfileAdmin) | 25.8 | 47 | 0.79845 | 45 | 387 | 6.866667 | 0.466667 | 0.097087 | 0.165049 | 0.135922 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002959 | 0.126615 | 387 | 15 | 48 | 25.8 | 0.911243 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.363636 | 0 | 0.818182 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
0360cafecaaa9455d7d33a8861e7c648c65fee2c | 9,049 | py | Python | PyObjCTest/test_nsimage.py | Khan/pyobjc-framework-Cocoa | f8b015ea2a72d8d78be6084fb12925c4785b8f1f | [
"MIT"
] | 132 | 2015-01-01T10:02:42.000Z | 2022-03-09T12:51:01.000Z | mac/pyobjc-framework-Cocoa/PyObjCTest/test_nsimage.py | mba811/music-player | 7998986b34cfda2244ef622adefb839331b81a81 | [
"BSD-2-Clause"
] | 6 | 2015-01-06T08:23:19.000Z | 2019-03-14T12:22:06.000Z | mac/pyobjc-framework-Cocoa/PyObjCTest/test_nsimage.py | mba811/music-player | 7998986b34cfda2244ef622adefb839331b81a81 | [
"BSD-2-Clause"
] | 27 | 2015-02-23T11:51:43.000Z | 2022-03-07T02:34:18.000Z | from PyObjCTools.TestSupport import *
import AppKit
from AppKit import *
try:
unicode
except NameError:
unicode = str
class TestNSImageHelper (NSObject):
def image_didLoadRepresentation_withStatus_(self, i, r, s): pass
def image_didLoadPartOfRepresentation_withValidRows_(self, i, r, c): pass
class TestNSImage (TestCase):
def test_compositePoint(self):
# comes straight from ReSTedit. Works on PPC, not on Intel (as of r1791)
ws = AppKit.NSWorkspace.sharedWorkspace()
txtIcon = ws.iconForFileType_("txt")
txtIcon.setSize_( (16,16) )
htmlIcon = ws.iconForFileType_("html")
htmlIcon.setSize_( (16,16) )
comboIcon = AppKit.NSImage.alloc().initWithSize_( (100,100) )
comboIcon.lockFocus()
txtIcon.compositeToPoint_fromRect_operation_((0,0), ((0,0),(16,16)), AppKit.NSCompositeCopy)
htmlIcon.compositeToPoint_fromRect_operation_((8,0), ((8,0),(8,16)), AppKit.NSCompositeCopy)
comboIcon.unlockFocus()
def testConstants(self):
self.assertEqual(NSImageLoadStatusCompleted, 0)
self.assertEqual(NSImageLoadStatusCancelled, 1)
self.assertEqual(NSImageLoadStatusInvalidData, 2)
self.assertEqual(NSImageLoadStatusUnexpectedEOF, 3)
self.assertEqual(NSImageLoadStatusReadError, 4)
self.assertEqual(NSImageCacheDefault, 0)
self.assertEqual(NSImageCacheAlways, 1)
self.assertEqual(NSImageCacheBySize, 2)
self.assertEqual(NSImageCacheNever, 3)
@min_os_level("10.5")
def testConstants10_5(self):
self.assertIsInstance( NSImageNameQuickLookTemplate, unicode)
self.assertIsInstance( NSImageNameBluetoothTemplate, unicode)
self.assertIsInstance( NSImageNameIChatTheaterTemplate, unicode)
self.assertIsInstance( NSImageNameSlideshowTemplate, unicode)
self.assertIsInstance( NSImageNameActionTemplate, unicode)
self.assertIsInstance( NSImageNameSmartBadgeTemplate, unicode)
self.assertIsInstance( NSImageNameIconViewTemplate, unicode)
self.assertIsInstance( NSImageNameListViewTemplate, unicode)
self.assertIsInstance( NSImageNameColumnViewTemplate, unicode)
self.assertIsInstance( NSImageNameFlowViewTemplate, unicode)
self.assertIsInstance( NSImageNamePathTemplate, unicode)
self.assertIsInstance( NSImageNameInvalidDataFreestandingTemplate, unicode)
self.assertIsInstance( NSImageNameLockLockedTemplate, unicode)
self.assertIsInstance( NSImageNameLockUnlockedTemplate, unicode)
self.assertIsInstance( NSImageNameGoRightTemplate, unicode)
self.assertIsInstance( NSImageNameGoLeftTemplate, unicode)
self.assertIsInstance( NSImageNameRightFacingTriangleTemplate, unicode)
self.assertIsInstance( NSImageNameLeftFacingTriangleTemplate, unicode)
self.assertIsInstance( NSImageNameAddTemplate, unicode)
self.assertIsInstance( NSImageNameRemoveTemplate, unicode)
self.assertIsInstance( NSImageNameRevealFreestandingTemplate, unicode)
self.assertIsInstance( NSImageNameFollowLinkFreestandingTemplate, unicode)
self.assertIsInstance( NSImageNameEnterFullScreenTemplate, unicode)
self.assertIsInstance( NSImageNameExitFullScreenTemplate, unicode)
self.assertIsInstance( NSImageNameStopProgressTemplate, unicode)
self.assertIsInstance( NSImageNameStopProgressFreestandingTemplate, unicode)
self.assertIsInstance( NSImageNameRefreshTemplate, unicode)
self.assertIsInstance( NSImageNameRefreshFreestandingTemplate, unicode)
self.assertIsInstance( NSImageNameBonjour, unicode)
self.assertIsInstance( NSImageNameDotMac, unicode)
self.assertIsInstance( NSImageNameComputer, unicode)
self.assertIsInstance( NSImageNameFolderBurnable, unicode)
self.assertIsInstance( NSImageNameFolderSmart, unicode)
self.assertIsInstance( NSImageNameNetwork, unicode)
self.assertIsInstance( NSImageNameMultipleDocuments, unicode)
self.assertIsInstance( NSImageNameUserAccounts, unicode)
self.assertIsInstance( NSImageNamePreferencesGeneral, unicode)
self.assertIsInstance( NSImageNameAdvanced, unicode)
self.assertIsInstance( NSImageNameInfo, unicode)
self.assertIsInstance( NSImageNameFontPanel, unicode)
self.assertIsInstance( NSImageNameColorPanel, unicode)
self.assertIsInstance( NSImageNameUser, unicode)
self.assertIsInstance( NSImageNameUserGroup, unicode)
self.assertIsInstance( NSImageNameEveryone, unicode)
def testMethods(self):
self.assertResultIsBOOL(NSImage.setName_)
self.assertArgIsBOOL(NSImage.setScalesWhenResized_, 0)
self.assertResultIsBOOL(NSImage.scalesWhenResized)
self.assertArgIsBOOL(NSImage.setDataRetained_, 0)
self.assertResultIsBOOL(NSImage.isDataRetained)
self.assertArgIsBOOL(NSImage.setCachedSeparately_, 0)
self.assertResultIsBOOL(NSImage.isCachedSeparately)
self.assertArgIsBOOL(NSImage.setCacheDepthMatchesImageDepth_, 0)
self.assertResultIsBOOL(NSImage.cacheDepthMatchesImageDepth)
self.assertArgIsBOOL(NSImage.setUsesEPSOnResolutionMismatch_, 0)
self.assertResultIsBOOL(NSImage.usesEPSOnResolutionMismatch)
self.assertArgIsBOOL(NSImage.setPrefersColorMatch_, 0)
self.assertResultIsBOOL(NSImage.prefersColorMatch)
self.assertArgIsBOOL(NSImage.setMatchesOnMultipleResolution_, 0)
self.assertResultIsBOOL(NSImage.matchesOnMultipleResolution)
self.assertResultIsBOOL(NSImage.drawRepresentation_inRect_)
self.assertResultIsBOOL(NSImage.isValid)
self.assertResultIsBOOL(NSImage.canInitWithPasteboard_)
self.assertResultIsBOOL(NSImage.isFlipped)
self.assertArgIsBOOL(NSImage.setFlipped_, 0)
self.assertResultIsBOOL(NSImage.isTemplate)
self.assertArgIsBOOL(NSImage.setTemplate_, 0)
def testProtocols(self):
self.assertArgHasType(TestNSImageHelper.image_didLoadPartOfRepresentation_withValidRows_, 2, objc._C_NSInteger)
self.assertArgHasType(TestNSImageHelper.image_didLoadRepresentation_withStatus_, 2, objc._C_NSUInteger)
@min_os_level('10.6')
def testMethods10_6(self):
self.assertArgHasType(NSImage.drawInRect_fromRect_operation_fraction_respectFlipped_hints_,
0, NSRect.__typestr__)
self.assertArgIsBOOL(NSImage.drawInRect_fromRect_operation_fraction_respectFlipped_hints_, 4)
self.assertArgIsBOOL(NSImage.lockFocusFlipped_, 0)
self.assertArgHasType(NSImage.initWithCGImage_size_, 1, NSSize.__typestr__)
self.assertArgHasType(NSImage.CGImageForProposedRect_context_hints_, 0, b'o^' + NSRect.__typestr__)
self.assertArgHasType(NSImage.bestRepresentationForRect_context_hints_, 0, NSRect.__typestr__)
self.assertResultIsBOOL(NSImage.hitTestRect_withImageDestinationRect_context_hints_flipped_)
self.assertArgHasType(NSImage.hitTestRect_withImageDestinationRect_context_hints_flipped_, 0, NSRect.__typestr__)
self.assertArgHasType(NSImage.hitTestRect_withImageDestinationRect_context_hints_flipped_, 1, NSRect.__typestr__)
@min_os_level('10.7')
def testMethods10_7(self):
self.assertResultIsBOOL(NSImage.matchesOnlyOnBestFittingAxis)
self.assertArgIsBOOL(NSImage.setMatchesOnlyOnBestFittingAxis_, 0)
@min_os_level('10.8')
def testMethods10_8(self):
self.assertArgIsBOOL(NSImage.imageWithSize_flipped_drawingHandler_, 1)
self.assertArgIsBlock(NSImage.imageWithSize_flipped_drawingHandler_, 2,
objc._C_NSBOOL + NSRect.__typestr__)
@min_os_level('10.6')
def testConstants10_6(self):
self.assertIsInstance(NSImageHintCTM, unicode)
self.assertIsInstance(NSImageHintInterpolation, unicode)
self.assertIsInstance(NSImageNameFolder, unicode)
self.assertIsInstance(NSImageNameMobileMe, unicode)
self.assertIsInstance(NSImageNameUserGuest, unicode)
self.assertIsInstance(NSImageNameMenuOnStateTemplate, unicode)
self.assertIsInstance(NSImageNameMenuMixedStateTemplate, unicode)
self.assertIsInstance(NSImageNameApplicationIcon, unicode)
self.assertIsInstance(NSImageNameTrashEmpty, unicode)
self.assertIsInstance(NSImageNameTrashFull, unicode)
self.assertIsInstance(NSImageNameHomeTemplate, unicode)
self.assertIsInstance(NSImageNameBookmarksTemplate, unicode)
self.assertIsInstance(NSImageNameCaution, unicode)
self.assertIsInstance(NSImageNameStatusAvailable, unicode)
self.assertIsInstance(NSImageNameStatusPartiallyAvailable, unicode)
self.assertIsInstance(NSImageNameStatusUnavailable, unicode)
self.assertIsInstance(NSImageNameStatusNone, unicode)
@min_os_level('10.8')
def testConstants10_8(self):
self.assertIsInstance(NSImageNameShareTemplate, unicode)
if __name__ == "__main__":
main()
| 53.229412 | 121 | 0.766162 | 693 | 9,049 | 9.802309 | 0.300144 | 0.182541 | 0.234506 | 0.03533 | 0.079641 | 0.065803 | 0.041808 | 0.023848 | 0 | 0 | 0 | 0.013167 | 0.160681 | 9,049 | 169 | 122 | 53.544379 | 0.881238 | 0.007846 | 0 | 0.026846 | 0 | 0 | 0.004568 | 0 | 0 | 0 | 0 | 0 | 0.724832 | 1 | 0.080537 | false | 0.013423 | 0.020134 | 0 | 0.114094 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
03658fd44f182cf1f9d458475f8bbe4dd7239ccc | 4,149 | py | Python | src/vgf/lego_alpha_team/cli_main.py | Robmaister/VideoGameFormats | 7676dde9ffaee036ba71526d8a09ee36474631e4 | [
"MIT"
] | 1 | 2019-07-21T17:46:28.000Z | 2019-07-21T17:46:28.000Z | src/vgf/lego_alpha_team/cli_main.py | Robmaister/VideoGameFormats | 7676dde9ffaee036ba71526d8a09ee36474631e4 | [
"MIT"
] | null | null | null | src/vgf/lego_alpha_team/cli_main.py | Robmaister/VideoGameFormats | 7676dde9ffaee036ba71526d8a09ee36474631e4 | [
"MIT"
] | null | null | null | #Copyright (c) 2012 Robert Rouhani <robert.rouhani@gmail.com>
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
#furnished to do so, subject to the following conditions:
#
#The above copyright notice and this permission notice shall be included in
#all copies or substantial portions of the Software.
#
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
#SOFTWARE.
from pac import PACFile
from dds import DDSFile
from misc import pathhelper
import os
def main(args):
if len(args) > 0:
if args[0] == "pac":
handle_pac_command(args[1:len(args)])
elif args[0] == "dds":
handle_dds_command(args[1:len(args)])
else:
print_help()
else:
print_help()
def print_help():
print "LEGO Alpha Team Utilities"
print "Usage: vgfutil.py lego_alpha_team <command> [options] <file>"
print ""
print "Available Formats:"
print " pac"
print " dds"
def print_help_pac():
print "LEGO Alpha Team .pac Extractor"
print "Usage: vgfutil.py lego_alpha_team pac <command> [options] <file>"
print ""
print "Example: vgfutil.py lego_alpha_team pac extract all ./audio Audio.pac"
print ""
print "All commands have the available option 'all' to execute the command for all"
print "entries in the file."
print ""
print "Available Commands (with options):"
print " extract [all|<entry name>] [output path]"
print " list [all|<entry name>]"
def print_help_dds():
print "LEGO Alpha Team .dds Converter"
print "Usage: vgfutil.py lego_alpha_team dds <command> [options] <file>"
print ""
print "Example: vgfutil.py lego_alpha_team dds convert out.wav in.dds"
print "Example: vgfutil.py lego_alpha_team dds convert ./out ./audio"
print ""
print "Available Commands (with options):"
print " convert [<output dir>|<output file>] [<dir>|<file>]"
def handle_pac_command(args):
if len(args) >= 3:
f = PACFile(args[len(args) - 1])
if args[0] == "list":
if args[1] == "all":
f.print_all_entries()
else:
f.print_entry(args[1])
elif args[0] == "extract":
if args[1] == "all":
if len(args) == 4:
f.extract_all(args[2])
else:
f.extract_all(".")
elif len(args) == 4:
f.extract(args[1], args[2])
else:
f.extract(args[1], ".")
else:
print_help_pac()
def handle_dds_command(args):
if len(args) == 3:
if args[0] == "convert":
if os.path.isdir(args[2]):
if not os.path.exists(args[1]):
os.makedirs(args[1])
for in_filepath in os.listdir(args[2]):
if (in_filepath.endswith(".DDS")):
out_filepath = pathhelper.new_ext_and_path(in_filepath, ".wav", args[1])
DDSFile(os.path.join(args[2], in_filepath)).save_as_wav(out_filepath)
elif os.path.isfile(args[2]):
out_filepath = args[1]
if not out_filepath.endswith(".wav"):
out_filepath.join(".wav")
DDSFile(args[2]).save_as_wav(out_filepath)
else:
print_help_dds()
else:
print_help_dds() | 38.416667 | 96 | 0.610991 | 557 | 4,149 | 4.452424 | 0.290844 | 0.024194 | 0.047177 | 0.043548 | 0.233468 | 0.164113 | 0.143548 | 0.070161 | 0.070161 | 0.070161 | 0 | 0.011092 | 0.28296 | 4,149 | 108 | 97 | 38.416667 | 0.822521 | 0.256929 | 0 | 0.271605 | 0 | 0 | 0.273083 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.049383 | null | null | 0.432099 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
03668cf9440c38ae185dd40a3ea4d789b11c3bec | 4,021 | py | Python | supersaver/common/utils/datetime.py | ftkghost/SuperSaver | 04d1f19c309b35b540f056ad9a4796225f97cb76 | [
"BSD-2-Clause"
] | null | null | null | supersaver/common/utils/datetime.py | ftkghost/SuperSaver | 04d1f19c309b35b540f056ad9a4796225f97cb76 | [
"BSD-2-Clause"
] | 1 | 2018-08-12T12:50:17.000Z | 2018-08-12T12:50:17.000Z | supersaver/common/utils/datetime.py | ftkghost/SuperSaver | 04d1f19c309b35b540f056ad9a4796225f97cb76 | [
"BSD-2-Clause"
] | null | null | null | from datetime import tzinfo, timedelta, datetime
from dateutil.zoneinfo import getzoneinfofile_stream, ZoneInfoFile
class GeneralTZ(tzinfo):
"""
General timezone with hour offset.
"""
def __init__(self, hour_offset):
self.hour_offset = hour_offset
def __repr__(self):
return "<TZ{0}>".format(self.hour_offset)
def utcoffset(self, dt):
return timedelta(hours=self.hour_offset)
def tzname(self, dt):
return "TZ{0}".format(self.hour_offset)
def dst(self, dt):
return timedelta(hours=self.hour_offset)
class UTC(tzinfo):
"""
UTC implementation taken from Python's docs.
Used only when pytz isn't available.
"""
def __repr__(self):
return "<UTC>"
def utcoffset(self, dt):
return timedelta(0)
def tzname(self, dt):
return "UTC"
def dst(self, dt):
return timedelta(0)
EPOCH_TIME = datetime.utcfromtimestamp(0).replace(tzinfo=UTC())
def get_timezone_by_name(tzname):
zone_info_file = ZoneInfoFile(getzoneinfofile_stream())
return zone_info_file.zones.get(tzname)
def get_total_seconds_since(date_time=datetime.utcnow().replace(tzinfo=UTC()), since=EPOCH_TIME):
delta = date_time - since
return delta.total_seconds()
def to_client_support_time_str(time_value):
return time_value.replace(microsecond=0).isoformat()
def to_client_timestamp(date_time):
if not isinstance(date_time, datetime):
raise TypeError("Argument type should be datetime or date.")
if date_time is None:
return None
if date_time.tzinfo is None:
time_value = date_time.replace(tzinfo=UTC())
else:
time_value = date_time
delta = (time_value - EPOCH_TIME)
return int(delta.total_seconds() * 1000)
def from_client_timestamp(timestamp):
"""
Convert timestamp from client to UTC datetime.
:param timestamp: timestamp from clients.
:return: UTC datetime.
"""
if isinstance(timestamp, str):
timestamp = int(timestamp)
timestamp = float(timestamp / 1000.0)
return datetime.utcfromtimestamp(timestamp).replace(tzinfo=UTC())
def from_utc_timestamp(timestamp):
utc_time = datetime.utcfromtimestamp(timestamp)
return utc_time.replace(tzinfo=UTC())
def beginning_of_today():
return datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
def end_of_today():
return datetime.now().replace(hour=23, minute=59, second=59, microsecond=999999)
def beginning_of_week():
beginning_of_today_time = beginning_of_today()
day_of_week = beginning_of_today_time.weekday()
beginning_of_week_time = beginning_of_today_time - timedelta(days=day_of_week)
return beginning_of_week_time
def end_of_week():
return beginning_of_week() + timedelta(days=7, microseconds=-1)
def utc_beginning_of_today(timezone_offset_hours):
# Make sure year,month,day are same as client time.
now = datetime.utcnow() + timedelta(hours=timezone_offset_hours)
utc_0am = now.replace(hour=0, minute=0, second=0, microsecond=0, tzinfo=UTC())
return utc_0am - timedelta(hours=timezone_offset_hours)
def utc_end_of_today(timezone_offset_hours):
# Make sure year/month/day are same as client time.
client_time_now = datetime.utcnow() + timedelta(hours=timezone_offset_hours)
utc_today_end_time = client_time_now.replace(hour=23, minute=59, second=59, microsecond=999999, tzinfo=UTC())
return utc_today_end_time - timedelta(hours=timezone_offset_hours)
def utc_beginning_of_week(timezone_offset_hours):
beginning_of_today_time = utc_beginning_of_today(timezone_offset_hours)
client_time = datetime.utcnow() + timedelta(hours=timezone_offset_hours)
day_of_week = client_time.weekday()
beginning_of_week_time = beginning_of_today_time - timedelta(days=day_of_week)
return beginning_of_week_time
def utc_end_of_week(timezone_offset_hours):
return utc_beginning_of_week(timezone_offset_hours) + timedelta(days=7, microseconds=-1)
| 29.785185 | 113 | 0.730415 | 550 | 4,021 | 5.045455 | 0.203636 | 0.067387 | 0.075315 | 0.036036 | 0.476396 | 0.434234 | 0.381261 | 0.277477 | 0.225586 | 0.225586 | 0 | 0.015897 | 0.170853 | 4,021 | 134 | 114 | 30.007463 | 0.816437 | 0.082069 | 0 | 0.207792 | 0 | 0 | 0.016795 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.298701 | false | 0 | 0.025974 | 0.168831 | 0.649351 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
cee03ee940c42f68705300b559b5bd61f2b1d992 | 99,800 | py | Python | pysnmp/A3COM-HUAWEI-IFQOS2-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/A3COM-HUAWEI-IFQOS2-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/A3COM-HUAWEI-IFQOS2-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module A3COM-HUAWEI-IFQOS2-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/A3COM-HUAWEI-IFQOS2-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 16:50:28 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)
#
h3cCommon, = mibBuilder.importSymbols("A3COM-HUAWEI-OID-MIB", "h3cCommon")
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, ValueRangeConstraint, ConstraintsUnion, SingleValueConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueRangeConstraint", "ConstraintsUnion", "SingleValueConstraint", "ValueSizeConstraint")
ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
NotificationType, ObjectIdentity, Counter32, Bits, Gauge32, Counter64, Unsigned32, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier, ModuleIdentity, IpAddress, Integer32, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "ObjectIdentity", "Counter32", "Bits", "Gauge32", "Counter64", "Unsigned32", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier", "ModuleIdentity", "IpAddress", "Integer32", "TimeTicks")
RowStatus, DisplayString, TextualConvention, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "DisplayString", "TextualConvention", "TruthValue")
h3cIfQos2 = ModuleIdentity((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1))
if mibBuilder.loadTexts: h3cIfQos2.setLastUpdated('200812020000Z')
if mibBuilder.loadTexts: h3cIfQos2.setOrganization('H3C Technologies Co.,Ltd.')
h3cQos2 = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65))
class CarAction(TextualConvention, Integer32):
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16))
namedValues = NamedValues(("invalid", 0), ("pass", 1), ("continue", 2), ("discard", 3), ("remark", 4), ("remark-ip-continue", 5), ("remark-ip-pass", 6), ("remark-mplsexp-continue", 7), ("remark-mplsexp-pass", 8), ("remark-dscp-continue", 9), ("remark-dscp-pass", 10), ("remark-dot1p-continue", 11), ("remark-dot1p-pass", 12), ("remark-atm-clp-continue", 13), ("remark-atm-clp-pass", 14), ("remark-fr-de-continue", 15), ("remark-fr-de-pass", 16))
class PriorityQueue(TextualConvention, Integer32):
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))
namedValues = NamedValues(("top", 1), ("middle", 2), ("normal", 3), ("bottom", 4))
class Direction(TextualConvention, Integer32):
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2))
namedValues = NamedValues(("inbound", 1), ("outbound", 2))
h3cIfQoSHardwareQueueObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1))
h3cIfQoSHardwareQueueConfigGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 1))
h3cIfQoSQSModeTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 1, 1), )
if mibBuilder.loadTexts: h3cIfQoSQSModeTable.setStatus('current')
h3cIfQoSQSModeEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: h3cIfQoSQSModeEntry.setStatus('current')
h3cIfQoSQSMode = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("sp", 1), ("sp0", 2), ("sp1", 3), ("sp2", 4), ("wrr", 5), ("hwfq", 6), ("wrr-sp", 7), ("byteCountWrr", 8), ("byteCountWfq", 9)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: h3cIfQoSQSMode.setStatus('current')
h3cIfQoSQSWeightTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 1, 2), )
if mibBuilder.loadTexts: h3cIfQoSQSWeightTable.setStatus('current')
h3cIfQoSQSWeightEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 1, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSQueueID"))
if mibBuilder.loadTexts: h3cIfQoSQSWeightEntry.setStatus('current')
h3cIfQoSQueueID = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 1, 2, 1, 1), Integer32())
if mibBuilder.loadTexts: h3cIfQoSQueueID.setStatus('current')
h3cIfQoSQueueGroupType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("group0", 1), ("group1", 2), ("group2", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: h3cIfQoSQueueGroupType.setStatus('current')
h3cIfQoSQSType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("weight", 1), ("byte-count", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: h3cIfQoSQSType.setStatus('current')
h3cIfQoSQSValue = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 1, 2, 1, 4), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: h3cIfQoSQSValue.setStatus('current')
h3cIfQoSQSMaxDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 1, 2, 1, 5), Integer32().clone(9)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: h3cIfQoSQSMaxDelay.setStatus('current')
h3cIfQoSQSMinBandwidth = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 1, 2, 1, 6), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: h3cIfQoSQSMinBandwidth.setStatus('current')
h3cIfQoSHardwareQueueRunInfoGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2))
h3cIfQoSHardwareQueueRunInfoTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1), )
if mibBuilder.loadTexts: h3cIfQoSHardwareQueueRunInfoTable.setStatus('current')
h3cIfQoSHardwareQueueRunInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSQueueID"))
if mibBuilder.loadTexts: h3cIfQoSHardwareQueueRunInfoEntry.setStatus('current')
h3cIfQoSPassPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1, 1), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSPassPackets.setStatus('current')
h3cIfQoSDropPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSDropPackets.setStatus('current')
h3cIfQoSPassBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSPassBytes.setStatus('current')
h3cIfQoSPassPPS = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSPassPPS.setStatus('current')
h3cIfQoSPassBPS = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1, 5), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSPassBPS.setStatus('current')
h3cIfQoSDropBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSDropBytes.setStatus('current')
h3cIfQoSQueueLengthInPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSQueueLengthInPkts.setStatus('current')
h3cIfQoSQueueLengthInBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1, 8), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSQueueLengthInBytes.setStatus('current')
h3cIfQoSCurQueuePkts = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSCurQueuePkts.setStatus('current')
h3cIfQoSCurQueueBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1, 10), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSCurQueueBytes.setStatus('current')
h3cIfQoSCurQueuePPS = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1, 11), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSCurQueuePPS.setStatus('current')
h3cIfQoSCurQueueBPS = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1, 12), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSCurQueueBPS.setStatus('current')
h3cIfQoSTailDropPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1, 13), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSTailDropPkts.setStatus('current')
h3cIfQoSTailDropBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1, 14), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSTailDropBytes.setStatus('current')
h3cIfQoSTailDropPPS = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1, 15), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSTailDropPPS.setStatus('current')
h3cIfQoSTailDropBPS = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1, 16), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSTailDropBPS.setStatus('current')
h3cIfQoSWredDropPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1, 17), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredDropPkts.setStatus('current')
h3cIfQoSWredDropBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1, 18), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredDropBytes.setStatus('current')
h3cIfQoSWredDropPPS = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1, 19), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredDropPPS.setStatus('current')
h3cIfQoSWredDropBPS = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 1, 1, 20), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredDropBPS.setStatus('current')
h3cIfQoSHQueueTcpRunInfoTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 2), )
if mibBuilder.loadTexts: h3cIfQoSHQueueTcpRunInfoTable.setStatus('current')
h3cIfQoSHQueueTcpRunInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSQueueID"))
if mibBuilder.loadTexts: h3cIfQoSHQueueTcpRunInfoEntry.setStatus('current')
h3cIfQoSWredDropLPreNTcpPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 2, 1, 1), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredDropLPreNTcpPkts.setStatus('current')
h3cIfQoSWredDropLPreNTcpBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 2, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredDropLPreNTcpBytes.setStatus('current')
h3cIfQoSWredDropLPreNTcpPPS = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 2, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredDropLPreNTcpPPS.setStatus('current')
h3cIfQoSWredDropLPreNTcpBPS = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 2, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredDropLPreNTcpBPS.setStatus('current')
h3cIfQoSWredDropLPreTcpPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 2, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredDropLPreTcpPkts.setStatus('current')
h3cIfQoSWredDropLPreTcpBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 2, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredDropLPreTcpBytes.setStatus('current')
h3cIfQoSWredDropLPreTcpPPS = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 2, 1, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredDropLPreTcpPPS.setStatus('current')
h3cIfQoSWredDropLPreTcpBPS = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 2, 1, 8), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredDropLPreTcpBPS.setStatus('current')
h3cIfQoSWredDropHPreNTcpPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 2, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredDropHPreNTcpPkts.setStatus('current')
h3cIfQoSWredDropHPreNTcpBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 2, 1, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredDropHPreNTcpBytes.setStatus('current')
h3cIfQoSWredDropHPreNTcpPPS = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 2, 1, 11), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredDropHPreNTcpPPS.setStatus('current')
h3cIfQoSWredDropHPreNTcpBPS = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 2, 1, 12), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredDropHPreNTcpBPS.setStatus('current')
h3cIfQoSWredDropHPreTcpPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 2, 1, 13), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredDropHPreTcpPkts.setStatus('current')
h3cIfQoSWredDropHPreTcpBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 2, 1, 14), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredDropHPreTcpBytes.setStatus('current')
h3cIfQoSWredDropHPreTcpPPS = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 2, 1, 15), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredDropHPreTcpPPS.setStatus('current')
h3cIfQoSWredDropHPreTcpBPS = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 1, 2, 2, 1, 16), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredDropHPreTcpBPS.setStatus('current')
h3cIfQoSSoftwareQueueObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2))
h3cIfQoSFIFOObject = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 1))
h3cIfQoSFIFOConfigTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 1, 1), )
if mibBuilder.loadTexts: h3cIfQoSFIFOConfigTable.setStatus('current')
h3cIfQoSFIFOConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: h3cIfQoSFIFOConfigEntry.setStatus('current')
h3cIfQoSFIFOMaxQueueLen = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 1, 1, 1, 1), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: h3cIfQoSFIFOMaxQueueLen.setStatus('current')
h3cIfQoSFIFORunInfoTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 1, 2), )
if mibBuilder.loadTexts: h3cIfQoSFIFORunInfoTable.setStatus('current')
h3cIfQoSFIFORunInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 1, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: h3cIfQoSFIFORunInfoEntry.setStatus('current')
h3cIfQoSFIFOSize = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 1, 2, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSFIFOSize.setStatus('current')
h3cIfQoSFIFODiscardPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 1, 2, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSFIFODiscardPackets.setStatus('current')
h3cIfQoSPQObject = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2))
h3cIfQoSPQConfigGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 1))
h3cIfQoSPQDefaultTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 1, 1), )
if mibBuilder.loadTexts: h3cIfQoSPQDefaultTable.setStatus('current')
h3cIfQoSPQDefaultEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 1, 1, 1), ).setIndexNames((0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSPQListNumber"))
if mibBuilder.loadTexts: h3cIfQoSPQDefaultEntry.setStatus('current')
h3cIfQoSPQListNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16)))
if mibBuilder.loadTexts: h3cIfQoSPQListNumber.setStatus('current')
h3cIfQoSPQDefaultQueueType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 1, 1, 1, 2), PriorityQueue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: h3cIfQoSPQDefaultQueueType.setStatus('current')
h3cIfQoSPQQueueLengthTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 1, 2), )
if mibBuilder.loadTexts: h3cIfQoSPQQueueLengthTable.setStatus('current')
h3cIfQoSPQQueueLengthEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 1, 2, 1), ).setIndexNames((0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSPQListNumber"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSPQQueueLengthType"))
if mibBuilder.loadTexts: h3cIfQoSPQQueueLengthEntry.setStatus('current')
h3cIfQoSPQQueueLengthType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 1, 2, 1, 1), PriorityQueue())
if mibBuilder.loadTexts: h3cIfQoSPQQueueLengthType.setStatus('current')
h3cIfQoSPQQueueLengthValue = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: h3cIfQoSPQQueueLengthValue.setStatus('current')
h3cIfQoSPQClassRuleTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 1, 3), )
if mibBuilder.loadTexts: h3cIfQoSPQClassRuleTable.setStatus('current')
h3cIfQoSPQClassRuleEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 1, 3, 1), ).setIndexNames((0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSPQListNumber"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSPQClassRuleType"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSPQClassRuleValue"))
if mibBuilder.loadTexts: h3cIfQoSPQClassRuleEntry.setStatus('current')
h3cIfQoSPQClassRuleType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=NamedValues(("interface", 1), ("ipv4acl", 2), ("ipv6acl", 3), ("fragments", 4), ("greater-than", 5), ("less-than", 6), ("tcp", 7), ("udp", 8), ("ipall", 9), ("mpls", 10))))
if mibBuilder.loadTexts: h3cIfQoSPQClassRuleType.setStatus('current')
h3cIfQoSPQClassRuleValue = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 1, 3, 1, 2), Integer32())
if mibBuilder.loadTexts: h3cIfQoSPQClassRuleValue.setStatus('current')
h3cIfQoSPQClassRuleQueueType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 1, 3, 1, 3), PriorityQueue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSPQClassRuleQueueType.setStatus('current')
h3cIfQoSPQClassRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 1, 3, 1, 4), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSPQClassRowStatus.setStatus('current')
h3cIfQoSPQApplyTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 1, 4), )
if mibBuilder.loadTexts: h3cIfQoSPQApplyTable.setStatus('current')
h3cIfQoSPQApplyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 1, 4, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: h3cIfQoSPQApplyEntry.setStatus('current')
h3cIfQoSPQApplyListNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 1, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSPQApplyListNumber.setStatus('current')
h3cIfQoSPQApplyRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 1, 4, 1, 2), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSPQApplyRowStatus.setStatus('current')
h3cIfQoSPQRunInfoGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 2))
h3cIfQoSPQRunInfoTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 2, 1), )
if mibBuilder.loadTexts: h3cIfQoSPQRunInfoTable.setStatus('current')
h3cIfQoSPQRunInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 2, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSPQType"))
if mibBuilder.loadTexts: h3cIfQoSPQRunInfoEntry.setStatus('current')
h3cIfQoSPQType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 2, 1, 1, 1), PriorityQueue())
if mibBuilder.loadTexts: h3cIfQoSPQType.setStatus('current')
h3cIfQoSPQSize = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 2, 1, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSPQSize.setStatus('current')
h3cIfQoSPQLength = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 2, 1, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSPQLength.setStatus('current')
h3cIfQoSPQDiscardPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 2, 2, 1, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSPQDiscardPackets.setStatus('current')
h3cIfQoSCQObject = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3))
h3cIfQoSCQConfigGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 1))
h3cIfQoSCQDefaultTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 1, 1), )
if mibBuilder.loadTexts: h3cIfQoSCQDefaultTable.setStatus('current')
h3cIfQoSCQDefaultEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 1, 1, 1), ).setIndexNames((0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSCQListNumber"))
if mibBuilder.loadTexts: h3cIfQoSCQDefaultEntry.setStatus('current')
h3cIfQoSCQListNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16)))
if mibBuilder.loadTexts: h3cIfQoSCQListNumber.setStatus('current')
h3cIfQoSCQDefaultQueueID = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 16)).clone(1)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: h3cIfQoSCQDefaultQueueID.setStatus('current')
h3cIfQoSCQQueueLengthTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 1, 2), )
if mibBuilder.loadTexts: h3cIfQoSCQQueueLengthTable.setStatus('current')
h3cIfQoSCQQueueLengthEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 1, 2, 1), ).setIndexNames((0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSCQListNumber"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSCQQueueID"))
if mibBuilder.loadTexts: h3cIfQoSCQQueueLengthEntry.setStatus('current')
h3cIfQoSCQQueueID = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16)))
if mibBuilder.loadTexts: h3cIfQoSCQQueueID.setStatus('current')
h3cIfQoSCQQueueLength = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024)).clone(20)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: h3cIfQoSCQQueueLength.setStatus('current')
h3cIfQoSCQQueueServing = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 1, 2, 1, 3), Integer32().clone(1500)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: h3cIfQoSCQQueueServing.setStatus('current')
h3cIfQoSCQClassRuleTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 1, 3), )
if mibBuilder.loadTexts: h3cIfQoSCQClassRuleTable.setStatus('current')
h3cIfQoSCQClassRuleEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 1, 3, 1), ).setIndexNames((0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSCQListNumber"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSCQClassRuleType"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSCQClassRuleValue"))
if mibBuilder.loadTexts: h3cIfQoSCQClassRuleEntry.setStatus('current')
h3cIfQoSCQClassRuleType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=NamedValues(("interface", 1), ("ipv4acl", 2), ("ipv6acl", 3), ("fragments", 4), ("greater-than", 5), ("less-than", 6), ("tcp", 7), ("udp", 8), ("ipall", 9), ("mpls", 10))))
if mibBuilder.loadTexts: h3cIfQoSCQClassRuleType.setStatus('current')
h3cIfQoSCQClassRuleValue = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 1, 3, 1, 2), Integer32())
if mibBuilder.loadTexts: h3cIfQoSCQClassRuleValue.setStatus('current')
h3cIfQoSCQClassRuleQueueID = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 1, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSCQClassRuleQueueID.setStatus('current')
h3cIfQoSCQClassRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 1, 3, 1, 4), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSCQClassRowStatus.setStatus('current')
h3cIfQoSCQApplyTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 1, 4), )
if mibBuilder.loadTexts: h3cIfQoSCQApplyTable.setStatus('current')
h3cIfQoSCQApplyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 1, 4, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: h3cIfQoSCQApplyEntry.setStatus('current')
h3cIfQoSCQApplyListNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 1, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSCQApplyListNumber.setStatus('current')
h3cIfQoSCQApplyRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 1, 4, 1, 2), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSCQApplyRowStatus.setStatus('current')
h3cIfQoSCQRunInfoGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 2))
h3cIfQoSCQRunInfoTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 2, 1), )
if mibBuilder.loadTexts: h3cIfQoSCQRunInfoTable.setStatus('current')
h3cIfQoSCQRunInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 2, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSCQQueueID"))
if mibBuilder.loadTexts: h3cIfQoSCQRunInfoEntry.setStatus('current')
h3cIfQoSCQRunInfoSize = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 2, 1, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSCQRunInfoSize.setStatus('current')
h3cIfQoSCQRunInfoLength = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 2, 1, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSCQRunInfoLength.setStatus('current')
h3cIfQoSCQRunInfoDiscardPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 3, 2, 1, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSCQRunInfoDiscardPackets.setStatus('current')
h3cIfQoSWFQObject = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 4))
h3cIfQoSWFQConfigGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 4, 1))
h3cIfQoSWFQTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 4, 1, 1), )
if mibBuilder.loadTexts: h3cIfQoSWFQTable.setStatus('current')
h3cIfQoSWFQEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 4, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: h3cIfQoSWFQEntry.setStatus('current')
h3cIfQoSWFQQueueLength = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 4, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024)).clone(64)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSWFQQueueLength.setStatus('current')
h3cIfQoSWFQQueueNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 4, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("size16", 1), ("size32", 2), ("size64", 3), ("size128", 4), ("size256", 5), ("size512", 6), ("size1024", 7), ("size2048", 8), ("size4096", 9))).clone(5)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSWFQQueueNumber.setStatus('current')
h3cIfQoSWFQRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 4, 1, 1, 1, 3), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSWFQRowStatus.setStatus('current')
h3cIfQoSWFQType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 4, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ip-precedence", 1), ("dscp", 2))).clone(1)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSWFQType.setStatus('current')
h3cIfQoSWFQRunInfoGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 4, 2))
h3cIfQoSWFQRunInfoTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 4, 2, 1), )
if mibBuilder.loadTexts: h3cIfQoSWFQRunInfoTable.setStatus('current')
h3cIfQoSWFQRunInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 4, 2, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: h3cIfQoSWFQRunInfoEntry.setStatus('current')
h3cIfQoSWFQSize = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 4, 2, 1, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWFQSize.setStatus('current')
h3cIfQoSWFQLength = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 4, 2, 1, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWFQLength.setStatus('current')
h3cIfQoSWFQDiscardPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 4, 2, 1, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWFQDiscardPackets.setStatus('current')
h3cIfQoSWFQHashedActiveQueues = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 4, 2, 1, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWFQHashedActiveQueues.setStatus('current')
h3cIfQoSWFQHashedMaxActiveQueues = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 4, 2, 1, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWFQHashedMaxActiveQueues.setStatus('current')
h3fIfQosWFQhashedTotalQueues = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 4, 2, 1, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3fIfQosWFQhashedTotalQueues.setStatus('current')
h3cIfQoSBandwidthGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 5))
h3cIfQoSBandwidthTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 5, 1), )
if mibBuilder.loadTexts: h3cIfQoSBandwidthTable.setStatus('current')
h3cIfQoSBandwidthEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 5, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: h3cIfQoSBandwidthEntry.setStatus('current')
h3cIfQoSMaxBandwidth = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 5, 1, 1, 1), Integer32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSMaxBandwidth.setStatus('current')
h3cIfQoSReservedBandwidthPct = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 5, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 100)).clone(75)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSReservedBandwidthPct.setStatus('current')
h3cIfQoSBandwidthRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 5, 1, 1, 3), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSBandwidthRowStatus.setStatus('current')
h3cIfQoSQmtokenGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 6))
h3cIfQoSQmtokenTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 6, 1), )
if mibBuilder.loadTexts: h3cIfQoSQmtokenTable.setStatus('current')
h3cIfQoSQmtokenEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 6, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: h3cIfQoSQmtokenEntry.setStatus('current')
h3cIfQoSQmtokenNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 6, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 50))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSQmtokenNumber.setStatus('current')
h3cIfQoSQmtokenRosStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 6, 1, 1, 2), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSQmtokenRosStatus.setStatus('current')
h3cIfQoSRTPQObject = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 7))
h3cIfQoSRTPQConfigGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 7, 1))
h3cIfQoSRTPQConfigTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 7, 1, 1), )
if mibBuilder.loadTexts: h3cIfQoSRTPQConfigTable.setStatus('current')
h3cIfQoSRTPQConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 7, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: h3cIfQoSRTPQConfigEntry.setStatus('current')
h3cIfQoSRTPQStartPort = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 7, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2000, 65535))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSRTPQStartPort.setStatus('current')
h3cIfQoSRTPQEndPort = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 7, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2000, 65535))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSRTPQEndPort.setStatus('current')
h3cIfQoSRTPQReservedBandwidth = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 7, 1, 1, 1, 3), Integer32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSRTPQReservedBandwidth.setStatus('current')
h3cIfQoSRTPQCbs = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 7, 1, 1, 1, 4), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSRTPQCbs.setStatus('current')
h3cIfQoSRTPQRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 7, 1, 1, 1, 5), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSRTPQRowStatus.setStatus('current')
h3cIfQoSRTPQRunInfoGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 7, 2))
h3cIfQoSRTPQRunInfoTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 7, 2, 1), )
if mibBuilder.loadTexts: h3cIfQoSRTPQRunInfoTable.setStatus('current')
h3cIfQoSRTPQRunInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 7, 2, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: h3cIfQoSRTPQRunInfoEntry.setStatus('current')
h3cIfQoSRTPQPacketNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 7, 2, 1, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSRTPQPacketNumber.setStatus('current')
h3cIfQoSRTPQPacketSize = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 7, 2, 1, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSRTPQPacketSize.setStatus('current')
h3cIfQoSRTPQOutputPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 7, 2, 1, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSRTPQOutputPackets.setStatus('current')
h3cIfQoSRTPQDiscardPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 7, 2, 1, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSRTPQDiscardPackets.setStatus('current')
h3cIfQoSCarListObject = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 8))
h3cIfQoCarListGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 8, 1))
h3cIfQoSCarlTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 8, 1, 1), )
if mibBuilder.loadTexts: h3cIfQoSCarlTable.setStatus('current')
h3cIfQoSCarlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 8, 1, 1, 1), ).setIndexNames((0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSCarlListNum"))
if mibBuilder.loadTexts: h3cIfQoSCarlEntry.setStatus('current')
h3cIfQoSCarlListNum = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 8, 1, 1, 1, 1), Integer32())
if mibBuilder.loadTexts: h3cIfQoSCarlListNum.setStatus('current')
h3cIfQoSCarlParaType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 8, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("macAddress", 1), ("precMask", 2), ("dscpMask", 3)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSCarlParaType.setStatus('current')
h3cIfQoSCarlParaValue = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 8, 1, 1, 1, 3), OctetString()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSCarlParaValue.setStatus('current')
h3cIfQoSCarlRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 2, 8, 1, 1, 1, 4), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSCarlRowStatus.setStatus('current')
h3cIfQoSLineRateObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 3))
h3cIfQoSLRConfigTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 3, 1), )
if mibBuilder.loadTexts: h3cIfQoSLRConfigTable.setStatus('current')
h3cIfQoSLRConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 3, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSLRDirection"))
if mibBuilder.loadTexts: h3cIfQoSLRConfigEntry.setStatus('current')
h3cIfQoSLRDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 3, 1, 1, 1), Direction())
if mibBuilder.loadTexts: h3cIfQoSLRDirection.setStatus('current')
h3cIfQoSLRCir = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 3, 1, 1, 2), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSLRCir.setStatus('current')
h3cIfQoSLRCbs = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 3, 1, 1, 3), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSLRCbs.setStatus('current')
h3cIfQoSLREbs = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 3, 1, 1, 4), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSLREbs.setStatus('current')
h3cIfQoSRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 3, 1, 1, 5), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSRowStatus.setStatus('current')
h3cIfQoSLRPir = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 3, 1, 1, 6), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSLRPir.setStatus('current')
h3cIfQoSLRRunInfoTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 3, 2), )
if mibBuilder.loadTexts: h3cIfQoSLRRunInfoTable.setStatus('current')
h3cIfQoSLRRunInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 3, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSLRDirection"))
if mibBuilder.loadTexts: h3cIfQoSLRRunInfoEntry.setStatus('current')
h3cIfQoSLRRunInfoPassedPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 3, 2, 1, 1), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSLRRunInfoPassedPackets.setStatus('current')
h3cIfQoSLRRunInfoPassedBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 3, 2, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSLRRunInfoPassedBytes.setStatus('current')
h3cIfQoSLRRunInfoDelayedPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 3, 2, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSLRRunInfoDelayedPackets.setStatus('current')
h3cIfQoSLRRunInfoDelayedBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 3, 2, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSLRRunInfoDelayedBytes.setStatus('current')
h3cIfQoSLRRunInfoActiveShaping = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 3, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("active", 1), ("inactive", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSLRRunInfoActiveShaping.setStatus('current')
h3cIfQoSCARObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4))
h3cIfQoSAggregativeCarGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1))
h3cIfQoSAggregativeCarNextIndex = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarNextIndex.setStatus('current')
h3cIfQoSAggregativeCarConfigTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 2), )
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarConfigTable.setStatus('current')
h3cIfQoSAggregativeCarConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 2, 1), ).setIndexNames((0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSAggregativeCarIndex"))
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarConfigEntry.setStatus('current')
h3cIfQoSAggregativeCarIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65534)))
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarIndex.setStatus('current')
h3cIfQoSAggregativeCarName = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 2, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 31))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarName.setStatus('current')
h3cIfQoSAggregativeCarCir = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 2, 1, 3), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarCir.setStatus('current')
h3cIfQoSAggregativeCarCbs = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 2, 1, 4), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarCbs.setStatus('current')
h3cIfQoSAggregativeCarEbs = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 2, 1, 5), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarEbs.setStatus('current')
h3cIfQoSAggregativeCarPir = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 2, 1, 6), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarPir.setStatus('current')
h3cIfQoSAggregativeCarGreenActionType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 2, 1, 7), CarAction().clone('pass')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarGreenActionType.setStatus('current')
h3cIfQoSAggregativeCarGreenActionValue = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 63), ValueRangeConstraint(255, 255), ))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarGreenActionValue.setStatus('current')
h3cIfQoSAggregativeCarYellowActionType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 2, 1, 9), CarAction()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarYellowActionType.setStatus('current')
h3cIfQoSAggregativeCarYellowActionValue = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 2, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 63), ValueRangeConstraint(255, 255), ))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarYellowActionValue.setStatus('current')
h3cIfQoSAggregativeCarRedActionType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 2, 1, 11), CarAction()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarRedActionType.setStatus('current')
h3cIfQoSAggregativeCarRedActionValue = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 2, 1, 12), Integer32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarRedActionValue.setStatus('current')
h3cIfQoSAggregativeCarType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 2, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("aggregative", 1), ("notAggregative", 2)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarType.setStatus('current')
h3cIfQoSAggregativeCarRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 2, 1, 14), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarRowStatus.setStatus('current')
h3cIfQoSAggregativeCarApplyTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 3), )
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarApplyTable.setStatus('current')
h3cIfQoSAggregativeCarApplyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 3, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSAggregativeCarApplyDirection"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSAggregativeCarApplyRuleType"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSAggregativeCarApplyRuleValue"))
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarApplyEntry.setStatus('current')
h3cIfQoSAggregativeCarApplyDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 3, 1, 1), Direction())
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarApplyDirection.setStatus('current')
h3cIfQoSAggregativeCarApplyRuleType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("ipv4acl", 1), ("ipv6acl", 2), ("carl", 3), ("any", 4))))
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarApplyRuleType.setStatus('current')
h3cIfQoSAggregativeCarApplyRuleValue = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 3, 1, 3), Integer32())
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarApplyRuleValue.setStatus('current')
h3cIfQoSAggregativeCarApplyCarIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 3, 1, 4), Integer32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarApplyCarIndex.setStatus('current')
h3cIfQoSAggregativeCarApplyRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 3, 1, 5), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarApplyRowStatus.setStatus('current')
h3cIfQoSAggregativeCarRunInfoTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 4), )
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarRunInfoTable.setStatus('current')
h3cIfQoSAggregativeCarRunInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 4, 1), ).setIndexNames((0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSAggregativeCarIndex"))
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarRunInfoEntry.setStatus('current')
h3cIfQoSAggregativeCarGreenPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 4, 1, 1), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarGreenPackets.setStatus('current')
h3cIfQoSAggregativeCarGreenBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 4, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarGreenBytes.setStatus('current')
h3cIfQoSAggregativeCarYellowPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 4, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarYellowPackets.setStatus('current')
h3cIfQoSAggregativeCarYellowBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 4, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarYellowBytes.setStatus('current')
h3cIfQoSAggregativeCarRedPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 4, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarRedPackets.setStatus('current')
h3cIfQoSAggregativeCarRedBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 1, 4, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSAggregativeCarRedBytes.setStatus('current')
h3cIfQoSTricolorCarGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2))
h3cIfQoSTricolorCarConfigTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 1), )
if mibBuilder.loadTexts: h3cIfQoSTricolorCarConfigTable.setStatus('current')
h3cIfQoSTricolorCarConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSTricolorCarDirection"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSTricolorCarType"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSTricolorCarValue"))
if mibBuilder.loadTexts: h3cIfQoSTricolorCarConfigEntry.setStatus('current')
h3cIfQoSTricolorCarDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 1, 1, 1), Direction())
if mibBuilder.loadTexts: h3cIfQoSTricolorCarDirection.setStatus('current')
h3cIfQoSTricolorCarType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("ipv4acl", 1), ("ipv6acl", 2), ("carl", 3), ("any", 4))))
if mibBuilder.loadTexts: h3cIfQoSTricolorCarType.setStatus('current')
h3cIfQoSTricolorCarValue = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 1, 1, 3), Integer32())
if mibBuilder.loadTexts: h3cIfQoSTricolorCarValue.setStatus('current')
h3cIfQoSTricolorCarCir = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 1, 1, 4), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSTricolorCarCir.setStatus('current')
h3cIfQoSTricolorCarCbs = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 1, 1, 5), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSTricolorCarCbs.setStatus('current')
h3cIfQoSTricolorCarEbs = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 1, 1, 6), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSTricolorCarEbs.setStatus('current')
h3cIfQoSTricolorCarPir = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 1, 1, 7), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSTricolorCarPir.setStatus('current')
h3cIfQoSTricolorCarGreenActionType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 1, 1, 8), CarAction().clone('pass')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSTricolorCarGreenActionType.setStatus('current')
h3cIfQoSTricolorCarGreenActionValue = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 63), ValueRangeConstraint(255, 255), ))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSTricolorCarGreenActionValue.setStatus('current')
h3cIfQoSTricolorCarYellowActionType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 1, 1, 10), CarAction().clone('pass')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSTricolorCarYellowActionType.setStatus('current')
h3cIfQoSTricolorCarYellowActionValue = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 63), ValueRangeConstraint(255, 255), ))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSTricolorCarYellowActionValue.setStatus('current')
h3cIfQoSTricolorCarRedActionType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 1, 1, 12), CarAction().clone('discard')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSTricolorCarRedActionType.setStatus('current')
h3cIfQoSTricolorCarRedActionValue = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 63), ValueRangeConstraint(255, 255), ))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSTricolorCarRedActionValue.setStatus('current')
h3cIfQoSTricolorCarRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 1, 1, 14), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSTricolorCarRowStatus.setStatus('current')
h3cIfQoSTricolorCarRunInfoTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 2), )
if mibBuilder.loadTexts: h3cIfQoSTricolorCarRunInfoTable.setStatus('current')
h3cIfQoSTricolorCarRunInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSTricolorCarDirection"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSTricolorCarType"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSTricolorCarValue"))
if mibBuilder.loadTexts: h3cIfQoSTricolorCarRunInfoEntry.setStatus('current')
h3cIfQoSTricolorCarGreenPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 2, 1, 1), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSTricolorCarGreenPackets.setStatus('current')
h3cIfQoSTricolorCarGreenBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 2, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSTricolorCarGreenBytes.setStatus('current')
h3cIfQoSTricolorCarYellowPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 2, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSTricolorCarYellowPackets.setStatus('current')
h3cIfQoSTricolorCarYellowBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 2, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSTricolorCarYellowBytes.setStatus('current')
h3cIfQoSTricolorCarRedPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 2, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSTricolorCarRedPackets.setStatus('current')
h3cIfQoSTricolorCarRedBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 4, 2, 2, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSTricolorCarRedBytes.setStatus('current')
h3cIfQoSGTSObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 5))
h3cIfQoSGTSConfigTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 5, 1), )
if mibBuilder.loadTexts: h3cIfQoSGTSConfigTable.setStatus('current')
h3cIfQoSGTSConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 5, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSGTSClassRuleType"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSGTSClassRuleValue"))
if mibBuilder.loadTexts: h3cIfQoSGTSConfigEntry.setStatus('current')
h3cIfQoSGTSClassRuleType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 5, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("any", 1), ("ipv4acl", 2), ("ipv6acl", 3), ("queue", 4))))
if mibBuilder.loadTexts: h3cIfQoSGTSClassRuleType.setStatus('current')
h3cIfQoSGTSClassRuleValue = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 5, 1, 1, 2), Integer32())
if mibBuilder.loadTexts: h3cIfQoSGTSClassRuleValue.setStatus('current')
h3cIfQoSGTSCir = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 5, 1, 1, 3), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSGTSCir.setStatus('current')
h3cIfQoSGTSCbs = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 5, 1, 1, 4), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSGTSCbs.setStatus('current')
h3cIfQoSGTSEbs = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 5, 1, 1, 5), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSGTSEbs.setStatus('current')
h3cIfQoSGTSQueueLength = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 5, 1, 1, 6), Integer32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSGTSQueueLength.setStatus('current')
h3cIfQoSGTSConfigRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 5, 1, 1, 7), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSGTSConfigRowStatus.setStatus('current')
h3cIfQoSGTSRunInfoTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 5, 2), )
if mibBuilder.loadTexts: h3cIfQoSGTSRunInfoTable.setStatus('current')
h3cIfQoSGTSRunInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 5, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSGTSClassRuleType"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSGTSClassRuleValue"))
if mibBuilder.loadTexts: h3cIfQoSGTSRunInfoEntry.setStatus('current')
h3cIfQoSGTSQueueSize = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 5, 2, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSGTSQueueSize.setStatus('current')
h3cIfQoSGTSPassedPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 5, 2, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSGTSPassedPackets.setStatus('current')
h3cIfQoSGTSPassedBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 5, 2, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSGTSPassedBytes.setStatus('current')
h3cIfQoSGTSDiscardPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 5, 2, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSGTSDiscardPackets.setStatus('current')
h3cIfQoSGTSDiscardBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 5, 2, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSGTSDiscardBytes.setStatus('current')
h3cIfQoSGTSDelayedPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 5, 2, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSGTSDelayedPackets.setStatus('current')
h3cIfQoSGTSDelayedBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 5, 2, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSGTSDelayedBytes.setStatus('current')
h3cIfQoSWREDObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6))
h3cIfQoSWredGroupGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1))
h3cIfQoSWredGroupNextIndex = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredGroupNextIndex.setStatus('current')
h3cIfQoSWredGroupTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 2), )
if mibBuilder.loadTexts: h3cIfQoSWredGroupTable.setStatus('current')
h3cIfQoSWredGroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 2, 1), ).setIndexNames((0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSWredGroupIndex"))
if mibBuilder.loadTexts: h3cIfQoSWredGroupEntry.setStatus('current')
h3cIfQoSWredGroupIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 2, 1, 1), Integer32())
if mibBuilder.loadTexts: h3cIfQoSWredGroupIndex.setStatus('current')
h3cIfQoSWredGroupName = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 2, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSWredGroupName.setStatus('current')
h3cIfQoSWredGroupType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("userdefined", 0), ("dot1p", 1), ("ippre", 2), ("dscp", 3), ("localpre", 4), ("atmclp", 5), ("frde", 6), ("exp", 7), ("queue", 8), ("dropLevel", 9)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSWredGroupType.setStatus('current')
h3cIfQoSWredGroupWeightingConstant = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 15)).clone(9)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSWredGroupWeightingConstant.setStatus('current')
h3cIfQoSWredGroupRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 2, 1, 6), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSWredGroupRowStatus.setStatus('current')
h3cIfQoSWredGroupContentTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 3), )
if mibBuilder.loadTexts: h3cIfQoSWredGroupContentTable.setStatus('current')
h3cIfQoSWredGroupContentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 3, 1), ).setIndexNames((0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSWredGroupIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSWredGroupContentIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSWredGroupContentSubIndex"))
if mibBuilder.loadTexts: h3cIfQoSWredGroupContentEntry.setStatus('current')
h3cIfQoSWredGroupContentIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 63)))
if mibBuilder.loadTexts: h3cIfQoSWredGroupContentIndex.setStatus('current')
h3cIfQoSWredGroupContentSubIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 63)))
if mibBuilder.loadTexts: h3cIfQoSWredGroupContentSubIndex.setStatus('current')
h3cIfQoSWredLowLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 3, 1, 3), Integer32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSWredLowLimit.setStatus('current')
h3cIfQoSWredHighLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 3, 1, 4), Integer32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSWredHighLimit.setStatus('current')
h3cIfQoSWredDiscardProb = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 3, 1, 5), Integer32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSWredDiscardProb.setStatus('current')
h3cIfQoSWredGroupExponent = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 3, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 15)).clone(9)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSWredGroupExponent.setStatus('current')
h3cIfQoSWredRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 3, 1, 7), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSWredRowStatus.setStatus('current')
h3cIfQoSWredGroupApplyIfTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 4), )
if mibBuilder.loadTexts: h3cIfQoSWredGroupApplyIfTable.setStatus('current')
h3cIfQoSWredGroupApplyIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 4, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: h3cIfQoSWredGroupApplyIfEntry.setStatus('current')
h3cIfQoSWredGroupApplyIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 256))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSWredGroupApplyIndex.setStatus('current')
h3cIfQoSWredGroupApplyName = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 4, 1, 2), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredGroupApplyName.setStatus('current')
h3cIfQoSWredGroupIfRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 4, 1, 3), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSWredGroupIfRowStatus.setStatus('current')
h3cIfQoSWredApplyIfRunInfoTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 5), )
if mibBuilder.loadTexts: h3cIfQoSWredApplyIfRunInfoTable.setStatus('current')
h3cIfQoSWredApplyIfRunInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 5, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSWredGroupIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSWredGroupContentIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSWredGroupContentSubIndex"))
if mibBuilder.loadTexts: h3cIfQoSWredApplyIfRunInfoEntry.setStatus('current')
h3cIfQoSWredPreRandomDropNum = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 5, 1, 1), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredPreRandomDropNum.setStatus('current')
h3cIfQoSWredPreTailDropNum = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 1, 5, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWredPreTailDropNum.setStatus('current')
h3cIfQoSPortWredGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 2))
h3cIfQoSPortWredWeightConstantTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 2, 1), )
if mibBuilder.loadTexts: h3cIfQoSPortWredWeightConstantTable.setStatus('current')
h3cIfQoSPortWredWeightConstantEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 2, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: h3cIfQoSPortWredWeightConstantEntry.setStatus('current')
h3cIfQoSPortWredEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 2, 1, 1, 1), TruthValue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSPortWredEnable.setStatus('current')
h3cIfQoSPortWredWeightConstant = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSPortWredWeightConstant.setStatus('current')
h3cIfQoSPortWredWeightConstantRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 2, 1, 1, 3), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSPortWredWeightConstantRowStatus.setStatus('current')
h3cIfQoSPortWredPreConfigTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 2, 2), )
if mibBuilder.loadTexts: h3cIfQoSPortWredPreConfigTable.setStatus('current')
h3cIfQoSPortWredPreConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 2, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSPortWredPreID"))
if mibBuilder.loadTexts: h3cIfQoSPortWredPreConfigEntry.setStatus('current')
h3cIfQoSPortWredPreID = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 2, 2, 1, 1), Integer32())
if mibBuilder.loadTexts: h3cIfQoSPortWredPreID.setStatus('current')
h3cIfQoSPortWredPreLowLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 2, 2, 1, 2), Integer32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSPortWredPreLowLimit.setStatus('current')
h3cIfQoSPortWredPreHighLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 2, 2, 1, 3), Integer32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSPortWredPreHighLimit.setStatus('current')
h3cIfQoSPortWredPreDiscardProbability = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 2, 2, 1, 4), Integer32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSPortWredPreDiscardProbability.setStatus('current')
h3cIfQoSPortWredPreRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 2, 2, 1, 5), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSPortWredPreRowStatus.setStatus('current')
h3cIfQoSPortWredRunInfoTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 2, 3), )
if mibBuilder.loadTexts: h3cIfQoSPortWredRunInfoTable.setStatus('current')
h3cIfQoSPortWredRunInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 2, 3, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSPortWredPreID"))
if mibBuilder.loadTexts: h3cIfQoSPortWredRunInfoEntry.setStatus('current')
h3cIfQoSWREDTailDropNum = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 2, 3, 1, 1), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWREDTailDropNum.setStatus('current')
h3cIfQoSWREDRandomDropNum = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 6, 2, 3, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSWREDRandomDropNum.setStatus('current')
h3cIfQoSPortPriorityObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 7))
h3cIfQoSPortPriorityConfigGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 7, 1))
h3cIfQoSPortPriorityTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 7, 1, 1), )
if mibBuilder.loadTexts: h3cIfQoSPortPriorityTable.setStatus('current')
h3cIfQoSPortPriorityEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 7, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: h3cIfQoSPortPriorityEntry.setStatus('current')
h3cIfQoSPortPriorityValue = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 7, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: h3cIfQoSPortPriorityValue.setStatus('current')
h3cIfQoSPortPirorityTrustTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 7, 1, 2), )
if mibBuilder.loadTexts: h3cIfQoSPortPirorityTrustTable.setStatus('current')
h3cIfQoSPortPirorityTrustEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 7, 1, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: h3cIfQoSPortPirorityTrustEntry.setStatus('current')
h3cIfQoSPortPriorityTrustTrustType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 7, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("untrust", 1), ("dot1p", 2), ("dscp", 3), ("exp", 4))).clone('untrust')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: h3cIfQoSPortPriorityTrustTrustType.setStatus('current')
h3cIfQoSPortPriorityTrustOvercastType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 7, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("noOvercast", 1), ("overcastDSCP", 2), ("overcastCOS", 3))).clone('noOvercast')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: h3cIfQoSPortPriorityTrustOvercastType.setStatus('current')
h3cIfQoSMapObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 9))
h3cIfQoSPriMapConfigGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 9, 1))
h3cIfQoSPriMapGroupNextIndex = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 9, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cIfQoSPriMapGroupNextIndex.setStatus('current')
h3cIfQoSPriMapGroupTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 9, 1, 2), )
if mibBuilder.loadTexts: h3cIfQoSPriMapGroupTable.setStatus('current')
h3cIfQoSPriMapGroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 9, 1, 2, 1), ).setIndexNames((0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSPriMapGroupIndex"))
if mibBuilder.loadTexts: h3cIfQoSPriMapGroupEntry.setStatus('current')
h3cIfQoSPriMapGroupIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 9, 1, 2, 1, 1), Integer32())
if mibBuilder.loadTexts: h3cIfQoSPriMapGroupIndex.setStatus('current')
h3cIfQoSPriMapGroupType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 9, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=NamedValues(("userdefined", 1), ("dot1p-dp", 2), ("dot1p-dscp", 3), ("dot1p-lp", 4), ("dscp-dot1p", 5), ("dscp-dp", 6), ("dscp-dscp", 7), ("dscp-lp", 8), ("exp-dp", 9), ("exp-lp", 10)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSPriMapGroupType.setStatus('current')
h3cIfQoSPriMapGroupName = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 9, 1, 2, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSPriMapGroupName.setStatus('current')
h3cIfQoSPriMapGroupRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 9, 1, 2, 1, 4), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSPriMapGroupRowStatus.setStatus('current')
h3cIfQoSPriMapContentTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 9, 1, 3), )
if mibBuilder.loadTexts: h3cIfQoSPriMapContentTable.setStatus('current')
h3cIfQoSPriMapContentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 9, 1, 3, 1), ).setIndexNames((0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSPriMapGroupIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cIfQoSPriMapGroupImportValue"))
if mibBuilder.loadTexts: h3cIfQoSPriMapContentEntry.setStatus('current')
h3cIfQoSPriMapGroupImportValue = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 9, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 63)))
if mibBuilder.loadTexts: h3cIfQoSPriMapGroupImportValue.setStatus('current')
h3cIfQoSPriMapGroupExportValue = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 9, 1, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 63))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSPriMapGroupExportValue.setStatus('current')
h3cIfQoSPriMapContentRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 9, 1, 3, 1, 3), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSPriMapContentRowStatus.setStatus('current')
h3cIfQoSL3PlusObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 10))
h3cIfQoSPortBindingGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 10, 1))
h3cIfQoSPortBindingTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 10, 1, 1), )
if mibBuilder.loadTexts: h3cIfQoSPortBindingTable.setStatus('current')
h3cIfQoSPortBindingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 10, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: h3cIfQoSPortBindingEntry.setStatus('current')
h3cIfQoSBindingIf = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 10, 1, 1, 1, 1), Integer32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSBindingIf.setStatus('current')
h3cIfQoSBindingRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 10, 1, 1, 1, 2), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cIfQoSBindingRowStatus.setStatus('current')
h3cQoSTraStaObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11))
h3cQoSTraStaConfigGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 1))
h3cQoSIfTraStaConfigInfoTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 1, 1), )
if mibBuilder.loadTexts: h3cQoSIfTraStaConfigInfoTable.setStatus('current')
h3cQoSIfTraStaConfigInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cQoSIfTraStaConfigDirection"))
if mibBuilder.loadTexts: h3cQoSIfTraStaConfigInfoEntry.setStatus('current')
h3cQoSIfTraStaConfigDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 1, 1, 1, 1), Direction())
if mibBuilder.loadTexts: h3cQoSIfTraStaConfigDirection.setStatus('current')
h3cQoSIfTraStaConfigQueue = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 1, 1, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 1)).setFixedLength(1)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cQoSIfTraStaConfigQueue.setStatus('current')
h3cQoSIfTraStaConfigDot1p = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 1, 1, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 1)).setFixedLength(1)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cQoSIfTraStaConfigDot1p.setStatus('current')
h3cQoSIfTraStaConfigDscp = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 1, 1, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cQoSIfTraStaConfigDscp.setStatus('current')
h3cQoSIfTraStaConfigVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 1, 1, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(512, 512)).setFixedLength(512)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cQoSIfTraStaConfigVlan.setStatus('current')
h3cQoSIfTraStaConfigStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 1, 1, 1, 6), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: h3cQoSIfTraStaConfigStatus.setStatus('current')
h3cQoSTraStaRunGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 2))
h3cQoSIfTraStaRunInfoTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 2, 1), )
if mibBuilder.loadTexts: h3cQoSIfTraStaRunInfoTable.setStatus('current')
h3cQoSIfTraStaRunInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 2, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cQoSIfTraStaRunObjectType"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cQoSIfTraStaRunObjectValue"), (0, "A3COM-HUAWEI-IFQOS2-MIB", "h3cQoSIfTraStaRunDirection"))
if mibBuilder.loadTexts: h3cQoSIfTraStaRunInfoEntry.setStatus('current')
h3cQoSIfTraStaRunObjectType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("queue", 1), ("dot1p", 2), ("dscp", 3), ("vlanID", 4))))
if mibBuilder.loadTexts: h3cQoSIfTraStaRunObjectType.setStatus('current')
h3cQoSIfTraStaRunObjectValue = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 2, 1, 1, 2), Integer32())
if mibBuilder.loadTexts: h3cQoSIfTraStaRunObjectValue.setStatus('current')
h3cQoSIfTraStaRunDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 2, 1, 1, 3), Direction())
if mibBuilder.loadTexts: h3cQoSIfTraStaRunDirection.setStatus('current')
h3cQoSIfTraStaRunPassPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 2, 1, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cQoSIfTraStaRunPassPackets.setStatus('current')
h3cQoSIfTraStaRunDropPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 2, 1, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cQoSIfTraStaRunDropPackets.setStatus('current')
h3cQoSIfTraStaRunPassBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 2, 1, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cQoSIfTraStaRunPassBytes.setStatus('current')
h3cQoSIfTraStaRunDropBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 2, 1, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cQoSIfTraStaRunDropBytes.setStatus('current')
h3cQoSIfTraStaRunPassPPS = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 2, 1, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cQoSIfTraStaRunPassPPS.setStatus('current')
h3cQoSIfTraStaRunPassBPS = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 10, 2, 65, 1, 11, 2, 1, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: h3cQoSIfTraStaRunPassBPS.setStatus('current')
mibBuilder.exportSymbols("A3COM-HUAWEI-IFQOS2-MIB", h3cIfQoSCarlParaType=h3cIfQoSCarlParaType, h3cIfQoSTailDropBytes=h3cIfQoSTailDropBytes, h3cIfQoSGTSDiscardPackets=h3cIfQoSGTSDiscardPackets, h3cIfQoSAggregativeCarRunInfoTable=h3cIfQoSAggregativeCarRunInfoTable, h3cIfQoSGTSClassRuleValue=h3cIfQoSGTSClassRuleValue, h3cIfQoSCQClassRuleEntry=h3cIfQoSCQClassRuleEntry, h3cIfQoSAggregativeCarName=h3cIfQoSAggregativeCarName, h3cIfQoSPortWredPreID=h3cIfQoSPortWredPreID, h3cIfQoSWredGroupExponent=h3cIfQoSWredGroupExponent, h3cIfQoSRTPQRunInfoGroup=h3cIfQoSRTPQRunInfoGroup, h3cIfQoSPriMapGroupRowStatus=h3cIfQoSPriMapGroupRowStatus, h3cIfQoSPQApplyListNumber=h3cIfQoSPQApplyListNumber, h3cIfQoSTricolorCarCir=h3cIfQoSTricolorCarCir, h3cIfQoSPQRunInfoTable=h3cIfQoSPQRunInfoTable, h3cIfQoSPriMapGroupTable=h3cIfQoSPriMapGroupTable, h3cIfQoSQSMaxDelay=h3cIfQoSQSMaxDelay, h3cIfQoSAggregativeCarGreenBytes=h3cIfQoSAggregativeCarGreenBytes, h3cIfQoSPortPriorityValue=h3cIfQoSPortPriorityValue, h3cIfQoSRTPQEndPort=h3cIfQoSRTPQEndPort, h3cQoSTraStaRunGroup=h3cQoSTraStaRunGroup, h3cIfQoSPriMapContentTable=h3cIfQoSPriMapContentTable, h3cIfQoSPQClassRuleQueueType=h3cIfQoSPQClassRuleQueueType, h3cIfQoSWredGroupIndex=h3cIfQoSWredGroupIndex, h3cIfQoSPQQueueLengthType=h3cIfQoSPQQueueLengthType, h3cIfQoSQueueLengthInBytes=h3cIfQoSQueueLengthInBytes, h3cIfQoSCQClassRowStatus=h3cIfQoSCQClassRowStatus, h3cIfQoSAggregativeCarApplyDirection=h3cIfQoSAggregativeCarApplyDirection, h3cIfQoSPQClassRuleType=h3cIfQoSPQClassRuleType, h3cIfQoSPriMapGroupExportValue=h3cIfQoSPriMapGroupExportValue, h3cIfQoSWredDropHPreNTcpBPS=h3cIfQoSWredDropHPreNTcpBPS, h3cIfQoSAggregativeCarYellowPackets=h3cIfQoSAggregativeCarYellowPackets, h3cIfQoSWredDiscardProb=h3cIfQoSWredDiscardProb, h3cIfQoSCQApplyRowStatus=h3cIfQoSCQApplyRowStatus, h3cIfQoSWredGroupApplyIfEntry=h3cIfQoSWredGroupApplyIfEntry, h3cIfQoSLREbs=h3cIfQoSLREbs, h3cIfQoSPQDefaultQueueType=h3cIfQoSPQDefaultQueueType, h3cIfQoSPortPriorityEntry=h3cIfQoSPortPriorityEntry, h3cIfQoSQSModeTable=h3cIfQoSQSModeTable, h3cIfQoSLRRunInfoTable=h3cIfQoSLRRunInfoTable, h3cIfQoSReservedBandwidthPct=h3cIfQoSReservedBandwidthPct, h3cIfQoSWredGroupTable=h3cIfQoSWredGroupTable, h3cIfQoSLRRunInfoDelayedPackets=h3cIfQoSLRRunInfoDelayedPackets, h3cIfQoSAggregativeCarConfigTable=h3cIfQoSAggregativeCarConfigTable, h3cIfQoSCurQueueBytes=h3cIfQoSCurQueueBytes, h3cIfQoSCQQueueLengthTable=h3cIfQoSCQQueueLengthTable, h3cIfQoSWredGroupRowStatus=h3cIfQoSWredGroupRowStatus, h3cIfQoSPQRunInfoGroup=h3cIfQoSPQRunInfoGroup, h3cIfQoSRTPQOutputPackets=h3cIfQoSRTPQOutputPackets, h3cIfQoSFIFOConfigEntry=h3cIfQoSFIFOConfigEntry, h3cQoSIfTraStaRunObjectType=h3cQoSIfTraStaRunObjectType, h3cIfQoSWredGroupApplyName=h3cIfQoSWredGroupApplyName, h3cIfQoSQSMinBandwidth=h3cIfQoSQSMinBandwidth, h3cIfQoSPortPriorityTrustTrustType=h3cIfQoSPortPriorityTrustTrustType, h3cIfQoSPQConfigGroup=h3cIfQoSPQConfigGroup, h3cIfQoSPortPriorityTrustOvercastType=h3cIfQoSPortPriorityTrustOvercastType, h3cIfQoSTricolorCarRowStatus=h3cIfQoSTricolorCarRowStatus, h3cIfQoSWFQRunInfoTable=h3cIfQoSWFQRunInfoTable, h3cIfQoSLRPir=h3cIfQoSLRPir, h3cIfQoSWredPreTailDropNum=h3cIfQoSWredPreTailDropNum, h3cIfQoSPortWredEnable=h3cIfQoSPortWredEnable, h3cIfQoSBindingIf=h3cIfQoSBindingIf, h3cIfQoSWredDropLPreTcpBytes=h3cIfQoSWredDropLPreTcpBytes, h3cIfQoSAggregativeCarIndex=h3cIfQoSAggregativeCarIndex, h3cQoSIfTraStaRunDropPackets=h3cQoSIfTraStaRunDropPackets, h3cIfQoSCQObject=h3cIfQoSCQObject, h3cIfQoSAggregativeCarRedBytes=h3cIfQoSAggregativeCarRedBytes, h3cIfQoSAggregativeCarNextIndex=h3cIfQoSAggregativeCarNextIndex, h3cIfQoSWredGroupContentIndex=h3cIfQoSWredGroupContentIndex, h3cIfQoSPQRunInfoEntry=h3cIfQoSPQRunInfoEntry, h3cIfQoSPQDefaultTable=h3cIfQoSPQDefaultTable, h3cIfQoSPortWredWeightConstantRowStatus=h3cIfQoSPortWredWeightConstantRowStatus, h3cQoSIfTraStaRunPassBPS=h3cQoSIfTraStaRunPassBPS, h3cIfQoSFIFOObject=h3cIfQoSFIFOObject, h3cIfQoSWredApplyIfRunInfoTable=h3cIfQoSWredApplyIfRunInfoTable, h3cIfQoSCQRunInfoEntry=h3cIfQoSCQRunInfoEntry, h3cIfQoSAggregativeCarRedPackets=h3cIfQoSAggregativeCarRedPackets, h3cIfQoSWredDropHPreNTcpBytes=h3cIfQoSWredDropHPreNTcpBytes, h3cIfQoSGTSRunInfoEntry=h3cIfQoSGTSRunInfoEntry, h3cIfQoSWFQType=h3cIfQoSWFQType, h3cIfQoSTricolorCarGreenActionType=h3cIfQoSTricolorCarGreenActionType, h3cIfQoSWredGroupContentTable=h3cIfQoSWredGroupContentTable, h3cIfQoSBindingRowStatus=h3cIfQoSBindingRowStatus, h3cIfQoSTricolorCarConfigEntry=h3cIfQoSTricolorCarConfigEntry, h3cIfQoSFIFOMaxQueueLen=h3cIfQoSFIFOMaxQueueLen, h3cIfQoSHQueueTcpRunInfoEntry=h3cIfQoSHQueueTcpRunInfoEntry, h3cIfQoSAggregativeCarRunInfoEntry=h3cIfQoSAggregativeCarRunInfoEntry, h3cIfQoSPQApplyRowStatus=h3cIfQoSPQApplyRowStatus, h3cIfQoSRTPQRowStatus=h3cIfQoSRTPQRowStatus, h3cIfQoSAggregativeCarYellowActionType=h3cIfQoSAggregativeCarYellowActionType, h3cIfQoSCQDefaultQueueID=h3cIfQoSCQDefaultQueueID, h3cIfQoSRTPQPacketSize=h3cIfQoSRTPQPacketSize, h3cIfQoSWredGroupContentEntry=h3cIfQoSWredGroupContentEntry, h3cIfQoSPQClassRuleValue=h3cIfQoSPQClassRuleValue, h3cIfQoSPQDefaultEntry=h3cIfQoSPQDefaultEntry, h3cIfQoSWFQObject=h3cIfQoSWFQObject, h3cIfQoSPortWredRunInfoTable=h3cIfQoSPortWredRunInfoTable, h3cIfQoSMapObjects=h3cIfQoSMapObjects, h3cIfQoSQmtokenGroup=h3cIfQoSQmtokenGroup, h3cIfQoSAggregativeCarGreenPackets=h3cIfQoSAggregativeCarGreenPackets, h3cIfQoSCQDefaultTable=h3cIfQoSCQDefaultTable, h3cIfQoSGTSDelayedBytes=h3cIfQoSGTSDelayedBytes, h3cIfQoSPriMapGroupEntry=h3cIfQoSPriMapGroupEntry, h3cIfQoSCQDefaultEntry=h3cIfQoSCQDefaultEntry, h3cIfQoSTricolorCarEbs=h3cIfQoSTricolorCarEbs, h3cIfQoSQSType=h3cIfQoSQSType, h3cIfQoSCurQueueBPS=h3cIfQoSCurQueueBPS, h3cIfQoSPQClassRuleTable=h3cIfQoSPQClassRuleTable, h3cIfQoSLRCbs=h3cIfQoSLRCbs, h3cIfQoSQueueLengthInPkts=h3cIfQoSQueueLengthInPkts, h3cIfQoSQueueGroupType=h3cIfQoSQueueGroupType, h3cIfQoSLRRunInfoDelayedBytes=h3cIfQoSLRRunInfoDelayedBytes, h3cIfQoSWredDropBytes=h3cIfQoSWredDropBytes, h3cIfQoSRTPQRunInfoTable=h3cIfQoSRTPQRunInfoTable, h3cIfQoSWredGroupApplyIndex=h3cIfQoSWredGroupApplyIndex, h3cIfQoSCarlParaValue=h3cIfQoSCarlParaValue, h3cIfQoSAggregativeCarRedActionValue=h3cIfQoSAggregativeCarRedActionValue, h3cIfQoSPortWredGroup=h3cIfQoSPortWredGroup, h3cIfQoSPortWredWeightConstantEntry=h3cIfQoSPortWredWeightConstantEntry, h3cIfQoSWredGroupWeightingConstant=h3cIfQoSWredGroupWeightingConstant, h3cIfQoSPQType=h3cIfQoSPQType, h3cIfQoSDropBytes=h3cIfQoSDropBytes, h3cIfQoSBandwidthTable=h3cIfQoSBandwidthTable, h3cIfQoSWredDropPPS=h3cIfQoSWredDropPPS, h3cIfQoSRTPQConfigTable=h3cIfQoSRTPQConfigTable, h3cIfQoSAggregativeCarApplyRowStatus=h3cIfQoSAggregativeCarApplyRowStatus, h3cIfQoSWredDropLPreNTcpPkts=h3cIfQoSWredDropLPreNTcpPkts, h3cIfQoSHardwareQueueObjects=h3cIfQoSHardwareQueueObjects, h3cIfQoSWFQLength=h3cIfQoSWFQLength, h3cQoSIfTraStaRunObjectValue=h3cQoSIfTraStaRunObjectValue, h3cQoSTraStaObjects=h3cQoSTraStaObjects, h3cIfQoSWredGroupApplyIfTable=h3cIfQoSWredGroupApplyIfTable, h3cIfQoSWREDTailDropNum=h3cIfQoSWREDTailDropNum, h3cIfQoSLRConfigEntry=h3cIfQoSLRConfigEntry, h3cIfQoSQSModeEntry=h3cIfQoSQSModeEntry, h3cIfQoSAggregativeCarGroup=h3cIfQoSAggregativeCarGroup, h3cIfQoSQSWeightTable=h3cIfQoSQSWeightTable, h3cIfQoSCQClassRuleValue=h3cIfQoSCQClassRuleValue, h3cIfQoSCQQueueLength=h3cIfQoSCQQueueLength, h3cIfQoSFIFODiscardPackets=h3cIfQoSFIFODiscardPackets, h3cIfQoSTricolorCarPir=h3cIfQoSTricolorCarPir, h3cIfQoSTricolorCarGroup=h3cIfQoSTricolorCarGroup, h3cIfQoSWredGroupIfRowStatus=h3cIfQoSWredGroupIfRowStatus, h3cIfQoSAggregativeCarRedActionType=h3cIfQoSAggregativeCarRedActionType, h3cIfQoCarListGroup=h3cIfQoCarListGroup, h3cIfQoSBandwidthEntry=h3cIfQoSBandwidthEntry, h3cIfQoSLRConfigTable=h3cIfQoSLRConfigTable, h3cIfQoSPortBindingGroup=h3cIfQoSPortBindingGroup, h3cIfQoSTricolorCarConfigTable=h3cIfQoSTricolorCarConfigTable, h3cIfQoSWredDropHPreNTcpPPS=h3cIfQoSWredDropHPreNTcpPPS, h3cIfQoSPriMapContentEntry=h3cIfQoSPriMapContentEntry, h3cIfQoSLRRunInfoActiveShaping=h3cIfQoSLRRunInfoActiveShaping, h3cIfQoSCQClassRuleType=h3cIfQoSCQClassRuleType, h3cIfQoSRTPQStartPort=h3cIfQoSRTPQStartPort, h3cIfQoSQSMode=h3cIfQoSQSMode, h3cIfQoSPQQueueLengthValue=h3cIfQoSPQQueueLengthValue, h3cIfQoSPQClassRowStatus=h3cIfQoSPQClassRowStatus, h3cIfQoSGTSQueueLength=h3cIfQoSGTSQueueLength, h3cQos2=h3cQos2, h3cIfQoSWredDropBPS=h3cIfQoSWredDropBPS, h3cIfQoSCQClassRuleTable=h3cIfQoSCQClassRuleTable, h3cIfQoSQmtokenTable=h3cIfQoSQmtokenTable, h3cIfQoSWredHighLimit=h3cIfQoSWredHighLimit, h3cIfQoSHardwareQueueRunInfoTable=h3cIfQoSHardwareQueueRunInfoTable, h3cIfQoSAggregativeCarPir=h3cIfQoSAggregativeCarPir, h3cIfQoSPQQueueLengthEntry=h3cIfQoSPQQueueLengthEntry, h3cIfQoSAggregativeCarCir=h3cIfQoSAggregativeCarCir, h3cIfQoSBandwidthRowStatus=h3cIfQoSBandwidthRowStatus, h3cIfQoSPortWredPreLowLimit=h3cIfQoSPortWredPreLowLimit, h3cIfQoSPortWredPreRowStatus=h3cIfQoSPortWredPreRowStatus, h3cIfQoSCarlRowStatus=h3cIfQoSCarlRowStatus, h3cIfQoSCQRunInfoDiscardPackets=h3cIfQoSCQRunInfoDiscardPackets, h3cIfQoSLRRunInfoPassedPackets=h3cIfQoSLRRunInfoPassedPackets, h3cIfQoSTailDropPPS=h3cIfQoSTailDropPPS, h3cIfQoSWredDropHPreTcpPPS=h3cIfQoSWredDropHPreTcpPPS, h3cIfQoSCQConfigGroup=h3cIfQoSCQConfigGroup, h3cIfQoSRTPQCbs=h3cIfQoSRTPQCbs, h3cIfQoSHQueueTcpRunInfoTable=h3cIfQoSHQueueTcpRunInfoTable, h3cIfQoSWFQHashedActiveQueues=h3cIfQoSWFQHashedActiveQueues, h3cIfQoSWFQDiscardPackets=h3cIfQoSWFQDiscardPackets, h3cIfQoSAggregativeCarApplyEntry=h3cIfQoSAggregativeCarApplyEntry, h3cIfQoSLRCir=h3cIfQoSLRCir, h3cIfQoSPortPriorityObjects=h3cIfQoSPortPriorityObjects, h3cIfQoSWredDropLPreTcpPkts=h3cIfQoSWredDropLPreTcpPkts, h3cIfQoSPortPirorityTrustEntry=h3cIfQoSPortPirorityTrustEntry, h3cQoSIfTraStaRunPassPackets=h3cQoSIfTraStaRunPassPackets, h3cQoSIfTraStaConfigDirection=h3cQoSIfTraStaConfigDirection, h3cIfQoSWFQRunInfoGroup=h3cIfQoSWFQRunInfoGroup, h3cQoSIfTraStaConfigVlan=h3cQoSIfTraStaConfigVlan, h3cIfQoSWredGroupNextIndex=h3cIfQoSWredGroupNextIndex, h3cIfQoSGTSPassedBytes=h3cIfQoSGTSPassedBytes, h3cIfQoSWFQRunInfoEntry=h3cIfQoSWFQRunInfoEntry, h3cIfQoSAggregativeCarYellowBytes=h3cIfQoSAggregativeCarYellowBytes, h3cIfQoSCQListNumber=h3cIfQoSCQListNumber, h3cIfQoSWredApplyIfRunInfoEntry=h3cIfQoSWredApplyIfRunInfoEntry, h3cIfQoSWredDropLPreNTcpBytes=h3cIfQoSWredDropLPreNTcpBytes, h3cIfQoSAggregativeCarCbs=h3cIfQoSAggregativeCarCbs, h3cIfQoSWredPreRandomDropNum=h3cIfQoSWredPreRandomDropNum, h3cIfQoSQSWeightEntry=h3cIfQoSQSWeightEntry, h3cIfQoSPQClassRuleEntry=h3cIfQoSPQClassRuleEntry, h3cIfQoSWredDropHPreNTcpPkts=h3cIfQoSWredDropHPreNTcpPkts, h3cQoSIfTraStaRunDirection=h3cQoSIfTraStaRunDirection, h3cIfQoSCarlListNum=h3cIfQoSCarlListNum, h3cIfQoSCQQueueLengthEntry=h3cIfQoSCQQueueLengthEntry, h3cIfQoSRTPQPacketNumber=h3cIfQoSRTPQPacketNumber, h3cIfQoSWFQHashedMaxActiveQueues=h3cIfQoSWFQHashedMaxActiveQueues, h3cIfQoSHardwareQueueConfigGroup=h3cIfQoSHardwareQueueConfigGroup, h3cIfQoSRTPQDiscardPackets=h3cIfQoSRTPQDiscardPackets, h3cIfQoSGTSRunInfoTable=h3cIfQoSGTSRunInfoTable, h3cIfQoSWFQQueueNumber=h3cIfQoSWFQQueueNumber, h3cIfQoSSoftwareQueueObjects=h3cIfQoSSoftwareQueueObjects, h3cIfQoSQmtokenRosStatus=h3cIfQoSQmtokenRosStatus, h3cQoSIfTraStaRunInfoTable=h3cQoSIfTraStaRunInfoTable, h3cIfQoSMaxBandwidth=h3cIfQoSMaxBandwidth, h3cIfQoSAggregativeCarApplyRuleType=h3cIfQoSAggregativeCarApplyRuleType, h3cIfQoSQueueID=h3cIfQoSQueueID, h3cIfQoSPQSize=h3cIfQoSPQSize, h3cQoSIfTraStaRunPassBytes=h3cQoSIfTraStaRunPassBytes, h3cIfQoSTricolorCarRedPackets=h3cIfQoSTricolorCarRedPackets, h3cIfQoSTailDropBPS=h3cIfQoSTailDropBPS, h3cIfQoSPassBPS=h3cIfQoSPassBPS, h3cIfQoSAggregativeCarApplyRuleValue=h3cIfQoSAggregativeCarApplyRuleValue, CarAction=CarAction, h3cIfQoSPortWredWeightConstantTable=h3cIfQoSPortWredWeightConstantTable, h3cIfQoSWredDropLPreTcpBPS=h3cIfQoSWredDropLPreTcpBPS, h3cIfQoSTricolorCarRedBytes=h3cIfQoSTricolorCarRedBytes, h3cIfQoSCQApplyEntry=h3cIfQoSCQApplyEntry, h3cIfQoSAggregativeCarEbs=h3cIfQoSAggregativeCarEbs, h3cIfQoSAggregativeCarConfigEntry=h3cIfQoSAggregativeCarConfigEntry, h3cIfQoSTricolorCarYellowActionType=h3cIfQoSTricolorCarYellowActionType, PriorityQueue=PriorityQueue, h3cIfQoSTricolorCarValue=h3cIfQoSTricolorCarValue, h3cQoSTraStaConfigGroup=h3cQoSTraStaConfigGroup, h3cIfQoSGTSConfigRowStatus=h3cIfQoSGTSConfigRowStatus, h3cIfQoSPriMapGroupNextIndex=h3cIfQoSPriMapGroupNextIndex, h3cIfQoSQmtokenNumber=h3cIfQoSQmtokenNumber, h3cIfQoSCurQueuePPS=h3cIfQoSCurQueuePPS, h3cIfQoSWREDRandomDropNum=h3cIfQoSWREDRandomDropNum, h3cIfQoSWFQTable=h3cIfQoSWFQTable, h3cIfQoSTricolorCarYellowBytes=h3cIfQoSTricolorCarYellowBytes, h3cIfQoSPortWredPreConfigTable=h3cIfQoSPortWredPreConfigTable, h3cQoSIfTraStaConfigInfoEntry=h3cQoSIfTraStaConfigInfoEntry, h3cIfQoSTricolorCarRunInfoTable=h3cIfQoSTricolorCarRunInfoTable, h3cIfQoSLRDirection=h3cIfQoSLRDirection, h3cIfQoSCQApplyListNumber=h3cIfQoSCQApplyListNumber, h3cIfQoSRTPQRunInfoEntry=h3cIfQoSRTPQRunInfoEntry, h3cIfQoSTricolorCarGreenActionValue=h3cIfQoSTricolorCarGreenActionValue, h3cIfQoSAggregativeCarGreenActionType=h3cIfQoSAggregativeCarGreenActionType, h3cIfQoSWredRowStatus=h3cIfQoSWredRowStatus, h3cIfQoSPortPriorityConfigGroup=h3cIfQoSPortPriorityConfigGroup, h3cIfQoSTricolorCarRedActionValue=h3cIfQoSTricolorCarRedActionValue, h3cIfQoSPortWredRunInfoEntry=h3cIfQoSPortWredRunInfoEntry, h3cIfQoSWFQEntry=h3cIfQoSWFQEntry, h3cIfQoSPortPriorityTable=h3cIfQoSPortPriorityTable, h3cIfQoSDropPackets=h3cIfQoSDropPackets)
mibBuilder.exportSymbols("A3COM-HUAWEI-IFQOS2-MIB", h3cIfQoSWredDropLPreNTcpPPS=h3cIfQoSWredDropLPreNTcpPPS, h3cIfQoSTricolorCarCbs=h3cIfQoSTricolorCarCbs, h3cQoSIfTraStaConfigInfoTable=h3cQoSIfTraStaConfigInfoTable, h3cIfQoSWFQConfigGroup=h3cIfQoSWFQConfigGroup, h3cQoSIfTraStaConfigQueue=h3cQoSIfTraStaConfigQueue, h3cIfQoSCarlEntry=h3cIfQoSCarlEntry, h3cIfQoSTricolorCarYellowActionValue=h3cIfQoSTricolorCarYellowActionValue, h3cIfQoSHardwareQueueRunInfoEntry=h3cIfQoSHardwareQueueRunInfoEntry, h3cIfQoSGTSPassedPackets=h3cIfQoSGTSPassedPackets, h3cIfQoSTricolorCarRedActionType=h3cIfQoSTricolorCarRedActionType, h3cIfQoSPortBindingTable=h3cIfQoSPortBindingTable, h3cIfQoSCQApplyTable=h3cIfQoSCQApplyTable, h3cIfQoSQSValue=h3cIfQoSQSValue, h3cIfQoSTricolorCarType=h3cIfQoSTricolorCarType, h3cIfQoSCQQueueServing=h3cIfQoSCQQueueServing, h3cIfQoSPriMapConfigGroup=h3cIfQoSPriMapConfigGroup, h3cIfQoSPortBindingEntry=h3cIfQoSPortBindingEntry, h3cIfQoSWredDropLPreTcpPPS=h3cIfQoSWredDropLPreTcpPPS, h3cIfQoSFIFORunInfoTable=h3cIfQoSFIFORunInfoTable, h3cIfQoSQmtokenEntry=h3cIfQoSQmtokenEntry, h3cIfQoSAggregativeCarApplyTable=h3cIfQoSAggregativeCarApplyTable, h3cIfQoSWredDropPkts=h3cIfQoSWredDropPkts, h3cIfQoSLRRunInfoPassedBytes=h3cIfQoSLRRunInfoPassedBytes, h3cIfQoSGTSQueueSize=h3cIfQoSGTSQueueSize, h3cIfQoSPQApplyTable=h3cIfQoSPQApplyTable, h3cIfQoSCarlTable=h3cIfQoSCarlTable, h3cIfQoSPQDiscardPackets=h3cIfQoSPQDiscardPackets, h3cIfQoSPQQueueLengthTable=h3cIfQoSPQQueueLengthTable, h3cIfQoSWredGroupGroup=h3cIfQoSWredGroupGroup, h3cQoSIfTraStaRunPassPPS=h3cQoSIfTraStaRunPassPPS, PYSNMP_MODULE_ID=h3cIfQos2, h3cIfQoSWredDropHPreTcpBytes=h3cIfQoSWredDropHPreTcpBytes, h3cIfQoSAggregativeCarRowStatus=h3cIfQoSAggregativeCarRowStatus, h3cIfQoSGTSCir=h3cIfQoSGTSCir, h3cIfQoSWFQSize=h3cIfQoSWFQSize, h3cIfQoSGTSObjects=h3cIfQoSGTSObjects, h3fIfQosWFQhashedTotalQueues=h3fIfQosWFQhashedTotalQueues, h3cIfQoSWFQRowStatus=h3cIfQoSWFQRowStatus, h3cIfQoSGTSEbs=h3cIfQoSGTSEbs, h3cIfQoSWredDropHPreTcpBPS=h3cIfQoSWredDropHPreTcpBPS, h3cIfQoSGTSConfigTable=h3cIfQoSGTSConfigTable, h3cIfQoSFIFORunInfoEntry=h3cIfQoSFIFORunInfoEntry, h3cIfQoSWredGroupContentSubIndex=h3cIfQoSWredGroupContentSubIndex, h3cIfQoSPortWredPreDiscardProbability=h3cIfQoSPortWredPreDiscardProbability, h3cIfQoSGTSClassRuleType=h3cIfQoSGTSClassRuleType, h3cIfQoSAggregativeCarYellowActionValue=h3cIfQoSAggregativeCarYellowActionValue, h3cIfQoSWREDObjects=h3cIfQoSWREDObjects, h3cIfQoSHardwareQueueRunInfoGroup=h3cIfQoSHardwareQueueRunInfoGroup, h3cIfQoSCQRunInfoGroup=h3cIfQoSCQRunInfoGroup, h3cIfQoSPortWredPreConfigEntry=h3cIfQoSPortWredPreConfigEntry, h3cIfQoSRowStatus=h3cIfQoSRowStatus, h3cIfQoSPassBytes=h3cIfQoSPassBytes, h3cIfQoSLineRateObjects=h3cIfQoSLineRateObjects, h3cIfQoSWredDropLPreNTcpBPS=h3cIfQoSWredDropLPreNTcpBPS, h3cIfQoSWredGroupName=h3cIfQoSWredGroupName, h3cIfQoSTricolorCarDirection=h3cIfQoSTricolorCarDirection, h3cIfQoSPriMapGroupType=h3cIfQoSPriMapGroupType, h3cIfQoSPQLength=h3cIfQoSPQLength, h3cIfQoSPriMapGroupImportValue=h3cIfQoSPriMapGroupImportValue, h3cIfQoSL3PlusObjects=h3cIfQoSL3PlusObjects, h3cIfQoSAggregativeCarApplyCarIndex=h3cIfQoSAggregativeCarApplyCarIndex, h3cIfQoSWredDropHPreTcpPkts=h3cIfQoSWredDropHPreTcpPkts, h3cIfQoSPQListNumber=h3cIfQoSPQListNumber, h3cQoSIfTraStaRunDropBytes=h3cQoSIfTraStaRunDropBytes, h3cQoSIfTraStaConfigDscp=h3cQoSIfTraStaConfigDscp, h3cIfQoSCQQueueID=h3cIfQoSCQQueueID, h3cIfQoSCQClassRuleQueueID=h3cIfQoSCQClassRuleQueueID, h3cIfQoSCQRunInfoLength=h3cIfQoSCQRunInfoLength, h3cIfQoSCQRunInfoSize=h3cIfQoSCQRunInfoSize, h3cIfQoSCARObjects=h3cIfQoSCARObjects, h3cIfQoSPortWredPreHighLimit=h3cIfQoSPortWredPreHighLimit, h3cIfQoSFIFOSize=h3cIfQoSFIFOSize, h3cIfQoSGTSConfigEntry=h3cIfQoSGTSConfigEntry, h3cIfQoSWredGroupEntry=h3cIfQoSWredGroupEntry, h3cIfQoSCurQueuePkts=h3cIfQoSCurQueuePkts, h3cIfQoSGTSDelayedPackets=h3cIfQoSGTSDelayedPackets, h3cIfQoSPassPPS=h3cIfQoSPassPPS, h3cIfQoSFIFOConfigTable=h3cIfQoSFIFOConfigTable, h3cIfQoSAggregativeCarGreenActionValue=h3cIfQoSAggregativeCarGreenActionValue, h3cIfQoSCQRunInfoTable=h3cIfQoSCQRunInfoTable, h3cIfQos2=h3cIfQos2, h3cIfQoSPriMapGroupName=h3cIfQoSPriMapGroupName, h3cIfQoSRTPQObject=h3cIfQoSRTPQObject, h3cIfQoSRTPQReservedBandwidth=h3cIfQoSRTPQReservedBandwidth, h3cIfQoSRTPQConfigGroup=h3cIfQoSRTPQConfigGroup, h3cIfQoSTricolorCarGreenPackets=h3cIfQoSTricolorCarGreenPackets, h3cIfQoSPriMapGroupIndex=h3cIfQoSPriMapGroupIndex, h3cIfQoSPQObject=h3cIfQoSPQObject, h3cIfQoSTricolorCarYellowPackets=h3cIfQoSTricolorCarYellowPackets, h3cIfQoSAggregativeCarType=h3cIfQoSAggregativeCarType, h3cQoSIfTraStaConfigDot1p=h3cQoSIfTraStaConfigDot1p, h3cIfQoSLRRunInfoEntry=h3cIfQoSLRRunInfoEntry, h3cIfQoSWFQQueueLength=h3cIfQoSWFQQueueLength, h3cIfQoSPriMapContentRowStatus=h3cIfQoSPriMapContentRowStatus, h3cIfQoSBandwidthGroup=h3cIfQoSBandwidthGroup, h3cIfQoSRTPQConfigEntry=h3cIfQoSRTPQConfigEntry, h3cQoSIfTraStaRunInfoEntry=h3cQoSIfTraStaRunInfoEntry, h3cIfQoSPassPackets=h3cIfQoSPassPackets, h3cIfQoSGTSDiscardBytes=h3cIfQoSGTSDiscardBytes, h3cQoSIfTraStaConfigStatus=h3cQoSIfTraStaConfigStatus, h3cIfQoSTailDropPkts=h3cIfQoSTailDropPkts, h3cIfQoSTricolorCarRunInfoEntry=h3cIfQoSTricolorCarRunInfoEntry, h3cIfQoSWredGroupType=h3cIfQoSWredGroupType, h3cIfQoSWredLowLimit=h3cIfQoSWredLowLimit, h3cIfQoSPortPirorityTrustTable=h3cIfQoSPortPirorityTrustTable, h3cIfQoSGTSCbs=h3cIfQoSGTSCbs, h3cIfQoSCarListObject=h3cIfQoSCarListObject, h3cIfQoSTricolorCarGreenBytes=h3cIfQoSTricolorCarGreenBytes, h3cIfQoSPQApplyEntry=h3cIfQoSPQApplyEntry, h3cIfQoSPortWredWeightConstant=h3cIfQoSPortWredWeightConstant, Direction=Direction)
| 139.191074 | 13,431 | 0.752555 | 11,763 | 99,800 | 6.384681 | 0.050072 | 0.012436 | 0.016417 | 0.01944 | 0.427826 | 0.397467 | 0.372089 | 0.369319 | 0.3204 | 0.289509 | 0 | 0.115011 | 0.094539 | 99,800 | 716 | 13,432 | 139.385475 | 0.716096 | 0.003407 | 0 | 0.004249 | 0 | 0 | 0.084715 | 0.023097 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.042493 | 0.016997 | 0 | 0.033994 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
30022d5b966a78ffbad58db514000ef1b2a328db | 953 | py | Python | helium_commander/device_configuration.py | helium/helium-commander | 58d1fe4064c51beccbff7a0d93bf037fffdac370 | [
"BSD-3-Clause"
] | 5 | 2016-06-16T06:45:18.000Z | 2022-02-18T22:19:01.000Z | helium_commander/device_configuration.py | helium/helium-commander | 58d1fe4064c51beccbff7a0d93bf037fffdac370 | [
"BSD-3-Clause"
] | 13 | 2016-09-15T21:20:34.000Z | 2017-02-24T02:21:26.000Z | helium_commander/device_configuration.py | helium/api-example | 58d1fe4064c51beccbff7a0d93bf037fffdac370 | [
"BSD-3-Clause"
] | 4 | 2016-06-24T19:47:43.000Z | 2021-04-03T10:41:33.000Z | from __future__ import unicode_literals
from helium import Device, Configuration, DeviceConfiguration
def display_map(cls, client, uuid=False, include=None):
def _trim_id(res):
return res.id if uuid or client.uuid else res.short_id
def _config(self):
return _trim_id(self.configuration(use_included=True))
def _device(self):
return _trim_id(self.device(use_included=True))
def _device_type(self):
return self.device(use_included=True)._resource_type()
def _loaded(self):
return 'yes' if self.is_loaded else 'no'
dict = super(DeviceConfiguration, cls).display_map(client, include=include)
if include and Configuration in include:
dict['config'] = _config
if include and Device in include:
dict['device'] = _device
dict['type'] = _device_type
dict['loaded'] = _loaded
return dict
DeviceConfiguration.display_map = classmethod(display_map)
| 27.228571 | 79 | 0.704092 | 123 | 953 | 5.195122 | 0.341463 | 0.062598 | 0.070423 | 0.050078 | 0.186228 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.204617 | 953 | 34 | 80 | 28.029412 | 0.843008 | 0 | 0 | 0 | 0 | 0 | 0.028332 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0 | 0.090909 | 0.227273 | 0.636364 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
3014f7440d9673a22311c1d6a047a4cdab754d98 | 527 | py | Python | src/PrettyErrorsConfig.py | Potriashka/NewsHelper | 0a3c7c191d9b41f23d7835064b225d409fe388e7 | [
"MIT"
] | null | null | null | src/PrettyErrorsConfig.py | Potriashka/NewsHelper | 0a3c7c191d9b41f23d7835064b225d409fe388e7 | [
"MIT"
] | null | null | null | src/PrettyErrorsConfig.py | Potriashka/NewsHelper | 0a3c7c191d9b41f23d7835064b225d409fe388e7 | [
"MIT"
] | null | null | null | import pretty_errors
pretty_errors.configure(
separator_character = '*',
filename_display = pretty_errors.FILENAME_EXTENDED,
line_number_first = True,
display_link = True,
lines_before = 5,
lines_after = 2,
line_color = pretty_errors.RED + '> ' + pretty_errors.default_config.line_color,
code_color = ' ' + pretty_errors.default_config.line_color,
truncate_code = True,
display_locals = True
)
pretty_errors.blacklist('c:/python') | 37.642857 | 93 | 0.648956 | 57 | 527 | 5.596491 | 0.508772 | 0.263323 | 0.106583 | 0.15674 | 0.213166 | 0.213166 | 0 | 0 | 0 | 0 | 0 | 0.005155 | 0.263757 | 527 | 14 | 94 | 37.642857 | 0.81701 | 0 | 0 | 0 | 0 | 0 | 0.026515 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.071429 | 0 | 0.071429 | 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 | 0 | 0 | 0 | 0 | 0 | 2 |
30356e919436e141d13ba5e54fc31d1c28874061 | 966 | py | Python | dynadb/migrations/0070_auto_20170107_1240.py | GPCRmd/GPCRmd | 7dc75359ace4a00c1597bdb7a86ebee17d51f09c | [
"Apache-2.0"
] | 3 | 2019-03-06T13:35:38.000Z | 2020-08-05T15:31:29.000Z | dynadb/migrations/0070_auto_20170107_1240.py | GPCRmd/GPCRmd | 7dc75359ace4a00c1597bdb7a86ebee17d51f09c | [
"Apache-2.0"
] | null | null | null | dynadb/migrations/0070_auto_20170107_1240.py | GPCRmd/GPCRmd | 7dc75359ace4a00c1597bdb7a86ebee17d51f09c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-01-07 11:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dynadb', '0069_auto_20170107_1203'),
]
operations = [
migrations.AddField(
model_name='dyndbcomplexexp',
name='ec_fifty',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='dyndbcomplexexp',
name='ic_fifty',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='dyndbcomplexexp',
name='kd',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='dyndbcomplexexp',
name='ki',
field=models.FloatField(blank=True, null=True),
),
]
| 26.833333 | 59 | 0.576605 | 94 | 966 | 5.776596 | 0.478723 | 0.132597 | 0.169429 | 0.198895 | 0.637201 | 0.637201 | 0.552486 | 0.482505 | 0.482505 | 0.482505 | 0 | 0.0462 | 0.305383 | 966 | 35 | 60 | 27.6 | 0.76304 | 0.067288 | 0 | 0.571429 | 1 | 0 | 0.121381 | 0.025612 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.071429 | 0 | 0.178571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
304ae2ffee3dad716f333c9b7c6ebd58e4c799b7 | 2,318 | py | Python | lux_dom/apps/core/models.py | mateuszdargacz/lux_dom | dcc5374a2e29d657b5efecf81761b38e84b492ac | [
"MIT"
] | null | null | null | lux_dom/apps/core/models.py | mateuszdargacz/lux_dom | dcc5374a2e29d657b5efecf81761b38e84b492ac | [
"MIT"
] | null | null | null | lux_dom/apps/core/models.py | mateuszdargacz/lux_dom | dcc5374a2e29d657b5efecf81761b38e84b492ac | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = 'mateusz'
__date__ = '13.11.14 / 08:59'
__git__ = 'https://github.com/mateuszdargacz'
from django.db import models
from django.utils.translation import gettext_lazy as _
class HouseType(models.Model):
name = models.CharField(_('Nazwa'), max_length=56)
description = models.TextField(_('Opis'))
short_desc = models.TextField(_('Krótki opis'))
space = models.DecimalField(_('Metraż'), max_digits=6, decimal_places=2)
price = models.DecimalField(_('Cena'), max_digits=10, decimal_places=2)
@property
def get_price(self):
return self.price
def __unicode__(self):
return self.name
class HouseDraft(models.Model):
name = models.CharField(_('Nazwa'), max_length=128)
desc = models.TextField(_('Opis'))
house_type = models.ForeignKey('HouseType', verbose_name=_('Dom'))
def __unicode__(self):
return self.name
class CImage(models.Model):
caption = models.CharField(_('podpis zdjecia'), max_length=56)
description = models.TextField(_('podpis zdjecia'))
image = models.ImageField(_('Plik zdjęcia'), upload_to='pics/')
house_type = models.ForeignKey('HouseType', verbose_name=_('Dom'), related_name='images')
corder = models.IntegerField(_('kolejnosc'), blank=True, null=True)
def __unicode__(self):
return self.caption
ETAP_CHOICES = (
('etap1', u'Prace ziemne i fundamenty.'),
('etap2', u'Wykonanie gabarytów domu'),
('etap3', u'Instalacje'),
('etap4', u'Wykończenie wnętrza'),
('etap5', u'Wykończenie zewnątrz'),
('etap6', u'Osiedle i okolice'),
)
class GalleryImage(models.Model):
caption = models.CharField(_('podpis zdjecia'), max_length=56)
description = models.TextField(_('podpis zdjecia'))
image = models.ImageField(_('Plik zdjęcia'), upload_to='pics/')
order = models.IntegerField(_('kolejnosc'), blank=True, null=True)
etap = models.CharField(max_length=20, blank=True, null=True, choices=ETAP_CHOICES)
def __unicode__(self):
return self.caption
class Message(models.Model):
email = models.CharField(_('Email'), max_length=128)
message = models.TextField(_('Wiadomość'))
d_created = models.DateTimeField(_('Odebrano'), auto_now=True)
def __unicode__(self):
return self.email | 31.324324 | 93 | 0.685073 | 273 | 2,318 | 5.534799 | 0.432234 | 0.059563 | 0.055592 | 0.066181 | 0.487095 | 0.487095 | 0.409001 | 0.307081 | 0.185308 | 0.185308 | 0 | 0.018595 | 0.164797 | 2,318 | 74 | 94 | 31.324324 | 0.76188 | 0.00906 | 0 | 0.288462 | 0 | 0 | 0.174652 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.115385 | false | 0 | 0.038462 | 0.115385 | 0.769231 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 2 |
304ae95989c40c10b900a6dc4b6dd05aa6d2ee66 | 3,672 | py | Python | Dictionary.py | vitorbellotto/synonymme | 93f528e2f7a099f9368f9db0126e5c2328579c8d | [
"MIT"
] | null | null | null | Dictionary.py | vitorbellotto/synonymme | 93f528e2f7a099f9368f9db0126e5c2328579c8d | [
"MIT"
] | null | null | null | Dictionary.py | vitorbellotto/synonymme | 93f528e2f7a099f9368f9db0126e5c2328579c8d | [
"MIT"
] | null | null | null | #!/bin/usr/python
#
# This class imports search results from
# DUDEN website and stores in a pickle for
# later use.
#
#############################################
import pprint, pickle
from bs4 import BeautifulSoup
import requests
import re
class Dictionary:
dict_pickle = "german_dict.pickle"
#meaning = list()
def __init__(self, word):
self.word = word
self.getHTMLaddress()
def getHTMLaddress(self):
self.url_word = 'http://www.duden.de/rechtschreibung/' + self.word
def showAttributes(self):
print('The word is ' + self.word + '.')
print('The website is ' + self.url_word + '.')
def getMeaningDict(self):
self.meaning = self.showDictionary()
def getMeaningDuden(self):
meaning = list()
r = requests.get(self.url_word)
soup = BeautifulSoup(r.text, 'html.parser')
soup_2 = BeautifulSoup(r.text, 'html.parser')
pattern_a = re.compile('>(.*)<')
pattern = re.compile('(.*)<section')
regex = re.compile('span class="lexem"')
i=1
for word_definition in soup.find_all(id='block-duden-tiles-1'):
for definitions in word_definition.find_all(lambda tag: tag.name == 'ol' and ( tag.get('class') == ['entry'] or tag.get('class') == ['lexem'] ) ):
for a_link in definitions.find_all(lambda tag: tag.name == 'a'):
meaning.append("{0} {2}: {1}.".format('Meaning', self.returnStr(a_link),i))
i+=1
for definitions in word_definition.find_all(lambda tag: tag.name == 'span' and tag.get('class') == ['lexem']):
meaning = pattern.search(self.returnStr(definitions))
meaning.append("{0} {2}: {1}.".format('Meaning', meaning.group(1),i))
print("{0} {2}: {1}.".format('Meaning', meaning.group(1),i))
i+=1
self.meaning = meaning
def getExample(self):
pass
def printMeaning(self):
for item in self.meaning:
print(item)
def getSynonym(self):
pass
def getPronunciation(self):
pass
def printWord(self):
pass
def debugMe( var ):
print('\n')
print(var)
print(type(var))
print('\n')
def saveWord( self ):
pickle_out = open( self.dict_pickle ,"wb")
pickle.dump( self.meaning, pickle_out )
pickle_out.close()
def showDictionary( self ):
pickle_in = open(self.dict_pickle,"rb")
de_dict = pickle.load(pickle_in)
print(type(de_dict))
return de_dict
def returnStr( self, bs4object ):
#for item in bs4object.contents:
# expression = "{0}: {1}.".format('Meaning is ', item.encode('utf-8'))
# print(expression)
return "".join([item.encode('utf-8') for item in bs4object.contents])
#german_dict = { word:meaning }
#pickleMe( german_dict )
#my_stored_dictionary = depickleMe("german_dict.pickle")
#print(my_stored_dictionary)
# print(line)
# for definition in line.find_all(lambda tag: tag.name == 'span' and tag.get('class') == ['lexem'],limit=1):
# print(definition)
# contents = "".join([str(item) for item in definition.contents])
# result = pattern.search(contents)
# print(result.group(1))
# #result = pattern.search(definition.text)
# #print(result.group(0))
# #for definition in line.find_all(lambda tag: tag.name == 'span' and tag.get('class') == ['lexem'],limit=1):
# # print(definition.text + '\n\n\n')
#for child in soup_2.section.descendants:
# print(child)
#for link in soup.find_all(lambda tag: tag.name='div' and tag.get('class') == ['entry']):
# print(link)
#for link in soup.find_all(lambda hat: hat.name='div' and hat.get('class') == ['entry']).find_all(lambda tag: tag.name == 'span' and tag.get('class') == ['lexem']):
# print(link.text)i
##########################################################################################################################
#
# Essential links used in this code:
#
#
#
| 28.030534 | 164 | 0.638072 | 500 | 3,672 | 4.6 | 0.248 | 0.027391 | 0.045217 | 0.048696 | 0.296522 | 0.233043 | 0.218696 | 0.177826 | 0.177826 | 0.151739 | 0 | 0.009277 | 0.148693 | 3,672 | 130 | 165 | 28.246154 | 0.726488 | 0.332516 | 0 | 0.126984 | 0 | 0 | 0.120428 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0.063492 | 0.063492 | 0.015873 | 0.349206 | 0.190476 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
3055900523d2bf55effafa8afe3068e2f75ff4bd | 19,787 | py | Python | projet/propagation.py | xinyuhuang97/LU3IN003-Projet | c0b80752a6e4454108d0e300a344e2b985c325d2 | [
"MIT"
] | null | null | null | projet/propagation.py | xinyuhuang97/LU3IN003-Projet | c0b80752a6e4454108d0e300a344e2b985c325d2 | [
"MIT"
] | null | null | null | projet/propagation.py | xinyuhuang97/LU3IN003-Projet | c0b80752a6e4454108d0e300a344e2b985c325d2 | [
"MIT"
] | null | null | null | import numpy as np
import sys
import string
M=4
N=5
# grille rempli par sequence
s_grille=np.full((M+N,M+N),0)
# grille remplit par 0 -1 1
grille=np.full((M,N), -1)
#grille[1][0]=0
sequence1=[1,1]
sequence2=[2,1]
# non-colore -1
# blanche 0
# noire 1
def lire_fichier(s_grille):
#file=sys.argv[1:]
try:
in_file = open(sys.argv[1], "r")
except:
sys.exit("ERROR. Can't read supplied filename.")
text = in_file.read()
lg=len(text)
i=0
nextline=0
line=0
colonne=0
bool=0
j=0
while(i<lg-1):
if(text[i]=='\n'):
nextline=1
if(bool==1):
bool=0
else:
line=line+1
i=i+1
colonne=0
continue
else:
if nextline==1:
if text[i]=="0x20":
if text[i+1]!="0x20" and text[i+1]!="\n":
s_grille[line][colonne]=0
colonne=colonne+1
nextline==1
else:
nextline==1
elif (text[i]>='1' and text[i]<='9'):
s_grille[line][colonne]=text[i]
colonne=colonne+1
nextline==0
elif text[i]=='#':
j=line-1
bool=1
nextline==0
else:
nextline==0
if nextline==0:
#print("hi")
if (text[i]>='1' and text[i]<='9'):
s_grille[line][colonne]=text[i]
i=i+1
#print(s_grille)
in_file.close()
return s_grille
def compare_block_ligne(grille, i, j, sl):
if ((j+1<N) and (grille[i][j+1]==1))or ((j-1>=0) and (grille[i][j-1]==1)):
return False
while(j>=0 and j<N and sl>0):
if grille[i][j]==0:
return False
j=j+1
sl=sl-1
return True
def compare_block_colonne(grille, i, j, sl):
if ((i+1<M) and (grille[i+1][j]==1))or ((i-1>=0) and (grille[i-1][j]==1)):
return False
while(i>=0 and i<M and sl>0):
if grille[i][j]==0:
return False
i=i+1
sl=sl-1
return True
def coloriage_possible_ligne(grille, sequence, i, j, l, cl):
# problem de syntaxe
# cas a: si l depasse le nb d'element de la sequence, inviolement de syntaxe
# cas b, i n'est pas compris entre 0 et N-1, inviolement de syntaxe
# cas c, j < 0 , inviolement de syntaxe
if (len(sequence)<l) or (i<0) or (i>N-1) or(j<0):
return False
# cas 1 : l=0:
# -si j=0, vrai
# -sinon faux
if (l==0):
if (j==0):
return True
print("1false")
return False
else:
val=sequence[l-1]
print("s", sequence[l-1])
# cas 2a : si j < sl -1
if (j<(sequence[l-1]-1)):
print("2false")
return False
# cas 2b : si j == sl-1
# -si l == 1, vrai
# -sinon faux
elif (j==(sequence[l-1]-1)):
cpt=j
bool=0
while(j>=0):
if grille[i][j]==0 or cl==0:
bool=1
break
j=j-1
print(l, bool)
if l==1 and bool==0:
print("ABC true")
return True
print("3false")
return False
else:
#cas 2c
return coloriage_possible_ligne_rec(grille, sequence, i, j, l, -1, cl )#, case_j ,nb_block)
def coloriage_possible_ligne_rec(grille, sequence, i, j, l, check ,cl):#, case_j ,nb_block):
if (l==0) and j>=-1 :
print("ABC True")
return True
if j<0:
print(i, j, l)
print(grille)
print("0false")
return False
# Pour la premiere iteration, on ne sait pas si c'est une case blanche ou noire
print(grille)
if check ==-1:
if cl==0:
compare=compare_block_ligne(grille, i, j-sequence[l-1], sequence[l-1])
else:
compare=compare_block_ligne(grille, i, j-sequence[l-1]+1, sequence[l-1])
print("i, j", i, j,"compare:", compare, "l", l)
if grille[i][j]==-1:
if not (compare):
print("4false")
return False
else:
if(j==0) and l==1 and sequence[0]==1:
return True
print("here i j", i ,j-(sequence[l-1])-(1-cl)-1)
if (j-(sequence[l-1])-(1-cl)-1<-1):
return coloriage_possible_ligne_rec(grille, sequence, i ,j-(sequence[l-1]), l-1, 0, cl)
return coloriage_possible_ligne_rec(grille, sequence, i ,j-(sequence[l-1])-(1-cl)-1, l-1, 0, cl)
elif grille[i][j]==1:
if(j==0) and l==1 and sequence[0]==1:
return True
if cl==0:
return False
if compare:
return coloriage_possible_ligne_rec(grille, sequence, i ,j-(sequence[l-1])-1, l-1 ,0, cl)
return False
elif grille[i][j]==0:
if(j==0) and l==1 and sequence[0]==1:
return False
if cl==1:
return False
if compare:
return coloriage_possible_ligne_rec(grille, sequence, i ,j-(sequence[l-1])-2, l-1 ,0, cl)
return False
else:
print("Syntaxe erreur valeur different que -1 0 1")
exit()
else:
compare_1=compare_block_ligne(grille, i, j-sequence[l-1], sequence[l-1])
compare_2=compare_block_ligne(grille, i, j-sequence[l-1]+1, sequence[l-1])
print("i, j", i, j,"compare1:", compare_1, "l",l)
print("i, j", i, j,"compare2:", compare_2, "l",l)
if grille[i][j]==-1:
if(j==0) and l==1 and sequence[0]==1:
return True
#print(i,j-sequence[l-1] ,sequence[l-1])
if grille[i][j-sequence[l-1]-1]==1 and compare_1:
return coloriage_possible_ligne_rec(grille, sequence, i ,j-(sequence[l-1])-2, l-1, 0, cl)
elif grille[i][j-sequence[l-1]]==1 and compare_2:
#if(j==0):
# return coloriage_possible_ligne_rec(grille, sequence, i ,j-(sequence[l-1]), l-1 ,0, cl)
return coloriage_possible_ligne_rec(grille, sequence, i ,j-(sequence[l-1])-1, l-1 ,0, cl)
elif not (compare_1 or compare_2):
print("6false")
return False
else:
if grille[i][j-sequence[l-1]-1]==0:
l=len(sequence[l-1])
while(l>=0):
list[i][j-(sequence[l-1])+l]=1
l=l-1
return coloriage_possible_ligne_rec(grille, sequence, i ,j-(sequence[l-1])-1, l-1 ,0, cl)
else:
print("or")
if (j==0) and sequence[l-1]==1:
print("ABC True")
return True
return coloriage_possible_ligne_rec(grille, sequence, i ,j-(sequence[l-1])-1, l-1 ,0, cl) or coloriage_possible_ligne_rec(grille, sequence, i ,j-(sequence[l-1])-2, l-1, 0, cl)
elif grille[i][j]==1:
if(j==0) and l==1 and sequence[0]==1:
return True
if compare_2:
return coloriage_possible_ligne_rec(grille, sequence, i ,j-(sequence[l-1])-1, l-1 ,0, cl)
else:
print("7false")
return False
elif grille[i][j]==0:
if(j==0) and l==1 and sequence[0]==1:
return False
if compare_1:
return coloriage_possible_ligne_rec(grille, sequence, i ,j-(sequence[l-1])-2, l-1 ,0, cl)
else:
print("8false")
return False
else:
print("Syntaxe erreur valeur different que -1 0 1")
exit()
def coloriage_possible_colonne(grille, sequence, i, j, l ,cl):
# problem de syntaxe
# cas a: si l depasse le nb d'element de la sequence, inviolement de syntaxe
# cas b, i n'est pas compris entre 0 et N-1, inviolement de syntaxe
# cas c, j < 0 , inviolement de syntaxe
if (len(sequence)<l) or (i<0) or (i>N-1) or(j<0):
return False
# cas 1 : l=0:
# -si j=0, vrai
# -sinon faux
if (l==0):
if (i==0):
return True
print("11false")
return False
else:
print("i")
val=sequence[l-1]
# cas 2a : si j < sl -1
if (i<(sequence[l-1]-1)):
print("22false")
return False
# cas 2b : si j == sl-1
# -si l == 1, vrai
# -sinon faux
elif (i==(sequence[l-1]-1)):
cpt=i
bool=0
while(i>=0):
if grille[i][j]==0 or cl==0:
bool=1
break
i=i-1
if l==1 and bool==0:
print("ABC true")
return True
print("33false")
return False
else:
#cas 2c
return coloriage_possible_colonne_rec(grille, sequence, i, j, l, -1 ,cl)#, case_j ,nb_block)
def coloriage_possible_colonne_rec(grille, sequence, i, j, l, check, cl):#, case_j ,nb_block):
if (l==0) and (i>=-1):
print("ABC true")
return True
if i<0:
print("44false")
return False
# Pour la premiere iteration, on ne sait pas si c'est une case blanche ou noire
print(grille)
if check ==-1:
if cl==0:
compare=compare_block_colonne(grille, i-sequence[l-1], j, sequence[l-1])
else:
compare=compare_block_colonne(grille, i-sequence[l-1]+1, j, sequence[l-1])
print("i, j", i, j,"compare:", compare, "l", l)
if grille[i][j]==-1:
if not (compare):
print("55false")
return False
else:
if(i==0) and l==1 and sequence[0]==1:
return True
print("here i j", i-(sequence[l-1])-(1-cl)-1 ,j)
if (i-(sequence[l-1])-(1-cl)-1<-1):
return coloriage_possible_ligne_rec(grille, sequence, i-(sequence[l-1]) ,j, l-1, 0, cl)
return coloriage_possible_ligne_rec(grille, sequence, i-(sequence[l-1])-(1-cl)-1 ,j, l-1, 0, cl)
elif grille[i][j]==1:
if(i==0) and l==1 and sequence[0]==1:
return True
if compare:
return coloriage_possible_colonne_rec(grille, sequence, i-(sequence[l-1])-1 ,j, l-1 ,0, cl)
else:
##print("77false")
return False
elif grille[i][j]==0:
return False
else:
print("Syntaxe erreur valeur different que -1 0 1")
exit()
else:
compare_1=compare_block_colonne(grille, i-sequence[l-1], j, sequence[l-1])
compare_2=compare_block_colonne(grille, i-sequence[l-1]+1, j, sequence[l-1])
print("i, j", i, j,"compare1:", compare_1, "l",l)
print("i, j", i, j,"compare2:", compare_2, "l",l)
if grille[i][j]==-1:
if grille[i][j-sequence[l-1]-1]==1 and compare_1:
return coloriage_possible_colonne_rec(grille, sequence, i-(sequence[l-1])-2 ,j, l-1, 0, cl)
elif grille[i][j-sequence[l-1]]==1 and compare_2:
if(i==0):
return coloriage_possible_ligne_rec(grille, sequence, i-(sequence[l-1]) ,j, l-1 ,0, cl)
return coloriage_possible_colonne_rec(grille, sequence, i-(sequence[l-1])-1 ,j, l-1 ,0, cl)
elif not (compare_1 or compare_2):
print("66false")
return False
else:
if grille[i][j-sequence[l-1]-1]==0:
return coloriage_possible_colonne_rec(grille, sequence, i-(sequence[l-1])-1 ,j, l-1 ,0, cl)
else:
if (j==0) and sequence[l-1]==1:
print("ABC True")
return True
return coloriage_possible_colonne_rec(grille, sequence, i-(sequence[l-1])-1 ,j, l-1 ,0, cl) or coloriage_possible_colonne_rec(grille, sequence, i-(sequence[l-1])-2 ,j, l-1, 0, cl)
elif grille[i][j]==1:
if(i==0) and l==1 and sequence[0]==1:
return True
if compare_2:
return coloriage_possible_colonne_rec(grille, sequence, i-(sequence[l-1])-1 ,j, l-1 ,0, cl)
else:
print("77false")
return False
elif grille[i][j]==0:
if(i==0) and l==1 and sequence[0]==1:
return False
if compare_1:
return coloriage_possible_colonne_rec(grille, sequence, i-(sequence[l-1])-2 ,j, l-1 ,0, cl)
else:
print("88false")
return False
else:
print("Syntaxe erreur valeur different que -1 0 1")
exit()
def dupliquer(grille):
grille_d=np.full((M,N), -1)
for i in range(M):
for j in range(N):
grille_d[i][j]=grille[i][j]
return grille_d
def creer_sequence(indice, direction):
init=1
k=0
sequence=[]
#print(s_grille)
if direction==1:
while(k<M):
if(s_grille[indice][k]!=0 or init==1):
sequence.append(s_grille[indice][k])
#print("this",indice, k)
#print(s_grille[indice][k])
init=0
k=k+1
elif direction==2:
while(k<N):
if(s_grille[indice+M][k]!=0 or init==1):
sequence.append(s_grille[indice+M][k])
init=0
k=k+1
return sequence
def coloreLig(grille, i):
sequence=creer_sequence(i,1)# 1 signifie ligne 2 signifie colonne
l=len(sequence)
a=0
somme_sequence=0
while (a<l):
somme_sequence=somme_sequence+sequence[a]
a=a+1
j=N-1
bool=0
print("----------------------",sequence)
while(j>=0 and l>0):
print("i",i, "j", j, "l", l)
resultat_blanc=(coloriage_possible_ligne(grille, sequence, i, j, l, 0))
print("noir")
resultat_noir=(coloriage_possible_ligne(grille, sequence, i, j, l, 1) )
print("resultat_blanc, resultat_noir",resultat_blanc, resultat_noir)
k=j
if resultat_noir==True:
bool=1
if resultat_blanc==False:
s=sequence[l-1]
print(l-1)
while(s>0):
print("in while")
print(sequence)
grille[i][k]=1
k=k-1
s=s-1
del sequence[l-1]
else:
nb=j-1
min=j
max=-1
while(nb>=0):
#print(grille[i][nb], nb)
if grille[i][nb]==1:
if(grille[i][nb]>max):
max=nb
if(grille[i][nb]<min):
min=nb
nb=nb-1
print("max",max)
print("min",min)
l=len(sequence)
print("************l",l,"max-min+1", max-min+1)
print((l==1 and max-min+1==sequence[l-1]))
if not (l==1 and max-min+1==sequence[l-1]):
print("why?")
del sequence[l-1]
print("fin")
if resultat_noir==False and resultat_blanc==False and j==N-1:
print(i, j)
return (False, grille)
j=k-1
l=len(sequence)
if(j<0 and l>0):
del sequence[l-1]
j=M-1
l=len(sequence)
if(bool==1):
return (True,grille)
print("what")
return (False, grille)
return resultat
def coloreCol(grille, j):
sequence=creer_sequence(j,2)# 1 signifie ligne 2 signifie colonne
l=len(sequence)
i=M-1
bool=0
print("----------------------",sequence)
while(i>=0 and l>0):
bool_del=0
print("i",i, "j", j, "l", l)
resultat_blanc=(coloriage_possible_colonne(grille, sequence, i, j, l, 0))
print("noir")
resultat_noir=(coloriage_possible_colonne(grille, sequence, i, j, l, 1) )
print("resultat_blanc, resultat_noir",resultat_blanc, resultat_noir)
print("l=",l)
k=i
if resultat_noir==True:
bool=1
if resultat_blanc==False:
s=sequence[l-1]
k=i
while(s>0):
print("welcome")
grille[k][j]=1
k=k-1
s=s-1
del sequence[l-1]
else:
nb=i-1
min=i
max=-1
while(nb>=0):
#print(grille[i][nb], nb)
if grille[nb][j]==1:
if(grille[nb][j]>max):
max=nb
if(grille[nb][j]<min):
min=nb
nb=nb-1
if not (l==1 and max-min+1==sequence[l-1]):
print("why?")
del sequence[l-1]
#del sequence[-1]
print("fin")
#if resultat_blanc==True:
# if resultat_noir==False:
if resultat_noir==False and resultat_blanc==False and i==M-1:
print(i, j)
return (False, grille)
i=k-1
#l=len(sequence)
#if(i<=0 and l>0):
# if(bool_del!=1):
# del sequence[-1]
#i=M-1"""
l=len(sequence)
if(bool==1):
return (True,grille)
print("what")
return (False, grille)
def coloration(grille):
grille_d=dupliquer(grille)
LigneAVoir=set()
ColonneAVoir=set()
i=M-1
j=N-1
while (i>=0):
LigneAVoir.add(i)
i=i-1
while(j>=0):
ColonneAVoir.add(j)
j=j-1
while ((LigneAVoir!=set())or(ColonneAVoir!=set())):
while (LigneAVoir):
i=LigneAVoir.pop()
(ok,grille_d)=coloreLig(grille_d, i)
if ok==False:
print("hi")
print(grille_d)
return (-1, [[]])#matrice vide!!
Nouveaux=set()
for j in range(N):
if grille_d[i][j]==1:
Nouveaux.add(j)
ColonneAVoir=ColonneAVoir.union(Nouveaux)
while(ColonneAVoir):
j=ColonneAVoir.pop()
(ok,grille_d)=coloreCol(grille_d, j)
if ok==False:
print("hello")
return (False, [[]])#matrice vide!
Nouveaux=set()
for i in range(M):
if grille_d[i][j]==1:
Nouveaux.add(i)
print("-------Nouveaux-------",Nouveaux)
print("-------LigneAVoir-------",LigneAVoir)
LigneAVoir=LigneAVoir.union(Nouveaux)
print("-------LigneAVoir-------",LigneAVoir)
for i in range(M) :
for j in range(N) :
if(grille_d[i][j]!=0 and grille_d[i][j]!=1):
return (0, grille_d)
return (1,grille_d)
#print(coloriage_possible(grille, sequence1, 1, 1, 2))
#print(coloriage_possible(grille, sequence2, 1, 3, 2))
lire_fichier(s_grille)
print(s_grille)
print(coloration(grille))
| 34.174439 | 199 | 0.468692 | 2,682 | 19,787 | 3.380313 | 0.066368 | 0.026252 | 0.079418 | 0.038826 | 0.74829 | 0.715089 | 0.690492 | 0.66788 | 0.644827 | 0.615707 | 0 | 0.044384 | 0.388538 | 19,787 | 578 | 200 | 34.233564 | 0.704934 | 0.085511 | 0 | 0.604082 | 0 | 0 | 0.040819 | 0.006322 | 0 | 0 | 0.000444 | 0 | 0 | 1 | 0.02449 | false | 0 | 0.006122 | 0 | 0.202041 | 0.153061 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
306040770b67b2e563d4229ae099ca34c25b419e | 2,272 | py | Python | robosuite/models/robots/kinova3_robot.py | kyungjaelee/robosuite | 0d73fcca9ed8e638632f4bd7b0f1b8ebf4640fb1 | [
"MIT"
] | null | null | null | robosuite/models/robots/kinova3_robot.py | kyungjaelee/robosuite | 0d73fcca9ed8e638632f4bd7b0f1b8ebf4640fb1 | [
"MIT"
] | null | null | null | robosuite/models/robots/kinova3_robot.py | kyungjaelee/robosuite | 0d73fcca9ed8e638632f4bd7b0f1b8ebf4640fb1 | [
"MIT"
] | 1 | 2021-03-26T19:10:00.000Z | 2021-03-26T19:10:00.000Z | import numpy as np
from robosuite.models.robots.robot_model import RobotModel
from robosuite.utils.mjcf_utils import xml_path_completion
class Kinova3(RobotModel):
"""
The Gen3 robot is sparkly newest addition to the Kinova line
Args:
idn (int or str): Number or some other unique identification string for this robot instance
bottom_offset (3-array): (x,y,z) offset desired from initial coordinates
"""
def __init__(self, idn=0, bottom_offset=(0, 0, -0.913)):
super().__init__(xml_path_completion("robots/kinova3/robot.xml"), idn=idn, bottom_offset=bottom_offset)
@property
def dof(self):
return 7
@property
def gripper(self):
return "Robotiq85Gripper"
@property
def default_controller_config(self):
return "default_kinova3"
@property
def init_qpos(self):
return np.array([0.000, 0.650, 0.000, 1.890, 0.000, 0.600, -np.pi / 2])
@property
def base_xpos_offset(self):
return {
"bins": (-0.5, -0.1, 0),
"empty": (-0.6, 0, 0),
"table": lambda table_length: (-0.16 - table_length/2, 0, 0)
}
@property
def arm_type(self):
return "single"
@property
def _joints(self):
return ["Actuator1", "Actuator2", "Actuator3", "Actuator4",
"Actuator5", "Actuator6", "Actuator7"]
@property
def _eef_name(self):
return "right_hand"
@property
def _robot_base(self):
return "base"
@property
def _actuators(self):
return {
"pos": [], # No position actuators for sawyer
"vel": [], # No velocity actuators for sawyer
"torq": ["torq_j1", "torq_j2", "torq_j3",
"torq_j4", "torq_j5", "torq_j6", "torq_j7"]
}
@property
def _contact_geoms(self):
return ["s_collision", "ha1_collision", "ha2_collision", "f_collision",
"w1_collision", "w2_collision", "b_collision"]
@property
def _root(self):
return 'base'
@property
def _links(self):
return ["Shoulder_Link", "HalfArm1_Link", "HalfArm2_Link", "ForeArm_Link",
"SphericalWrist1_Link", "SphericalWrist2_Link", "Bracelet_Link"]
| 28.049383 | 111 | 0.602553 | 273 | 2,272 | 4.798535 | 0.490842 | 0.10916 | 0.025954 | 0.033588 | 0.038168 | 0 | 0 | 0 | 0 | 0 | 0 | 0.046638 | 0.273327 | 2,272 | 80 | 112 | 28.4 | 0.74682 | 0.135123 | 0 | 0.263158 | 0 | 0 | 0.207645 | 0.012397 | 0 | 0 | 0 | 0 | 0 | 1 | 0.245614 | false | 0 | 0.052632 | 0.22807 | 0.54386 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
30647229a9d44d6fe36188d478ce7d532efc5085 | 1,591 | py | Python | dilemma_lib.py | idoheinemann/Prisoners-Dilemma | ad3e9b81748f19f5bb23243e118a656a60cba450 | [
"Apache-2.0"
] | 3 | 2019-12-02T21:06:28.000Z | 2020-10-31T20:22:29.000Z | dilemma_lib.py | idoheinemann/Prisoners-Dilemma | ad3e9b81748f19f5bb23243e118a656a60cba450 | [
"Apache-2.0"
] | null | null | null | dilemma_lib.py | idoheinemann/Prisoners-Dilemma | ad3e9b81748f19f5bb23243e118a656a60cba450 | [
"Apache-2.0"
] | null | null | null | import abc
from typing import NewType
from copy import copy
def _(): # make the registered classes variable invisible
__registered_classes = []
def _register(cls):
if hasattr(cls, 'do_turn'):
print(f'registering {cls.__name__}...')
__registered_classes.append(cls)
else:
print(f'class {cls.__name__} does not have a method do_turn')
def _get_registered_classes():
return copy(__registered_classes)
return _register, _get_registered_classes
register, get_registered_classes = _()
class PrisonerAction:
def __init__(self, name):
self.__name = name
def __str__(self):
return self.__name
def __repr__(self):
return str(self)
LOYAL = PrisonerAction('LOYAL')
BETRAY = PrisonerAction('BETRAY')
class Prisoner(abc.ABC):
"""
prisoner base class
all prisoner bots must inherit from the prisoner class
Note! constructor for this class cannot accept any arguments
Note! printing will not work when using do_turn
"""
def __init_subclass__(cls, **kwargs):
register(cls)
@abc.abstractmethod
def do_turn(self, history: list) -> PrisonerAction:
"""
runs a single turn and return's the prisoners choice
:param history: a list of all the history so fur, each event is consisted of two elements, the first is your
action that turn, and the second is your opponent's action.
:type history: list[tuple[int, int]]
:return: the action for this turn, either LOYAL or BETRAY
"""
| 24.859375 | 116 | 0.663105 | 201 | 1,591 | 4.9801 | 0.452736 | 0.118881 | 0.05994 | 0.055944 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2577 | 1,591 | 63 | 117 | 25.253968 | 0.847587 | 0.349466 | 0 | 0 | 0 | 0 | 0.102941 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.275862 | false | 0 | 0.103448 | 0.103448 | 0.586207 | 0.068966 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
3069fb5225d892e1d87570d254925ed6c19fd94f | 1,671 | py | Python | accencis/settings/development.py | majestylink/majestyAccencis | 41bdde6f9982980609f93a8b44bcaf06cc5f6ea6 | [
"MIT"
] | null | null | null | accencis/settings/development.py | majestylink/majestyAccencis | 41bdde6f9982980609f93a8b44bcaf06cc5f6ea6 | [
"MIT"
] | null | null | null | accencis/settings/development.py | majestylink/majestyAccencis | 41bdde6f9982980609f93a8b44bcaf06cc5f6ea6 | [
"MIT"
] | null | null | null | from .base import *
SECRET_KEY = 'zn#g)t661djs1(#p!92%#sr=2d_y3$@m_s5uxlrvobu&w&xgy0'
DEBUG = True
ALLOWED_HOSTS += ['*']
INSTALLED_APPS += [
'debug_toolbar'
]
MIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware', ]
# DEBUG TOOLBAR SETTINGS
DEBUG_TOOLBAR_PANELS = [
'debug_toolbar.panels.versions.VersionsPanel',
'debug_toolbar.panels.timer.TimerPanel',
'debug_toolbar.panels.settings.SettingsPanel',
'debug_toolbar.panels.headers.HeadersPanel',
'debug_toolbar.panels.request.RequestPanel',
'debug_toolbar.panels.sql.SQLPanel',
'debug_toolbar.panels.staticfiles.StaticFilesPanel',
'debug_toolbar.panels.templates.TemplatesPanel',
'debug_toolbar.panels.cache.CachePanel',
'debug_toolbar.panels.signals.SignalsPanel',
'debug_toolbar.panels.logging.LoggingPanel',
'debug_toolbar.panels.redirects.RedirectsPanel',
]
def show_toolbar(request):
return True
DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': False,
'SHOW_TOOLBAR_CALLBACK': show_toolbar
}
# Database
# https://docs.djangoproject.com/en/2.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(PROJECT_ROOT, 'db.sqlite3'),
}
}
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
STATIC_URL = '/accencisstatic/'
# Extra places for collectstatic to find static files.
STATICFILES_DIRS = (
os.path.join(PROJECT_ROOT, 'static'),
)
MEDIA_URL = '/accencismedia/'
MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media')
STRIPE_PUBLIC_KEY = 'pk_test_cxV8Zd4v13T7RkU9RNINPBol00WKFEUL55'
STRIPE_SECRET_KEY = 'sk_test_knglyTcCTnYlH4XhS2IpDgNP00XDjE1VP7'
| 27.85 | 67 | 0.745063 | 189 | 1,671 | 6.349206 | 0.529101 | 0.17 | 0.195 | 0.056667 | 0.076667 | 0.041667 | 0 | 0 | 0 | 0 | 0 | 0.02052 | 0.125075 | 1,671 | 59 | 68 | 28.322034 | 0.800274 | 0.086774 | 0 | 0 | 0 | 0 | 0.550658 | 0.476316 | 0 | 0 | 0 | 0 | 0 | 1 | 0.023256 | false | 0 | 0.023256 | 0.023256 | 0.069767 | 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 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
306a20b083fb472393dc2153a102396fad358364 | 434 | py | Python | src/Zadanie2/NotesService.py | TestowanieAutomatyczneUG/laboratorium-11-LudwikaMalinowska | 1e1bd74c0d098336773d5a7cda8def04bb5f0f0f | [
"MIT"
] | null | null | null | src/Zadanie2/NotesService.py | TestowanieAutomatyczneUG/laboratorium-11-LudwikaMalinowska | 1e1bd74c0d098336773d5a7cda8def04bb5f0f0f | [
"MIT"
] | null | null | null | src/Zadanie2/NotesService.py | TestowanieAutomatyczneUG/laboratorium-11-LudwikaMalinowska | 1e1bd74c0d098336773d5a7cda8def04bb5f0f0f | [
"MIT"
] | null | null | null |
from Zadanie2.NotesStorage import NotesStorage
import math
import statistics
class NotesService:
def __init__(self, storage):
self.storage = storage
def add(self, note):
return self.storage.add(note)
def averageOf(self, name):
grades = self.storage.getAllNotesOf(name)
grades_mean = statistics.mean(grades)
return grades_mean
def clear(self):
self.storage.clear()
| 20.666667 | 49 | 0.675115 | 50 | 434 | 5.74 | 0.42 | 0.191638 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00304 | 0.241935 | 434 | 20 | 50 | 21.7 | 0.869301 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.214286 | 0.071429 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
30726cf2a4a832db5bb69a907951d1c3f71809f5 | 742 | py | Python | 5_singleton/chocolate_boiler.py | hypersport/Head-First-Design-Patterns-Python | 0c8b831ae89ebbbef8b203b96508deb7e3063590 | [
"MIT"
] | null | null | null | 5_singleton/chocolate_boiler.py | hypersport/Head-First-Design-Patterns-Python | 0c8b831ae89ebbbef8b203b96508deb7e3063590 | [
"MIT"
] | null | null | null | 5_singleton/chocolate_boiler.py | hypersport/Head-First-Design-Patterns-Python | 0c8b831ae89ebbbef8b203b96508deb7e3063590 | [
"MIT"
] | null | null | null | class ChocolateBoiler:
unique_instance = None
def __new__(cls, *args, **kwargs):
if not cls.unique_instance:
cls.unique_instance = super().__new__(cls, *args, **kwargs)
return cls.unique_instance
def __init__(self):
self.empty = True
self.boiled = False
def is_empty(self):
return self.empty
def is_boiled(self):
return self.boiled
def fill(self):
if self.is_empty():
self.empty = False
self.boiled = False
def drain(self):
if not self.is_empty() and self.is_boiled():
self.empty = True
def boil(self):
if not self.is_empty() and not self.is_boiled():
self.boiled = True
| 23.935484 | 71 | 0.579515 | 94 | 742 | 4.329787 | 0.265957 | 0.07371 | 0.125307 | 0.078624 | 0.113022 | 0.113022 | 0.113022 | 0 | 0 | 0 | 0 | 0 | 0.319407 | 742 | 30 | 72 | 24.733333 | 0.805941 | 0 | 0 | 0.173913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.304348 | false | 0 | 0 | 0.086957 | 0.521739 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
307417c3a1dd36ee415424082366bc3645b8258e | 9,717 | py | Python | mediator_test.py | ssoloff/petulant-octo-adventure | b5f44d3350d332bbf8bb0a290904170babd3d5f1 | [
"MIT"
] | null | null | null | mediator_test.py | ssoloff/petulant-octo-adventure | b5f44d3350d332bbf8bb0a290904170babd3d5f1 | [
"MIT"
] | null | null | null | mediator_test.py | ssoloff/petulant-octo-adventure | b5f44d3350d332bbf8bb0a290904170babd3d5f1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import functools
import itertools
import operator
import re
class _Topic:
def __init__(self, mediator):
self._mediator = mediator
def _get_published_data_for_topic(self, topic):
return [publisher(topic) for publisher in self._mediator._get_publishers_for_topic(topic)]
def _notify_subscribers_for_topic(self, subscribers, topic):
assert _Topic.is_single_topic(topic)
for subscriber in subscribers:
subscriber(topic)
@staticmethod
def is_multi_topic(*topics):
return all(map(lambda topic: isinstance(topic, _MultiTopic), topics))
@staticmethod
def is_single_topic(*topics):
return all(map(lambda topic: isinstance(topic, _SingleTopic), topics))
class _SingleTopic(_Topic):
def __init__(self, mediator, name):
super().__init__(mediator)
self._name = name
def __eq__(self, other):
return self._name == other._name
def __hash__(self):
return hash(self._name)
def __repr__(self):
return 'SingleTopic[{}]'.format(self._name)
def get_published_data(self):
return self._get_published_data_for_topic(self)
def matches(self, topic):
return self._name == topic._name
def notify_subscribers(self, *subscribers):
self._notify_subscribers_for_topic(subscribers, self)
class _MultiTopic(_Topic):
def __init__(self, mediator, name_pattern):
super().__init__(mediator)
self._name_pattern = name_pattern
def __eq__(self, other):
return self._name_pattern == other._name_pattern
def __hash__(self):
return hash(self._name_pattern)
def __repr__(self):
return 'MultiTopic[{}]'.format(self._name_pattern)
def get_published_data(self):
return itertools.chain.from_iterable(
self._get_published_data_for_topic(publisher_topic)
for publisher_topic in self._mediator._get_all_publisher_topics()
if self._name_pattern.fullmatch(publisher_topic._name)
)
def matches(self, topic):
return self._name_pattern.fullmatch(topic._name)
def notify_subscribers(self, *subscribers):
for publisher_topic in self._mediator._get_all_publisher_topics():
if self._name_pattern.fullmatch(publisher_topic._name):
self._notify_subscribers_for_topic(subscribers, publisher_topic)
class _Value:
def __init__(self, mediator, name):
self._mediator = mediator
self._published_topics = []
self._topic = mediator.new_single_topic(name)
def _notify_subscribers(self):
self._mediator.notify_subscribers(*self._published_topics)
def get_topic(self):
return self._topic
def publish(self, *topics):
assert _Topic.is_single_topic(*topics)
self._published_topics += topics
self._mediator.publish(lambda topic: self, *topics)
class _StaticValue(_Value):
def __init__(self, mediator, name, value):
super().__init__(mediator, name)
self._value = value
def get_value(self):
return self._value
def set_value(self, value):
self._value = value
self._notify_subscribers()
class _DynamicValue(_Value):
def __init__(self, mediator, name):
super().__init__(mediator, name)
self._subscribed_topics = []
def _get_subscribed_values(self):
return self._mediator.get_published_data(*self._subscribed_topics)
def get_value(self):
return functools.reduce(
operator.add,
[value.get_value() for value in self._get_subscribed_values()],
0
)
def subscribe(self, *topics):
self._subscribed_topics += topics
self._mediator.subscribe(lambda topic: self._notify_subscribers(), *topics)
class Mediator:
def __init__(self):
self._observers = []
self._publishers_by_topic = {}
self._subscribers_by_topic = {}
def _add_publisher(self, publisher, topic):
assert _Topic.is_single_topic(topic)
publishers = self._get_publishers_for_topic(topic, create_if_absent=True)
publishers.append(publisher)
self._notify_observers_that_publisher_added(publisher, topic)
def _add_subscriber(self, subscriber, topic):
subscribers = self._get_subscribers_for_topic(topic, create_if_absent=True)
subscribers.append(subscriber)
self._notify_observers_that_subscriber_added(subscriber, topic)
def _get_all_publisher_topics(self):
return self._publishers_by_topic.keys()
def _get_all_subscriber_topics(self):
return self._subscribers_by_topic.keys()
def _get_publishers_for_topic(self, topic, create_if_absent=False):
assert _Topic.is_single_topic(topic)
if create_if_absent:
return self._publishers_by_topic.setdefault(topic, [])
else:
return self._publishers_by_topic.get(topic, [])
def _get_subscribers_for_topic(self, topic, create_if_absent=False):
if create_if_absent:
return self._subscribers_by_topic.setdefault(topic, [])
else:
return self._subscribers_by_topic.get(topic, [])
def _notify_observers(self, action):
for observer in self._observers:
action(observer)
def _notify_observers_that_publisher_added(self, publisher, topic):
self._notify_observers(lambda observer: observer.publisher_added(publisher, topic))
def _notify_observers_that_subscriber_added(self, subscriber, topic):
self._notify_observers(lambda observer: observer.subscriber_added(subscriber, topic))
def _notify_observers_that_topic_published(self, topic):
self._notify_observers(lambda observer: observer.topic_published(topic))
def _notify_subscribers(self, topic):
assert _Topic.is_single_topic(topic)
self._notify_observers_that_topic_published(topic)
for subscriber_topic in self._get_all_subscriber_topics():
if subscriber_topic.matches(topic):
topic.notify_subscribers(*self._get_subscribers_for_topic(subscriber_topic))
def add_observer(self, observer):
self._observers.append(observer)
def get_published_data(self, *topics):
return itertools.chain.from_iterable([
topic.get_published_data() for topic in topics
])
def new_dynamic_value(self, name):
value = _DynamicValue(self, name)
value.publish(value.get_topic())
return value
def new_multi_topic(self, name_pattern):
return _MultiTopic(self, name_pattern)
def new_single_topic(self, name):
return _SingleTopic(self, name)
def new_static_value(self, name, value=0):
value = _StaticValue(self, name, value)
value.publish(value.get_topic())
return value
def notify_subscribers(self, *topics):
for topic in topics:
self._notify_subscribers(topic)
def publish(self, publisher, *topics):
for topic in topics:
self._add_publisher(publisher, topic)
self._notify_subscribers(topic)
def subscribe(self, subscriber, *topics):
for topic in topics:
self._add_subscriber(subscriber, topic)
topic.notify_subscribers(subscriber)
if __name__ == '__main__':
class Observer:
def publisher_added(self, publisher, topic):
print('[observer] added publisher "{}" for topic "{}"'.format(publisher, topic))
def subscriber_added(self, subscriber, topic):
print('[observer] added subscriber "{}" for topic "{}"'.format(subscriber, topic))
def topic_published(self, topic):
print('[observer] topic "{}" published'.format(topic))
def print_value(message, value):
print('[{}] {} = {}'.format(message, value.get_topic(), value.get_value()))
mediator = Mediator()
mediator.subscribe(
lambda topic: [
print_value('notification', value)
for value in mediator.get_published_data(topic)
],
mediator.new_multi_topic(re.compile('astr|aint|adex'))
)
# uncomment the following line to enable verbose Mediator logging
#mediator.add_observer(Observer())
# Case 1: composite value subscribes to component values
astr_base = mediator.new_static_value('astr_base', 14)
astr_adj = mediator.new_static_value('astr_adj', 2)
astr = mediator.new_dynamic_value('astr')
print_value('initial', astr)
astr.subscribe(astr_base.get_topic())
astr.subscribe(astr_adj.get_topic())
astr_adj.set_value(-1)
astr_base.set_value(10)
print_value('final', astr)
# Case 2: component values publish to composite value
aint_base = mediator.new_static_value('aint_base', 12)
aint_adj = mediator.new_static_value('aint_adj', 1)
aint = mediator.new_dynamic_value('aint')
print_value('initial', aint)
aint_contrib_topic = mediator.new_single_topic('aint_contrib')
aint.subscribe(aint_contrib_topic)
aint_base.publish(aint_contrib_topic)
aint_adj.publish(aint_contrib_topic)
aint_adj.set_value(-3)
aint_base.set_value(8)
print_value('final', aint)
# Case 3: composite value subscribes to pattern; component values publish to topics that match pattern
adex_base = mediator.new_static_value('adex_base', 13)
adex_adj = mediator.new_static_value('adex_adj', 3)
adex = mediator.new_dynamic_value('adex')
print_value('initial', adex)
adex.subscribe(mediator.new_multi_topic(re.compile('adex_.+')))
adex_adj.set_value(-2)
adex_base.set_value(9)
print_value('final', adex)
| 33.506897 | 106 | 0.689719 | 1,162 | 9,717 | 5.364028 | 0.098967 | 0.02567 | 0.023103 | 0.01829 | 0.486604 | 0.299374 | 0.195732 | 0.083427 | 0.046527 | 0.030804 | 0 | 0.002879 | 0.213646 | 9,717 | 289 | 107 | 33.622837 | 0.812852 | 0.033549 | 0 | 0.206573 | 0 | 0 | 0.033777 | 0 | 0 | 0 | 0 | 0 | 0.023474 | 1 | 0.258216 | false | 0 | 0.018779 | 0.103286 | 0.446009 | 0.056338 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
30753f46ece861cb8f01b59eafa2ab02208c5ffe | 3,116 | py | Python | Chapter10/ch10_ex5.py | leetschau/Functional-Python-Programming-Second-Edition | 650c50aaaf23c988ef78ab7a46d49d993414782f | [
"MIT"
] | 65 | 2018-04-15T00:44:42.000Z | 2022-02-20T04:11:10.000Z | Chapter10/ch10_ex5.py | zaqmoda/Functional-Python-Programming-Second-Edition | bd9d9467ef906095560a5955ebc82a360794269d | [
"MIT"
] | 1 | 2019-07-20T10:30:37.000Z | 2020-09-14T09:06:08.000Z | Chapter10/ch10_ex5.py | zaqmoda/Functional-Python-Programming-Second-Edition | bd9d9467ef906095560a5955ebc82a360794269d | [
"MIT"
] | 52 | 2018-04-12T12:51:02.000Z | 2022-03-02T18:35:50.000Z | #!/usr/bin/env python3
"""Functional Python Programming
Chapter 10, Example Set 5
"""
from collections import defaultdict
from typing import (
Iterable, Callable, Dict, List, TypeVar,
Iterator, Tuple, cast)
D_ = TypeVar("D_")
K_ = TypeVar("K_")
def partition(
source: Iterable[D_],
key: Callable[[D_], K_] = lambda x: cast(K_, x)
) -> Iterable[Tuple[K_, Iterator[D_]]]:
"""Sort not required."""
pd: Dict[K_, List[D_]] = defaultdict(list)
for item in source:
pd[key(item)].append(item)
for k in sorted(pd):
yield k, iter(pd[k])
from itertools import groupby
def partition_s(
source: Iterable[D_],
key: Callable[[D_], K_] = lambda x: cast(K_, x)
) -> Iterable[Tuple[K_, Iterator[D_]]]:
"""Sort required"""
return groupby(sorted(source, key=key), key)
test_data = """
>>> data = [('4', 6.1), ('1', 4.0), ('2', 8.3), ('2', 6.5),
... ('1', 4.6), ('2', 6.8), ('3', 9.3), ('2', 7.8),
... ('2', 9.2), ('4', 5.6), ('3', 10.5), ('1', 5.8),
... ('4', 3.8), ('3', 8.1), ('3', 8.0), ('1', 6.9),
... ('3', 6.9), ('4', 6.2), ('1', 5.4), ('4', 5.8)]
>>> for key, group_iter in partition(data, key=lambda x:x[0]):
... print(key, tuple(group_iter))
1 (('1', 4.0), ('1', 4.6), ('1', 5.8), ('1', 6.9), ('1', 5.4))
2 (('2', 8.3), ('2', 6.5), ('2', 6.8), ('2', 7.8), ('2', 9.2))
3 (('3', 9.3), ('3', 10.5), ('3', 8.1), ('3', 8.0), ('3', 6.9))
4 (('4', 6.1), ('4', 5.6), ('4', 3.8), ('4', 6.2), ('4', 5.8))
>>> for key, group_iter in partition_s(data, key=lambda x:x[0]):
... print(key, tuple(group_iter))
1 (('1', 4.0), ('1', 4.6), ('1', 5.8), ('1', 6.9), ('1', 5.4))
2 (('2', 8.3), ('2', 6.5), ('2', 6.8), ('2', 7.8), ('2', 9.2))
3 (('3', 9.3), ('3', 10.5), ('3', 8.1), ('3', 8.0), ('3', 6.9))
4 (('4', 6.1), ('4', 5.6), ('4', 3.8), ('4', 6.2), ('4', 5.8))
"""
mean = lambda seq: sum(seq)/len(seq)
var = lambda mean, seq: sum((x-mean)**2/mean for x in seq)
Item = Tuple[K_, float]
def summarize(
key_iter: Tuple[K_, Iterable[Item]]
) -> Tuple[K_, float, float]:
key, item_iter = key_iter
values = tuple(v for k, v in item_iter)
m = mean(values)
return key, m, var(m, values)
test_summarize = """
>>> data = [('4', 6.1), ('1', 4.0), ('2', 8.3), ('2', 6.5), ('1', 4.6),
... ('2', 6.8), ('3', 9.3), ('2', 7.8), ('2', 9.2), ('4', 5.6),
... ('3', 10.5), ('1', 5.8), ('4', 3.8), ('3', 8.1), ('3', 8.0),
... ('1', 6.9), ('3', 6.9), ('4', 6.2), ('1', 5.4), ('4', 5.8)]
>>> partition1= partition( data, key=lambda x:x[0] )
>>> groups1= map( summarize, partition1 )
>>> for g, s, s2 in groups1:
... print( g, round(s,2), round(s2,2) )
1 5.34 0.93
2 7.72 0.63
3 8.56 0.89
4 5.5 0.7
>>> partition2= partition_s( data, key=lambda x:x[0] )
>>> groups2= map( summarize, partition2 )
>>> for g, s, s2 in groups2:
... print( g, round(s,2), round(s2,2) )
1 5.34 0.93
2 7.72 0.63
3 8.56 0.89
4 5.5 0.7
"""
__test__ = {
"test_data": test_data,
"test_summarize": test_summarize,
}
def test():
import doctest
doctest.testmod(verbose=1)
if __name__ == "__main__":
test()
#performance()
| 29.121495 | 71 | 0.494223 | 577 | 3,116 | 2.582322 | 0.159445 | 0.018792 | 0.012081 | 0.010738 | 0.461745 | 0.449664 | 0.449664 | 0.432886 | 0.414765 | 0.379866 | 0 | 0.132424 | 0.200257 | 3,116 | 106 | 72 | 29.396226 | 0.46549 | 0.039795 | 0 | 0.345679 | 0 | 0.209877 | 0.577337 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.049383 | false | 0 | 0.049383 | 0 | 0.123457 | 0.049383 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
0630c031293049b621a7573b3db56b607905b6c6 | 1,117 | py | Python | photospicker/event/start_upload_event.py | l-vo/photos-picker | 6790e0411bb46e3206ca778dbd83ddd1d4f90f21 | [
"MIT"
] | null | null | null | photospicker/event/start_upload_event.py | l-vo/photos-picker | 6790e0411bb46e3206ca778dbd83ddd1d4f90f21 | [
"MIT"
] | 52 | 2018-08-31T05:57:04.000Z | 2019-02-19T15:26:40.000Z | photospicker/event/start_upload_event.py | l-vo/photos-picker | 6790e0411bb46e3206ca778dbd83ddd1d4f90f21 | [
"MIT"
] | null | null | null | class StartUploadEvent(object):
"""Event dispatched when an upload starts"""
def __init__(self, filepath, upload_file_rank, files_to_upload):
"""
Constructor
:param str filepath: file which starts to be uploaded
:param int upload_file_rank: rank of the file in upload queue
:param int files_to_upload: total files to upload count
"""
self._filepath = filepath
self._upload_file_rank = upload_file_rank
self._files_to_upload = files_to_upload
@property
def filepath(self): # pragma: no cover
"""
Getter for the file which starts to be uploaded
:type: str
"""
return self._filepath
@property
def upload_file_rank(self): # pragma: no cover
"""
Getter for the rank of the file in upload queue
:type: int
"""
return self._upload_file_rank
@property
def files_to_upload(self): # pragma: no cover
"""
Getter for the total files to upload count
:rtype: int
"""
return self._files_to_upload
| 26.595238 | 69 | 0.614145 | 139 | 1,117 | 4.690647 | 0.280576 | 0.08589 | 0.159509 | 0.078221 | 0.366564 | 0.296012 | 0.21319 | 0 | 0 | 0 | 0 | 0 | 0.316025 | 1,117 | 41 | 70 | 27.243902 | 0.853403 | 0.40376 | 0 | 0.214286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
0639d890af9f1658d5aa3ad283b2ff3b7fe8463c | 244 | py | Python | SomeParameters.py | mchtter/mucoTraining | 4f304a4fb1bdc1a63313ae31358306ce957fe6c0 | [
"MIT"
] | 1 | 2021-08-01T17:11:28.000Z | 2021-08-01T17:11:28.000Z | SomeParameters.py | mchtter/PracticePython | 4f304a4fb1bdc1a63313ae31358306ce957fe6c0 | [
"MIT"
] | null | null | null | SomeParameters.py | mchtter/PracticePython | 4f304a4fb1bdc1a63313ae31358306ce957fe6c0 | [
"MIT"
] | null | null | null | someParameters = input("Please Enter some parameters: ")
def createList(*someParameters):
paramList = []
for add in someParameters:
paramList.append(add)
print(paramList)
return paramList
createList(someParameters)
| 17.428571 | 56 | 0.709016 | 23 | 244 | 7.521739 | 0.652174 | 0.277457 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.204918 | 244 | 13 | 57 | 18.769231 | 0.891753 | 0 | 0 | 0 | 0 | 0 | 0.122951 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0 | 0 | 0.25 | 0.125 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
063ecdd8605df495112b13a2da80d77dcfb6798e | 3,151 | py | Python | tests/controllers/test_user.py | narutox900/GotItOnboardFinal | 32d4c186adb1ac0cb0cd719f4a3aa8d5e85ea07b | [
"MIT"
] | null | null | null | tests/controllers/test_user.py | narutox900/GotItOnboardFinal | 32d4c186adb1ac0cb0cd719f4a3aa8d5e85ea07b | [
"MIT"
] | null | null | null | tests/controllers/test_user.py | narutox900/GotItOnboardFinal | 32d4c186adb1ac0cb0cd719f4a3aa8d5e85ea07b | [
"MIT"
] | null | null | null | from tests.utils import request
from app.utils.messages.message import USERNAME_DUPLICATED, INVALID_CREDENTIALS
class TestRegister:
def test_register_valid(self, client):
data = {
'username': 'test@name',
'password': 'Abc@.12345'
}
rv = request.post(client, '/register', data)
assert rv.status_code == 200
def test_register_duplicate_username(self, client):
data = {
'username': 'tung',
'password': '654321'
}
rv = request.post(client, '/register', data)
assert rv.status_code == 409
assert rv.get_json()['message'] == USERNAME_DUPLICATED
def test_register_invalid_password(self, client):
data = {
'username': 'new_user',
'password': '654 321'
}
rv = request.post(client, '/register', data)
assert rv.status_code == 400
def test_register_invalid_field_type(self, client):
data = {
'username': 'new_user',
'password': 654321
}
rv = request.post(client, '/register', data)
assert rv.status_code == 400
def test_register_missing_field(self, client):
data = {
'username': 'new_user'
}
rv = request.post(client, '/register', data)
assert rv.status_code == 400
def test_register_invalid_field_length(self, client):
data = {
'username': 'u' * 100,
'password': '1232144'
}
rv = request.post(client, '/register', data)
assert rv.status_code == 400
class TestLogin:
def test_login_valid(self, client):
data = {
'username': 'tung',
'password': '123456'
}
rv = request.post(client, '/login', data)
assert rv.status_code == 200
assert rv.get_json()['access_token']
def test_login_wrong_password(self, client):
data = {
'username': 'tung',
'password': '111111'
}
rv = request.post(client, '/login', data)
assert rv.status_code == 401
assert rv.get_json()['message'] == INVALID_CREDENTIALS
def test_login_wrong_username(self, client):
data = {
'username': 'wrong',
'password': '111111'
}
rv = request.post(client, '/login', data)
assert rv.status_code == 401
assert rv.get_json()['message'] == INVALID_CREDENTIALS
def test_login_missing_field(self, client):
data = {
'username': 'tung'
}
rv = request.post(client, '/login', data)
assert rv.status_code == 400
def test_login_invalid_field_type(self, client):
data = {
'username': 'tung',
'password': 123456
}
rv = request.post(client, '/login', data)
assert rv.status_code == 400
def test_login_unknown_field(self, client):
data = {
'username': 'tung',
'password': '123456',
'valid': True
}
rv = request.post(client, '/login', data)
assert rv.status_code == 400
| 29.726415 | 79 | 0.550619 | 328 | 3,151 | 5.10061 | 0.179878 | 0.076509 | 0.100418 | 0.1578 | 0.780634 | 0.716079 | 0.631201 | 0.555888 | 0.555888 | 0.555888 | 0 | 0.046523 | 0.324659 | 3,151 | 105 | 80 | 30.009524 | 0.739662 | 0 | 0 | 0.527473 | 0 | 0 | 0.133926 | 0 | 0 | 0 | 0 | 0 | 0.175824 | 1 | 0.131868 | false | 0.131868 | 0.021978 | 0 | 0.175824 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
06485e93e5d509808935b9e7dff59c8e973fb02c | 1,228 | py | Python | initialisations/onoda_base.py | simonharris/pycluster | 4d47eb12a2bbaf1b05d7ccfd0cfc9ccf78ddf86d | [
"MIT"
] | 1 | 2019-05-01T00:10:12.000Z | 2019-05-01T00:10:12.000Z | initialisations/onoda_base.py | simonharris/pycluster | 4d47eb12a2bbaf1b05d7ccfd0cfc9ccf78ddf86d | [
"MIT"
] | 3 | 2020-11-12T12:36:00.000Z | 2021-06-18T12:46:59.000Z | initialisations/onoda_base.py | simonharris/pycluster | 4d47eb12a2bbaf1b05d7ccfd0cfc9ccf78ddf86d | [
"MIT"
] | 1 | 2021-12-30T01:32:32.000Z | 2021-12-30T01:32:32.000Z | """
Onoda 2012 ICA- and PCA-based algorithm
See: Careful seeding method based on independent components analysis for
k-means clustering
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.663.5343&rep=rep1&type=pdf#page=53
"""
from abc import abstractmethod
import numpy as np
from initialisations.base import Initialisation
class Onoda(Initialisation):
"""Base class for the two Onoda 2012 initialisation algorithms"""
def _find_centroids(self, components) -> np.array:
"""Step 1b from the algorithms"""
centroids = []
for component in components:
distances = [self._calc_distance(x, component) for x in self._data]
centroids.append(self._data[np.argmin(distances)])
return np.array(centroids)
@staticmethod
def _calc_distance(row, component):
"""Used in Step 1b from the algorithms"""
mag = np.linalg.norm
return np.dot(component, row) / (mag(component) * mag(row))
@staticmethod
@abstractmethod
def _find_components() -> np.array:
"""Each algorithm must implement this"""
def find_centers(self):
"""Main method"""
return self._find_centroids(self._find_components())
| 26.12766 | 91 | 0.678339 | 154 | 1,228 | 5.311688 | 0.525974 | 0.025672 | 0.041565 | 0.031785 | 0.056235 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02487 | 0.214169 | 1,228 | 46 | 92 | 26.695652 | 0.822798 | 0.322476 | 0 | 0.105263 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.210526 | false | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
0649cdda8f8c70edab2be6582f4b188914304838 | 352 | py | Python | desafio32.py | lucasmc64/Curso_de_Python_CeV | aed942828913ff405941a7d86fb65ddcc79c414d | [
"MIT"
] | 1 | 2021-02-19T05:13:32.000Z | 2021-02-19T05:13:32.000Z | desafio32.py | lucasmc64/python_cev | aed942828913ff405941a7d86fb65ddcc79c414d | [
"MIT"
] | null | null | null | desafio32.py | lucasmc64/python_cev | aed942828913ff405941a7d86fb65ddcc79c414d | [
"MIT"
] | null | null | null | from datetime import date
print('{} DESAFIO 32 {}'.format('='*10, '='*10))
ano = int(input('Digite um ano qualquer (Ou 0 se quiser a análise do ano atual): '))
if ano == 0:
ano = date.today().year
if ano % 4 == 0 and ano != 100 or ano % 400 == 0:
print('O ano {} é BISSEXTO!'.format(ano))
else:
print('O ano {} NÃO é BISSEXTO!'.format(ano)) | 39.111111 | 84 | 0.605114 | 60 | 352 | 3.55 | 0.6 | 0.046948 | 0.084507 | 0.169014 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.060498 | 0.201705 | 352 | 9 | 85 | 39.111111 | 0.697509 | 0 | 0 | 0 | 0 | 0 | 0.356941 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.111111 | 0 | 0.111111 | 0.333333 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
067e8be4afa8c1e0f21a19069097a81d4d0a42be | 640 | py | Python | annotation/migrations/0010_one_off_recalculate_sample_stats.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | 5 | 2021-01-14T03:34:42.000Z | 2022-03-07T15:34:18.000Z | annotation/migrations/0010_one_off_recalculate_sample_stats.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | 551 | 2020-10-19T00:02:38.000Z | 2022-03-30T02:18:22.000Z | annotation/migrations/0010_one_off_recalculate_sample_stats.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | null | null | null | # Generated by Django 3.1 on 2020-11-23 02:24
from django.db import migrations
from manual.operations.manual_operations import ManualOperation
def test_has_sample_stats(apps):
SampleVariantAnnotationStats = apps.get_model("annotation", "SampleVariantAnnotationStats")
return SampleVariantAnnotationStats.objects.all().exists()
class Migration(migrations.Migration):
dependencies = [
('annotation', '0009_vcfannotationstats'),
]
operations = [
ManualOperation(task_id=ManualOperation.task_id_manage(["calculate_sample_stats", "--clear"]),
test=test_has_sample_stats)
]
| 27.826087 | 102 | 0.729688 | 65 | 640 | 6.969231 | 0.646154 | 0.072848 | 0.057395 | 0.07947 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.034026 | 0.173438 | 640 | 22 | 103 | 29.090909 | 0.822306 | 0.067188 | 0 | 0 | 1 | 0 | 0.168067 | 0.122689 | 0 | 0 | 0 | 0 | 0 | 1 | 0.076923 | false | 0 | 0.153846 | 0 | 0.538462 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
0686b03cca2f9fa7f733a95e78be40d62eb48d7e | 11,347 | py | Python | forNSF/generate_schedules.py | ctames/conference-host | 2e4c9733629053ac381669339bb6139ca6f38efa | [
"MIT"
] | 1 | 2016-02-15T11:34:36.000Z | 2016-02-15T11:34:36.000Z | forNSF/generate_schedules.py | ctames/conference-host | 2e4c9733629053ac381669339bb6139ca6f38efa | [
"MIT"
] | null | null | null | forNSF/generate_schedules.py | ctames/conference-host | 2e4c9733629053ac381669339bb6139ca6f38efa | [
"MIT"
] | null | null | null | ###
### generate_schedules.py
###
import os
import sys
import csv
import random
import datetime
from utils import LogWarning, LogMessage
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webApp.settings")
django.setup()
from django.shortcuts import render
from django.db import transaction
from webApp.models import NSFInvestigator, NSFProject, ProjectPIs, CollabProjects, \
Organizations, Programs, Words, Institutions, \
RapidMeeting, PosterPresenters, BreakoutParticipant
import json
from pprint import pprint
def generate_row(time, room, event):
return "\\row{" + time + "}{" + room + "}{" + event + "}\n"
def generate_brow(time, room, event):
return "\\brow{" + time + "}{" + room + "}{" + event + "}\n"
def generate_prow(time, room, event):
return "\\prow{" + time + "}{" + room + "}{" + event + "}\n"
def generate_block(msg):
return "\\end{tabular} \\begin{addmargin}[2em]{2em}\\small\n" + msg + "\\end{addmargin} \\begin{tabular}{x{1.5in}x{1.5in}x{3.5in}}"
def latex_schedule(pi, rm, poster, breakout1, breakout2, breakout3,
breakoutleader, breakout1leader, breakout2leader, breakout3leader):
LogMessage("Schedule for: " + pi.email + " . " + str(pi.id))
msg = """
\\documentclass[11pt, letterpaper]{article}
\\input{preamble.tex}
\\begin{document}
\\begin{center}
"""
msg += "{\\colorbox{black}{\\parbox{\\dimexpr\\textwidth-2\\fboxsep\\relax}{\\centering\\textcolor{white}{\\quad {\\large Schedule for {\\bf " + pi.displayName() + "}}}}}}\n"
msg += """
\\end{center}
Welcome to the National Science Foundation Secure and Trustworthy
Cyberspace (SaTC) Principal Investigators' Meeting! Your personal
schedule is below. See the conference program or website for more
details. You can also find a web version of your personal schedule
at: \\begin{center}\\url{http://www.rematchr.org/schedule/"""
msg += pi.email + "}\\end{center}\n\n"
msg += "\\bday{Monday 5 January 2015}{\n"
msg += generate_row('8:30-9:15am', 'Regency EF', 'Welcome: Jim Kurose and Jeryl Mumpower (NSF)')
msg += generate_row('9:15-10:30am', 'Regency EF', 'Keynote: \\ptitle{What\'s on the Horizon?}, Latanya Sweeney (Harvard University)')
msg += generate_brow('10:30-11:00am','Regency Foyer','Break')
msg += generate_row('11am-12:15pm','Regency EF','Panel: \\ptitle{Ethics in Security and Privacy Research} (Michael Bailey, Lujo Bauer, Stevan Savage; Rahul Telang)')
msg += generate_brow('12:15-1:30pm','Independence Center','Lunch')
if breakout1:
msg += generate_prow('1:30-3:00pm', breakout1.location, 'Breakout ' + str(breakout1.number) + ": \\ptitle{" + breakout1.title + '}')
if breakout1leader:
print "**** BREAKOUT LEADER ****"
msg += generate_block('Thank you for leading this breakout discussion. You should find the room set up with a projector and screen, flip chart, and power strips. If you need anything else for your breakout, please let the conference staff know right away.')
else:
msg += generate_row('1:30-3:00pm','Regency EF', 'Panel: \\title{Educating Everyone} (Diana Burley, Shriram Krishnamurthi, Zachary Peterson; Victor Piotrowski)')
msg += generate_brow('3:00-3:30pm','Regency Foyer','Break')
if rm:
msg += generate_prow('3:30-5:15pm', '{\\em various locations}',
'Rapid-Fire Cross Collaborations')
for rfm in rm:
if rfm.round == 1: time = "3:30-3:50pm"
elif rfm.round == 2: time = "3:55-4:15pm"
elif rfm.round == 3: time = "4:20-4:40pm"
elif rfm.round == 4: time = "4:45-5:15pm"
else: assert False
msg += generate_row(time, rfm.latexLocation(), ', '.join([pi.displayNameInst() for pi in rfm.getParticipants()]))
msg += generate_block("""
The goal of the rapid-fire cross collaborations is to instigate
discussions that would not otherwise happen and that may lead to
useful collaborations, or at least gaining insights and contacts. The
matches were generated according to several different criteria: (1)
expertise-interest compatibility (based on registration forms you
submited), (2) selfishly serving one individuals interests as well as
possible, (3) similar topics based on text analysis of NSF abstracts,
and (4) dis-similar topics based on text analysis of NSF abstract.
The matches you have may not cover all of these criteria, they are
selected to maximize some overall metrics. After the meeting, you'll
be able to see why you were matched for each meeting round. If you
are at a loss for how to get a conversation going, you can try to
figure out which of the four criteria were the reason you were
matched.
""")
else:
msg += generate_block("No rapid-fire cross collaborations scheduled. If you would like to participate in ad-hoc rapid matching, go to headquarters in Regency EF.")
if poster:
msg += generate_prow('6:00-8:00pm', 'Independence Center', 'Present poster: \\ptitle{' + poster.title + '}')
msg += generate_block("Easels and poster boards will be provided. Poster locations are not assigned; you may set up your poster at any open location.")
else:
msg += generate_row('6:00-8:00pm', 'Independence Center', 'Poster Session and Reception')
msg += "} \n" # end dayschedule
msg += "\\clearpage\n"
msg += "\\bday{Tuesday 6 January 2015}{\n"
msg += generate_row('8:30-9:00am', 'Regency EF', 'Opening: Keith Marzullo and Michael Vogelius (NSF)')
msg += generate_row('9:00-9:15am', 'Regency EF', 'SaTC Programmatics, Jeremy Epstein (NSF)')
msg += generate_row('9:15-10:30am','Regency EF', 'Keynote: \\ptitle{T.S. Kuhn Revisited}, Dan Geer (In-Q-Tel)')
msg += generate_brow('10:30-11:00am','Regency Foyer','Break')
msg += generate_row('11am-12:15pm', 'Regency EF', 'Panel: Ideas to Innovations (Farnam Jahanian, Angelos Stavrou, Giovanni Vigna; Patrick Traynor)')
msg += generate_brow('12:15-1:30pm', 'Independence Center', 'Lunch')
if breakout2:
msg += generate_prow('1:30-3:00pm', breakout2.location, 'Breakout ' + str(breakout2.number) + ": \\ptitle{" + breakout2.title + '}')
if breakout2leader:
print "**** BREAKOUT LEADER ****"
msg += generate_block('Thank you for leading this breakout discussion. You should find the room set up with a projector and screen, flip chart, and power strips. If you need anything else for your breakout, please let the conference staff know right away.')
else:
msg += generate_row('1:30-3:00pm', 'Regency EF', 'Panel: \\ptitle{Security and Privacy Challenges in Health Informatics} (Xiaoqian Jiang, David Kotz, XiaoFeng Wang; Elaine Shi)')
msg += generate_brow('3:00-3:30pm','Regency Foyer', 'Break')
if breakout3:
msg += generate_prow('1:30-3:00pm', breakout3.location, 'Breakout ' + str(breakout3.number) + ": \\ptitle{" + breakout3.title + '}')
if breakout3leader:
print "**** BREAKOUT LEADER ****"
msg += generate_block('Thank you for leading this breakout discussion. You should find the room set up with a projector and screen, flip chart, and power strips. If you need anything else for your breakout, please let the conference staff know right away.')
else:
msg += generate_row('3:30-5:00pm','Regency EF', 'Panel: \\ptitle{Future of Privacy} (Tamara Denning, Apu Kapadia, Arvind Narayanan; Christopher Clifton)')
msg += generate_row('5:30-7:30pm','Potomac Rooms','Birds-of-a-Feather Sessions (signup to host a BoF at the registration desk)')
msg += "} \n" # end dayschedule
msg += "\\par \n \\par \n"
msg += "\\bday{Wednesday 7 January 2015}{\n"
msg += generate_row('8:30-9:15am','Regency EF','Opening: Pramod Khargonekar and Joan Ferrini-Mundy (NSF)')
msg += generate_row('9:15-10:30am','Regency EF','Keynote: \\ptitle{The Coming Design Wars}, Deirdre Mulligan (UC Berkeley)')
if breakoutleader:
msg += generate_block('As breakout leader, you or someone else representing your breakout should be prepared to present a 4-minute report on your breakout in the 11am session. Please send slides for this as a simple PowerPoint file with no fancy template to {\\tt evans@virginia.edu} or get them to me on a USB stick before 10:30am (preferably earlier!). Breakout leaders will present in order by breakout number, and the slides will be combined to avoid presentation transitions.')
msg += generate_brow('10:30-11:00am','Regency Foyer','Break')
msg += generate_row('11am-12:15pm', 'Regency EF', 'Results of Breakout Discussions')
msg += generate_row('12:15-1:30pm', 'Independence Center', 'Lunch')
msg += generate_row('1:30-2:45pm', 'Regency EF', 'Panel: \\ptitle{SaTC 2029?} (Carl Landwehr, Patrick McDaniel, Amit Sahai; David Evans)')
msg += generate_row('2:45-3:00pm','Regency EF','Closing')
msg += "} \n" # end dayschedule
msg += "\\end{document}"
return msg
def schedule(pi):
rm = RapidMeeting.objects.filter(pi1=pi) | RapidMeeting.objects.filter(pi2=pi) | RapidMeeting.objects.filter(pi3=pi) | RapidMeeting.objects.filter(pi4=pi)
rm = rm.order_by('round')
# LogMessage("rapid meeting 1: " + ' / '.join([m.displayMeeting() for m in rm]))
# lots of sanity checking to do here...
posterobj = PosterPresenters.objects.filter(presenter=pi)
if posterobj:
poster = posterobj[0].poster
else:
poster = None
breakout1 = None
breakout2 = None
breakout3 = None
breakoutleader = False
breakout1leader = False
breakout2leader = False
breakout3leader = False
breakouts = BreakoutParticipant.objects.filter(pi=pi)
for bobj in breakouts:
breakout = bobj.breakout
leader = bobj.leader
if leader:
breakoutleader = True
if breakout.session == 1:
assert not breakout1
breakout1 = breakout
breakout1leader = leader
elif breakout.session == 2:
assert not breakout2
breakout2 = breakout
breakout2leader = leader
elif breakout.session == 3:
assert not breakout3
breakout3 = breakout
breakout3leader = leader
else:
LogWarning("Bad breakout session: " + breakout.title)
return latex_schedule(pi, rm, poster, breakout1, breakout2, breakout3, breakoutleader,
breakout1leader, breakout2leader, breakout3leader)
def generate_schedule(no, attendee):
msg = schedule(attendee)
fname = 'schedules/schedule-' + "%03d" % no + "-" + str(attendee.id) + '.tex'
print "Writing schedule for " + attendee.displayName() + " to " + fname + "..."
with open(fname, "w") as file:
file.write(msg)
def generate_schedules():
attendees = NSFInvestigator.objects.filter(attendee=True).order_by('lastname','firstname')
count = 1
for attendee in attendees:
if not attendee.email:
LogMessage("Bad pi: " + str(attendee.id))
continue
generate_schedule(count, attendee)
count += 1
# if count > 100:
# break # one for now
if __name__ == "__main__":
generate_schedules()
| 49.334783 | 492 | 0.664228 | 1,483 | 11,347 | 5.041133 | 0.333109 | 0.055912 | 0.035581 | 0.00535 | 0.279428 | 0.262306 | 0.245318 | 0.231808 | 0.22191 | 0.217897 | 0 | 0.035452 | 0.207015 | 11,347 | 229 | 493 | 49.550218 | 0.795399 | 0.021151 | 0 | 0.125683 | 1 | 0.10929 | 0.494725 | 0.024168 | 0.005464 | 0 | 0 | 0 | 0.021858 | 0 | null | null | 0 | 0.065574 | null | null | 0.027322 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
0688236063b026668c8b71a36def9914a68bb227 | 1,017 | py | Python | layerindex/middleware.py | epyeoh/clear-linux-dissector-web | 6c8d3b73aad5a9364555711c6cc709ef8054427d | [
"MIT"
] | null | null | null | layerindex/middleware.py | epyeoh/clear-linux-dissector-web | 6c8d3b73aad5a9364555711c6cc709ef8054427d | [
"MIT"
] | null | null | null | layerindex/middleware.py | epyeoh/clear-linux-dissector-web | 6c8d3b73aad5a9364555711c6cc709ef8054427d | [
"MIT"
] | null | null | null | # layerindex-web - middleware definitions
#
# Copyright (C) 2019 Intel Corporation
#
# Licensed under the MIT license, see COPYING.MIT for details
from django.utils.deprecation import MiddlewareMixin
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
import settings
import re
class LoginRequiredMiddleware(MiddlewareMixin):
"""
Middleware that requires a user to be authenticated to view any page.
Exemptions to this requirement can optionally be specified
in settings via a list of regular expressions in LOGIN_EXEMPT_URLS.
"""
def process_request(self, request):
try:
if not request.user.is_authenticated:
path = request.path_info
if (not any(re.compile(m).match(path) for m in settings.LOGIN_EXEMPT_URLS)) and not reverse('login') == path:
return HttpResponseRedirect(reverse('login'))
except AttributeError:
return HttpResponseRedirect(reverse('login'))
| 36.321429 | 125 | 0.716814 | 121 | 1,017 | 5.966942 | 0.619835 | 0.041551 | 0.041551 | 0.105263 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005019 | 0.216323 | 1,017 | 27 | 126 | 37.666667 | 0.900878 | 0.328417 | 0 | 0.142857 | 0 | 0 | 0.022936 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.071429 | false | 0 | 0.357143 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
068f358bbc6a1ec37d2b005f27788d30142795b4 | 5,966 | py | Python | pegleg/engine/exceptions.py | openstack/airship-pegleg | cbc87967ebd572463a893b03097b615b99d9dbcf | [
"Apache-2.0"
] | 9 | 2018-06-20T20:16:29.000Z | 2019-03-24T23:07:25.000Z | pegleg/engine/exceptions.py | openstack/airship-pegleg | cbc87967ebd572463a893b03097b615b99d9dbcf | [
"Apache-2.0"
] | 8 | 2020-11-16T16:22:58.000Z | 2021-05-14T13:29:45.000Z | pegleg/engine/exceptions.py | airshipit/pegle | 772d3a47a6db425be8249f770a732dbad4e00b08 | [
"Apache-2.0"
] | 2 | 2020-03-02T13:53:53.000Z | 2021-07-19T05:02:13.000Z | # Copyright 2018 AT&T Intellectual Property. All other rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
__all__ = (
'PeglegBaseException', 'GitException', 'GitAuthException',
'GitProxyException', 'GitSSHException', 'GitConfigException',
'GitInvalidRepoException')
LOG = logging.getLogger(__name__)
class PeglegBaseException(Exception):
"""The base Pegleg exception for everything."""
message = "Base Pegleg exception"
def __init__(self, message=None, **kwargs):
self.message = message or self.message
try:
self.message = self.message.format(**kwargs)
except KeyError:
LOG.warning("Missing kwargs")
super().__init__(self.message)
class GitException(PeglegBaseException):
"""Exception when an error occurs cloning a Git repository."""
message = (
'Git exception occurred: [%(location)s] may not be a valid '
'git repository. Details: %(details)s')
class GitAuthException(PeglegBaseException):
"""Exception that occurs when authentication fails for cloning a repo."""
message = (
'Failed to authenticate for repo %(repo_url)s with ssh-key '
'at path %(ssh_key_path)s')
class GitProxyException(PeglegBaseException):
"""Exception when cloning through proxy."""
message = 'Could not resolve proxy [%(location)s]'
class GitSSHException(PeglegBaseException):
"""Exception that occurs when an SSH key could not be found."""
message = 'Failed to find specified SSH key: %(ssh_key_path)s'
class GitConfigException(PeglegBaseException):
"""Exception that occurs when reading Git repo config fails."""
message = 'Failed to read Git config file for repo path: %(repo_url)s'
class GitInvalidRepoException(PeglegBaseException):
"""Exception raised when an invalid repository is detected."""
message = 'The repository path or URL is invalid: %(repo_url)s'
class GitMissingUserException(PeglegBaseException):
"""Exception raised when a username is required, but not provided."""
message = 'Repo URL %(url)s requires a username, but none was provided.'
#
# PKI EXCEPTIONS
#
class IncompletePKIPairError(PeglegBaseException):
"""Exception for incomplete private/public keypair."""
message = ("Incomplete keypair set %(kinds)s for name: %(name)s")
class PassphraseCatalogNotFoundException(PeglegBaseException):
"""Failed to find Catalog for Passphrases generation."""
message = (
'Could not find the Passphrase Catalog to generate '
'the site Passphrases!')
class InvalidPassphraseType(PeglegBaseException):
"""Invalid Passphrase type"""
message = (
'Invalid Passphrase type %(ptype)s specified for %(pname)s. Valid '
'values are: %(validvalues)s.')
class InvalidPassphrasePrompt(PeglegBaseException):
"""Invalid Passphrase prompt field"""
message = (
'Invalid Passphrase prompt %(pprompt)s specified for %(pname)s. Valid '
'values are: %(validvalues)s.')
class InvalidPassphraseRegeneration(PeglegBaseException):
"""Invalid Regenerable value for entry in passphrase-catalog"""
message = (
'Invalid Regenerable value %(pregen)s specified for %(pname)s. Valid '
'values are: %(validvalues)s.')
class InvalidPassphraseProfile(PeglegBaseException):
"""Invalid Passphrase profile field"""
message = (
'Invalid Passphrase profile %(pprofile)s specified. '
'Valid values are: %(validvalues)s.')
class GenesisBundleEncryptionException(PeglegBaseException):
"""Exception raised when encryption of the genesis bundle fails."""
message = 'Encryption is required for genesis bundle, but no encryption ' \
'policy or key is specified.'
class GenesisBundleGenerateException(PeglegBaseException):
"""
Exception raised when pormenade engine fails to build the genesis
bundle.
"""
message = 'Bundle generation failed on deckhand validation.'
class PKICertificateInvalidDuration(PeglegBaseException):
"""Exception for invalid duration of PKI Certificate."""
message = (
'Provided duration is invalid. Certificate durations must be '
'a positive integer.')
#
# CREDENTIALS EXCEPTIONS
#
class PassphraseNotFoundException(PeglegBaseException):
"""Exception raised when passphrase is not set."""
message = 'PEGLEG_PASSPHRASE must be set'
class PassphraseInsufficientLengthException(PeglegBaseException):
"""Exception raised when passphrase is too short."""
message = 'PEGLEG_PASSPHRASE must be at least 24 characters long.'
class SaltNotFoundException(PeglegBaseException):
"""Exception raised when salt is not set."""
message = 'PEGLEG_SALT must be set'
class SaltInsufficientLengthException(PeglegBaseException):
"""Exception raised when salt is too short."""
message = 'PEGLEG_SALT must be at least 24 characters long.'
class GlobalCredentialsNotFound(PeglegBaseException):
"""Exception raised when global_passphrase or global_salt are not found."""
message = (
'global_salt and global_passphrase must either both be '
'defined, or neither can be defined in site documents.')
#
# Shipyard Helper Exceptions
#
class InvalidBufferModeException(PeglegBaseException):
"""Exception raised when invalid buffer mode specified"""
message = 'BUFFER MODE must be one of: append, auto, replace'
| 31.072917 | 79 | 0.717399 | 654 | 5,966 | 6.496942 | 0.336391 | 0.118616 | 0.080019 | 0.089433 | 0.168275 | 0.102848 | 0.051306 | 0.051306 | 0.035302 | 0.035302 | 0 | 0.002484 | 0.190245 | 5,966 | 191 | 80 | 31.235602 | 0.877044 | 0.306403 | 0 | 0.153846 | 0 | 0 | 0.402809 | 0.005769 | 0 | 0 | 0 | 0 | 0 | 1 | 0.012821 | false | 0.192308 | 0.012821 | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
06994dc529d119cd048cde8599a924af3fbe88a6 | 75 | py | Python | yahoo_weather/classes/errors.py | M-Ahadi/yahoo_weather | f494c38c38fd664a8ffc6440180775db135ba25a | [
"Apache-2.0"
] | 7 | 2019-01-29T00:59:20.000Z | 2020-08-25T22:41:00.000Z | yahoo_weather/classes/errors.py | M-Ahadi/yahoo_weather | f494c38c38fd664a8ffc6440180775db135ba25a | [
"Apache-2.0"
] | 3 | 2019-03-19T18:21:37.000Z | 2022-02-11T16:25:02.000Z | yahoo_weather/classes/errors.py | M-Ahadi/yahoo_weather | f494c38c38fd664a8ffc6440180775db135ba25a | [
"Apache-2.0"
] | 2 | 2019-04-03T20:45:46.000Z | 2020-10-01T10:56:47.000Z | class Error:
unacceptable_json = "json input has unacceptable format."
| 25 | 61 | 0.76 | 9 | 75 | 6.222222 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.173333 | 75 | 2 | 62 | 37.5 | 0.903226 | 0 | 0 | 0 | 0 | 0 | 0.466667 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
06aa6e05d78ea1d89749a172d432589f604dcbef | 502 | py | Python | tests/stub.py | rafa-acioly/circuitpy | 662f6ab5e85465dfde2217c3880af65d44e28219 | [
"MIT"
] | null | null | null | tests/stub.py | rafa-acioly/circuitpy | 662f6ab5e85465dfde2217c3880af65d44e28219 | [
"MIT"
] | null | null | null | tests/stub.py | rafa-acioly/circuitpy | 662f6ab5e85465dfde2217c3880af65d44e28219 | [
"MIT"
] | null | null | null | from circuitpy.base import BaseCircuitBreaker
class StubStorage:
errors_quantity: int = 0
def increment(self, key: str) -> int:
self.errors_quantity += 1
def expire(self, key: str, ttl: int) -> None:
pass
def get(self, key: str) -> int:
return self.errors_quantity
class StubHandler(BaseCircuitBreaker):
storage = StubStorage()
expected_exception = (Exception,)
failure_threshold = 0
recovery_timeout = 1
failure_key = "myhandler_cb"
| 20.916667 | 49 | 0.667331 | 58 | 502 | 5.637931 | 0.568966 | 0.12844 | 0.091743 | 0.079511 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010499 | 0.241036 | 502 | 23 | 50 | 21.826087 | 0.847769 | 0 | 0 | 0 | 0 | 0 | 0.023904 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0.066667 | 0.066667 | 0.066667 | 0.866667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
06aab1746815047f64a7083110f6ed3040f75904 | 3,685 | py | Python | dltb/thirdparty/tensorflow/v1.py | CogSciUOS/DeepLearningToolbox | bf07578b9486d8c48e25df357bc4b9963b513b46 | [
"MIT"
] | 2 | 2019-09-01T01:38:59.000Z | 2020-02-13T19:25:51.000Z | dltb/thirdparty/tensorflow/v1.py | CogSciUOS/DeepLearningToolbox | bf07578b9486d8c48e25df357bc4b9963b513b46 | [
"MIT"
] | null | null | null | dltb/thirdparty/tensorflow/v1.py | CogSciUOS/DeepLearningToolbox | bf07578b9486d8c48e25df357bc4b9963b513b46 | [
"MIT"
] | null | null | null | """Tensorflow version 1 access module.
from dltb.thirdparty.tensorflow.v1 import tensorflow as tf
"""
import sys
import logging
import tensorflow # pylint: disable=wrong-import-position
from . import TF_LOGGER
def disable_v2_behavior():
"""Disables TensorFlow 2.x behaviors.
This function can be called at the beginning of the program
(before `Tensors`, `Graphs` or other structures have been created,
and before devices have been initialized. It switches all global
behaviors that are different between TensorFlow 1.x and 2.x to
behave as intended for 1.x.
User can call this function to disable 2.x behavior during complex
migrations.
"""
from tensorflow.python import tf2
from tensorflow.python.data.experimental.ops import counter
from tensorflow.python.data.experimental.ops import interleave_ops
from tensorflow.python.data.experimental.ops import random_ops
from tensorflow.python.data.experimental.ops import readers as exp_readers
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.data.ops import readers
from tensorflow.python.eager import monitoring
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
from tensorflow.python.ops import control_flow_v2_toggles
from tensorflow.python.ops import variable_scope
# _v2_behavior_usage_gauge.get_cell("disable").set(True)
tf2.disable()
ops.disable_eager_execution()
tensor_shape.disable_v2_tensorshape() # Also switched by tf2
# FIXME[bug]:
# Warning: disable_resource_variables (from
# tensorflow.python.ops.variable_scope) is deprecated and will be
# removed in a future version.
# Instructions for updating:
# non-resource variables are not supported in the long term
#
# The function tf.compat.v1.disable_resource_variables() is
# depreciated instead you can mention use_resource=False in
# tf.get_variable() which will be forced to true when eager excecution
# is enabled by default in Tensorflow 2.x.
# variable_scope.disable_resource_variables()
ops.disable_tensor_equality()
# Disables TensorArrayV2 and control flow V2.
control_flow_v2_toggles.disable_control_flow_v2()
# Make sure internal uses of tf.data symbols map to V1 versions.
dataset_ops.Dataset = dataset_ops.DatasetV1
readers.FixedLengthRecordDataset = readers.FixedLengthRecordDatasetV1
readers.TFRecordDataset = readers.TFRecordDatasetV1
readers.TextLineDataset = readers.TextLineDatasetV1
counter.Counter = counter.CounterV1
interleave_ops.choose_from_datasets = \
interleave_ops.choose_from_datasets_v1
interleave_ops.sample_from_datasets = \
interleave_ops.sample_from_datasets_v1
random_ops.RandomDataset = random_ops.RandomDatasetV1
exp_readers.CsvDataset = exp_readers.CsvDatasetV1
exp_readers.SqlDataset = exp_readers.SqlDatasetV1
exp_readers.make_batched_features_dataset = (
exp_readers.make_batched_features_dataset_v1)
exp_readers.make_csv_dataset = exp_readers.make_csv_dataset_v1
if hasattr(tensorflow, 'compat'):
v1 = getattr(tensorflow.compat, 'v1', None)
v2 = getattr(tensorflow.compat, 'v2', None)
# v1.disable_v2_behavior()
old_level = TF_LOGGER.level
TF_LOGGER.setLevel(logging.ERROR)
disable_v2_behavior()
TF_LOGGER.setLevel(old_level)
else:
v1 = tensorflow
v2 = None # pylint: disable=invalid-name
tensorflow = v1
# FIXME[hack]: this following line will make subsequent imports of
# tensorflow use the v1 interface
sys.modules['tensorflow'] = tensorflow
del v1, v2
| 37.989691 | 78 | 0.762551 | 480 | 3,685 | 5.672917 | 0.36875 | 0.066838 | 0.095483 | 0.052883 | 0.230261 | 0.118986 | 0.068307 | 0.035255 | 0 | 0 | 0 | 0.015087 | 0.172592 | 3,685 | 96 | 79 | 38.385417 | 0.877993 | 0.374763 | 0 | 0 | 0 | 0 | 0.008933 | 0 | 0 | 0 | 0 | 0.010417 | 0 | 1 | 0.02 | false | 0 | 0.32 | 0 | 0.34 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
ebea7320990078c4f8375fac844740a2e65257c5 | 292 | py | Python | CalibPPS/ESProducers/python/ctppsRPAlignmentCorrectionsDataESSourceXML_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | CalibPPS/ESProducers/python/ctppsRPAlignmentCorrectionsDataESSourceXML_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | CalibPPS/ESProducers/python/ctppsRPAlignmentCorrectionsDataESSourceXML_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
ctppsRPAlignmentCorrectionsDataESSourceXML = cms.ESSource("CTPPSRPAlignmentCorrectionsDataESSourceXML",
verbosity = cms.untracked.uint32(0),
MeasuredFiles = cms.vstring(),
RealFiles = cms.vstring(),
MisalignedFiles = cms.vstring()
)
| 29.2 | 103 | 0.770548 | 24 | 292 | 9.375 | 0.666667 | 0.133333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011811 | 0.130137 | 292 | 9 | 104 | 32.444444 | 0.874016 | 0 | 0 | 0 | 0 | 0 | 0.143836 | 0.143836 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.142857 | 0 | 0.142857 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
ebf258292ec6f531c1895de34a95ec5e6cf95285 | 6,183 | py | Python | approval_system/forms.py | rmboot/approvalsystem | b084ecb5fa4b401a052f3cf2a307af1d55f3c8fc | [
"MIT"
] | 3 | 2019-04-16T04:11:11.000Z | 2021-09-19T02:38:49.000Z | approval_system/forms.py | rmboot/approvalsystem | b084ecb5fa4b401a052f3cf2a307af1d55f3c8fc | [
"MIT"
] | 4 | 2019-06-04T11:14:22.000Z | 2021-09-08T01:11:26.000Z | approval_system/forms.py | rmboot/approvalsystem | b084ecb5fa4b401a052f3cf2a307af1d55f3c8fc | [
"MIT"
] | 4 | 2019-10-10T15:04:31.000Z | 2021-06-19T17:03:06.000Z | from flask_login import current_user
from flask_wtf import FlaskForm
from flask_ckeditor import CKEditorField
from flask_wtf.file import FileField, FileAllowed, FileRequired
from wtforms import StringField, SubmitField, BooleanField, PasswordField, SelectField, TextAreaField
from wtforms.validators import DataRequired, Regexp, Length, EqualTo, ValidationError
from approval_system.extensions import archives
from approval_system.models import User, Dept, Role
class LoginForm(FlaskForm):
number = StringField('学号/工号', validators=[DataRequired(), Length(8, 12)])
password = PasswordField('密码', validators=[DataRequired(), Length(1, 100)])
remember = BooleanField()
submit = SubmitField('登录')
class RegisterForm(FlaskForm):
number = StringField('学号', validators=[DataRequired(), Length(12, 12), Regexp('^[0-9]*$', message='学号只能包含0-9')])
name = StringField('姓名', validators=[DataRequired(), Length(1, 60)])
dept_id = SelectField('学院', coerce=int, validators=[DataRequired()])
phone = StringField('手机号', validators=[DataRequired(), Length(11, 11)])
password = PasswordField('密码', validators=[DataRequired(), Length(1, 100), EqualTo('password1')])
password1 = PasswordField('确认密码', validators=[DataRequired(), Length(1, 100)])
submit = SubmitField('注册')
def __init__(self, *args, **kwargs):
super(RegisterForm, self).__init__(*args, **kwargs)
self.dept_id.choices = [(dept.id, dept.name) for dept in Dept.query.filter(Dept.id > 1).all()]
def validate_number(self, field):
if User.query.filter_by(number=field.data).first():
raise ValidationError('该学号已经被注册')
class RegisterAdminForm(FlaskForm):
number = StringField('工号', validators=[DataRequired(), Length(8, 8), Regexp('^[0-9]*$', message='工号只能包含0-9')])
name = StringField('姓名', validators=[DataRequired(), Length(1, 60)])
dept_id = SelectField('学院/部门', coerce=int, validators=[DataRequired()])
role_id = SelectField('角色', coerce=int, validators=[DataRequired()])
phone = StringField('手机号', validators=[DataRequired(), Length(11, 11)])
password = PasswordField('密码', validators=[DataRequired(), Length(1, 100), EqualTo('password1')])
password1 = PasswordField('确认密码', validators=[DataRequired(), Length(1, 100)])
submit = SubmitField('注册')
def __init__(self, *args, **kwargs):
super(RegisterAdminForm, self).__init__(*args, **kwargs)
self.dept_id.choices = [(dept.id, dept.name) for dept in Dept.query.order_by(Dept.id.desc()).all()]
self.role_id.choices = [(role.id, role.info) for role in Role.query.filter(Role.id > 1).all()]
def validate_number(self, field):
if User.query.filter_by(number=field.data).first():
raise ValidationError('该工号已经被注册')
class SettingForm(FlaskForm):
number = StringField('学号/工号', validators=[DataRequired(), Length(8, 12), Regexp('^[0-9]*$', message='学号/工号只能包含0-9')])
name = StringField('姓名', validators=[DataRequired(), Length(1, 60)])
dept_id = SelectField('学院', coerce=int, validators=[DataRequired()])
phone = StringField('手机号', validators=[DataRequired(), Length(11, 11)])
submit = SubmitField('提交')
def __init__(self, *args, **kwargs):
super(SettingForm, self).__init__(*args, **kwargs)
if current_user.dept_id == 1:
self.dept_id.choices = [(current_user.dept_id, current_user.dept.name)]
else:
self.dept_id.choices = [(dept.id, dept.name) for dept in Dept.query.filter(Dept.id > 1).all()]
def validate_number(self, field):
if current_user.number == field.data:
return
if User.query.filter_by(number=field.data).first():
raise ValidationError('该学号/工号已经被注册')
class PasswordForm(FlaskForm):
old_password = PasswordField('原密码', validators=[DataRequired(), Length(1, 100)])
password = PasswordField('新密码', validators=[DataRequired(), Length(1, 100), EqualTo('password1')])
password1 = PasswordField('确认密码', validators=[DataRequired(), Length(1, 100)])
submit = SubmitField('提交')
def validate_old_password(self, field):
if not current_user.validate_password(field.data):
raise ValidationError('原密码错误')
class ApplyFormBase(FlaskForm):
name = StringField('项目名', validators=[DataRequired(), Length(1, 60)])
info = CKEditorField('项目描述', validators=[DataRequired()])
file = FileField('项目文件', render_kw={'multiple': 'multiple'}, validators=[
FileRequired(), FileAllowed(archives, '必须为压缩文件')
])
t_id = SelectField('导师', coerce=int, validators=[DataRequired()])
submit = SubmitField('立即申请')
class ApplyForm(ApplyFormBase):
def __init__(self, *args, **kwargs):
super(ApplyForm, self).__init__(*args, **kwargs)
self.t_id.choices = [(t.id, t.name) for t in
User.query.filter(User.dept_id == current_user.dept_id, User.role_id == 2).all()]
class ReApplyForm(ApplyForm):
name, info, file, submit = None, None, None, None
submit0 = SubmitField('重新申请')
class MyApplyForm(ApplyFormBase):
file, t_id, submit = None, None, None
submit1 = SubmitField('立即更改')
class FileApplyForm(ApplyFormBase):
name, info, t_id, submit = None, None, None, None
submit2 = SubmitField('立即上传')
class CommentForm(FlaskForm):
body = TextAreaField('', validators=[DataRequired()])
submit3 = SubmitField('提交评论')
class NoticeForm(FlaskForm):
title = StringField('标题', validators=[DataRequired(), Length(1, 100)])
body = CKEditorField('公告内容', validators=[DataRequired()])
submit = SubmitField('发布公告')
class MyNoticeForm(FlaskForm):
title = StringField('标题', validators=[DataRequired(), Length(1, 100)])
body = CKEditorField('公告内容', validators=[DataRequired()])
submit = SubmitField('立即更改')
class UserSearchForm(FlaskForm):
number = StringField('学号/工号', validators=[DataRequired(), Length(8, 12), Regexp('^[0-9]*$', message='学号/工号只能包含0-9')])
submit = SubmitField('搜索')
class PasswordResetForm(FlaskForm):
new_password = StringField('密码', default='12345678', validators=[DataRequired(), Length(1, 100)])
submit1 = SubmitField('重置')
| 42.349315 | 121 | 0.680738 | 702 | 6,183 | 5.887464 | 0.207977 | 0.170336 | 0.155819 | 0.10525 | 0.54827 | 0.502057 | 0.467215 | 0.467215 | 0.453908 | 0.453908 | 0 | 0.023672 | 0.159631 | 6,183 | 145 | 122 | 42.641379 | 0.771748 | 0 | 0 | 0.327103 | 0 | 0 | 0.048844 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.074766 | false | 0.130841 | 0.074766 | 0 | 0.747664 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
230e8c1540fa7285c8b3f7ee6f90ceedce9e2fc5 | 917 | py | Python | graph_based_slam/launch/graphbasedslam.launch.py | edhml/lidarslam_ros2 | 40ea7cc8db47073f31bdc6d5bb4d7d3670a2c319 | [
"BSD-2-Clause"
] | 130 | 2020-04-28T23:22:46.000Z | 2022-03-29T08:13:11.000Z | graph_based_slam/launch/graphbasedslam.launch.py | edhml/lidarslam_ros2 | 40ea7cc8db47073f31bdc6d5bb4d7d3670a2c319 | [
"BSD-2-Clause"
] | 14 | 2020-04-28T23:59:30.000Z | 2022-03-11T08:52:13.000Z | graph_based_slam/launch/graphbasedslam.launch.py | edhml/lidarslam_ros2 | 40ea7cc8db47073f31bdc6d5bb4d7d3670a2c319 | [
"BSD-2-Clause"
] | 34 | 2020-05-01T00:03:58.000Z | 2022-03-10T12:26:38.000Z | import os
import launch
import launch_ros.actions
from ament_index_python.packages import get_package_share_directory
def generate_launch_description():
graphbasedslam_param_dir = launch.substitutions.LaunchConfiguration(
'graphbasedslam_param_dir',
default=os.path.join(
get_package_share_directory('graph_based_slam'),
'param',
'graphbasedslam.yaml'))
graphbasedslam = launch_ros.actions.Node(
package='graph_based_slam',
executable='graph_based_slam_node',
parameters=[graphbasedslam_param_dir],
output='screen'
)
return launch.LaunchDescription([
launch.actions.DeclareLaunchArgument(
'graphbasedslam_param_dir',
default_value=graphbasedslam_param_dir,
description='Full path to graphbasedslam parameter file to load'),
graphbasedslam,
]) | 29.580645 | 78 | 0.689204 | 89 | 917 | 6.764045 | 0.483146 | 0.157807 | 0.182724 | 0.079734 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.236641 | 917 | 31 | 79 | 29.580645 | 0.86 | 0 | 0 | 0.083333 | 1 | 0 | 0.197168 | 0.075163 | 0 | 0 | 0 | 0 | 0 | 1 | 0.041667 | false | 0 | 0.166667 | 0 | 0.25 | 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 | 0 | 0 | 0 | 0 | 2 |
2311908b102acb4b107bcce2e0192afc0a45af69 | 613 | py | Python | tests/classes/linkto.py | zhichao-github/jsonclasses-cli | 631235a438e6def77cef22601df9c3c91c8d38f7 | [
"MIT"
] | null | null | null | tests/classes/linkto.py | zhichao-github/jsonclasses-cli | 631235a438e6def77cef22601df9c3c91c8d38f7 | [
"MIT"
] | null | null | null | tests/classes/linkto.py | zhichao-github/jsonclasses-cli | 631235a438e6def77cef22601df9c3c91c8d38f7 | [
"MIT"
] | 3 | 2021-11-22T06:56:52.000Z | 2021-12-07T02:39:22.000Z | from __future__ import annotations
from datetime import datetime
from typing import Annotated
from jsonclasses import jsonclass, types, linkto,linkedby
from jsonclasses_server import api
@api
@jsonclass(class_graph='linkto')
class User:
id: str = types.readonly.str.primary.mongoid.required
phone_num: str | None = types.str.alnum
articles: Annotated[list[Article], linkedby('users')]
@api
@jsonclass(class_graph='linkto')
class Article:
id: str = types.readonly.str.primary.mongoid.required
title: str = types.str.required
content: str = types.str
users: Annotated[User, linkto]
| 25.541667 | 57 | 0.755302 | 80 | 613 | 5.6875 | 0.4125 | 0.07033 | 0.074725 | 0.096703 | 0.334066 | 0.334066 | 0.189011 | 0.189011 | 0 | 0 | 0 | 0 | 0.14845 | 613 | 23 | 58 | 26.652174 | 0.871648 | 0 | 0 | 0.333333 | 0 | 0 | 0.027778 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.277778 | 0 | 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 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
2313f312bcdf66cdf3c8e92bea93434d1daf32f3 | 222 | py | Python | Test Code/speak_reg/pydub_test.py | joexu01/speak_auth | 05b2a10761463d45d926ff0d8b865f9f6ab86757 | [
"MIT"
] | null | null | null | Test Code/speak_reg/pydub_test.py | joexu01/speak_auth | 05b2a10761463d45d926ff0d8b865f9f6ab86757 | [
"MIT"
] | 3 | 2020-03-24T17:15:01.000Z | 2020-03-31T04:38:24.000Z | Test Code/speak_reg/pydub_test.py | joexu01/speak_auth | 05b2a10761463d45d926ff0d8b865f9f6ab86757 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
from pydub import AudioSegment
sound = AudioSegment.from_mp3('D:/360Downloads/caixi-from-net-common.mp3').set_frame_rate(11025)
sound.export('D:/360Downloads/from-net-common-3.wav', format='wav')
| 31.714286 | 96 | 0.743243 | 33 | 222 | 4.909091 | 0.666667 | 0.160494 | 0.160494 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.072816 | 0.072072 | 222 | 6 | 97 | 37 | 0.713592 | 0.094595 | 0 | 0 | 0 | 0 | 0.407035 | 0.39196 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
23197d7acf5b1414b4eb9a4391f877952b61e5ca | 793 | py | Python | src/api/routes/test_health.py | serinth/python-flask-boilerplate | 45658f375e6a08caa0efca5175b4d8096aac3f5d | [
"MIT"
] | null | null | null | src/api/routes/test_health.py | serinth/python-flask-boilerplate | 45658f375e6a08caa0efca5175b4d8096aac3f5d | [
"MIT"
] | 2 | 2021-09-06T06:52:06.000Z | 2021-09-06T06:52:06.000Z | src/api/routes/test_health.py | serinth/python-flask-boilerplate | 45658f375e6a08caa0efca5175b4d8096aac3f5d | [
"MIT"
] | null | null | null | import json
import unittest
from utils.factory import create_app
from utils.config import Config
class BaseTestCase(unittest.TestCase):
"""A base test case"""
def setUp(self):
app = create_app(Config())
app.app_context().push()
self.app = app.test_client()
def tearDown(self):
print("teardown complete")
class TestHealthEndpoint(BaseTestCase):
"""Test Health Endpoint"""
def setUp(self):
super(TestHealthEndpoint, self).setUp()
def test_returns_status_ok(self):
"""Should return status OK and HTTP 200 when hitting health endpoint"""
response = self.app.get('/health')
r = json.dumps(str(response.data))
self.assertEqual(200, response.status_code)
self.assertTrue('"status":"OK"', r) | 29.37037 | 79 | 0.662043 | 97 | 793 | 5.329897 | 0.494845 | 0.040619 | 0.046422 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009662 | 0.216898 | 793 | 27 | 80 | 29.37037 | 0.822866 | 0.129887 | 0 | 0.105263 | 0 | 0 | 0.054815 | 0 | 0 | 0 | 0 | 0 | 0.105263 | 1 | 0.210526 | false | 0 | 0.210526 | 0 | 0.526316 | 0.052632 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
2334e127f516d07c0bb0b2bc0f436f5295b546f9 | 493 | py | Python | db.py | justinhchae/jc_hw01_hci | 00d3661823c44d3cadb2adfdd198b025e8fa4215 | [
"Unlicense"
] | null | null | null | db.py | justinhchae/jc_hw01_hci | 00d3661823c44d3cadb2adfdd198b025e8fa4215 | [
"Unlicense"
] | null | null | null | db.py | justinhchae/jc_hw01_hci | 00d3661823c44d3cadb2adfdd198b025e8fa4215 | [
"Unlicense"
] | null | null | null | import os
from flask_mongoengine import MongoEngine
def init_database_connection(app):
app.config['MONGODB_SETTINGS'] = {
'db': os.environ.get('DATABASE_NAME'),
'host': 'mongodb+srv://' + os.environ.get('HOST') + '/' + os.environ.get('DATABASE_NAME') + '?retryWrites=true&w=majority',
'username': os.environ.get('USERNAME'),
# 'username': 'justinhchae@admin',
'password': os.environ.get('PASSWORD')
}
db = MongoEngine()
db.init_app(app) | 37.923077 | 131 | 0.634888 | 57 | 493 | 5.368421 | 0.473684 | 0.147059 | 0.196078 | 0.130719 | 0.156863 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.184584 | 493 | 13 | 132 | 37.923077 | 0.761194 | 0.064909 | 0 | 0 | 0 | 0 | 0.276087 | 0.06087 | 0 | 0 | 0 | 0 | 0 | 1 | 0.090909 | false | 0.090909 | 0.181818 | 0 | 0.272727 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
233559e30b090eb877e6abac8e1e70d36416f462 | 2,232 | py | Python | keylogger.py | Subucc/Tanit-Keylogger | f0ce269ac6ae49deca4960c8e053ecbaff51f13b | [
"MIT"
] | 60 | 2018-11-02T05:41:39.000Z | 2022-02-22T15:50:04.000Z | keylogger.py | Subucc/Tanit-Keylogger | f0ce269ac6ae49deca4960c8e053ecbaff51f13b | [
"MIT"
] | 9 | 2020-08-26T20:47:40.000Z | 2022-02-05T19:17:55.000Z | keylogger.py | Subucc/Tanit-Keylogger | f0ce269ac6ae49deca4960c8e053ecbaff51f13b | [
"MIT"
] | 25 | 2019-03-28T10:37:27.000Z | 2021-11-20T05:43:42.000Z | #!/usr/bin/python
import pynput.keyboard
import smtplib
import threading
'''
Description: This tool is part of the Ethical Hacking toolset. This is for educational use ONLY for security purposes.
The keylogger takes the all key strikes on keyboard and send them to an email every specific period of time
Requirements: You need only to install pynput
'pip install pynput'
Use packaged executables for Mac OS, Linux and MS Windows for deployment
Usage: python keylogger.py or better for deployment to chnage source code and package the app as executables
Enjoy!
'''
class Keylogger:
def __init__(self, time_interval, email, password):
#constructor
self.logger = "[Keylogger Initiated]"
self.subject = "Keylogger Report Email"
self.email = email
self.password = password
self.interval = time_interval
def append_to_log(self, key_strike):
self.logger = self.logger + key_strike
def evaluate_keys(self, key):
try:
# This will not throw exceptions when encountering a special character
Pressed_key = str(key.char)
except AttributeError:
# The case is for encountering a special character (space, tab, ctrl, Enter etc...)
#TODO: include as many if as need to remove unwanted special characters
if key == key.space: # Show actual space instead of key.space
Pressed_key = " "
else:
Pressed_key = " " + str(key) + " "
#Now appending the key pressed
self.append_to_log(Pressed_key)
def report(self):
#print(self.logger)
#sending the email of what has been logged
self.send_mail(self.email, self.password, self.subject, self.logger)
self.logger = ""
timer = threading.Timer(self.interval, self.report)
timer.start()
def send_mail(self, email, password, subject, message):
Email_message = 'Subject: {}\n\n{}'.format(subject, message)
server = smtplib.SMTP("smtp.gmail.com", 587)
server.starttls()
server.login(email, password)
server.sendmail(email, email, Email_message)
server.quit()
def start(self):
keyboard_listener = pynput.keyboard.Listener(on_press=self.evaluate_keys)
with keyboard_listener:
self.report()
keyboard_listener.join()
| 31.43662 | 119 | 0.708333 | 303 | 2,232 | 5.132013 | 0.458746 | 0.038585 | 0.021865 | 0.025723 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001691 | 0.205197 | 2,232 | 70 | 120 | 31.885714 | 0.874859 | 0.168907 | 0 | 0 | 0 | 0 | 0.06116 | 0 | 0 | 0 | 0 | 0.014286 | 0 | 1 | 0.157895 | false | 0.131579 | 0.078947 | 0 | 0.263158 | 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 | 0 | 0 | 0 | 2 |
2340289b1ae101e3a111be507146563f532057a4 | 164 | py | Python | Longest-Consecutive-Duplicate-String/solution.py | adriandarian/binary-search-io | 461f016d668227e3220a15c9e9d2ee6decab384e | [
"MIT"
] | null | null | null | Longest-Consecutive-Duplicate-String/solution.py | adriandarian/binary-search-io | 461f016d668227e3220a15c9e9d2ee6decab384e | [
"MIT"
] | null | null | null | Longest-Consecutive-Duplicate-String/solution.py | adriandarian/binary-search-io | 461f016d668227e3220a15c9e9d2ee6decab384e | [
"MIT"
] | null | null | null | import itertools
class Solution:
def solve(self, s):
if not s:
return 0
return max(len(list(v)) for _, v in itertools.groupby(s))
| 18.222222 | 65 | 0.579268 | 24 | 164 | 3.916667 | 0.791667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009009 | 0.323171 | 164 | 8 | 66 | 20.5 | 0.837838 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0 | 0.833333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
235ed822af8d9a8aa093addc6b9bd53cb6e14e97 | 372 | py | Python | accounts/views/system_user.py | shafikshaon/daybook | cff3ebc636741e8424d1c078c9811db664675a8a | [
"MIT"
] | null | null | null | accounts/views/system_user.py | shafikshaon/daybook | cff3ebc636741e8424d1c078c9811db664675a8a | [
"MIT"
] | null | null | null | accounts/views/system_user.py | shafikshaon/daybook | cff3ebc636741e8424d1c078c9811db664675a8a | [
"MIT"
] | null | null | null | from rest_framework import viewsets
from accounts.models import SystemUser
from accounts.serializers.system_user import SystemUserSerializer
class AccountViewSet(viewsets.ModelViewSet):
"""
A simple ViewSet for viewing and editing accounts.
"""
queryset = SystemUser.objects.all()
serializer_class = SystemUserSerializer
permission_classes = []
| 26.571429 | 65 | 0.776882 | 38 | 372 | 7.5 | 0.736842 | 0.084211 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.16129 | 372 | 13 | 66 | 28.615385 | 0.913462 | 0.134409 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.428571 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
88cf8de584c316e7cf85b005234a7acbbc846d8c | 360 | py | Python | ws-python/ex022.py | DerickSilva/Python | 8e81c6fe403e3321f18d2767f0bdfc818b180fd2 | [
"MIT"
] | null | null | null | ws-python/ex022.py | DerickSilva/Python | 8e81c6fe403e3321f18d2767f0bdfc818b180fd2 | [
"MIT"
] | null | null | null | ws-python/ex022.py | DerickSilva/Python | 8e81c6fe403e3321f18d2767f0bdfc818b180fd2 | [
"MIT"
] | null | null | null | nome = str(input('Digite seu nome completo ')).strip()
maisculas = nome.upper()
minusculas = nome.lower()
letras = len(nome) - nome.count(' ')
primeiro = nome.find(' ')
print(f'Seu nome em maiusculas é {maisculas}')
print(f'Seu nome em minusculas é {minusculas}')
print(f'Seu nome tem ao todo {letras} letras')
print(f'Seu primeiro nome tem {primeiro} letras') | 40 | 54 | 0.711111 | 55 | 360 | 4.654545 | 0.436364 | 0.109375 | 0.140625 | 0.152344 | 0.117188 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130556 | 360 | 9 | 55 | 40 | 0.817891 | 0 | 0 | 0 | 0 | 0 | 0.484765 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.444444 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
88d3ea317631fdf4f0d3aa3e657b9d8408324b9e | 379 | py | Python | unit 7/exc. 7.2.4.py | AviKalPython/self.py | 44f8de33797a9ea28bbd1e01006920ba7c818b97 | [
"MIT"
] | null | null | null | unit 7/exc. 7.2.4.py | AviKalPython/self.py | 44f8de33797a9ea28bbd1e01006920ba7c818b97 | [
"MIT"
] | null | null | null | unit 7/exc. 7.2.4.py | AviKalPython/self.py | 44f8de33797a9ea28bbd1e01006920ba7c818b97 | [
"MIT"
] | null | null | null | # exc. 7.2.4
def seven_boom(end_number):
my_list = []
for i in range(0, end_number + 1):
s = str(i)
if '7' in s or i % 7 == 0:
my_list += ['BOOM']
else:
my_list += [i]
print(my_list)
def main():
end_number = 17
seven_boom(end_number)
if __name__ == "__main__":
main()
| 19.947368 | 40 | 0.451187 | 53 | 379 | 2.886792 | 0.490566 | 0.235294 | 0.156863 | 0.235294 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.045249 | 0.416887 | 379 | 18 | 41 | 21.055556 | 0.647059 | 0.026385 | 0 | 0 | 0 | 0 | 0.037249 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0 | 0 | 0.142857 | 0.071429 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
88d5c27c01df7f2af239dd27d875e8da5b3cf322 | 278 | py | Python | tests/test_ping.py | naujoh/TorMySQL | 09123c58f52d015ef59b490c346b20e72bcd5e30 | [
"MIT"
] | 340 | 2015-02-02T22:21:22.000Z | 2022-02-24T06:52:23.000Z | tests/test_ping.py | naujoh/TorMySQL | 09123c58f52d015ef59b490c346b20e72bcd5e30 | [
"MIT"
] | 42 | 2015-02-12T15:01:44.000Z | 2020-11-18T02:03:22.000Z | tests/test_ping.py | naujoh/TorMySQL | 09123c58f52d015ef59b490c346b20e72bcd5e30 | [
"MIT"
] | 78 | 2015-02-12T11:53:15.000Z | 2022-02-03T07:30:18.000Z | #!/usr/bin/env python
# encoding: utf-8
import uuid
from tornado.testing import gen_test
from . import BaseTestCase
class TestPing(BaseTestCase):
@gen_test
def test1(self):
with (yield self.pool.Connection()) as connection:
yield connection.ping()
| 21.384615 | 58 | 0.697842 | 36 | 278 | 5.333333 | 0.722222 | 0.072917 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00905 | 0.205036 | 278 | 12 | 59 | 23.166667 | 0.859729 | 0.129496 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.375 | 0 | 0.625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
88dfd4e5191755823e87f8137531074ba9351a42 | 136 | py | Python | dacy/about.py | peleiden/DaCy | ccda8a54ba03781cca03eb8ea6b6b82c64b3bb4c | [
"Apache-2.0"
] | null | null | null | dacy/about.py | peleiden/DaCy | ccda8a54ba03781cca03eb8ea6b6b82c64b3bb4c | [
"Apache-2.0"
] | null | null | null | dacy/about.py | peleiden/DaCy | ccda8a54ba03781cca03eb8ea6b6b82c64b3bb4c | [
"Apache-2.0"
] | null | null | null | __title__ = "dacy"
__version__ = "1.0.1" # the ONLY source of version ID
__download_url__ = "https://github.com/KennethEnevoldsen/DaCy" | 45.333333 | 62 | 0.75 | 19 | 136 | 4.684211 | 0.842105 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025 | 0.117647 | 136 | 3 | 62 | 45.333333 | 0.716667 | 0.213235 | 0 | 0 | 0 | 0 | 0.471698 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
88ea2c355f47120b9c3b48bd0713d241e22486ae | 2,794 | py | Python | api/users/migrations/0001_initial.py | fujikawahiroaki/webspecimanager | d46a4feec0c695d5231b21e3311f4adbe25435cb | [
"BSD-2-Clause"
] | null | null | null | api/users/migrations/0001_initial.py | fujikawahiroaki/webspecimanager | d46a4feec0c695d5231b21e3311f4adbe25435cb | [
"BSD-2-Clause"
] | 10 | 2020-12-07T08:54:30.000Z | 2022-03-13T12:23:03.000Z | api/users/migrations/0001_initial.py | fujikawahiroaki/webspecimanager | d46a4feec0c695d5231b21e3311f4adbe25435cb | [
"BSD-2-Clause"
] | null | null | null | # Generated by Django 3.1.3 on 2021-01-10 03:26
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_countries.fields
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='UserProfile',
fields=[
('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
('created_at', models.DateTimeField(auto_now_add=True)),
('contient', models.CharField(blank=True, default='', max_length=20, verbose_name='大陸')),
('island_group', models.CharField(blank=True, default='', max_length=30, verbose_name='島郡')),
('island', models.CharField(blank=True, default='', max_length=24, verbose_name='島')),
('country', django_countries.fields.CountryField(blank=True, default='', max_length=2, verbose_name='国名コード(2文字 ISO 3166-1)')),
('state_provice', models.CharField(blank=True, default='', max_length=30, verbose_name='県(州)')),
('identified_by', models.CharField(blank=True, default='', max_length=19, verbose_name='同定者')),
('collecter', models.CharField(blank=True, default='', max_length=18, verbose_name='採集者')),
('preparation_type', models.CharField(blank=True, default='dry specimens', max_length=20, verbose_name='標本の種類')),
('disposition', models.CharField(blank=True, default='', max_length=30, verbose_name='現在の標本の状況')),
('lifestage', models.CharField(blank=True, default='', max_length=20, verbose_name='ライフステージ')),
('establishment_means', models.CharField(blank=True, default='', max_length=20, verbose_name='生成プロセス')),
('rights', models.CharField(blank=True, default='', max_length=10, verbose_name='ライセンス')),
('kingdom', models.CharField(blank=True, default='Animalia', max_length=30, verbose_name='界')),
('phylum', models.CharField(blank=True, default='Arthropoda', max_length=30, verbose_name='門')),
('class_name', models.CharField(blank=True, default='Insecta', max_length=30, verbose_name='鋼')),
('order', models.CharField(blank=True, default='', max_length=30, verbose_name='目')),
('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='user_profiles', to=settings.AUTH_USER_MODEL, verbose_name='ユーザーモデル')),
],
options={
'db_table': 'user_profiles',
'ordering': ['-created_at'],
},
),
]
| 58.208333 | 183 | 0.632427 | 315 | 2,794 | 5.431746 | 0.368254 | 0.109293 | 0.14962 | 0.210403 | 0.44886 | 0.310345 | 0.310345 | 0.216832 | 0.216832 | 0.216832 | 0 | 0.024036 | 0.210809 | 2,794 | 47 | 184 | 59.446809 | 0.751927 | 0.016106 | 0 | 0 | 1 | 0 | 0.128504 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.125 | 0 | 0.225 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
88f2b0638df39c112ccec6cd7c6cad3676a68288 | 318 | py | Python | accounts/urls.py | SynBioUC/flapjack_api | 343f44a7ca3d0ae69a38f6ee0447d8c7097b23ee | [
"MIT"
] | null | null | null | accounts/urls.py | SynBioUC/flapjack_api | 343f44a7ca3d0ae69a38f6ee0447d8c7097b23ee | [
"MIT"
] | 17 | 2020-10-08T15:52:49.000Z | 2021-11-12T14:02:10.000Z | accounts/urls.py | RudgeLab/flapjack_api | 59a9c03f3093e0a3c65e18d36108aec97d352867 | [
"MIT"
] | 1 | 2021-09-23T18:51:46.000Z | 2021-09-23T18:51:46.000Z | from django.urls import path
from rest_framework_simplejwt.views import TokenRefreshView
from .views import registration, log_in
urlpatterns = [
path('register/', registration, name='register'),
path('log_in/', log_in, name='log_in'),
path('refresh/', TokenRefreshView.as_view(), name='token_refresh'),
]
| 31.8 | 71 | 0.742138 | 40 | 318 | 5.7 | 0.5 | 0.087719 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.122642 | 318 | 9 | 72 | 35.333333 | 0.817204 | 0 | 0 | 0 | 0 | 0 | 0.160377 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.375 | 0 | 0.375 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
000d82351b84ce4d2ee799f193a82f324f2e004b | 1,764 | py | Python | src/tests/scanner/controls/conftest.py | alex-dya/security_scanner | 7aeb6af863ccdbf6c066d52446318aaf898afe7b | [
"MIT"
] | null | null | null | src/tests/scanner/controls/conftest.py | alex-dya/security_scanner | 7aeb6af863ccdbf6c066d52446318aaf898afe7b | [
"MIT"
] | 7 | 2021-05-28T14:31:27.000Z | 2022-03-12T00:57:40.000Z | src/tests/scanner/controls/conftest.py | alex-dya/security_scanner | 7aeb6af863ccdbf6c066d52446318aaf898afe7b | [
"MIT"
] | 1 | 2021-05-15T12:18:49.000Z | 2021-05-15T12:18:49.000Z | from abc import ABC, abstractmethod
from functools import partial
from textwrap import dedent
from scanner.types import ControlStatus
def pytest_generate_tests(metafunc):
if metafunc.function.__name__ != 'test_case':
return metafunc
idlist = [
f'Test case {i+1}'
for i in range(len(metafunc.cls.case_list))
]
argnames = ['text', 'status', 'result']
argvalues = []
for text, status, result in metafunc.cls.case_list:
if isinstance(text, str):
text = (dedent(text),)
else:
text = tuple(dedent(item) for item in text)
argvalues.append((text, status, result and dedent(result).strip()))
metafunc.parametrize(argnames, argvalues, ids=idlist, scope="class")
class BaseUnixControlTest(ABC):
@property
@abstractmethod
def case_list(self):
pass
@property
@abstractmethod
def origin(self):
pass
@staticmethod
def not_passed_prerequisite():
return False
def test_case(self, monkeypatch, text, status, result, get_transport_patch):
monkeypatch.setattr(
self.origin,
'get_transport',
partial(get_transport_patch, text=text)
)
monkeypatch.setattr(
self.origin.Control, 'prerequisite', lambda self_: True)
control = self.origin.Control()
control.run()
assert control.control.status == status
assert control.result == result
def test_execute_not_checked(self, monkeypatch):
control = self.origin.Control()
monkeypatch.setattr(
control, 'prerequisite', self.not_passed_prerequisite)
control.run()
assert control.control.status == ControlStatus.NotChecked
| 27.138462 | 80 | 0.641723 | 190 | 1,764 | 5.831579 | 0.378947 | 0.036101 | 0.057762 | 0.034296 | 0.064982 | 0.064982 | 0 | 0 | 0 | 0 | 0 | 0.000768 | 0.261905 | 1,764 | 64 | 81 | 27.5625 | 0.85023 | 0 | 0 | 0.26 | 1 | 0 | 0.046485 | 0 | 0 | 0 | 0 | 0 | 0.06 | 1 | 0.12 | false | 0.08 | 0.08 | 0.02 | 0.26 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
000fd5080ff000213666d72d489caa0a49e8bee8 | 2,517 | py | Python | netbox-interact/netbox-extract.py | jmanteau/evpn-cicd-arista-containerlab | d0b9adf98070f73dec86b9fd1ae4bd6f5b47652f | [
"MIT"
] | 1 | 2022-03-29T20:08:56.000Z | 2022-03-29T20:08:56.000Z | netbox-interact/netbox-extract.py | jmanteau/evpn-cicd-arista-containerlab | d0b9adf98070f73dec86b9fd1ae4bd6f5b47652f | [
"MIT"
] | null | null | null | netbox-interact/netbox-extract.py | jmanteau/evpn-cicd-arista-containerlab | d0b9adf98070f73dec86b9fd1ae4bd6f5b47652f | [
"MIT"
] | null | null | null |
from pprint import pprint
from collections import defaultdict
import yaml
import pynetbox
def get_netbox():
"""
Return Netbox API handler
Returns:
pynetbox.API -- Netbox API handler
"""
nburl = "http://127.0.0.1:8000/"
NETBOX_TOKEN = "0123456789abcdef0123456789abcdef01234567"
session = requests.Session()
session.verify = False # https://pynetbox.readthedocs.io/en/latest/advanced.html#ssl-verification
nb = pynetbox.api(url=nburl, token=NETBOX_TOKEN, threading=True)
nb.http_session = session
return nb
nb = get_netbox()
def ddict():
return defaultdict(ddict)
def ddict2dict(d):
for k, v in d.items():
if isinstance(v, dict):
d[k] = ddict2dict(v)
return dict(d)
structured_config = ddict()
structured_config["router_bgp"]= {} #TODO
structured_config["static_routes"]= {} #TODO
structured_config["service_routing_protocols_model"]= "multi-agent"
structured_config["ip_routing"]= True
structured_config["vlan_internal_order"]["allocation"]= "ascending"
structured_config["vlan_internal_order"]["range"]["beginning"]= 1006
structured_config["vlan_internal_order"]["range"]["ending"]= 1199
structured_config["name_server"] #TODO
structured_config["spanning_tree"]["mode"] = "mstp"
structured_config["spanning_tree"]["mst_instances"]["0"]["priority"] = 4096
userscf= nb.extras.config_contexts.get(name='local-users').data
users= userscf["system"]["aaa"]["authentication"]["users"]
for user in users:
structured_config["local_users"][user]["privilege"]= users[user]['privilege']
structured_config["local_users"][user]["sha512_password"]= users[user]['password']
structured_config["local_users"][user]["role"]= users[user]['role']
structured_config["vrfs"] #TODO
structured_config["management_interfaces"] #TODO
structured_config["management_api_http"] #TODO
structured_config["ethernet_interfaces"] #TODO
structured_config["loopback_interfaces"] #TODO
structured_config["vlan_interfaces"] #TODO
structured_config["vxlan_interface"] #TODO
structured_config["prefix_lists"] #TODO
structured_config["route_maps"] #TODO
structured_config["router_bfd"] #TODO
structured_config["vlans"] #TODO
structured_config["ip_igmp_snooping"]["globally_enabled"]= True
structured_config["ip_virtual_router_mac_address"] = "00:00:00:00:00:01"
structured_config["virtual_source_nat_vrfs"] #TODO
output=yaml.dump(ddict2dict(structured_config), allow_unicode=True, default_flow_style=False)
print(output) | 25.424242 | 102 | 0.744934 | 309 | 2,517 | 5.815534 | 0.420712 | 0.258208 | 0.155815 | 0.066778 | 0.11074 | 0.042293 | 0 | 0 | 0 | 0 | 0 | 0.0309 | 0.112833 | 2,517 | 99 | 103 | 25.424242 | 0.773847 | 0.082241 | 0 | 0 | 0 | 0 | 0.297797 | 0.063436 | 0 | 0 | 0 | 0.010101 | 0 | 1 | 0.056604 | false | 0.018868 | 0.075472 | 0.018868 | 0.188679 | 0.037736 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
00188840a3f1a151e6076aa51a747a0f060bad18 | 581 | py | Python | traiders/backend/api/models/__init__.py | rdilruba/bounswe2019group2 | b373908a4a8e92481f359297aba07245f0a23c1c | [
"Apache-2.0"
] | 11 | 2019-02-15T12:08:32.000Z | 2019-11-14T19:25:09.000Z | traiders/backend/api/models/__init__.py | bounswe/bounswe2019group2 | 05d41cf7b6bc1b3f994e82495d2a885a6eaa7cf3 | [
"Apache-2.0"
] | 279 | 2019-02-13T14:57:39.000Z | 2022-03-12T00:02:30.000Z | traiders/backend/api/models/__init__.py | rdilruba/bounswe2019group2 | b373908a4a8e92481f359297aba07245f0a23c1c | [
"Apache-2.0"
] | 13 | 2019-03-20T08:30:55.000Z | 2021-01-31T16:49:14.000Z | from .equipment import Equipment
from .investment import ManualInvestment, Asset, OnlineInvestment
from .parity import Parity
from .users import User
from .article import Article
from .comment import ArticleComment, EquipmentComment
from .mobile_app import MobileApp
from .likes import Like
from .following import Following
from .portfolio import Portfolio, PortfolioItem
from .event import Event
from .prediction import Prediction
from .parity_setting import ParitySetting
from .order import BuyOrder, StopLossOrder
from .notification import Notification
from .alert import Alert
| 34.176471 | 65 | 0.845095 | 71 | 581 | 6.887324 | 0.43662 | 0.0409 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.118761 | 581 | 16 | 66 | 36.3125 | 0.955078 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
00296f0755d7b345d440616575af2c5af1c094b3 | 1,539 | py | Python | tests/test_temp.py | D-Bits/Converty | 98207932ff8d0df78f611691b1b39d54fd82f420 | [
"MIT"
] | 1 | 2021-02-27T14:59:30.000Z | 2021-02-27T14:59:30.000Z | tests/test_temp.py | D-Bits/Converty | 98207932ff8d0df78f611691b1b39d54fd82f420 | [
"MIT"
] | 2 | 2021-04-06T18:20:50.000Z | 2021-06-02T03:33:45.000Z | tests/test_temp.py | D-Bits/Converty | 98207932ff8d0df78f611691b1b39d54fd82f420 | [
"MIT"
] | null | null | null | from unittest import TestCase
from converty.temperature import(
fahrenheit_to_celsius,
celsius_to_fahrenheit,
celsius_to_kelvin,
kelvin_to_celsius,
fahrenheit_to_kelvin,
kelvin_to_fahrenheit
)
# Temperature unit tests
class TempTests(TestCase):
# Test that 1 degree fahrenheit = -17.22 degrees celsius
def test_fahrenheit_to_celsius(self):
self.assertAlmostEqual(fahrenheit_to_celsius(1), -17.22)
# Test that 1 degree C = 33.8 degress F
def test_celsius_to_fahrenheit(self):
self.assertAlmostEqual(celsius_to_fahrenheit(1), 33.8)
# Tst that 1 degree C = 274.15 degrees K
def test_celsius_to_kelvin(self):
self.assertAlmostEqual(celsius_to_kelvin(1), 274.15)
# Test that 1 degree K = -272.15 C
def test_kelvin_to_celsius(self):
self.assertAlmostEqual(kelvin_to_celsius(1), -272.15)
# Test that absolute zero = -273.15 Celsius
def test_absolute_zero_celsius(self):
self.assertAlmostEqual(kelvin_to_celsius(0), -273.15)
# Test that 1 degree fahrenheit = 255.93 (rounded) degrees Kelvin
def test_fahrenheit_to_kelvin(self):
self.assertAlmostEqual(fahrenheit_to_kelvin(1), 255.93)
# Test that 1 degree K = -457.87 degrees F
def test_kelvin_to_fahrenheit(self):
self.assertAlmostEqual(kelvin_to_fahrenheit(1), -457.87)
# Test that absoulte zero in F is equal to -459.67 degrees
def test_absolute_zero_fahrenheit(self):
self.assertAlmostEqual(kelvin_to_fahrenheit(0), -459.67) | 29.037736 | 69 | 0.721897 | 217 | 1,539 | 4.880184 | 0.225806 | 0.060434 | 0.188857 | 0.070822 | 0.442871 | 0.188857 | 0.188857 | 0 | 0 | 0 | 0 | 0.071082 | 0.195582 | 1,539 | 53 | 70 | 29.037736 | 0.78433 | 0.254061 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.307692 | 1 | 0.307692 | false | 0 | 0.076923 | 0 | 0.423077 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
0036bab63ed32b35277a9779aae64c80f87c6047 | 225 | py | Python | Scripts/Games/FirstPersonWalker.py | SeboTime/Sebo-Dos | 4dbc9481bcc497c5f9f77ec665cbe3263c262f1f | [
"Apache-2.0"
] | 1 | 2021-12-26T12:09:42.000Z | 2021-12-26T12:09:42.000Z | Scripts/Games/FirstPersonWalker.py | SeboTime/Sebo-Dos | 4dbc9481bcc497c5f9f77ec665cbe3263c262f1f | [
"Apache-2.0"
] | null | null | null | Scripts/Games/FirstPersonWalker.py | SeboTime/Sebo-Dos | 4dbc9481bcc497c5f9f77ec665cbe3263c262f1f | [
"Apache-2.0"
] | null | null | null | import imp
from os import system
import platform
import os
print("")
if platform.system() == "Windows":
os.system("py Scripts/Games/FirstPersonWalker/Install.py")
else:
print("Your system doesn't support this game!") | 22.5 | 62 | 0.733333 | 32 | 225 | 5.15625 | 0.65625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142222 | 225 | 10 | 63 | 22.5 | 0.854922 | 0 | 0 | 0 | 0 | 0 | 0.39823 | 0.185841 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.444444 | 0 | 0.444444 | 0.222222 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
00426b28a623ba30f9ad3f97db796ff9f5d2e470 | 783 | py | Python | utils_timing.py | tingofurro/keep_it_simple | 59c8dd5416407a117e68097810b50bc6e252c539 | [
"Apache-2.0"
] | 23 | 2021-06-19T09:02:56.000Z | 2022-03-20T13:39:03.000Z | utils_timing.py | tingofurro/keep_it_simple | 59c8dd5416407a117e68097810b50bc6e252c539 | [
"Apache-2.0"
] | 2 | 2022-01-23T16:55:07.000Z | 2022-03-14T16:37:53.000Z | utils_timing.py | tingofurro/keep_it_simple | 59c8dd5416407a117e68097810b50bc6e252c539 | [
"Apache-2.0"
] | 2 | 2021-12-27T02:11:46.000Z | 2022-03-20T07:57:09.000Z | import time
class TickTimer:
def __init__(self, start_key=None):
self.T = time.time()
self.time_map = {}
self.current_key = start_key
def tick(self, new_key):
lapse = time.time() - self.T
if self.current_key is not None:
if self.current_key not in self.time_map:
self.time_map[self.current_key] = 0
self.time_map[self.current_key] += lapse
self.current_key = new_key
self.T = time.time()
def reset(self):
self.time_map = {}
self.T = time.time()
def report(self):
if self.current_key is not None:
self.tick(None)
print("[TIMING REPORT] %s" % (" ".join("[%s: %.5f sec]" % (k, v) for k, v in self.time_map.items())))
| 29 | 109 | 0.554278 | 112 | 783 | 3.6875 | 0.294643 | 0.186441 | 0.237288 | 0.181598 | 0.380145 | 0.302663 | 0.121065 | 0 | 0 | 0 | 0 | 0.003731 | 0.315453 | 783 | 26 | 110 | 30.115385 | 0.766791 | 0 | 0 | 0.333333 | 0 | 0 | 0.042146 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.190476 | false | 0 | 0.047619 | 0 | 0.285714 | 0.047619 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
00431176bad12615c7e73a32fdf98d4a23f4fa9d | 1,462 | py | Python | sound/disksnd.py | gbeckers/sound | eb3c6a97974c6a9c1d86d37278048d7838a906c1 | [
"BSD-3-Clause"
] | 1 | 2021-03-08T14:57:50.000Z | 2021-03-08T14:57:50.000Z | sound/disksnd.py | gbeckers/sound | eb3c6a97974c6a9c1d86d37278048d7838a906c1 | [
"BSD-3-Clause"
] | null | null | null | sound/disksnd.py | gbeckers/sound | eb3c6a97974c6a9c1d86d37278048d7838a906c1 | [
"BSD-3-Clause"
] | null | null | null | from darr.basedatadir import BaseDataDir, create_basedatadir
from darr.metadata import MetaData
from ._version import get_versions
#TODO: required keys for sndinfo
class DataDir(BaseDataDir):
_classid = 'DataDir'
_classdescr = 'object for IO for disk-persistent sounds'
_version = get_versions()['version']
_suffix = '.snd'
_sndinfopath = 'sndinfo.json' # here goes required sound information
_metadatapath = 'metadata.json' # here goes extra information
def __init__(self, path, accessmode='r'):
BaseDataDir.__init__(self, path)
self._metadata = MetaData(self.path / self._metadatapath,
accessmode=accessmode)
@property
def metadata(self):
"""Dictionary-like access to disk based metadata.
Metadata items can be anything that can be saved in JSON format. If
there is no metadata, the metadata file does not exist, rather than
being empty. This saves a block of disk space (potentially 4kb)."""
return self._metadata
def read_sndinfo(self):
return self._read_jsondict(self._sndinfopath)
def write_sndinfo(self, d, overwrite=False):
self._write_jsondict(self._sndinfopath, d=d,
overwrite=overwrite)
self.read_sndinfo()
def create_datadir(path, overwrite=False):
dd = create_basedatadir(path=path,overwrite=overwrite)
return DataDir(dd.path)
| 28.666667 | 75 | 0.677839 | 171 | 1,462 | 5.608187 | 0.479532 | 0.025026 | 0.025026 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000903 | 0.242818 | 1,462 | 50 | 76 | 29.24 | 0.865402 | 0.235978 | 0 | 0 | 0 | 0 | 0.077994 | 0 | 0 | 0 | 0 | 0.02 | 0 | 1 | 0.192308 | false | 0 | 0.115385 | 0.038462 | 0.692308 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
cc4e3f7d500d4ee80c820324ce43974d1968954e | 238 | py | Python | main.py | duyvu1991/license-plate-detection- | e42681f50fa8175df6907d19e3b5564674504ac5 | [
"Net-SNMP",
"Xnet"
] | null | null | null | main.py | duyvu1991/license-plate-detection- | e42681f50fa8175df6907d19e3b5564674504ac5 | [
"Net-SNMP",
"Xnet"
] | null | null | null | main.py | duyvu1991/license-plate-detection- | e42681f50fa8175df6907d19e3b5564674504ac5 | [
"Net-SNMP",
"Xnet"
] | null | null | null | from flask import Flask, render_template
from blueprints import *
app = Flask(__name__)
app.register_blueprint(home)
app.register_blueprint(upload_api)
if __name__ == '__main__':
app.run(debug = True, host='127.0.0.1', port=5001)
| 19.833333 | 54 | 0.747899 | 35 | 238 | 4.628571 | 0.685714 | 0.135802 | 0.246914 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.048309 | 0.130252 | 238 | 11 | 55 | 21.636364 | 0.7343 | 0 | 0 | 0 | 0 | 0 | 0.071429 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.285714 | 0 | 0.285714 | 0.428571 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
cc57ee2370c61620bacf034eee8a7991d60dda0b | 950 | py | Python | download_recordings/source/server_paths.py | PCH-Engineering/pch-cloud | 9b0f774c6f15e8ee02f8311b4965816d04d73edd | [
"MIT"
] | null | null | null | download_recordings/source/server_paths.py | PCH-Engineering/pch-cloud | 9b0f774c6f15e8ee02f8311b4965816d04d73edd | [
"MIT"
] | null | null | null | download_recordings/source/server_paths.py | PCH-Engineering/pch-cloud | 9b0f774c6f15e8ee02f8311b4965816d04d73edd | [
"MIT"
] | 1 | 2020-12-03T17:53:14.000Z | 2020-12-03T17:53:14.000Z | import json
#import os
#fn= os.path.abspath(__file__ + "/../../")
#hostfile =os.path.join(fn,'config/hosts.json')
from pathlib import Path;
parent = Path(__file__).parents[1]
hostfile=parent.joinpath('config/hosts.json')
with open(hostfile) as f:
hosts = json.load(f)
def service_url(host, service):
return hosts[host][service]
def backend(host):
return service_url(host, 'backend')
def usermanager(host):
return service_url(host, 'usermanager')
def devicemanager(host):
return service_url(host, 'devicemanager')
if __name__ == "__main__":
print("Local:")
print(backend('local'))
print(usermanager('local'))
print(devicemanager('local'))
print("pchcloud:")
print(backend('pchcloud'))
print(usermanager('pchcloud'))
print(devicemanager('pchcloud'))
print("pchcloud:")
print(backend('pchcloud2'))
print(usermanager('pchcloud2'))
print(devicemanager('pchcloud2')) | 24.358974 | 47 | 0.677895 | 110 | 950 | 5.672727 | 0.336364 | 0.104167 | 0.089744 | 0.096154 | 0.115385 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005 | 0.157895 | 950 | 39 | 48 | 24.358974 | 0.775 | 0.102105 | 0 | 0.074074 | 0 | 0 | 0.171563 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.148148 | false | 0 | 0.074074 | 0.148148 | 0.37037 | 0.444444 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 2 |
cc66ebba68272fd3fe7e4e76a3799f1c06e5217d | 163 | py | Python | src/messages/__init__.py | chrishendra93/dinner_at_clemz | a884973f257bb18584a5b69d627d01f82573a082 | [
"MIT"
] | null | null | null | src/messages/__init__.py | chrishendra93/dinner_at_clemz | a884973f257bb18584a5b69d627d01f82573a082 | [
"MIT"
] | null | null | null | src/messages/__init__.py | chrishendra93/dinner_at_clemz | a884973f257bb18584a5b69d627d01f82573a082 | [
"MIT"
] | null | null | null | from .all_messages import *
__all__ = [
'Eko', 'Emil', 'Marco', 'Ida', 'Karin', 'Rika', 'Zefa', 'Jason', 'Billy', 'Kafi', 'Indrik', 'Toto', 'Acang', 'Bena'
]
| 27.166667 | 119 | 0.552147 | 19 | 163 | 4.473684 | 0.947368 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.165644 | 163 | 5 | 120 | 32.6 | 0.625 | 0 | 0 | 0 | 0 | 0 | 0.374233 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
cc6d246e7d9eb8ce8cd8a7ad0af220830dbedce9 | 201 | py | Python | Intro/longestDigitPrefix.py | sumeyaali/Code_Challenges | e130e9a2bd94f9928e92474e54736409aee69384 | [
"MIT"
] | null | null | null | Intro/longestDigitPrefix.py | sumeyaali/Code_Challenges | e130e9a2bd94f9928e92474e54736409aee69384 | [
"MIT"
] | null | null | null | Intro/longestDigitPrefix.py | sumeyaali/Code_Challenges | e130e9a2bd94f9928e92474e54736409aee69384 | [
"MIT"
] | null | null | null | def longestDigitsPrefix(inputString):
# iterate through the string
arr = ''
for i in inputString:
if i.isdigit():
arr += i
else:
break
return arr | 22.333333 | 37 | 0.537313 | 21 | 201 | 5.142857 | 0.761905 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.38806 | 201 | 9 | 38 | 22.333333 | 0.878049 | 0.129353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
cc9a38ddc8d85fa7f6758b69aa22994ab78f807f | 1,083 | py | Python | 1301-1400/1344-Counter Diagonal Sort/1344-Counter Diagonal Sort.py | jiadaizhao/LintCode | a8aecc65c47a944e9debad1971a7bc6b8776e48b | [
"MIT"
] | 77 | 2017-12-30T13:33:37.000Z | 2022-01-16T23:47:08.000Z | 1301-1400/1344-Counter Diagonal Sort/1344-Counter Diagonal Sort.py | jxhangithub/LintCode-1 | a8aecc65c47a944e9debad1971a7bc6b8776e48b | [
"MIT"
] | 1 | 2018-05-14T14:15:40.000Z | 2018-05-14T14:15:40.000Z | 1301-1400/1344-Counter Diagonal Sort/1344-Counter Diagonal Sort.py | jxhangithub/LintCode-1 | a8aecc65c47a944e9debad1971a7bc6b8776e48b | [
"MIT"
] | 39 | 2017-12-07T14:36:25.000Z | 2022-03-10T23:05:37.000Z | class Solution:
"""
@param grids: a maxtrix with alphabet
@return: return sorted lists
"""
def CounterDiagonalSort(self, grids):
# write your code here
m = len(grids)
n = len(grids[0])
table = []
for i in range(m):
temp = []
row = i
col = 0
while row >= 0 and col < n:
temp.append(grids[row][col])
row -= 1
col += 1
table.append(temp)
for i in range(m, m + n - 1):
temp = []
row = m - 1
col = i - m + 1
while row >= 0 and col < n:
temp.append(grids[row][col])
row -= 1
col += 1
table.append(temp)
l = min(m, n)
result = []
for t in table:
temp = []
i = 0
while len(temp) < l:
temp.append(t[i % len(t)])
i += 1
result.append(temp)
return sorted(result)
| 25.785714 | 44 | 0.374885 | 120 | 1,083 | 3.383333 | 0.316667 | 0.073892 | 0.029557 | 0.054187 | 0.35468 | 0.295567 | 0.295567 | 0.295567 | 0.295567 | 0.295567 | 0 | 0.024904 | 0.518006 | 1,083 | 41 | 45 | 26.414634 | 0.752874 | 0.081256 | 0 | 0.393939 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02439 | 0 | 1 | 0.030303 | false | 0 | 0 | 0 | 0.090909 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
cc9f90721971a6548b87fd57ba5bae6d6f402fc6 | 397 | py | Python | mqueue/tests/test_apps.py | synw/django-mqueue | 02d68baba29ab33d71d4238b850d44a637fec04a | [
"MIT"
] | 29 | 2016-04-24T11:57:52.000Z | 2022-03-22T17:12:36.000Z | mqueue/tests/test_apps.py | synw/django-mqueue | 02d68baba29ab33d71d4238b850d44a637fec04a | [
"MIT"
] | 4 | 2016-11-02T13:23:03.000Z | 2021-07-23T12:42:03.000Z | mqueue/tests/test_apps.py | synw/django-mqueue | 02d68baba29ab33d71d4238b850d44a637fec04a | [
"MIT"
] | 5 | 2016-05-22T12:34:48.000Z | 2020-03-13T10:54:46.000Z | from .base import MqueueBaseTest
from django.apps import apps
class MqueueTestApps(MqueueBaseTest):
def test_apps(self):
apps.get_app_config("mqueue")
def test_apps_import_error(self):
req = (("wrong.model.path", ["c", "d", "u"]),)
with self.settings(MQUEUE_AUTOREGISTER=req):
apps.get_app_config("mqueue")
self.assertRaises(ImportError)
| 28.357143 | 54 | 0.662469 | 48 | 397 | 5.291667 | 0.583333 | 0.07874 | 0.086614 | 0.125984 | 0.173228 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.211587 | 397 | 13 | 55 | 30.538462 | 0.811502 | 0 | 0 | 0.2 | 0 | 0 | 0.078086 | 0 | 0 | 0 | 0 | 0 | 0.1 | 1 | 0.2 | false | 0 | 0.4 | 0 | 0.7 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
cca34ccdb5a526a4f649e859757852532c16f394 | 1,437 | py | Python | bluebottle/bb_donations/serializers.py | maykinmedia/bluebottle | 355d4729662b5e9a03398efb4fe882e0f8cfa28d | [
"BSD-3-Clause"
] | null | null | null | bluebottle/bb_donations/serializers.py | maykinmedia/bluebottle | 355d4729662b5e9a03398efb4fe882e0f8cfa28d | [
"BSD-3-Clause"
] | null | null | null | bluebottle/bb_donations/serializers.py | maykinmedia/bluebottle | 355d4729662b5e9a03398efb4fe882e0f8cfa28d | [
"BSD-3-Clause"
] | null | null | null | # coding=utf-8
from bluebottle.utils.model_dispatcher import get_donation_model
from bluebottle.utils.serializer_dispatcher import get_serializer_class
from rest_framework import serializers
DONATION_MODEL = get_donation_model()
class ManageDonationSerializer(serializers.ModelSerializer):
project = serializers.SlugRelatedField(slug_field='slug')
fundraiser = serializers.PrimaryKeyRelatedField(required=False)
order = serializers.PrimaryKeyRelatedField()
amount = serializers.DecimalField(max_digits=10, decimal_places=2)
status = serializers.CharField(source='status', read_only=True)
class Meta:
model = DONATION_MODEL
fields = ('id', 'project', 'fundraiser', 'amount', 'status', 'order', 'anonymous', 'completed', 'created')
# FIXME Add validations for amount and project phase
class PreviewDonationSerializer(serializers.ModelSerializer):
project = get_serializer_class('PROJECTS_PROJECT_MODEL', 'preview')
fundraiser = serializers.PrimaryKeyRelatedField(required=False)
user = get_serializer_class('AUTH_USER_MODEL', 'preview')(source='public_user')
class Meta:
model = DONATION_MODEL
fields = ('id', 'project', 'fundraiser', 'user', 'created', 'anonymous', 'amount')
class DefaultDonationSerializer(PreviewDonationSerializer):
class Meta:
model = DONATION_MODEL
fields = PreviewDonationSerializer.Meta.fields + ('amount',)
| 38.837838 | 114 | 0.754349 | 143 | 1,437 | 7.398601 | 0.41958 | 0.073724 | 0.05104 | 0.062382 | 0.23535 | 0.12949 | 0.098299 | 0.098299 | 0.098299 | 0 | 0 | 0.003249 | 0.143354 | 1,437 | 36 | 115 | 39.916667 | 0.856214 | 0.043841 | 0 | 0.333333 | 0 | 0 | 0.134209 | 0.016047 | 0 | 0 | 0 | 0.027778 | 0 | 1 | 0 | false | 0 | 0.125 | 0 | 0.708333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
cca41550992f461ce3e9d4e87bacf954eeead462 | 1,346 | py | Python | src/ultru_client/utils/config.py | Ultru/ultru-client | b8dae2869804fea166e33d5d4fc05dc6dbc363be | [
"MIT"
] | null | null | null | src/ultru_client/utils/config.py | Ultru/ultru-client | b8dae2869804fea166e33d5d4fc05dc6dbc363be | [
"MIT"
] | null | null | null | src/ultru_client/utils/config.py | Ultru/ultru-client | b8dae2869804fea166e33d5d4fc05dc6dbc363be | [
"MIT"
] | null | null | null | import json
import os
from .globals import CLI_GLOBALS
def __maybe_init_config():
if not os.path.exists(CLI_GLOBALS.ULTRU_CLI_CONFIG_DIR):
os.mkdir(CLI_GLOBALS.ULTRU_CLI_CONFIG_DIR)
if not os.path.exists(CLI_GLOBALS.CONFIG):
with open(CLI_GLOBALS.CONFIG, 'w') as config_fp:
json.dump({
"username": "",
"password": "",
"store_password": False
}, config_fp)
def __store_config(field, value):
__maybe_init_config()
with open(CLI_GLOBALS.CONFIG, 'r') as config_fp:
config = json.load(config_fp)
config[field] = value
with open(CLI_GLOBALS.CONFIG, 'w') as config_fp:
json.dump(config, config_fp)
def get_config_value(field):
__maybe_init_config()
with open(CLI_GLOBALS.CONFIG, 'r') as config_fp:
config = json.load(config_fp)
return config.get(field)
def list_config():
__maybe_init_config()
with open(CLI_GLOBALS.CONFIG, 'r') as config_fp:
config = json.load(config_fp)
return config
def put_config_value(field, value):
__store_config(field, value)
def store_username(username):
__store_config('username', username)
def store_password(password):
__store_config('password', password)
def set_store_password(boolean):
__store_config('store_password', boolean)
| 28.041667 | 60 | 0.678306 | 181 | 1,346 | 4.674033 | 0.20442 | 0.094563 | 0.113475 | 0.106383 | 0.508274 | 0.508274 | 0.449173 | 0.385343 | 0.385343 | 0.385343 | 0 | 0 | 0.213967 | 1,346 | 47 | 61 | 28.638298 | 0.799622 | 0 | 0 | 0.289474 | 0 | 0 | 0.048327 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.210526 | false | 0.157895 | 0.078947 | 0 | 0.342105 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
cca88d7195510bd6d48b3a2186dbaaaa91de2323 | 1,259 | py | Python | lang/jquery_python/read/master_python_read.py | ekzemplaro/data_base_language | e77030367ffc595f1fac8583f03f9a3ce5eb1611 | [
"MIT",
"Unlicense"
] | 3 | 2015-05-12T16:44:27.000Z | 2021-02-09T00:39:24.000Z | lang/jquery_python/read/master_python_read.py | ekzemplaro/data_base_language | e77030367ffc595f1fac8583f03f9a3ce5eb1611 | [
"MIT",
"Unlicense"
] | null | null | null | lang/jquery_python/read/master_python_read.py | ekzemplaro/data_base_language | e77030367ffc595f1fac8583f03f9a3ce5eb1611 | [
"MIT",
"Unlicense"
] | null | null | null | #! /usr/bin/python3
# -*- coding: utf-8 -*-
#
# master_python_read.py
#
# Jul/31/2014
import sys
import json
#
#
sys.path.append ('/var/www/data_base/common/python_common')
from text_manipulate import dict_append_proc
# ---------------------------------------------------------------------
def data_prepare_proc ():
dict_aa = {}
dict_aa = dict_append_proc (dict_aa,'t0421','仙台',41295,'2003-8-12')
dict_aa = dict_append_proc (dict_aa,'t0422','石巻',27936,'2003-5-21')
dict_aa = dict_append_proc (dict_aa,'t0423','塩竈',19825,'2003-4-9')
dict_aa = dict_append_proc (dict_aa,'t0424','気仙沼',39256,'2003-2-25')
dict_aa = dict_append_proc (dict_aa,'t0425','白石',81452,'2003-9-12')
dict_aa = dict_append_proc (dict_aa,'t0426','名取',62397,'2003-7-26')
dict_aa = dict_append_proc (dict_aa,'t0427','多賀城',52984,'2003-10-8')
dict_aa = dict_append_proc (dict_aa,'t0428','岩沼',93612,'2003-2-12')
dict_aa = dict_append_proc (dict_aa,'t0429','大崎',89431,'2003-8-18')
#
return dict_aa
#
# ---------------------------------------------------------------------
dict_aa = data_prepare_proc ()
json_str = json.dumps (dict_aa)
#
print ("Content-type: text/json; charset=UTF-8\n\n")
#
print (json_str)
#
# ---------------------------------------------------------------------
| 34.027027 | 71 | 0.586974 | 184 | 1,259 | 3.728261 | 0.423913 | 0.19242 | 0.16035 | 0.209913 | 0.349854 | 0.349854 | 0.349854 | 0.122449 | 0 | 0 | 0 | 0.132174 | 0.086577 | 1,259 | 36 | 72 | 34.972222 | 0.464348 | 0.228753 | 0 | 0 | 0 | 0 | 0.236649 | 0.040838 | 0 | 0 | 0 | 0 | 0 | 1 | 0.05 | false | 0 | 0.15 | 0 | 0.25 | 0.1 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
ccabbe7abf4c7fb18c55a12d8aebef89c81ec7a4 | 6,966 | py | Python | bff-2/Rom/rom.py | Alpha-Demon404/RE-14 | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 39 | 2020-02-26T09:44:36.000Z | 2022-03-23T00:18:25.000Z | bff-2/Rom/rom.py | B4BY-DG/reverse-enginnering | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 15 | 2020-05-14T10:07:26.000Z | 2022-01-06T02:55:32.000Z | bff-2/Rom/rom.py | B4BY-DG/reverse-enginnering | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 41 | 2020-03-16T22:36:38.000Z | 2022-03-17T14:47:19.000Z | #!usr/bin/python2.7
# coding=utf-8
import requests, json, sys, os, re, time
from multiprocessing.pool import ThreadPool as th
from datetime import datetime
class Brute:
def __init__(self):
self.setpw = False
self.ok = []
self.cp = []
self.loop = 0
def bruteRequest(self, username, password):
params = {'access_token': '350685531728%7C62f8ce9f74b12f84c123cc23437a4a32',
'format': 'JSON',
'sdk_version': '2',
'email': username,
'locale': 'en_US',
'password': password,
'sdk': 'ios',
'generate_session_cookies': '1',
'sig': '3f555f99fb61fcd7aa0c44f58f522ef6'}
try:
os.mkdir('out')
except:
pass
api = 'https://b-api.facebook.com/method/auth.login'
response = requests.get(api, params=params)
if re.search('(EAAA)\\w+', response.text):
#print '\r\x1b[1;92m [Succesfull] '+ username + ' ◊ ' + password
self.ok.append(username + ' ◊ ' + password)
save = open('out/ok.txt', 'a')
save.write(str(username) + ' ◊ ' + str(password) + '\n')
save.close()
return True
else:
if 'www.facebook.com' in response.json()['error_msg']:
#print '\r \x1b[1;93m[Checkpoint] '+ username+' ◊ '+ password
self.cp.append(username + ' ◊ ' + password)
save = open('out/cp.txt', 'a')
save.write(str(username) + ' ◊ ' + str(password) + '\n')
save.close()
return True
return False
def brute(self, users):
if self.setpw == False:
self.loop += 1
for pw in users['pw']:
username = users['id'].lower()
password = pw.lower()
try:
if self.bruteRequest(username, password) == True:
break
except:
pass
sys.stdout.write(('\r\x1b[1;97m [\x1b[1;97m{}\x1b[1;97m*] Crack {}/{}\x1b[1;92m OK\x1b[1;97m:\x1b[1;92m{}\x1b[1;93m CP\x1b[1;97m:\x1b[1;93m{} \x1b[1;97m').format(datetime.now().strftime(''), self.loop, len(self.target), len(self.ok), len(self.cp)))
sys.stdout.flush()
else:
self.loop += 1
for pw in self.setpw:
username = users['id'].lower()
password = pw.lower()
try:
if self.bruteRequest(username, password) == True:
break
except:
pass
sys.stdout.write(('\r\x1b[1;97m [\x1b[1;97m{}\x1b[1;97m*] Crack {}/{}\x1b[1;92m OK\x1b[1;97m:\x1b[1;92m{}\x1b[1;93m CP\x1b[1;97m:\x1b[1;93m{} \x1b[1;97m').format(datetime.now().strftime(''), self.loop, len(self.target), len(self.ok), len(self.cp)))
sys.stdout.flush()
def main(self):
os.system('clear')
print'\x1b[1;95m• \x1b[1;92mrom.py \n\x1b[1;93m _____ __________ _____ \n / \\\\______ \\_/ ____\\ \n / \\ / \\| | _/\\ __\\ \n / Y \\ | \\ | | \n \\____|__ /______ / |__| \n \\/ \\/ \n [ github.com/Mark-Zuck ] '
print '\x1b[1;97m════════════════════════════════════════════════'
os.system("echo -e ' [•] Masukan Hasil Output Yang Anda Dump Tadi '| lolcat")
while True:
file = raw_input('\x1b[1;97m [*] Contoh Hasil Dump :\x1b[1;93m dump/xnxx.json\n \x1b[1;97m[?] Output Dump Tadi :\x1b[1;93m ')
try:
list = open(file, 'r').read()
object = json.loads(list)
break
except IOError:
print '\n\x1b[1;91m File \x1b[1;92m%s\x1b[1;91m Tidak Ada!' % file
os.system('exit')
self.target = []
for user in object:
try:
obj = user['name'].split(' ')
if len(obj) == 1:
listpass = [obj[0] + '123', obj[0] + '1234',
obj[0] + '12345']
elif len(obj) == 2:
listpass = [obj[0] + '123', obj[0] + '12345',
obj[1] + '123', obj[1] + '12345']
elif len(obj) == 3:
listpass = [obj[0] + '123', obj[0] + '12345',
obj[1] + '123', obj[1] + '12345',
obj[2] + '123', obj[2] + '12345']
elif len(obj) == 4:
listpass = [obj[0] + '123', obj[0] + '12345',
obj[1] + '123', obj[1] + '12345',
obj[2] + '123', obj[2] + '12345',
obj[3] + '123', obj[3] + '12345']
else:
listpass = ['sayang', 'anjing',
'bangsat', 'kontol','bismillah',
'cantik']
self.target.append({'id': user['uid'], 'pw': listpass})
except:
pass
if len(self.target) == 0:
exit('\x1b[1;91m Id Tidak ditemukan dalam file\x1b[1;97m [\x1b[1;92m %s \x1b[1;97m]' % file)
ask = raw_input("\x1b[1;97m [?] Password default/manual [d/m] :\x1b[1;93m ")
print''
print('\x1b[1;97m════════════════════════════════════════════════');time.sleep(0.07)
if ask.lower() == 'm':
while True:
print (" \x1b[1;97m[•] Gunakan Tanda (\x1b[1;92m,\x1b[1;97m) koma untuk pemisah ");time.sleep(0.07)
print (' \x1b[1;97m[*] Contoh : \x1b[1;93msayang\x1b[1;92m,\x1b[1;93mpengen\x1b[1;92m,\x1b[1;93mngentot ');time.sleep(0.07)
self.setpw = raw_input('\x1b[1;97m [?] Masukan Password :\x1b[1;93m ').strip().split(',')
print''
print('\x1b[1;97m════════════════════════════════════════════════');time.sleep(0.07)
if self.setpw[0] != '':
break
th(30).map(self.brute, self.target)
self.results()
exit()
def results(self):
if len(self.ok) != 0:
print '\n\n\x1b[1;92m Succesfull ' + str(len(self.ok))
for i in self.ok:
print '\x1b[1;92m [Succesfull] ' + str(i)
print '\x1b[1;97m Account Succesfull Tersimpan Di :\x1b[1;92m ok.txt'
if len(self.cp) != 0:
print '\n\n\x1b[1;93m Checkpoint ' + str(len(self.cp))
for i in self.cp:
print '\x1b[1;93m [Checkpoint] ' + str(i)
print '\x1b[1;97m Account Checkpoint Tersimpan Di :\x1b[1;93m cp.txt'
if len(self.cp) == 0 and len(self.ok) == 0:
print '\n\x1b[1;91m Tidak Mendapatkan Hasil \n'
# Awokawokawok Ngerekod:v | 44.941935 | 325 | 0.443296 | 809 | 6,966 | 3.930779 | 0.245983 | 0.07673 | 0.057233 | 0.028302 | 0.454717 | 0.384277 | 0.333962 | 0.298113 | 0.298113 | 0.298113 | 0 | 0.099175 | 0.373241 | 6,966 | 155 | 326 | 44.941935 | 0.594137 | 0.025553 | 0 | 0.365672 | 0 | 0.067164 | 0.305128 | 0.084917 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.164179 | 0.022388 | null | null | 0.119403 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
ccb53642d2a584a25a230bae533bd9ea08f7e834 | 671 | py | Python | tests/test_losses.py | yutayamazaki/Machine-Learning-Scratch | aa8f8479b14dfff3451f4b2a77d721062f2e6780 | [
"MIT"
] | null | null | null | tests/test_losses.py | yutayamazaki/Machine-Learning-Scratch | aa8f8479b14dfff3451f4b2a77d721062f2e6780 | [
"MIT"
] | 10 | 2019-11-27T14:54:50.000Z | 2020-04-22T19:33:16.000Z | tests/test_losses.py | yutayamazaki/Machine-Learning-Scratch | aa8f8479b14dfff3451f4b2a77d721062f2e6780 | [
"MIT"
] | null | null | null | import unittest
import numpy as np
from mlscratch.models import losses
class TestBinaryCrossEntropy(unittest.TestCase):
def setUp(self):
self.y_true = np.array([0, 1, 0.5])
self.y_pred = np.array([0, 1, 0.5])
def test_return(self):
bce = losses.binary_cross_entropy(self.y_true, self.y_pred)
self.assertIsInstance(bce, np.float64)
class TestMeanSquaredError(unittest.TestCase):
def setUp(self):
self.y_true = np.array([0, 1])
self.y_pred = np.array([0.3, 0.4])
def test_return(self):
mse = losses.mean_squared_error(self.y_true, self.y_pred)
self.assertIsInstance(mse, np.float64)
| 23.964286 | 67 | 0.66468 | 99 | 671 | 4.363636 | 0.373737 | 0.092593 | 0.083333 | 0.0625 | 0.479167 | 0.479167 | 0.388889 | 0.388889 | 0.212963 | 0.212963 | 0 | 0.034026 | 0.211624 | 671 | 27 | 68 | 24.851852 | 0.782609 | 0 | 0 | 0.235294 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.117647 | 1 | 0.235294 | false | 0 | 0.176471 | 0 | 0.529412 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
ccbacea1ae1e606c0c786eca7fe9faca1f25038e | 278 | py | Python | smalldistance.py | TheAnybodys/statistics-projects | 855984157221f0327a3164aba3def34eca1aacb1 | [
"MIT"
] | null | null | null | smalldistance.py | TheAnybodys/statistics-projects | 855984157221f0327a3164aba3def34eca1aacb1 | [
"MIT"
] | null | null | null | smalldistance.py | TheAnybodys/statistics-projects | 855984157221f0327a3164aba3def34eca1aacb1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 26 20:23:06 2022
@author: olivi
"""
import random
result = 0
for i in range(1000000):
X = random.uniform(0.0, 1.0)
Y = random.uniform(0.0, 1.0)
if abs(X - Y) <= 0.2:
result += 1
print(result / 1000000)
| 14.631579 | 35 | 0.557554 | 48 | 278 | 3.229167 | 0.645833 | 0.167742 | 0.180645 | 0.193548 | 0.219355 | 0.219355 | 0 | 0 | 0 | 0 | 0 | 0.191176 | 0.266187 | 278 | 19 | 36 | 14.631579 | 0.568627 | 0.266187 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.125 | 0 | 0.125 | 0.125 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
ccc3217e77cd568caf63f6f3f49400ed79e1c7f8 | 4,541 | py | Python | recipe/settings.py | lirixiang123/recipe | e78deb5e67c2a4faf140fd183c1a716a23b8a508 | [
"Apache-2.0"
] | null | null | null | recipe/settings.py | lirixiang123/recipe | e78deb5e67c2a4faf140fd183c1a716a23b8a508 | [
"Apache-2.0"
] | null | null | null | recipe/settings.py | lirixiang123/recipe | e78deb5e67c2a4faf140fd183c1a716a23b8a508 | [
"Apache-2.0"
] | 1 | 2021-07-10T16:46:25.000Z | 2021-07-10T16:46:25.000Z | """
Django settings for recipe project.
Generated by 'django-admin startproject' using Django 1.11.20.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'vm3us8wz9!=q1nolab7$1)ximn-6kh!i6lul)%lxnaa04k4f4!'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'apps.user',
'apps.index',
'apps.video',
'apps.news',
'apps.comment',
'apps.shop',
'ckeditor',
'ckeditor_uploader',
'rest_framework',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'recipe.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'recipe.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
# }
# }
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'cook',
'USER': 'root',
'PASSWORD': '123456',
'HOST': '127.0.0.1',
'PORT': '3306',
},
}
CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/2",
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
"PASSWORD": ""
}
}
}
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
SESSION_CACHE_ALIAS = "default"
# Password validation
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/
# LANGUAGE_CODE = 'en-us'
LANGUAGE_CODE = 'zh-hans'
# TIME_ZONE = 'UTC'
TIME_ZONE = 'Asia/Shanghai'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/
# 静态文件以/static/开头
STATIC_URL = '/static/'
# 静态文件查找路径,注意不要写错参数名
# STATICFILES_DIRS = [
# os.path.join(BASE_DIR, "static"), # 静态文件存放位置
# ]
STATIC_ROOT = os.path.join(BASE_DIR, 'allstatic')
#配置media
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
# 单位:px
THUMB_SIZE = 70
if not os.path.exists(MEDIA_ROOT):
os.mkdir(MEDIA_ROOT)
# 修改上传文件大小(Default: 2621440 (i.e. 2.5 MB).)
DATA_UPLOAD_MAX_MEMORY_SIZE = 2621440*10
#配置ckeditor
CKEDITOR_UPLOAD_PATH = 'upload/'
| 26.097701 | 92 | 0.64237 | 491 | 4,541 | 5.826884 | 0.417515 | 0.072702 | 0.053827 | 0.061167 | 0.220552 | 0.191541 | 0.095771 | 0.095771 | 0.042992 | 0 | 0 | 0.026109 | 0.215591 | 4,541 | 173 | 93 | 26.248555 | 0.777092 | 0.297291 | 0 | 0 | 1 | 0 | 0.513604 | 0.384279 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.071429 | 0.010204 | 0 | 0.010204 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
ccc7bc055674dd0055b622d6efd042d762b99f00 | 1,673 | py | Python | bling/clients.py | Elizabeth-Warren/bling-open | a5fd82d1a8d62ea74afada88b4fe1219e9144fc5 | [
"MIT"
] | 1 | 2020-09-16T16:57:27.000Z | 2020-09-16T16:57:27.000Z | bling/clients.py | Elizabeth-Warren/bling-open | a5fd82d1a8d62ea74afada88b4fe1219e9144fc5 | [
"MIT"
] | null | null | null | bling/clients.py | Elizabeth-Warren/bling-open | a5fd82d1a8d62ea74afada88b4fe1219e9144fc5 | [
"MIT"
] | null | null | null | from bling.helpscout.client import HelpScoutClient
from bling.mc.client import MobileCommonsClient
from twilio.rest import Client as TwilioClient
from bling.incoming import IncomingHandler
from bling.outgoing import OutgoingHandler
from bling.config import config
from bling.transport import (
Transport,
TwilioTransport,
MobileCommonsTransport,
TWILIO_TRANSPORT_TYPE,
MOBILECOMMONS_TRANSPORT_TYPE,
)
def helpscout_client() -> HelpScoutClient:
return HelpScoutClient(
client_id=config.helpscout_api_client_id,
secret=config.helpscout_api_client_secret,
)
def twilio_client() -> TwilioClient:
return TwilioClient(config.twilio_account_sid, config.twilio_auth_token)
def twilio_transport() -> TwilioTransport:
return TwilioTransport(twilio_client())
def mobilecommons_client() -> MobileCommonsClient:
return MobileCommonsClient(
config.mobilecommons_username, config.mobilecommons_password
)
def mobilecommons_transport() -> MobileCommonsTransport:
return MobileCommonsTransport(mobilecommons_client())
def incoming_message_handler(transport: Transport) -> IncomingHandler:
return IncomingHandler(helpscout_client(), transport)
def transport_for_type(transport_type: str) -> Transport:
if transport_type == TWILIO_TRANSPORT_TYPE:
return twilio_transport()
elif transport_type == MOBILECOMMONS_TRANSPORT_TYPE:
return mobilecommons_transport()
else:
raise Exception(f"'{transport_type}' is not a valid transport type'")
def outgoing_reply_handler(transport: Transport) -> OutgoingHandler:
return OutgoingHandler(helpscout_client(), transport) | 28.844828 | 77 | 0.782427 | 170 | 1,673 | 7.452941 | 0.282353 | 0.092344 | 0.029992 | 0.055249 | 0.061563 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.148834 | 1,673 | 58 | 78 | 28.844828 | 0.889747 | 0 | 0 | 0 | 0 | 0 | 0.029271 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.205128 | false | 0.025641 | 0.179487 | 0.179487 | 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 | 0 | 1 | 0 | 0 | 0 | 2 |
aea80db732950f7e91533dd06e240af2ea502040 | 829 | py | Python | src/3_examples/Structural/adapter.py | MilovanTomasevic/Python-Design-Patterns | 2a30e24e062bc623e390f8ced9c228c3ff038e54 | [
"MIT"
] | 2 | 2020-12-01T21:06:29.000Z | 2022-01-11T12:40:06.000Z | src/3_examples/Structural/adapter.py | MilovanTomasevic/Python-Design-Patterns | 2a30e24e062bc623e390f8ced9c228c3ff038e54 | [
"MIT"
] | null | null | null | src/3_examples/Structural/adapter.py | MilovanTomasevic/Python-Design-Patterns | 2a30e24e062bc623e390f8ced9c228c3ff038e54 | [
"MIT"
] | 1 | 2022-01-11T12:39:51.000Z | 2022-01-11T12:39:51.000Z | """
Convert the interface of a class into another interface clients expect.
Adapter lets classes work together that couldn't otherwise because of
incompatible interfaces.
"""
from abc import ABC, abstractmethod
# ----------------
# Target Interface
# ----------------
class Target(ABC):
"""
Interface for Client
"""
def __init__(self):
self._adaptee = Adaptee()
@abstractmethod
def request(self):
pass
# ----------------
# Adapter Class
# ----------------
class Adapter(Target):
def request(self):
self._adaptee.adaptee_request()
# ----------------
# Adaptee Class
# --------------
class Adaptee:
def adaptee_request(self):
print("Adaptee function called.")
def main():
adapter = Adapter()
adapter.request()
if __name__ == "__main__":
main() | 18.840909 | 71 | 0.583836 | 82 | 829 | 5.707317 | 0.5 | 0.070513 | 0.064103 | 0.094017 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.21351 | 829 | 44 | 72 | 18.840909 | 0.717791 | 0.401689 | 0 | 0.111111 | 0 | 0 | 0.069264 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.277778 | false | 0.055556 | 0.055556 | 0 | 0.5 | 0.055556 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
aeb326e6b9fdaf4309888e7191dc8a23d3f77d8e | 1,366 | py | Python | SIGNUS/modules/crawler/etc/driver_agent.py | 837477/SIGNUS | cd395dfd45d2c36d09ec9a8069e6e52e19f058e8 | [
"MIT"
] | null | null | null | SIGNUS/modules/crawler/etc/driver_agent.py | 837477/SIGNUS | cd395dfd45d2c36d09ec9a8069e6e52e19f058e8 | [
"MIT"
] | null | null | null | SIGNUS/modules/crawler/etc/driver_agent.py | 837477/SIGNUS | cd395dfd45d2c36d09ec9a8069e6e52e19f058e8 | [
"MIT"
] | null | null | null | from selenium import webdriver
from platform import platform
import os
# def chromedriver():
# options = webdriver.ChromeOptions()
# options.add_argument('headless')
# options.add_argument('window-size=1920x1080')
# options.add_argument("disable-gpu")
# options.add_argument("user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5)AppleWebKit 537.36 (KHTML, like Gecko) Chrome")
# options.add_argument("lang=ko_KR")
# path = os.getenv("SIGNUS_CHROMEDRIVER_PATH")
# if platform().startswith("Windows"):
# driver = webdriver.Chrome('../chromedriver.exe', options=options)
# else:
# driver = webdriver.Chrome(path, options=options)
# return driver
def chromedriver():
path = os.getenv("SIGNUS_CHROMEDRIVER_PATH")
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-gpu')
chrome_options.add_argument('--disable-dev-shm-usage')
chrome_options.add_argument("--ignore-ssl-errors=true")
chrome_options.add_argument("--ssl-protocol=any")
chrome_options.add_argument('--ignore-certificate-errors')
chrome_options.add_argument("user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5)AppleWebKit 537.36 (KHTML, like Gecko) Chrome")
driver = webdriver.Chrome(executable_path=path,options=chrome_options)
return driver
| 36.918919 | 134 | 0.763543 | 179 | 1,366 | 5.642458 | 0.346369 | 0.128713 | 0.231683 | 0.213861 | 0.408911 | 0.257426 | 0.190099 | 0.190099 | 0.190099 | 0.190099 | 0 | 0.024331 | 0.097365 | 1,366 | 36 | 135 | 37.944444 | 0.794809 | 0.418009 | 0 | 0 | 0 | 0.0625 | 0.324775 | 0.154044 | 0 | 0 | 0 | 0 | 0 | 1 | 0.0625 | false | 0 | 0.1875 | 0 | 0.3125 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
aebcb1771fcd260b5409e7f5db8a39fc73a58c25 | 807 | py | Python | src/unix_accounts/bin/auth_tokens.py | 1nfiniteloop/unix-accounts | 9b4dc6f07e203610ea58698f982727daa3389d20 | [
"MIT"
] | null | null | null | src/unix_accounts/bin/auth_tokens.py | 1nfiniteloop/unix-accounts | 9b4dc6f07e203610ea58698f982727daa3389d20 | [
"MIT"
] | null | null | null | src/unix_accounts/bin/auth_tokens.py | 1nfiniteloop/unix-accounts | 9b4dc6f07e203610ea58698f982727daa3389d20 | [
"MIT"
] | null | null | null | import secrets
from typing import FrozenSet
class AuthorizationTokens:
def __init__(self, filename: str):
self._filename = filename
def get_tokens(self) -> FrozenSet[str]:
return self._read_tokens()
def generate_token(self) -> str:
token = secrets.token_urlsafe(32)
self._write_token(token)
return token
def _write_token(self, token: str):
with open(self._filename, "at") as file:
file.write(token)
file.write("\n")
def _read_tokens(self) -> FrozenSet[str]:
with open(self._filename, "r") as file:
return frozenset(self._token_gen(file))
def _token_gen(self, file):
lines = file.read()
for line in lines.split("\n"):
if (line):
yield line
| 25.21875 | 51 | 0.599752 | 98 | 807 | 4.714286 | 0.367347 | 0.103896 | 0.082251 | 0.095238 | 0.099567 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003497 | 0.291202 | 807 | 31 | 52 | 26.032258 | 0.804196 | 0 | 0 | 0 | 0 | 0 | 0.008674 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.26087 | false | 0 | 0.086957 | 0.043478 | 0.521739 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
aed38b35eb60930e42cb0ae1c59b8cfc1c65b304 | 372 | py | Python | self_virtualenv/do_virtualenv.py | zhaoyu69/python3-learning | faf786f03d13c632d107b1dbd42e923f8b012a28 | [
"MIT"
] | 1 | 2018-07-08T00:19:51.000Z | 2018-07-08T00:19:51.000Z | self_virtualenv/do_virtualenv.py | zhaoyu69/python3-learning | faf786f03d13c632d107b1dbd42e923f8b012a28 | [
"MIT"
] | null | null | null | self_virtualenv/do_virtualenv.py | zhaoyu69/python3-learning | faf786f03d13c632d107b1dbd42e923f8b012a28 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# virtualenv: 为每个应用创建一套“隔离”的Python运行环境。
# pip3 install virtualenv
# 整一套独立的python运行环境
# 1. 创建目录
# mkdir myproject
# cd myproject/
# 2. 创建一个独立的Python运行环境,命名为venv
# virtualenv --no-site-packages venv
# --no-site-packages 不带任何第三方包
# 进入环境
# source venv/bin/activate
# venv\Scripts\activate.bat (Windows)
# 退出环境
# deactivate | 16.173913 | 39 | 0.72043 | 45 | 372 | 5.955556 | 0.777778 | 0.044776 | 0.104478 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015674 | 0.142473 | 372 | 23 | 40 | 16.173913 | 0.824451 | 0.897849 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
aeea92b3661eb71cb5d51e828614f15e511a2c7c | 482 | py | Python | summarize/test.py | ChaiJT/summarize | 6d364fc20784bb37dcb62d06ddbf4b4ec667e8f8 | [
"MIT"
] | 1 | 2020-12-03T10:41:09.000Z | 2020-12-03T10:41:09.000Z | summarize/test.py | ChaiJT/summarize | 6d364fc20784bb37dcb62d06ddbf4b4ec667e8f8 | [
"MIT"
] | null | null | null | summarize/test.py | ChaiJT/summarize | 6d364fc20784bb37dcb62d06ddbf4b4ec667e8f8 | [
"MIT"
] | null | null | null |
# from textrank4zh import TextRank4Keyword
#
# test_text = open("test_text.txt", "r", encoding="utf-8").read()
#
#
# tr4w = TextRank4Keyword()
# tr4w.analyze(text=test_text,lower=True, window=2, pagerank_config={'alpha':0.85})
#
# for item in tr4w.get_keywords(10, word_min_len=1):
# print(item.word, item.weight)
#
# import time
#
# s_t = time.time()
# for i in range(10):
# tr4w.get_keywords(10, word_min_len=1)
# e_t = time.time()
# print(f"\n10篇文章提取关键词耗时{e_t-s_t}s。")
| 22.952381 | 83 | 0.678423 | 78 | 482 | 4.012821 | 0.564103 | 0.076677 | 0.095847 | 0.108626 | 0.178914 | 0.178914 | 0.178914 | 0.178914 | 0 | 0 | 0 | 0.052758 | 0.134855 | 482 | 20 | 84 | 24.1 | 0.697842 | 0.919087 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
aef6aa1450f2d3243b6b5e34cdbbe32a76c278e7 | 2,278 | py | Python | src/utils/audio.py | Jiyao17/fledge | d622376751d7a6ec7b373c367a0dcef96a10c6a0 | [
"MIT"
] | 4 | 2021-09-15T03:46:10.000Z | 2022-01-01T02:18:06.000Z | src/utils/audio.py | Jiyao17/fledge | d622376751d7a6ec7b373c367a0dcef96a10c6a0 | [
"MIT"
] | null | null | null | src/utils/audio.py | Jiyao17/fledge | d622376751d7a6ec7b373c367a0dcef96a10c6a0 | [
"MIT"
] | null | null | null |
import os
from torchaudio.datasets import SPEECHCOMMANDS
import torch
class SubsetSC(SPEECHCOMMANDS):
def __init__(self, subset, data_path):
super().__init__(root=data_path, download=True)
def load_list(filename):
filepath = os.path.join(self._path, filename)
with open(filepath) as fileobj:
return [os.path.join(self._path, line.strip()) for line in fileobj]
if subset == "validation":
self._walker = load_list("validation_list.txt")
elif subset == "testing":
self._walker = load_list("testing_list.txt")
elif subset == "training":
excludes = load_list("validation_list.txt") + load_list("testing_list.txt")
excludes = set(excludes)
self._walker = [w for w in self._walker if w not in excludes]
def set_LABELS(labels):
global LABELS
LABELS = labels
def label_to_index(word):
# Return the position of the word in labels
return torch.tensor(LABELS.index(word))
def index_to_label(index):
# Return the word corresponding to the index in labels
# This is the inverse of label_to_index
return LABELS[index]
def pad_sequence(batch):
# Make all tensor in a batch the same length by padding with zeros
batch = [item.t() for item in batch]
batch = torch.nn.utils.rnn.pad_sequence(batch, batch_first=True, padding_value=0.)
return batch.permute(0, 2, 1)
def collate_fn(batch):
# A data tuple has the form:
# waveform, sample_rate, label, speaker_id, utterance_number
tensors, targets = [], []
# Gather in lists, and encode labels as indices
for waveform, _, label, *_ in batch:
tensors += [waveform]
targets += [label_to_index(label)]
# Group the list of tensors into a batched tensor
tensors = pad_sequence(tensors)
targets = torch.stack(targets)
return tensors, targets
def number_of_correct(pred, target):
# count number of correct predictions
return pred.squeeze().eq(target).sum().item()
def get_likely_index(tensor):
# find most likely label index for each element in the batch
return tensor.argmax(dim=-1)
def count_parameters(model):
return sum(p.numel() for p in model.parameters() if p.requires_grad) | 32.542857 | 87 | 0.676471 | 315 | 2,278 | 4.730159 | 0.396825 | 0.026846 | 0.024161 | 0.018792 | 0.087248 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002841 | 0.227392 | 2,278 | 70 | 88 | 32.542857 | 0.84375 | 0.207199 | 0 | 0 | 0 | 0 | 0.052925 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.232558 | false | 0 | 0.069767 | 0.116279 | 0.511628 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
aef82dbd2da1020351f0d689eefdf7e06470a701 | 769 | py | Python | setup.py | dmitriiweb/clpb | c9680c574a540c86edfcc8c733a45740424e386d | [
"MIT"
] | 1 | 2018-12-28T05:51:52.000Z | 2018-12-28T05:51:52.000Z | setup.py | dmitriiweb/clpb | c9680c574a540c86edfcc8c733a45740424e386d | [
"MIT"
] | null | null | null | setup.py | dmitriiweb/clpb | c9680c574a540c86edfcc8c733a45740424e386d | [
"MIT"
] | null | null | null | from setuptools import setup
with open('README.rst') as readme:
r = str(readme.read())
setup(
name='clpb',
version='1.0.0',
url='https://github.com/dmitriiweb/clpb',
license='MIT',
author='Dmitrii K',
author_email='winston_smith_spb@gmail.com',
description=' Command line progress bar for Python 3',
long_description=r,
classifiers=(
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
),
)
| 29.576923 | 58 | 0.611183 | 86 | 769 | 5.418605 | 0.651163 | 0.075107 | 0.26824 | 0.223176 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020583 | 0.241873 | 769 | 25 | 59 | 30.76 | 0.778731 | 0 | 0 | 0 | 0 | 0 | 0.544863 | 0.035111 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4e0010ffdb2965bda6160c8e8411b76654438888 | 7,184 | py | Python | product_spider/items.py | Pandaaaa906/product_spider | cc7f865f53fd3ed68f4869be3ba917c8373dfcf2 | [
"MIT"
] | null | null | null | product_spider/items.py | Pandaaaa906/product_spider | cc7f865f53fd3ed68f4869be3ba917c8373dfcf2 | [
"MIT"
] | null | null | null | product_spider/items.py | Pandaaaa906/product_spider | cc7f865f53fd3ed68f4869be3ba917c8373dfcf2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
# import scrapy
import scrapyautodb as scrapy
class JkItem(scrapy.OrderedItem):
cat_no = scrapy.Field()
en_name = scrapy.Field()
chs_name = scrapy.Field()
cas = scrapy.Field()
brand = scrapy.Field()
package = scrapy.Field()
price = scrapy.Field()
purity = scrapy.Field()
class Meta:
indexes = (
(("cat_no",), True),
)
class JkProduct(scrapy.OrderedItem):
brand = scrapy.Field()
cat_no = scrapy.Field()
en_name = scrapy.Field()
cn_name = scrapy.Field()
cas = scrapy.Field()
purity = scrapy.Field()
prd_url = scrapy.Field()
img_url = scrapy.Field()
class Meta:
indexes = (
(("brand", "cat_no",), True),
)
class JKPackage(scrapy.OrderedItem):
brand = scrapy.Field()
cat_no = scrapy.Field()
package = scrapy.Field()
price = scrapy.Field()
currency = scrapy.Field()
attrs = scrapy.Field()
class Meta:
indexes = (
(('brand', 'cat_no', 'package'), True),
)
class BestownPrdItem(scrapy.OrderedItem):
chs_name = scrapy.Field()
en_name = scrapy.Field()
country = scrapy.Field()
brand = scrapy.Field()
unit = scrapy.Field()
cas = scrapy.Field()
cat_no_unit = scrapy.Field()
prd_type = scrapy.Field()
stock = scrapy.Field()
coupon = scrapy.Field()
price = scrapy.Field()
url = scrapy.Field()
class Meta:
indexes = (
(('cat_no_unit',), True),
)
class NicpbpItem(scrapy.OrderedItem):
cat_no = scrapy.Field()
name = scrapy.Field()
lot = scrapy.Field()
unit = scrapy.Field()
usage = scrapy.Field()
storage = scrapy.Field()
in_stock = scrapy.Field()
class Meta:
indexes = (
(("cat_no",), True),
)
class RawData(scrapy.OrderedItem):
brand = scrapy.Field() ##品牌
parent = scrapy.Field() ##分类
cat_no = scrapy.Field() ##货号
en_name = scrapy.Field() ##英文名
chs_name = scrapy.Field() ##中文名
cas = scrapy.Field() ##cas号
smiles = scrapy.Field() ##结构式
mf = scrapy.Field() ##分子式
mw = scrapy.Field() ##分子量
stock_info = scrapy.Field() ##库存状态
purity = scrapy.Field() ##纯度
appearance = scrapy.Field() ##外观
img_url = scrapy.Field() ##图片url
info1 = scrapy.Field() ##化学名称
info2 = scrapy.Field() ##储存条件
info3 = scrapy.Field() ##
info4 = scrapy.Field() ##
info5 = scrapy.Field() ##
tags = scrapy.Field()
grade = scrapy.Field()
mol_text = scrapy.Field()
prd_url = scrapy.Field() ##详情地址
expiry_date = scrapy.Field()
stock_num = scrapy.Field()
mdl = scrapy.Field()
einecs = scrapy.Field()
class Meta:
indexes = (
(('brand', 'cat_no',), True),
)
class ProductPackage(scrapy.OrderedItem):
brand = scrapy.Field()
cat_no = scrapy.Field()
cat_no_unit = scrapy.Field()
package = scrapy.Field()
price = scrapy.Field()
currency = scrapy.Field()
delivery_time = scrapy.Field()
stock_num = scrapy.Field()
info = scrapy.Field()
class Meta:
indexes = (
(('brand', 'cat_no', 'package'), True),
)
class TanmoItem(scrapy.OrderedItem):
cat_no = scrapy.Field()
name = scrapy.Field()
standard = scrapy.Field()
cas = scrapy.Field()
unit = scrapy.Field()
price = scrapy.Field()
stock = scrapy.Field()
delivery = scrapy.Field()
expiry_date = scrapy.Field()
company = scrapy.Field()
class Meta:
indexes = (
(('cat_no', 'name'), True),
)
class AnpelItem(scrapy.OrderedItem):
cat_no = scrapy.Field()
cn_name = scrapy.Field()
en_name = scrapy.Field()
brand = scrapy.Field()
sub_brand = scrapy.Field()
cas = scrapy.Field()
package = scrapy.Field()
unit = scrapy.Field()
price = scrapy.Field()
delivery_time = scrapy.Field()
storage = scrapy.Field()
prd_url = scrapy.Field()
class Meta:
indexes = (
(('cat_no',), True),
)
class NewBestownItem(scrapy.OrderedItem):
uid = scrapy.Field()
stockcode = scrapy.Field()
name = scrapy.Field()
brand = scrapy.Field()
purity = scrapy.Field()
name2 = scrapy.Field()
name3 = scrapy.Field()
pack = scrapy.Field()
molecular = scrapy.Field()
picture = scrapy.Field()
picture2 = scrapy.Field()
date = scrapy.Field()
temp = scrapy.Field()
method = scrapy.Field()
transport = scrapy.Field()
attention = scrapy.Field()
price = scrapy.Field()
num = scrapy.Field()
msds = scrapy.Field()
report = scrapy.Field()
rj = scrapy.Field()
class Meta:
indexes = (
(('stockcode',), True),
)
class HbErmItem(scrapy.OrderedItem):
cat_no = scrapy.Field()
cn_name = scrapy.Field()
batch = scrapy.Field()
manufacture = scrapy.Field()
expire_date = scrapy.Field()
package = scrapy.Field()
sale_info = scrapy.Field()
usage = scrapy.Field()
components = scrapy.Field()
concentrate = scrapy.Field()
price = scrapy.Field()
stock_info = scrapy.Field()
class Meta:
indexes = (
(('cat_no', 'batch'), True),
)
class HongmengItem(scrapy.OrderedItem):
brand = scrapy.Field()
sub_brand = scrapy.Field()
parent = scrapy.Field()
cat_no = scrapy.Field()
sub_cat_no = scrapy.Field()
cn_name = scrapy.Field()
purity = scrapy.Field()
cas = scrapy.Field()
package = scrapy.Field()
price = scrapy.Field()
amount = scrapy.Field()
place_code = scrapy.Field()
prd_url = scrapy.Field()
class Meta:
indexes = (
(('brand', 'sub_brand', 'cat_no', 'sub_cat_no', 'place_code'), True),
)
class SupplierProduct(scrapy.OrderedItem):
platform = scrapy.Field()
source_id = scrapy.Field()
vendor = scrapy.Field()
brand = scrapy.Field()
vendor_origin = scrapy.Field()
vendor_type = scrapy.Field()
vendor_url = scrapy.Field()
parent = scrapy.Field()
cat_no = scrapy.Field()
en_name = scrapy.Field()
chs_name = scrapy.Field()
cas = scrapy.Field()
smiles = scrapy.Field()
mf = scrapy.Field()
mw = scrapy.Field()
stock_info = scrapy.Field()
purity = scrapy.Field()
appearance = scrapy.Field()
img_url = scrapy.Field()
synonyms = scrapy.Field()
storage_condition = scrapy.Field()
package = scrapy.Field()
price = scrapy.Field()
delivery = scrapy.Field()
info1 = scrapy.Field()
info2 = scrapy.Field()
info3 = scrapy.Field()
info4 = scrapy.Field()
info5 = scrapy.Field()
tags = scrapy.Field()
grade = scrapy.Field()
mol_text = scrapy.Field()
prd_url = scrapy.Field()
expiry_date = scrapy.Field()
stock_num = scrapy.Field()
mdl = scrapy.Field()
einecs = scrapy.Field()
class Meta:
indexes = (
(('platform', 'source_id',), True),
)
| 24.026756 | 81 | 0.585329 | 799 | 7,184 | 5.161452 | 0.173967 | 0.482784 | 0.061833 | 0.063046 | 0.669738 | 0.556984 | 0.479631 | 0.428952 | 0.348206 | 0.239088 | 0 | 0.002668 | 0.269627 | 7,184 | 298 | 82 | 24.107383 | 0.783305 | 0.028257 | 0 | 0.676113 | 0 | 0 | 0.025087 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.004049 | 0 | 0.842105 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
4e06f53e4dfca66992beab888e9ba6530968dac0 | 88 | py | Python | Idat_Python2022/Semana_9/Ejercicio10.py | Kennethguerra3/Python_Ejercicio_2022 | cf1297cf1e1585eba699e32c02993818c3d9ecbf | [
"MIT"
] | null | null | null | Idat_Python2022/Semana_9/Ejercicio10.py | Kennethguerra3/Python_Ejercicio_2022 | cf1297cf1e1585eba699e32c02993818c3d9ecbf | [
"MIT"
] | null | null | null | Idat_Python2022/Semana_9/Ejercicio10.py | Kennethguerra3/Python_Ejercicio_2022 | cf1297cf1e1585eba699e32c02993818c3d9ecbf | [
"MIT"
] | null | null | null | num = int(input("Numero: "))
for i in range(1,13):
m = num * i
print(num,"X",i,"=",m) | 17.6 | 28 | 0.534091 | 18 | 88 | 2.611111 | 0.722222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.041667 | 0.181818 | 88 | 5 | 29 | 17.6 | 0.611111 | 0 | 0 | 0 | 0 | 0 | 0.11236 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4e0b495f3fe8123e996df8578796aff25304839d | 3,369 | py | Python | MagicTelecomAPILib/Models/Account.py | MagicTelecom/mt_python_api | b014760809cb1d0cab48a3376cbaface0c4bef66 | [
"MIT"
] | null | null | null | MagicTelecomAPILib/Models/Account.py | MagicTelecom/mt_python_api | b014760809cb1d0cab48a3376cbaface0c4bef66 | [
"MIT"
] | null | null | null | MagicTelecomAPILib/Models/Account.py | MagicTelecom/mt_python_api | b014760809cb1d0cab48a3376cbaface0c4bef66 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
MagicTelecomAPILib.Models.Account
This file was automatically generated by APIMATIC v2.0 on 06/22/2016
"""
from MagicTelecomAPILib.APIHelper import APIHelper
class Account(object):
"""Implementation of the 'Account' model.
TODO: type model description here.
Attributes:
number (string): TODO: type description here.
roles (list of string): TODO: type description here.
email (string): TODO: type description here.
contact_number (string): TODO: type description here.
firstname (string): TODO: type description here.
lastname (string): TODO: type description here.
"""
def __init__(self,
**kwargs):
"""Constructor for the Account class
Args:
**kwargs: Keyword Arguments in order to initialise the
object. Any of the attributes in this object are able to
be set through the **kwargs of the constructor. The values
that can be supplied and their types are as follows::
number -- string -- Sets the attribute number
roles -- list of string -- Sets the attribute roles
email -- string -- Sets the attribute email
contact_number -- string -- Sets the attribute contact_number
firstname -- string -- Sets the attribute firstname
lastname -- string -- Sets the attribute lastname
"""
# Set all of the parameters to their default values
self.number = None
self.roles = None
self.email = None
self.contact_number = None
self.firstname = None
self.lastname = None
# Create a mapping from API property names to Model property names
replace_names = {
"number": "number",
"roles": "roles",
"email": "email",
"contact_number": "contact_number",
"firstname": "firstname",
"lastname": "lastname",
}
# Parse all of the Key-Value arguments
if kwargs is not None:
for key in kwargs:
# Only add arguments that are actually part of this object
if key in replace_names:
setattr(self, replace_names[key], kwargs[key])
def resolve_names(self):
"""Creates a dictionary representation of this object.
This method converts an object to a dictionary that represents the
format that the model should be in when passed into an API Request.
Because of this, the generated dictionary may have different
property names to that of the model itself.
Returns:
dict: The dictionary representing the object.
"""
# Create a mapping from Model property names to API property names
replace_names = {
"number": "number",
"roles": "roles",
"email": "email",
"contact_number": "contact_number",
"firstname": "firstname",
"lastname": "lastname",
}
retval = dict()
return APIHelper.resolve_names(self, replace_names, retval) | 36.225806 | 82 | 0.56634 | 355 | 3,369 | 5.321127 | 0.329577 | 0.055056 | 0.044468 | 0.079407 | 0.251985 | 0.160932 | 0.123875 | 0.123875 | 0.123875 | 0.123875 | 0 | 0.005114 | 0.361532 | 3,369 | 93 | 83 | 36.225806 | 0.873082 | 0.544078 | 0 | 0.424242 | 1 | 0 | 0.159864 | 0 | 0 | 0 | 0 | 0.075269 | 0 | 1 | 0.060606 | false | 0 | 0.030303 | 0 | 0.151515 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4e0bf296e8c8ac48f1b53f27551dc0819b04ed86 | 1,424 | py | Python | lib/segmentation/algorithm.py | rusty1s/embedded_gcnn | 06db3799e794d6ebcd9db023ebd8b0937587df94 | [
"MIT"
] | 74 | 2017-03-07T07:06:15.000Z | 2022-01-21T07:37:33.000Z | lib/segmentation/algorithm.py | DeepaliVerma/embedded_gcnn | 06db3799e794d6ebcd9db023ebd8b0937587df94 | [
"MIT"
] | 9 | 2017-07-01T11:22:18.000Z | 2020-03-31T04:48:52.000Z | lib/segmentation/algorithm.py | DeepaliVerma/embedded_gcnn | 06db3799e794d6ebcd9db023ebd8b0937587df94 | [
"MIT"
] | 12 | 2018-01-09T08:06:27.000Z | 2022-02-25T01:49:35.000Z | import numpy as np
from skimage import color, segmentation
def slic(image, num_segments, compactness=10, max_iterations=10, sigma=0):
image = _preprocess(image)
return segmentation.slic(image, num_segments, compactness, max_iterations,
sigma)
def slic_fixed(num_segments, compactness=10, max_iterations=10, sigma=0):
def slic_image(image):
return slic(image, num_segments, compactness, max_iterations, sigma)
return slic_image
def quickshift(image, ratio=1, kernel_size=5, max_dist=1, sigma=0):
image = _preprocess(image)
return segmentation.quickshift(
image, ratio, kernel_size, max_dist, sigma=sigma)
def quickshift_fixed(ratio=1, kernel_size=5, max_dist=1, sigma=0):
def quickshift_image(image):
return quickshift(image, ratio, kernel_size, max_dist, sigma)
return quickshift_image
def felzenszwalb(image, scale=1, min_size=1, sigma=0):
image = _preprocess(image)
return segmentation.felzenszwalb(image, scale, sigma, min_size)
def felzenszwalb_fixed(scale=1, min_size=1, sigma=0):
def felzenszwalb_image(image):
return felzenszwalb(image, scale, min_size, sigma)
return felzenszwalb_image
def _preprocess(image):
if len(image.shape) == 2 or image.shape[2] == 1:
return color.gray2rgb(
np.reshape(image, (image.shape[0], image.shape[1])))
else:
return image
| 29.061224 | 78 | 0.704354 | 191 | 1,424 | 5.078534 | 0.209424 | 0.037113 | 0.090722 | 0.061856 | 0.512371 | 0.503093 | 0.503093 | 0.429897 | 0.156701 | 0.063918 | 0 | 0.026132 | 0.19382 | 1,424 | 48 | 79 | 29.666667 | 0.818815 | 0 | 0 | 0.096774 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.322581 | false | 0 | 0.064516 | 0.096774 | 0.741935 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.