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
df6daf8c05e63066bef5079673fe8edf1351a1c1
580
py
Python
source/validate.py
asaranprasad/nvda
e9609694acbfb06398eb6552067a0dcd532d67af
[ "bzip2-1.0.6" ]
2
2020-08-24T17:41:45.000Z
2020-08-25T16:48:52.000Z
source/validate.py
asaranprasad/nvda
e9609694acbfb06398eb6552067a0dcd532d67af
[ "bzip2-1.0.6" ]
3
2017-09-29T17:14:18.000Z
2019-05-20T16:13:39.000Z
source/validate.py
asaranprasad/nvda
e9609694acbfb06398eb6552067a0dcd532d67af
[ "bzip2-1.0.6" ]
1
2017-09-29T08:53:52.000Z
2017-09-29T08:53:52.000Z
#validate.py #A part of NonVisual Desktop Access (NVDA) #Copyright (C) 2018 NV Access Limited, Babbage B.V., Joseph Lee #This file is covered by the GNU General Public License. #See the file COPYING for more details. """ Module to provide backwards compatibility with add-ons that use the configobj validate module. Add-ons should be changed to use configobj.validate instead. """ from configobj.validate import * import warnings warnings.warn("Importing validate directly is deprecated. Please use configobj.validate instead", DeprecationWarning, stacklevel=2)
36.25
132
0.772414
82
580
5.463415
0.731707
0.151786
0.089286
0.120536
0
0
0
0
0
0
0
0.010267
0.160345
580
15
133
38.666667
0.909651
0.625862
0
0
0
0
0.421053
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
3
df84a7a243315f70e25d11411c0e01399e194143
8,223
py
Python
tests/shakedown/shakedown/dcos/cluster.py
ryanmaclean/marathon
cc35af421675205b797b31890e88b5fa4d178a02
[ "Apache-2.0" ]
null
null
null
tests/shakedown/shakedown/dcos/cluster.py
ryanmaclean/marathon
cc35af421675205b797b31890e88b5fa4d178a02
[ "Apache-2.0" ]
1
2021-12-17T10:43:40.000Z
2021-12-17T10:43:40.000Z
tests/shakedown/shakedown/dcos/cluster.py
ryanmaclean/marathon
cc35af421675205b797b31890e88b5fa4d178a02
[ "Apache-2.0" ]
null
null
null
import logging import pytest from . import dcos_version from .. import http, VERSION as SHAKEDOWN_VERSION from ..clients import dcos_url_path from ..clients.mesos import DCOSClient from distutils.version import LooseVersion logger = logging.getLogger(__name__) dcos_1_12 = pytest.mark.skipif('dcos_version_less_than("1.12")') dcos_1_11 = pytest.mark.skipif('dcos_version_less_than("1.11")') dcos_1_10 = pytest.mark.skipif('dcos_version_less_than("1.10")') dcos_1_9 = pytest.mark.skipif('dcos_version_less_than("1.9")') dcos_1_8 = pytest.mark.skipif('dcos_version_less_than("1.8")') dcos_1_7 = pytest.mark.skipif('dcos_version_less_than("1.7")') # runs for strict, ignores if not strict (strict is required) strict = pytest.mark.skipif("ee_version() != 'strict'") permissive = pytest.mark.skipif("ee_version() != 'permissive'") disabled = pytest.mark.skipif("ee_version() != 'disabled'") PUBLIC_ROLE = 'slave_public' def shakedown_canonical_version(): return _canonical_version(SHAKEDOWN_VERSION) def shakedown_version_less_than(version): """@pytest.mark.skipif("shakedown_version_less_than('1.3')") skip if shakedown doesn't support it yet. """ return shakedown_canonical_version() < LooseVersion(version) def dcos_canonical_version(): return _canonical_version(dcos_version()) def _canonical_version(version): index = version.rfind("-dev") if index != -1: version = version[:index] return LooseVersion(version) def dcos_version_less_than(version): return dcos_canonical_version() < LooseVersion(version) def required_cpus(cpus, role='*'): """ Returns True if the number of available cpus is equal to or greater than the cpus. This is useful in using pytest skipif such as: `pytest.mark.skipif('required_cpus(2)')` which will skip the test if the number of cpus is not 2 or more. :param cpus: the number of required cpus. :param role: the role / reservation (default='*') """ resources = get_resources_by_role() # reverse logic (skip if less than count) # returns True if less than count return resources.cpus < cpus def required_mem(mem, role='*'): """ Returns True if the number of available memory is equal to or greater than the mem. This is useful in using pytest skipif such as: `pytest.mark.skipif('required_mem(2)')` which will skip the test if the number of mem is not 2m or more. :param mem: the amount of required mem in meg. :param role: the role / reservation (default='*') """ resources = get_resources_by_role() # reverse logic (skip if less than count) # returns True if less than count return resources.mem < mem def bootstrap_metadata(): """ Provides cluster metadata which includes security modes """ return _metadata_helper('bootstrap-config.json') def ui_config_metadata(): """ Provides cluster metadata used by the ui which includes mesos logging strategy """ return _metadata_helper('ui-config.json') def dcos_version_metadata(): return _metadata_helper('dcos-version.json') def _metadata_helper(json_path): """ Returns json for specific cluster metadata. Important to realize that this was introduced in dcos-1.9. Clusters prior to 1.9 and missing metadata will return None """ url = dcos_url_path('dcos-metadata/{}'.format(json_path)) try: response = http.request('get', url) if response.status_code == 200: return response.json() except Exception: logger.exception('Could not request cluster metadata.') pass return None def ee_version(): """ Provides the type or version of EE if it is Enterprise. Useful for @pytest.mark.skipif("ee_version() in {'strict', 'disabled'}") """ metadata = bootstrap_metadata() if metadata: return metadata['security'] else: return None def is_strict(): return ee_version() == 'strict' def mesos_logging_strategy(): metadata = ui_config_metadata() if metadata: try: return metadata['uiConfiguration']['plugins']['mesos']['logging-strategy'] except Exception: logger.exception('Could not fetch Mesos logging strategy.') pass return None def get_resources(): return _get_resources() def resources_needed(total_tasks=1, per_task_cpu=0.01, per_task_mem=1): total_cpu = per_task_cpu * total_tasks total_mem = per_task_mem * total_tasks return Resources(total_cpu, total_mem) def get_used_resources(): return _get_resources('used_resources') def get_unreserved_resources(): return _get_resources('unreserved_resources') def available_resources(): res = get_resources() used = get_used_resources() return res - used def get_resources_by_role(role='*'): if '*' in role: return get_resources() - get_reserved_resources() else: return get_reserved_resources(role) def _get_resources(rtype='resources'): """ resource types from state summary include: resources, used_resources offered_resources, reserved_resources, unreserved_resources The default is resources. :param rtype: the type of resources to return :type rtype: str :param role: the name of the role if for reserved and if None all reserved :type rtype: str :return: resources(cpu,mem) :rtype: Resources """ cpus = 0 mem = 0 summary = DCOSClient().get_state_summary() if 'slaves' in summary: agents = summary.get('slaves') for agent in agents: if agent[rtype].get('cpus') is not None: cpus += agent[rtype].get('cpus') if agent[rtype].get('mem') is not None: mem += agent[rtype].get('mem') return Resources(cpus, mem) def get_reserved_resources(role=None): """ resource types from state summary include: reserved_resources :param role: the name of the role if for reserved and if None all reserved :type role: str :return: resources(cpu,mem) :rtype: Resources """ rtype = 'reserved_resources' cpus = 0.0 mem = 0.0 summary = DCOSClient().get_state_summary() if 'slaves' in summary: agents = summary.get('slaves') for agent in agents: resource_reservations = agent.get(rtype) reservations = [] if role is None or '*' in role: reservations = resource_reservations.values() elif role in resource_reservations: reservations = [resource_reservations.get(role)] for reservation in reservations: if reservation.get('cpus') is not None: cpus += reservation.get('cpus') if reservation.get('mem') is not None: mem += reservation.get('mem') return Resources(cpus, mem) class Resources(object): cpus = 0 mem = 0 def __init__(self, cpus=0, mem=0): self.cpus = cpus self.mem = mem def __str__(self): return "cpus: {}, mem: {}".format(self.cpus, self.mem) def __repr__(self): return "cpus: {}, mem: {}".format(self.cpus, self.mem) def __sub__(self, other): total_cpu = self.cpus - other.cpus total_mem = self.mem - other.mem return Resources(total_cpu, total_mem) def __rsub__(self, other): return self.__sub__(other) def __gt__(self, other): return self.cpus > other.cpus and self.mem > other.cpus def __ge__(self, other): return self.cpus >= other.cpus and self.mem >= other.cpus def __lt__(self, other): return self.cpus < other.cpus and self.mem < other.cpus def __le__(self, other): return self.cpus <= other.cpus and self.mem <= other.cpus def __mul__(self, other): return Resources(self.cpus * other, self.mem * other) def __rmul__(self, other): return Resources(self.cpus * other, self.mem * other) def __eq__(self, other): """Override the default Equals behavior""" if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False
28.852632
86
0.665329
1,078
8,223
4.859926
0.166976
0.024814
0.039702
0.025387
0.414965
0.366864
0.313419
0.276389
0.221035
0.221035
0
0.00931
0.229357
8,223
284
87
28.954225
0.817421
0.243828
0
0.228758
0
0
0.104097
0.032978
0
0
0
0
0
1
0.222222
false
0.013072
0.045752
0.111111
0.535948
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
10ce6fec2773612267b1f7b336d29f6e43213825
361
py
Python
app/templatetags/sessions_tags.py
TataneInYourFace/wifill
9b0cbb43f2e3671a4272246ada7a863f42f948c5
[ "MIT" ]
null
null
null
app/templatetags/sessions_tags.py
TataneInYourFace/wifill
9b0cbb43f2e3671a4272246ada7a863f42f948c5
[ "MIT" ]
null
null
null
app/templatetags/sessions_tags.py
TataneInYourFace/wifill
9b0cbb43f2e3671a4272246ada7a863f42f948c5
[ "MIT" ]
null
null
null
from django import template register = template.Library() def is_authenticated(session): return 'user' in session and 'is_authenticated' in session def is_admin(session): return 'user' in session and 'is_admin' in session and session['is_admin'] is True register.filter('is_authenticated', is_authenticated) register.filter('is_admin', is_admin)
22.5625
86
0.767313
51
361
5.254902
0.333333
0.130597
0.134328
0.141791
0.231343
0.231343
0.231343
0
0
0
0
0
0.138504
361
15
87
24.066667
0.861736
0
0
0
0
0
0.177285
0
0
0
0
0
0
1
0.25
false
0
0.125
0.25
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
1
0
0
0
1
1
0
0
3
10d73ff339734374bf311866fb82a76399fdcb7c
216
py
Python
scripts/scenes/combat/elements/unit_behaviours/behaviour.py
novialriptide/nqp2
db2c8a2ce298638eb06f84d283ed3f6807c2e131
[ "MIT" ]
12
2022-01-02T11:21:46.000Z
2022-03-12T20:53:40.000Z
scripts/scenes/combat/elements/unit_behaviours/behaviour.py
novialriptide/nqp2
db2c8a2ce298638eb06f84d283ed3f6807c2e131
[ "MIT" ]
142
2021-07-25T14:05:11.000Z
2022-03-26T21:12:53.000Z
scripts/scenes/combat/elements/unit_behaviours/behaviour.py
novialriptide/nqp2
db2c8a2ce298638eb06f84d283ed3f6807c2e131
[ "MIT" ]
9
2021-08-25T00:25:24.000Z
2022-03-12T20:53:41.000Z
class Behaviour: def __init__(self, unit): self.game = unit.game self.unit = unit self.complete_init() def complete_init(self): pass def process(self, dt): pass
16.615385
29
0.564815
26
216
4.461538
0.423077
0.137931
0
0
0
0
0
0
0
0
0
0
0.342593
216
12
30
18
0.816901
0
0
0.222222
0
0
0
0
0
0
0
0
0
1
0.333333
false
0.222222
0
0
0.444444
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
3
10dcc329b40ad7a19895cdc5735eee49de04563d
197
py
Python
data_collection/gazette/spiders/sc_cunha_pora.py
kaiocp/querido-diario
86004049c6eee305e13066cf3607d30849bb099a
[ "MIT" ]
454
2018-04-07T03:32:57.000Z
2020-08-17T19:56:22.000Z
data_collection/gazette/spiders/sc_cunha_pora.py
kaiocp/querido-diario
86004049c6eee305e13066cf3607d30849bb099a
[ "MIT" ]
254
2020-08-18T14:09:43.000Z
2022-03-28T11:30:51.000Z
data_collection/gazette/spiders/sc_cunha_pora.py
kaiocp/querido-diario
86004049c6eee305e13066cf3607d30849bb099a
[ "MIT" ]
183
2018-04-11T15:09:37.000Z
2020-08-15T18:55:11.000Z
from gazette.spiders.base.fecam import FecamGazetteSpider class ScCunhaPoraSpider(FecamGazetteSpider): name = "sc_cunha_pora" FECAM_QUERY = "cod_entidade:80" TERRITORY_ID = "4204707"
24.625
57
0.771574
22
197
6.681818
0.909091
0
0
0
0
0
0
0
0
0
0
0.053571
0.147208
197
7
58
28.142857
0.821429
0
0
0
0
0
0.177665
0
0
0
0
0
0
1
0
false
0
0.2
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
3
801ccd5892e08d8948c732c4efa90cc93606ed73
87
py
Python
scripts/consts.py
Eve-ning/aleph0
0a893f81328420ba4661cb920d3f9c39b3506d96
[ "MIT" ]
null
null
null
scripts/consts.py
Eve-ning/aleph0
0a893f81328420ba4661cb920d3f9c39b3506d96
[ "MIT" ]
null
null
null
scripts/consts.py
Eve-ning/aleph0
0a893f81328420ba4661cb920d3f9c39b3506d96
[ "MIT" ]
null
null
null
PADDING = 23 NOTE_THICKNESS = 3 RAND_SIZE = 20 REF_BPM = 1000 SCALE = REF_BPM / 104.15
14.5
24
0.724138
16
87
3.6875
0.875
0.20339
0
0
0
0
0
0
0
0
0
0.2
0.195402
87
5
25
17.4
0.642857
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
8055c84498ba5381887804f95d4c2b79522549aa
1,057
py
Python
release/stubs.min/System/Windows/Controls/__init___parts/InkCanvasClipboardFormat.py
htlcnn/ironpython-stubs
780d829e2104b2789d5f4d6f32b0ec9f2930ca03
[ "MIT" ]
182
2017-06-27T02:26:15.000Z
2022-03-30T18:53:43.000Z
release/stubs.min/System/Windows/Controls/__init___parts/InkCanvasClipboardFormat.py
htlcnn/ironpython-stubs
780d829e2104b2789d5f4d6f32b0ec9f2930ca03
[ "MIT" ]
28
2017-06-27T13:38:23.000Z
2022-03-15T11:19:44.000Z
release/stubs.min/System/Windows/Controls/__init___parts/InkCanvasClipboardFormat.py
htlcnn/ironpython-stubs
780d829e2104b2789d5f4d6f32b0ec9f2930ca03
[ "MIT" ]
67
2017-06-28T09:43:59.000Z
2022-03-20T21:17:10.000Z
class InkCanvasClipboardFormat(Enum,IComparable,IFormattable,IConvertible): """ Specifies the formats that an System.Windows.Controls.InkCanvas will accept from the Clipboard. enum InkCanvasClipboardFormat,values: InkSerializedFormat (0),Text (1),Xaml (2) """ def __eq__(self,*args): """ x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """ pass def __format__(self,*args): """ __format__(formattable: IFormattable,format: str) -> str """ pass def __ge__(self,*args): pass def __gt__(self,*args): pass def __init__(self,*args): """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass def __le__(self,*args): pass def __lt__(self,*args): pass def __ne__(self,*args): pass def __reduce_ex__(self,*args): pass def __str__(self,*args): pass InkSerializedFormat=None Text=None value__=None Xaml=None
28.567568
215
0.682119
135
1,057
4.637037
0.392593
0.127796
0.134185
0.14377
0.20607
0.20607
0.20607
0.180511
0.180511
0.180511
0
0.003409
0.167455
1,057
36
216
29.361111
0.707955
0.478713
0
0.4
0
0
0
0
0
0
0
0
0
1
0.4
false
0.4
0
0
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
3
337f84cd9b42ebbb50233035031025d016c02ef3
676
py
Python
app/main/forms.py
Charles-Ndugire/personal-blog
a56a80ea7602b713d08724d33636bf4e69fc9b06
[ "MIT" ]
null
null
null
app/main/forms.py
Charles-Ndugire/personal-blog
a56a80ea7602b713d08724d33636bf4e69fc9b06
[ "MIT" ]
4
2021-06-08T22:09:18.000Z
2022-03-12T00:44:04.000Z
app/main/forms.py
Charles-Ndugire/personal-blog
a56a80ea7602b713d08724d33636bf4e69fc9b06
[ "MIT" ]
1
2020-12-17T20:22:39.000Z
2020-12-17T20:22:39.000Z
from . import main from flask_wtf import FlaskForm from wtforms import SubmitField,StringField,TextAreaField,SelectField from wtforms.validators import Required from ..models import Article,Comment class ArticleUploadForm(FlaskForm): article = TextAreaField('Article',validators=[Required()]) category = StringField('Title',validators=[Required()]) submit = SubmitField('Add Article') class CommentsForm(FlaskForm): comment = TextAreaField('comment on the article',validators=[Required()]) submit = SubmitField('Add Comment') class UpdateProfile(FlaskForm): bio = StringField('About You',validators=[Required()]) submit = SubmitField('Add Bio')
35.578947
77
0.761834
70
676
7.342857
0.414286
0.140078
0.140078
0.20428
0.22179
0
0
0
0
0
0
0
0.12574
676
18
78
37.555556
0.869712
0
0
0
0
0
0.106509
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
3387b51e3563f6d6eb4cedcfdeb3889d5b8b22d7
134,317
py
Python
pysnmp_mibs/Printer-MIB.py
jackjack821/pysnmp-mibs
9835ea0bb2420715caf4ee9aaa07d59bb263acd6
[ "BSD-2-Clause" ]
6
2017-04-21T13:48:08.000Z
2022-01-06T19:42:52.000Z
pysnmp_mibs/Printer-MIB.py
jackjack821/pysnmp-mibs
9835ea0bb2420715caf4ee9aaa07d59bb263acd6
[ "BSD-2-Clause" ]
1
2020-05-05T16:42:25.000Z
2020-05-05T16:42:25.000Z
pysnmp_mibs/Printer-MIB.py
jackjack821/pysnmp-mibs
9835ea0bb2420715caf4ee9aaa07d59bb263acd6
[ "BSD-2-Clause" ]
6
2020-02-08T20:28:49.000Z
2021-09-14T13:36:46.000Z
# # PySNMP MIB module Printer-MIB (http://pysnmp.sf.net) # ASN.1 source http://mibs.snmplabs.com:80/asn1/Printer-MIB # Produced by pysmi-0.0.7 at Sun Feb 14 00:12:48 2016 # On host bldfarm platform Linux version 4.1.13-100.fc21.x86_64 by user goose # Using Python version 3.5.0 (default, Jan 5 2016, 17:11:52) # ( ObjectIdentifier, Integer, OctetString, ) = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") ( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ( ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection") ( hrStorageIndex, hrDeviceIndex, ) = mibBuilder.importSymbols("HOST-RESOURCES-MIB", "hrStorageIndex", "hrDeviceIndex") ( NotificationGroup, ModuleCompliance, ObjectGroup, ) = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance", "ObjectGroup") ( Bits, ModuleIdentity, Counter32, IpAddress, Unsigned32, MibIdentifier, ObjectIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, mib_2, NotificationType, Counter64, TimeTicks, Gauge32, Integer32, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "ModuleIdentity", "Counter32", "IpAddress", "Unsigned32", "MibIdentifier", "ObjectIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "mib-2", "NotificationType", "Counter64", "TimeTicks", "Gauge32", "Integer32") ( TextualConvention, DisplayString, ) = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") printmib = ModuleIdentity((1, 3, 6, 1, 2, 1, 43)) if mibBuilder.loadTexts: printmib.setLastUpdated('9810070000Z') if mibBuilder.loadTexts: printmib.setOrganization('IETF Printer MIB Working Group') if mibBuilder.loadTexts: printmib.setContactInfo('Randy Turner\n Sharp Laboratories of America\n 5750 NW Pacific Rim Blvd\n Camas, WA 98607\n rturner@sharplabs.com') if mibBuilder.loadTexts: printmib.setDescription('The MIB module for management of printers.') class PrtMediaUnitTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(3, 4,)) namedValues = NamedValues(("tenThousandthsOfInches", 3), ("micrometers", 4),) class PrtCapacityUnitTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(3, 4, 8, 16, 17,)) namedValues = NamedValues(("tenThousandthsOfInches", 3), ("micrometers", 4), ("sheets", 8), ("feet", 16), ("meters", 17),) class PrtPrintOrientationTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(1, 3, 4,)) namedValues = NamedValues(("other", 1), ("portrait", 3), ("landscape", 4),) class PrtCoverStatusTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(1, 3, 4, 5, 6,)) namedValues = NamedValues(("other", 1), ("coverOpen", 3), ("coverClosed", 4), ("interlockOpen", 5), ("interlockClosed", 6),) class PrtSubUnitStatusTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ValueRangeConstraint(0,126) class PresentOnOff(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(1, 3, 4, 5,)) namedValues = NamedValues(("other", 1), ("on", 3), ("off", 4), ("notPresent", 5),) class CodedCharSet(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(1,)) namedValues = NamedValues(("other", 1),) class PrtGeneralResetTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(3, 4, 5, 6,)) namedValues = NamedValues(("notResetting", 3), ("powerCycleReset", 4), ("resetToNVRAM", 5), ("resetToFactoryDefaults", 6),) class PrtChannelStateTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(1, 3, 4,)) namedValues = NamedValues(("other", 1), ("printDataAccepted", 3), ("noDataAccepted", 4),) class PrtChannelTypeTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 26, 27, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,)) namedValues = NamedValues(("other", 1), ("chSerialPort", 3), ("chParallelPort", 4), ("chIEEE1284Port", 5), ("chSCSIPort", 6), ("chAppleTalkPAP", 7), ("chLPDServer", 8), ("chNetwareRPrinter", 9), ("chNetwarePServer", 10), ("chPort9100", 11), ("chAppSocket", 12), ("chFTP", 13), ("chTFTP", 14), ("chDLCLLCPort", 15), ("chIBM3270", 16), ("chIBM5250", 17), ("chFax", 18), ("chIEEE1394", 19), ("chTransport1", 20), ("chCPAP", 21), ("chPCPrint", 26), ("chServerMessageBlock", 27), ("chPSM", 28), ("chSystemObjectManager", 31), ("chDECLAT", 32), ("chNPAP", 33), ("chUSB", 34), ("chIRDA", 35), ("chPrintXChange", 36), ("chPortTCP", 37), ("chBidirPortTCP", 38), ("chUNPP", 39), ("chAppleTalkADSP", 40), ("chPortSPX", 41), ("chPortHTTP", 42), ("chNDPS", 43),) class PrtInterpreterLangFamilyTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,)) namedValues = NamedValues(("other", 1), ("unknown", 2), ("langPCL", 3), ("langHPGL", 4), ("langPJL", 5), ("langPS", 6), ("langIPDS", 7), ("langPPDS", 8), ("langEscapeP", 9), ("langEpson", 10), ("langDDIF", 11), ("langInterpress", 12), ("langISO6429", 13), ("langLineData", 14), ("langMODCA", 15), ("langREGIS", 16), ("langSCS", 17), ("langSPDL", 18), ("langTEK4014", 19), ("langPDS", 20), ("langIGP", 21), ("langCodeV", 22), ("langDSCDSE", 23), ("langWPS", 24), ("langLN03", 25), ("langCCITT", 26), ("langQUIC", 27), ("langCPAP", 28), ("langDecPPL", 29), ("langSimpleText", 30), ("langNPAP", 31), ("langDOC", 32), ("langimPress", 33), ("langPinwriter", 34), ("langNPDL", 35), ("langNEC201PL", 36), ("langAutomatic", 37), ("langPages", 38), ("langLIPS", 39), ("langTIFF", 40), ("langDiagnostic", 41), ("langPSPrinter", 42), ("langCaPSL", 43), ("langEXCL", 44), ("langLCDS", 45), ("langXES", 46), ("langPCLXL", 47), ("langART", 48), ("langTIPSI", 49), ("langPrescribe", 50), ("langLinePrinter", 51), ("langIDP", 52), ("langXJCL", 53), ("langPDF", 54), ("langRPDL", 55), ("langIntermecIPL", 56), ("langUBIFingerprint", 57), ("langUBIDirectProtocol", 58), ("langFujitsu", 59),) class PrtInputTypeTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7,)) namedValues = NamedValues(("other", 1), ("unknown", 2), ("sheetFeedAutoRemovableTray", 3), ("sheetFeedAutoNonRemovableTray", 4), ("sheetFeedManual", 5), ("continuousRoll", 6), ("continuousFanFold", 7),) class PrtOutputTypeTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7,)) namedValues = NamedValues(("other", 1), ("unknown", 2), ("removableBin", 3), ("unRemovableBin", 4), ("continuousRollDevice", 5), ("mailBox", 6), ("continuousFanFold", 7),) class PrtOutputStackingOrderTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(2, 3, 4,)) namedValues = NamedValues(("unknown", 2), ("firstToLast", 3), ("lastToFirst", 4),) class PrtOutputPageDeliveryOrientationTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(3, 4,)) namedValues = NamedValues(("faceUp", 3), ("faceDown", 4),) class PrtMarkerMarkTechTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,)) namedValues = NamedValues(("other", 1), ("unknown", 2), ("electrophotographicLED", 3), ("electrophotographicLaser", 4), ("electrophotographicOther", 5), ("impactMovingHeadDotMatrix9pin", 6), ("impactMovingHeadDotMatrix24pin", 7), ("impactMovingHeadDotMatrixOther", 8), ("impactMovingHeadFullyFormed", 9), ("impactBand", 10), ("impactOther", 11), ("inkjetAqueous", 12), ("inkjetSolid", 13), ("inkjetOther", 14), ("pen", 15), ("thermalTransfer", 16), ("thermalSensitive", 17), ("thermalDiffusion", 18), ("thermalOther", 19), ("electroerosion", 20), ("electrostatic", 21), ("photographicMicrofiche", 22), ("photographicImagesetter", 23), ("photographicOther", 24), ("ionDeposition", 25), ("eBeam", 26), ("typesetter", 27),) class PrtMarkerCounterUnitTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(3, 4, 5, 6, 7, 8, 9, 11, 16, 17,)) namedValues = NamedValues(("tenThousandthsOfInches", 3), ("micrometers", 4), ("characters", 5), ("lines", 6), ("impressions", 7), ("sheets", 8), ("dotRow", 9), ("hours", 11), ("feet", 16), ("meters", 17),) class PrtMarkerSuppliesTypeTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,)) namedValues = NamedValues(("other", 1), ("unknown", 2), ("toner", 3), ("wasteToner", 4), ("ink", 5), ("inkCartridge", 6), ("inkRibbon", 7), ("wasteInk", 8), ("opc", 9), ("developer", 10), ("fuserOil", 11), ("solidWax", 12), ("ribbonWax", 13), ("wasteWax", 14), ("fuser", 15), ("coronaWire", 16), ("fuserOilWick", 17), ("cleanerUnit", 18), ("fuserCleaningPad", 19), ("transferUnit", 20), ("tonerCartridge", 21), ("fuserOiler", 22), ("water", 23), ("wasteWater", 24), ("glueWaterAdditive", 25), ("wastePaper", 26), ("bindingSupply", 27), ("bandingSupply", 28), ("stitchingWire", 29), ("shrinkWrap", 30), ("paperWrap", 31), ("staples", 32), ("inserts", 33), ("covers", 34),) class PrtMarkerSuppliesSupplyUnitTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(3, 4, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18,)) namedValues = NamedValues(("tenThousandthsOfInches", 3), ("micrometers", 4), ("impressions", 7), ("sheets", 8), ("hours", 11), ("thousandthsOfOunces", 12), ("tenthsOfGrams", 13), ("hundrethsOfFluidOunces", 14), ("tenthsOfMilliliters", 15), ("feet", 16), ("meters", 17), ("items", 18),) class PrtMarkerSuppliesClassTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(1, 3, 4,)) namedValues = NamedValues(("other", 1), ("supplyThatIsConsumed", 3), ("receptacleThatIsFilled", 4),) class PrtMarkerColorantRoleTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(1, 3, 4,)) namedValues = NamedValues(("other", 1), ("process", 3), ("spot", 4),) class PrtMediaPathMaxSpeedPrintUnitTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(3, 4, 5, 6, 7, 8, 9, 16, 17,)) namedValues = NamedValues(("tenThousandthsOfInchesPerHour", 3), ("micrometersPerHour", 4), ("charactersPerHour", 5), ("linesPerHour", 6), ("impressionsPerHour", 7), ("sheetsPerHour", 8), ("dotRowPerHour", 9), ("feetPerHour", 16), ("metersPerHour", 17),) class PrtMediaPathTypeTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5,)) namedValues = NamedValues(("other", 1), ("unknown", 2), ("longEdgeBindingDuplex", 3), ("shortEdgeBindingDuplex", 4), ("simplex", 5),) class PrtInterpreterTwoWayTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(3, 4,)) namedValues = NamedValues(("yes", 3), ("no", 4),) class PrtConsoleColorTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10,)) namedValues = NamedValues(("other", 1), ("unknown", 2), ("white", 3), ("red", 4), ("green", 5), ("blue", 6), ("cyan", 7), ("magenta", 8), ("yellow", 9), ("orange", 10),) class PrtAlertSeverityLevelTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(1, 3, 4, 5,)) namedValues = NamedValues(("other", 1), ("criticalBinaryChangeEvent", 3), ("warningUnaryChangeEvent", 4), ("warningBinaryChangeEvent", 5),) class PrtAlertTrainingLevelTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7,)) namedValues = NamedValues(("other", 1), ("unknown", 2), ("untrained", 3), ("trained", 4), ("fieldService", 5), ("management", 6), ("noInterventionRequired", 7),) class PrtAlertGroupTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 30, 31, 32, 33,)) namedValues = NamedValues(("other", 1), ("hostResourcesMIBStorageTable", 3), ("hostResourcesMIBDeviceTable", 4), ("generalPrinter", 5), ("cover", 6), ("localization", 7), ("input", 8), ("output", 9), ("marker", 10), ("markerSupplies", 11), ("markerColorant", 12), ("mediaPath", 13), ("channel", 14), ("interpreter", 15), ("consoleDisplayBuffer", 16), ("consoleLights", 17), ("alert", 18), ("finDevice", 30), ("finSupply", 31), ("finSupplyMediaInput", 32), ("finAttributeTable", 33),) class PrtAlertCodeTC(Integer32, TextualConvention): subtypeSpec = Integer32.subtypeSpec+ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 501, 502, 503, 504, 505, 506, 507, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 901, 902, 903, 904, 1001, 1002, 1003, 1004, 1005, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1301, 1302, 1303, 1501, 1502, 1503, 1504, 1505, 1506, 1507, 1509, 1801,)) namedValues = NamedValues(("other", 1), ("unknown", 2), ("coverOpened", 3), ("coverClosed", 4), ("interlockOpened", 5), ("interlockClosed", 6), ("configurationChanged", 7), ("jammed", 8), ("subunitMissing", 9), ("subunitLifeAlmostOver", 10), ("subunitLifeOver", 11), ("subunitAlmostEmpty", 12), ("subunitEmpty", 13), ("subunitAlmostFull", 14), ("subunitFull", 15), ("subunitNearLimit", 16), ("subunitAtLimit", 17), ("subunitOpened", 18), ("subunitClosed", 19), ("subunitTurnedOn", 20), ("subunitTurnedOff", 21), ("subunitOffline", 22), ("subunitPowerSaver", 23), ("subunitWarmingUp", 24), ("subunitAdded", 25), ("subunitRemoved", 26), ("subunitResourceAdded", 27), ("subunitResourceRemoved", 28), ("subunitRecoverableFailure", 29), ("subunitUnrecoverableFailure", 30), ("subunitRecoverableStorageError", 31), ("subunitUnrecoverableStorageError", 32), ("subunitMotorFailure", 33), ("subunitMemoryExhausted", 34), ("subunitUnderTemperature", 35), ("subunitOverTemperature", 36), ("subunitTimingFailure", 37), ("subunitThermistorFailure", 38), ("doorOpen", 501), ("doorClosed", 502), ("poweredUp", 503), ("poweredDown", 504), ("printerNMSReset", 505), ("printerManualReset", 506), ("printerReadyToPrint", 507), ("inputMediaTrayMissing", 801), ("inputMediaSizeChanged", 802), ("inputMediaWeightChanged", 803), ("inputMediaTypeChanged", 804), ("inputMediaColorChanged", 805), ("inputMediaFormPartsChange", 806), ("inputMediaSupplyLow", 807), ("inputMediaSupplyEmpty", 808), ("inputMediaChangeRequest", 809), ("inputManualInputRequest", 810), ("inputTrayPositionFailure", 811), ("inputTrayElevationFailure", 812), ("inputCannotFeedSizeSelected", 813), ("outputMediaTrayMissing", 901), ("outputMediaTrayAlmostFull", 902), ("outputMediaTrayFull", 903), ("outputMailboxSelectFailure", 904), ("markerFuserUnderTemperature", 1001), ("markerFuserOverTemperature", 1002), ("markerFuserTimingFailure", 1003), ("markerFuserThermistorFailure", 1004), ("markerAdjustingPrintQuality", 1005), ("markerTonerEmpty", 1101), ("markerInkEmpty", 1102), ("markerPrintRibbonEmpty", 1103), ("markerTonerAlmostEmpty", 1104), ("markerInkAlmostEmpty", 1105), ("markerPrintRibbonAlmostEmpty", 1106), ("markerWasteTonerReceptacleAlmostFull", 1107), ("markerWasteInkReceptacleAlmostFull", 1108), ("markerWasteTonerReceptacleFull", 1109), ("markerWasteInkReceptacleFull", 1110), ("markerOpcLifeAlmostOver", 1111), ("markerOpcLifeOver", 1112), ("markerDeveloperAlmostEmpty", 1113), ("markerDeveloperEmpty", 1114), ("markerTonerCartridgeMissing", 1115), ("mediaPathMediaTrayMissing", 1301), ("mediaPathMediaTrayAlmostFull", 1302), ("mediaPathMediaTrayFull", 1303), ("interpreterMemoryIncreased", 1501), ("interpreterMemoryDecreased", 1502), ("interpreterCartridgeAdded", 1503), ("interpreterCartridgeDeleted", 1504), ("interpreterResourceAdded", 1505), ("interpreterResourceDeleted", 1506), ("interpreterResourceUnavailable", 1507), ("interpreterComplexPageEncountered", 1509), ("alertRemovalOfBinaryChangeEntry", 1801),) prtGeneral = MibIdentifier((1, 3, 6, 1, 2, 1, 43, 5)) prtGeneralTable = MibTable((1, 3, 6, 1, 2, 1, 43, 5, 1), ) if mibBuilder.loadTexts: prtGeneralTable.setDescription('A table of general information per printer.\n Objects in this table are defined in various\n places in the MIB, nearby the groups to\n which they apply. They are all defined\n here to minimize the number of tables that would\n otherwise need to exist.') prtGeneralEntry = MibTableRow((1, 3, 6, 1, 2, 1, 43, 5, 1, 1), ).setIndexNames((0, "HOST-RESOURCES-MIB", "hrDeviceIndex")) if mibBuilder.loadTexts: prtGeneralEntry.setDescription("An entry exists in this table for each device entry in\n the host resources MIB device table with a device type\n of 'printer'") prtGeneralConfigChanges = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 1, 1, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtGeneralConfigChanges.setDescription("Counts configuration changes within the printer. A\n configuration change is defined to be an action that\n results in a change to any MIB object other than those\n that reflect status or level, or those that act as\n counters or gauges. In addition, any action that results\n in a row being added or deleted from any table in the\n Printer MIB is considered a configuration change. Such\n changes will often affect the capability of the printer\n to service certain types of print jobs. Management\n applications may cache infrequently changed\n configuration information about sub-units within the\n printer. This object should be incremented whenever the\n agent wishes to notify management applications that any\n cached configuration information for this device is to\n be considered 'stale'. At this point, the management\n application should flush any configuration information\n cached about this device and fetch new configuration\n information.\n\n The following are examples of actions that would cause\n the prtGeneralConfigChanges object to be incremented:\n\n - Adding an output bin\n - Changing the media in a sensing input tray\n - Changing the value of prtInputMediaType\n Note that the prtGeneralConfigChanges counter would not\n be incremented when an input tray is removed, or the\n level of an input device changes.") prtGeneralCurrentLocalization = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtGeneralCurrentLocalization.setDescription('The value of the prtLocalizationIndex corresponding to\n the current language, country, and character set to be\n used for localized string values that are identified as\n being dependent on the value of this object. Note that\n this object does not apply to localized strings in the\n prtConsole group or to any object that is not\n explicitly identified as being localized according to\n prtGeneralCurrentLocalization.') prtGeneralReset = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 1, 1, 3), PrtGeneralResetTC()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtGeneralReset.setDescription("Setting this value to 'powerCycleReset',\n 'resetToNVRAM', or 'resetToFactoryDefaults' will result\n in the resetting of the printer. When read, this object\n will always have the value 'notResetting(3)', and a SET\n of the value 'notResetting' shall have no effect on the\n printer. Some of the defined values are optional.\n However, every implementation must support at least the\n values 'notResetting' and 'resetToNVRAM'.") prtGeneralCurrentOperator = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 1, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,127))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtGeneralCurrentOperator.setDescription("The name of the person who is responsible for operating\n this printer. It is suggested that this string include\n information that would enable other humans to reach the\n operator, such as a phone number. As a convention to\n facilitate automatic notification of the operator by the\n agent or the network management station, the phone\n number, fax number or email address should be placed on\n a separate line starting with ASCII LF (hex 0x0A) and\n the ASCII text string (without the quotes): 'phone: ',\n 'fax: ', and 'email: ', respectively. Phone numbers may\n contain digits, spaces and parentheses, which shall be\n ignored. Phone numbers may also include ASCII comma\n characters(hex 2C) that are used to indicate a two-\n second pause during the dialing sequence. If either the\n phone, fax, or email information is not available, then\n a line should not be included for this information.\n\n NOTE: For interoperability purposes, it is advisable to\n use email addresses formatted according to RFC 822\n requirements.") prtGeneralServicePerson = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 1, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,127))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtGeneralServicePerson.setDescription("The name of the person responsible for servicing this\n printer. It is suggested that this string include\n information that would enable other humans to reach the\n service person, such as a phone number. As a convention\n to facilitate automatic notification of the service\n person by the agent or a network management station, the\n phone number, fax number or email address should be\n placed on a separate line starting with ASCII LF (hex\n 0x0A) and the ASCII text string (without the quotes):\n 'phone: ', 'fax: ', and 'email: ', respectively. Phone\n numbers may contain digits, spaces and parentheses,\n which shall be ignored. Phone numbers can also include\n one or more ASCII comma characters(hex 2C) to indicate a\n two-second pause during the dialing sequence. If either\n the phone, fax, or email information is not available,\n then a line should not included for this information.\n\n NOTE: For interoperability purposes, it is advisable to\n use email addresses formatted according to RFC 822\n requirements.") prtInputDefaultIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 1, 1, 6), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtInputDefaultIndex.setDescription('The value of prtInputIndex corresponding to the default\n input sub-unit: that is, this object selects the default\n source of input media.\n\n This value shall be -1 if there is no default input\n subunit specified for the printer as a whole. In this\n case, the actual default input subunit may be specified\n by means outside the scope of this MIB, such as by each\n interpreter in a printer with multiple interpreters.') prtOutputDefaultIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 1, 1, 7), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtOutputDefaultIndex.setDescription('The value of prtOutputIndex corresponding to the\n default output sub-unit; that is, this object selects\n the default output destination.\n\n This value shall be -1 if there is no default output\n subunit specified for the printer as a whole. In this\n case, the actual default output subunit may be specified\n by means outside the scope of this MIB, such as by each\n interpreter in a printer with multiple interpreters.') prtMarkerDefaultIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtMarkerDefaultIndex.setDescription('The value of prtMarkerIndex corresponding to the\n default marker sub-unit; that is, this object selects the\n default marker.') prtMediaPathDefaultIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtMediaPathDefaultIndex.setDescription('The value of prtMediaPathIndex corresponding to\n the default media path; that is, the selection of the\n default media path.') prtConsoleLocalization = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtConsoleLocalization.setDescription('The value of the prtLocalizationIndex corresponding to\n the language, country, and character set to be used for\n the console. This localization applies both to the\n actual display on the console as well as the encoding of\n these console objects in management operations.') prtConsoleNumberOfDisplayLines = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 1, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtConsoleNumberOfDisplayLines.setDescription("The number of lines on the printer's physical\n display. This value is 0 if there are no lines on the\n physical display or if there is no physical display") prtConsoleNumberOfDisplayChars = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtConsoleNumberOfDisplayChars.setDescription('The number of characters per line displayed on the\n physical display. This value is 0 if there are no lines\n on the physical display or if there is no physical\n display') prtConsoleDisable = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(3, 4, 5, 6, 7,))).clone(namedValues=NamedValues(("operatorConsoleEnabled", 3), ("operatorConsoleDisabled", 4), ("operatorConsoleEnabledLevel1", 5), ("operatorConsoleEnabledLevel2", 6), ("operatorConsoleEnabledLevel3", 7),))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtConsoleDisable.setDescription("If the object prtConsoleDisable has value\n 'operatorConsoleDisabled' then input is not accepted\n from the operator console. If the object\n prtConsoleDisable has the value 'operatorConsoleEnabled'\n then input is accepted from the operator console. If the\n object prtConsoleDisable has the value\n 'operatorConsoleEnabledLevel1',\n 'operatorConsoleEnabledLevel2' or\n 'operatorConsoleEnabledLevel3' then limited input is\n accepted from the operator console; the limitations are\n product specific, however, the limitations are generally\n less restrictive for operatorConsoleEnabledLevel1 than\n for operatorConsoleEnabledLeve2, which is less\n restrictive than operatorConsoleEnabledLevel3.\n\n The value of the prtConsoleDisable object is a type-2\n enumeration.") prtAuxiliarySheetStartupPage = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 1, 1, 14), PresentOnOff()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtAuxiliarySheetStartupPage.setDescription('Used to enable or disable printing a startup page. If\n enabled, a startup page will be printed shortly after\n power-up, when the device is ready. Typical startup\n pages include test patterns and/or printer configuration\n information.') prtAuxiliarySheetBannerPage = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 1, 1, 15), PresentOnOff()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtAuxiliarySheetBannerPage.setDescription('Used to enable or disable printing banner pages at the\n beginning of jobs. This is a master switch which applies\n to all jobs, regardless of interpreter.') prtGeneralPrinterName = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 1, 1, 16), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,127))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtGeneralPrinterName.setDescription("An administrator-specified name for this printer.\n Depending upon implementation of this printer, the value\n of this object may or may not be same as the value for\n the MIB-II 'SysName' object.") prtGeneralSerialNumber = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 1, 1, 17), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtGeneralSerialNumber.setDescription('A recorded serial number for this device that indexes\n some type device catalog or inventory. This value is\n usually set by the device manufacturer but the MIB\n supports the option of writing for this object for site-\n specific administration of device inventory or\n tracking.') prtAlertCriticalEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 1, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtAlertCriticalEvents.setDescription('A running counter of the number of critical alert\n events that have been recorded in the alert table. The\n value of this object is RESET in the event of a power\n cycle operation (i.e., the value is not persistent.') prtAlertAllEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 1, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtAlertAllEvents.setDescription('A running counter of the total number of alert event\n entries (critical and non-critical) that have been\n recorded in the alert table') prtCover = MibIdentifier((1, 3, 6, 1, 2, 1, 43, 6)) prtCoverTable = MibTable((1, 3, 6, 1, 2, 1, 43, 6, 1), ) if mibBuilder.loadTexts: prtCoverTable.setDescription('A table of the covers and interlocks of the printer.') prtCoverEntry = MibTableRow((1, 3, 6, 1, 2, 1, 43, 6, 1, 1), ).setIndexNames((0, "HOST-RESOURCES-MIB", "hrDeviceIndex"), (0, "Printer-MIB", "prtCoverIndex")) if mibBuilder.loadTexts: prtCoverEntry.setDescription("Information about a cover or interlock.\n Entries may exist in the table for each device\n index with a device type of 'printer'.") prtCoverIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 6, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))) if mibBuilder.loadTexts: prtCoverIndex.setDescription('A unique value used by the printer to identify this\n Cover sub-unit. Although these values may change due to\n a major reconfiguration of the device (e.g. the addition\n of new cover sub-units to the printer), values are\n expected to remain stable across successive printer\n power cycles.') prtCoverDescription = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 6, 1, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,255))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtCoverDescription.setDescription('The manufacturer provided cover sub-mechanism name in\n the localization specified by\n prtGeneralCurrentLocalization.') prtCoverStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 6, 1, 1, 3), PrtCoverStatusTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtCoverStatus.setDescription('The status of this cover sub-unit.') prtLocalization = MibIdentifier((1, 3, 6, 1, 2, 1, 43, 7)) prtLocalizationTable = MibTable((1, 3, 6, 1, 2, 1, 43, 7, 1), ) if mibBuilder.loadTexts: prtLocalizationTable.setDescription('The available localizations in this printer.') prtLocalizationEntry = MibTableRow((1, 3, 6, 1, 2, 1, 43, 7, 1, 1), ).setIndexNames((0, "HOST-RESOURCES-MIB", "hrDeviceIndex"), (0, "Printer-MIB", "prtLocalizationIndex")) if mibBuilder.loadTexts: prtLocalizationEntry.setDescription("A description of a localization.\n Entries may exist in the table for each device\n index with a device type of 'printer'.") prtLocalizationIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 7, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))) if mibBuilder.loadTexts: prtLocalizationIndex.setDescription('A unique value used by the printer to identify this\n localization entry. Although these values may change\n due to a major reconfiguration of the device (e.g., the\n addition of new localization data to the printer),\n values are expected to remain stable across successive\n printer power cycles.') prtLocalizationLanguage = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 7, 1, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0,2))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtLocalizationLanguage.setDescription('A two character language code from ISO 639. Examples\n en, gb, ca, fr, de.') prtLocalizationCountry = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 7, 1, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0,2))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtLocalizationCountry.setDescription('A two character country code from ISO 3166, a blank\n string (two space characters) shall indicate that the\n country is not defined. Examples: US, FR, DE, ...') prtLocalizationCharacterSet = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 7, 1, 1, 4), CodedCharSet()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtLocalizationCharacterSet.setDescription('The coded character set used for this localization.') prtStorageRefTable = MibTable((1, 3, 6, 1, 2, 1, 43, 5, 2), ) if mibBuilder.loadTexts: prtStorageRefTable.setDescription('') prtStorageRefEntry = MibTableRow((1, 3, 6, 1, 2, 1, 43, 5, 2, 1), ).setIndexNames((0, "HOST-RESOURCES-MIB", "hrStorageIndex"), (0, "Printer-MIB", "prtStorageRefSeqNumber")) if mibBuilder.loadTexts: prtStorageRefEntry.setDescription('This table will have an entry for each entry in the\n Host Resources MIB storage table that represents storage\n associated with a printer managed by this agent.') prtStorageRefSeqNumber = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))) if mibBuilder.loadTexts: prtStorageRefSeqNumber.setDescription('This value will be unique amongst all entries with a\n common value of hrStorageIndex. This object allows a\n storage entry to point to the multiple printer devices\n with which it is associated.') prtStorageRefIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtStorageRefIndex.setDescription('The value of the hrDeviceIndex of the printer device\n that this storageEntry is associated with.') prtDeviceRefTable = MibTable((1, 3, 6, 1, 2, 1, 43, 5, 3), ) if mibBuilder.loadTexts: prtDeviceRefTable.setDescription('') prtDeviceRefEntry = MibTableRow((1, 3, 6, 1, 2, 1, 43, 5, 3, 1), ).setIndexNames((0, "HOST-RESOURCES-MIB", "hrDeviceIndex"), (0, "Printer-MIB", "prtDeviceRefSeqNumber")) if mibBuilder.loadTexts: prtDeviceRefEntry.setDescription('This table will have an entry for each entry in the\n Host Resources MIB device table that represents a device\n associated with a printer managed by this agent.') prtDeviceRefSeqNumber = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))) if mibBuilder.loadTexts: prtDeviceRefSeqNumber.setDescription('This value will be unique amongst all entries with a\n common value of hrDeviceIndex. This object allows a\n device entry to point to the multiple printer devices\n with which it is associated.') prtDeviceRefIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 5, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtDeviceRefIndex.setDescription('The value of the hrDeviceIndex of the printer device\n that this deviceEntry is associated with.') prtInput = MibIdentifier((1, 3, 6, 1, 2, 1, 43, 8)) prtInputTable = MibTable((1, 3, 6, 1, 2, 1, 43, 8, 2), ) if mibBuilder.loadTexts: prtInputTable.setDescription('A table of the devices capable of providing media for\n input to the printing process.') prtInputEntry = MibTableRow((1, 3, 6, 1, 2, 1, 43, 8, 2, 1), ).setIndexNames((0, "HOST-RESOURCES-MIB", "hrDeviceIndex"), (0, "Printer-MIB", "prtInputIndex")) if mibBuilder.loadTexts: prtInputEntry.setDescription("Attributes of a device capable of providing media for\n input to the printing process. Entries may exist in the\n table for each device index with a device type of\n 'printer'.") prtInputIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))) if mibBuilder.loadTexts: prtInputIndex.setDescription('A unique value used by the printer to identify this\n input sub-unit. Although these values may change due to\n a major reconfiguration of the device (e.g. the addition\n of n input sub-units to the printer), values are\n expected to remain stable across successive printer\n power cycles.') prtInputType = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 2), PrtInputTypeTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtInputType.setDescription('The type of technology (discriminated primarily\n according to feeder mechanism type) employed by the\n input sub-unit. Note, the Optional Input Class provides\n for a descriptor field to further qualify the other\n choice.') prtInputDimUnit = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 3), PrtMediaUnitTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtInputDimUnit.setDescription('The unit of measurement for use calculating and relaying\n dimensional values for this input sub-unit.') prtInputMediaDimFeedDirDeclared = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 4), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtInputMediaDimFeedDirDeclared.setDescription('This object provides the value of the declared\n dimension, in the feed direction, of the media that is\n (or, if empty, was or will be) in this input sub-unit.\n The feed direction is the direction in which the media\n is fed on this sub-unit. This dimension is measured in\n input sub-unit dimensional units (prtInputDimUnit). If\n this input sub-unit can reliably sense this value, the\n value is sensed by the printer and may not be changed by\n management requests. Otherwise, the value may be\n changed. The value (-1) means other and specifically\n means that this sub-unit places no restriction on this\n parameter.\n\n The value (-2) indicates unknown.') prtInputMediaDimXFeedDirDeclared = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 5), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtInputMediaDimXFeedDirDeclared.setDescription('This object provides the value of the declared\n dimension, in the cross feed direction, of the media\n that is (or, if empty, was or will be) in this input\n sub-unit. The cross feed direction is ninety degrees\n relative to the feed direction associated with this sub-\n unit. This dimension is measured in input sub-unit\n dimensional units (prtInputDimUnit). If this input sub-\n unit can reliably sense this value, the value is sensed\n by the printer and may not be changed by management\n requests. Otherwise, the value may be changed. The value\n (-1) means other and specifically means that this sub-\n unit places no restriction on this parameter. The value\n (-2) indicates unknown.') prtInputMediaDimFeedDirChosen = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtInputMediaDimFeedDirChosen.setDescription('The printer will act as if media of the chosen\n dimension (in the feed direction) is present in this\n input source. Note that this value will be used even if\n the input tray is empty. Feed dimension measurements are\n taken relative to the feed direction associated with\n that sub-unit and are in input sub-unit dimensional\n units (MediaUnit). If the printer supports the declared\n dimension, the granted dimension is the same as the\n declared dimension. If not, the granted dimension is set\n to the closest dimension that the printer supports when\n the declared dimension is set. The value (-1) means\n other and specifically indicates that this sub-unit\n places no restriction on this parameter. The value (-2)\n indicates unknown.') prtInputMediaDimXFeedDirChosen = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtInputMediaDimXFeedDirChosen.setDescription('The printer will act as if media of the chosen\n dimension (in the cross feed direction) is present in\n this input source. Note that this value will be used\n even if the input tray is empty. The cross feed\n direction is ninety degrees relative to the feed\n direction associated with this sub-unit. This dimension\n is measured in input sub-unit dimensional units\n (MediaUnit). If the printer supports the declare\n dimension, the granted dimension is the same as the\n declared dimension. If not, the granted dimension is set\n to the closest dimension that the printer supports when\n the declared dimension is set. The value (-1) means\n other and specifically indicates that this sub-unit\n places no restriction on this parameter. The value (-2)\n indicates unknown.') prtInputCapacityUnit = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 8), PrtCapacityUnitTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtInputCapacityUnit.setDescription('The unit of measurement for use in calculating and\n relaying capacity values for this input sub-unit.') prtInputMaxCapacity = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 9), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtInputMaxCapacity.setDescription('The maximum capacity of the input sub-unit in input\n sub-unit capacity units (PrtCapacityUnitTC). There is\n no convention associated with the media itself so this\n value reflects claimed capacity. If this input sub-unit\n can reliably sense this value, the value is sensed by\n the printer and may not be changed by management\n requests; otherwise, the value may be written (by a\n Remote Control Panel or a Management Application). The\n value (-1) means other and specifically indicates that\n the sub-unit places no restrictions on this parameter.\n The value (-2) means unknown.') prtInputCurrentLevel = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 10), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtInputCurrentLevel.setDescription('The current capacity of the input sub-unit in input\n sub-unit capacity units (PrtCapacityUnitTC). If this\n input sub-unit can reliably sense this value, the value\n is sensed by the printer and may not be changed by\n management requests; otherwise, the value may be written\n (by a Remote Control Panel or a Management Application).\n The value (-1) means other and specifically indicates\n that the sub-unit places no restrictions on this\n parameter. The value (-2) means unknown. The value (-3)\n means that the printer knows that at least one unit\n remains.') prtInputStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 11), PrtSubUnitStatusTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtInputStatus.setDescription('The current status of this input sub-unit.') prtInputMediaName = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 12), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,63))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtInputMediaName.setDescription("A description of the media contained in this input sub-\n unit; This description is intended for display to a\n human operator. This description is not processed by the\n printer. It is used to provide information not\n expressible in terms of the other media attributes (e.g.\n prtInputMediaDimFeedDirChosen,\n prtInputMediaDimXFeedDirChosen, prtInputMediaWeight,\n prtInputMediaType). An example would be 'legal tender\n bond paper'.") prtInputName = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 13), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,63))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtInputName.setDescription('The name assigned to this input sub-unit.') prtInputVendorName = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 14), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,63))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtInputVendorName.setDescription('The vendor name of this input sub-unit.') prtInputModel = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 15), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,63))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtInputModel.setDescription('The model name of this input sub-unit.') prtInputVersion = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 16), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,63))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtInputVersion.setDescription('The version of this input sub-unit.') prtInputSerialNumber = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 17), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,63))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtInputSerialNumber.setDescription('The serial number assigned to this input sub-unit.') prtInputDescription = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 18), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,255))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtInputDescription.setDescription('A free-form text description of this input sub-unit in\n the localization specified by\n prtGeneralCurrentLocalization.') prtInputSecurity = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 19), PresentOnOff()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtInputSecurity.setDescription('Indicates if this input sub-unit has some security\n associated with it.') prtInputMediaWeight = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 20), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtInputMediaWeight.setDescription('The weight of the medium associated with this input\n sub-unit in grams / per meter squared. The value (-2)\n means unknown.') prtInputMediaType = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 21), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,63))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtInputMediaType.setDescription('The name of the type of medium associated with this\n input sub-unit. This name need not be processed by the\n printer; it might simply be displayed to an operator.\n The standardized string values from ISO 10175 (DPA) and\n ISO 10180 (SPDL) are:\n\n stationery Separately cut sheets of an opaque\n material\n transparency Separately cut sheets of a transparent\n material\n envelope Envelopes that can be used for\n conventional mailing purposes\n envelope-plain Envelopes that are not preprinted and\n have no windows\n envelope-window Envelopes that have windows for\n addressing purposes\n continuous-long Continuously connected sheets of an\n opaque material connected along the\n long edge\n continuous-short Continuously connected sheets of an\n opaque material connected along the\n short edge\n tab-stock Media with tabs\n multi-part-form Form medium composed of multiple layers\n not pre-attached to one another; each\n sheet may be drawn separately from an\n input source\n labels Label stock\n multi-layer Form medium composed of multiple layers\n which are pre-attached to one another;\n e.g., for use with impact printers.\n\n Implementers may add additional string values. The\n naming\n conventions in ISO 9070 are recommended in order to\n avoid\n potential name clashes.') prtInputMediaColor = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 22), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,63))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtInputMediaColor.setDescription('The name of the color of the medium associated with\n this input sub-unit using standardized string values\n from ISO 10175 (DPA) and ISO 10180 (SPDL) which are:\n\n other\n unknown\n white\n pink\n yellow\n buff\n goldenrod\n blue\n green\n transparent\n\n Implementers may add additional string values. The naming\n conventions in ISO 9070 are recommended in order to avoid\n potential name clashes.') prtInputMediaFormParts = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 23), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtInputMediaFormParts.setDescription('The number of parts associated with the medium\n associated with this input sub-unit if the medium is a\n multi-part form. The value (-1) means other and\n specifically indicates that the device places no\n restrictions on this parameter. The value (-2) means\n unknown.') prtInputMediaLoadTimeout = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 24), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtInputMediaLoadTimeout.setDescription("When the printer is not able to print due to a subunit\n being empty or the requested media must be manually\n loaded, the printer will wait for the duration (in\n seconds) specified by this object. Upon expiration of\n the time-out, the printer will take the action specified\n by prtInputNextIndex.\n\n The event which causes the printer to enter the waiting\n state is product specific. If the printer is not waiting\n for manually fed media, it may switch from an empty\n subunit to a different subunit without waiting for the\n time-out to expire.\n\n A value of (-1) implies 'other' or 'infinite' which\n translates to 'wait forever'. The action which causes\n printing to continue is product specific. A value of (-\n 2) implies 'unknown'.") prtInputNextIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 8, 2, 1, 25), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtInputNextIndex.setDescription("The value of prtInputIndex corresponding to the input\n subunit which will be used when this input subunit is\n emptied and the time-out specified by\n prtInputMediaLoadTimeout expires. A value of zero(0)\n indicates that auto input switching will not occur when\n this input subunit is emptied. If the time-out specified\n by prtInputLoadMediaTimeout expires and this value is\n zero(0), the job will be aborted. A value of (-1) means\n other. The value (-2) means 'unknown' and specifically\n indicates that an implementation specific method will\n determine the next input subunit to use at the time this\n subunit is emptied and the time-out expires. The value(-\n 3) means input switching is not supported for this\n subunit.") prtOutput = MibIdentifier((1, 3, 6, 1, 2, 1, 43, 9)) prtOutputTable = MibTable((1, 3, 6, 1, 2, 1, 43, 9, 2), ) if mibBuilder.loadTexts: prtOutputTable.setDescription('A table of the devices capable of receiving media\n delivered from the printing process.') prtOutputEntry = MibTableRow((1, 3, 6, 1, 2, 1, 43, 9, 2, 1), ).setIndexNames((0, "HOST-RESOURCES-MIB", "hrDeviceIndex"), (0, "Printer-MIB", "prtOutputIndex")) if mibBuilder.loadTexts: prtOutputEntry.setDescription("Attributes of a device capable of receiving media\n delivered from the printing process. Entries may exist\n in the table for each device index with a device type of\n 'printer'.") prtOutputIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))) if mibBuilder.loadTexts: prtOutputIndex.setDescription('A unique value used by this printer to identify this\n output sub-unit. Although these values may change due\n to a major reconfiguration of the sub-unit (e.g. the\n addition of new output devices to the printer), values\n are expected to remain stable across successive printer\n power cycles.') prtOutputType = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 2), PrtOutputTypeTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtOutputType.setDescription('The type of technology supported by this output sub-\n unit.') prtOutputCapacityUnit = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 3), PrtCapacityUnitTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtOutputCapacityUnit.setDescription('The unit of measurement for use in calculating and\n relaying capacity values for this output sub-unit.') prtOutputMaxCapacity = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 4), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtOutputMaxCapacity.setDescription('The maximum capacity of this output sub-unit in output\n sub-unit capacity units (PrtCapacityUnitTC). There is no\n convention associated with the media itself so this\n value essentially reflects claimed capacity. If this\n output sub-unit can reliably sense this value, the value\n is sensed by the printer and may not be changed by\n management requests; otherwise, the value may be written\n (by a Remote Control Panel or a Management Application).\n The value (-1) means other and specifically indicates\n that the sub-unit places no restrictions on this\n parameter. The value (-2) means unknown.') prtOutputRemainingCapacity = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 5), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtOutputRemainingCapacity.setDescription('The remaining capacity of the possible output sub-unit\n capacity in output sub-unit capacity units\n (PrtCapacityUnitTC)of this output sub-unit. If this\n output sub-unit can reliably sense this value, the value\n is sensed by the printer and may not be modified by\n management requests; otherwise, the value may be written\n (by a Remote Control Panel or a Management Application).\n The value (-1) means other and specifically indicates\n that the sub-unit places no restrictions on this\n parameter. The value (-2) means unknown. The value (-\n 3) means that the printer knows that there remains\n capacity for at least one unit.') prtOutputStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 6), PrtSubUnitStatusTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtOutputStatus.setDescription('The current status of this output sub-unit.') prtOutputName = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,63))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtOutputName.setDescription('The name assigned to this output sub-unit.') prtOutputVendorName = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,63))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtOutputVendorName.setDescription('The vendor name of this output sub-unit.') prtOutputModel = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 9), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,63))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtOutputModel.setDescription('The model name assigned to this output sub-unit.') prtOutputVersion = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 10), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,63))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtOutputVersion.setDescription('The version of this output sub-unit.') prtOutputSerialNumber = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 11), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,63))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtOutputSerialNumber.setDescription('The serial number assigned to this output sub-unit.') prtOutputDescription = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 12), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,255))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtOutputDescription.setDescription('A free-form text description of this output sub-unit in\n the localization specified by\n prtGeneralCurrentLocalization.') prtOutputSecurity = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 13), PresentOnOff()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtOutputSecurity.setDescription('Indicates if this output sub-unit has some security\n associated with it and if that security is enabled or\n not.') prtOutputDimUnit = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 14), PrtMediaUnitTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtOutputDimUnit.setDescription('The unit of measurement for use in calculating and\n relaying dimensional values for this output sub-unit.') prtOutputMaxDimFeedDir = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 15), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtOutputMaxDimFeedDir.setDescription('The maximum dimensions supported by this output sub-unit\n for measurements taken parallel relative to the feed\n direction associated with that sub-unit in output\n sub-unit dimensional units (MediaUnit). If this output\n sub-unit can reliably sense this value, the value is\n sensed by the printer and may not be changed with\n management protocol operations.') prtOutputMaxDimXFeedDir = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 16), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtOutputMaxDimXFeedDir.setDescription('The maximum dimensions supported by this output sub-unit\n for measurements taken ninety degrees relative to the\n feed direction associated with that sub-unit in output\n sub-unit dimensional units (MediaUnit). If this output\n sub-unit can reliably sense this value, the value is\n sensed by the printer and may not be changed with\n management protocol operations.') prtOutputMinDimFeedDir = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 17), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtOutputMinDimFeedDir.setDescription('The minimum dimensions supported by this output sub-unit\n for measurements taken parallel relative to the feed\n direction associated with that sub-unit in output\n sub-unit dimensional units (DimUnit). If this output\n sub-unit can reliably sense this value, the value is\n sensed by the printer and may not be changed with\n management protocol operations.') prtOutputMinDimXFeedDir = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 18), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtOutputMinDimXFeedDir.setDescription('The minimum dimensions supported by this output sub-unit\n for measurements taken ninety degrees relative to the\n feed direction associated with that sub-unit in output\n sub-unit dimensional units (DimUnit). If this output\n sub-unit can reliably sense this value, the value is\n sensed by the printer and may not be changed with\n management protocol operations.') prtOutputStackingOrder = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 19), PrtOutputStackingOrderTC()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtOutputStackingOrder.setDescription("The current state of the stacking order for the\n associated output sub-unit. 'FirstToLast' means\n that as pages are output the front of the next page is\n placed against the back of the previous page.\n 'LasttoFirst' means that as pages are output the back\n of the next page is placed against the front of the\n previous page.") prtOutputPageDeliveryOrientation = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 20), PrtOutputPageDeliveryOrientationTC()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtOutputPageDeliveryOrientation.setDescription("The reading surface that will be 'up' when pages are\n delivered to the associated output sub-unit. Values are\n faceUp and faceDown. (Note: interpretation of these\n values is in general context-dependent based on locale;\n presentation of these values to an end-user should be\n normalized to the expectations of the user).") prtOutputBursting = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 21), PresentOnOff()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtOutputBursting.setDescription('This object indicates that the outputting sub-unit\n supports bursting, and if so, whether the feature is\n enabled. Bursting is the process by which continuous\n media is separated into individual sheets, typically by\n bursting along pre-formed perforations.') prtOutputDecollating = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 22), PresentOnOff()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtOutputDecollating.setDescription('This object indicates that the output supports\n decollating, and if so, whether the feature is enabled.\n Decollating is the process by which the individual parts\n within a multi-part form are separated and sorted into\n separate stacks for each part.') prtOutputPageCollated = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 23), PresentOnOff()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtOutputPageCollated.setDescription('This object indicates that the output sub-unit supports\n page collation, and if so, whether the feature is\n enabled. See glossary for definition of how this\n document defines collation.') prtOutputOffsetStacking = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 9, 2, 1, 24), PresentOnOff()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtOutputOffsetStacking.setDescription('This object indicates that the output supports offset\n stacking, and if so, whether the feature is enabled. See\n glossary for how Offset Stacking is defined by this\n document.') prtMarker = MibIdentifier((1, 3, 6, 1, 2, 1, 43, 10)) prtMarkerTable = MibTable((1, 3, 6, 1, 2, 1, 43, 10, 2), ) if mibBuilder.loadTexts: prtMarkerTable.setDescription('') prtMarkerEntry = MibTableRow((1, 3, 6, 1, 2, 1, 43, 10, 2, 1), ).setIndexNames((0, "HOST-RESOURCES-MIB", "hrDeviceIndex"), (0, "Printer-MIB", "prtMarkerIndex")) if mibBuilder.loadTexts: prtMarkerEntry.setDescription("Entries may exist in the table for each device index\n with a device type of 'printer'.") prtMarkerIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 10, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))) if mibBuilder.loadTexts: prtMarkerIndex.setDescription('A unique value used by the printer to identify this\n marking SubUnit. Although these values may change due\n to a major reconfiguration of the device (e.g. the\n addition of new marking sub-units to the printer),\n values are expected to remain stable across successive\n printer power cycles.') prtMarkerMarkTech = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 10, 2, 1, 2), PrtMarkerMarkTechTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerMarkTech.setDescription('The type of marking technology used for this marking\n sub-unit.') prtMarkerCounterUnit = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 10, 2, 1, 3), PrtMarkerCounterUnitTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerCounterUnit.setDescription('The unit that will be used by the printer when\n reporting counter values for this marking sub-unit. The\n time units of measure are provided for a device like a\n strip recorder that does not or cannot track the\n physical dimensions of the media and does not use\n characters, lines or sheets.') prtMarkerLifeCount = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 10, 2, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerLifeCount.setDescription('The count of the number of units of measure counted\n during the life of printer using units of measure as\n specified by prtMarkerCounterUnit.') prtMarkerPowerOnCount = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 10, 2, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerPowerOnCount.setDescription('The count of the number of units of measure counted\n since the equipment was most recently powered on using\n units of measure as specified by prtMarkerCounterUnit.') prtMarkerProcessColorants = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 10, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerProcessColorants.setDescription('The number of process colors supported by this marker.\n A process color of 1 implies monochrome. The value of\n this object and prtMarkerSpotColorants cannot both be 0.\n The value of prtMarkerProcessColorants must be 0 or\n greater.') prtMarkerSpotColorants = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 10, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerSpotColorants.setDescription('The number of spot colors supported by this marker. The\n value of this object and prtMarkerProcessColorants\n cannot both be 0. Must be 0 or greater.') prtMarkerAddressabilityUnit = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 10, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(3, 4,))).clone(namedValues=NamedValues(("tenThousandthsOfInches", 3), ("micrometers", 4),))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerAddressabilityUnit.setDescription("The unit of measure of distances, as applied to the\n marker's resolution.") prtMarkerAddressabilityFeedDir = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 10, 2, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerAddressabilityFeedDir.setDescription("The maximum number of addressable marking positions in\n the feed direction per 10000 units of measure specified\n by prtMarkerAddressabilityUnit. A value of (-1) implies\n 'other' or 'infinite' while a value of (-2) implies\n 'unknown'.") prtMarkerAddressabilityXFeedDir = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 10, 2, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerAddressabilityXFeedDir.setDescription("The maximum number of addressable marking positions in\n the cross feed direction in 10000 units of measure\n specified by prtMarkerAddressabilityUnit. A value of (-\n 1) implies 'other' or 'infinite' while a value of (-2)\n implies 'unknown'.") prtMarkerNorthMargin = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 10, 2, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerNorthMargin.setDescription('The margin, in units identified by\n prtMarkerAddressabilityUnit, from the leading edge of\n the medium as the medium flows through the marking\n engine with the side to be imaged facing the observer.\n The leading edge is the North edge and the other edges\n are defined by the normal compass layout of directions\n with the compass facing the observer. Printing within\n the area bounded by all four margins is guaranteed for\n all interpreters. The value (-2) means unknown.') prtMarkerSouthMargin = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 10, 2, 1, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerSouthMargin.setDescription('The margin from the South edge (see\n prtMarkerNorthMargin) of the medium in units identified\n by prtMarkerAddressabilityUnit. Printing within the\n area bounded by all four margins is guaranteed for all\n interpreters. The value (-2) means unknown.') prtMarkerWestMargin = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 10, 2, 1, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerWestMargin.setDescription('The margin from the West edge (see\n prtMarkerNorthMargin) of the medium in units identified\n by prtMarkerAddressabilityUnit. Printing within the area\n bounded by all four margins is guaranteed for all\n interpreters. The value (-2) means unknown.') prtMarkerEastMargin = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 10, 2, 1, 14), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerEastMargin.setDescription('The margin from the East edge (see\n prtMarkerNorthMargin) of the medium in units identified\n by prtMarkerAddressabilityUnit. Printing within the area\n bounded by all four margins is guaranteed for all\n interpreters. The value (-2) means unknown.') prtMarkerStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 10, 2, 1, 15), PrtSubUnitStatusTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerStatus.setDescription('The current status of this marker sub-unit.') prtMarkerSupplies = MibIdentifier((1, 3, 6, 1, 2, 1, 43, 11)) prtMarkerSuppliesTable = MibTable((1, 3, 6, 1, 2, 1, 43, 11, 1), ) if mibBuilder.loadTexts: prtMarkerSuppliesTable.setDescription('A table of the marker supplies available on this\n printer.') prtMarkerSuppliesEntry = MibTableRow((1, 3, 6, 1, 2, 1, 43, 11, 1, 1), ).setIndexNames((0, "HOST-RESOURCES-MIB", "hrDeviceIndex"), (0, "Printer-MIB", "prtMarkerSuppliesIndex")) if mibBuilder.loadTexts: prtMarkerSuppliesEntry.setDescription("Attributes of a marker supply. Entries may exist in the\n table for each device index with a device type of\n 'printer'.") prtMarkerSuppliesIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 11, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))) if mibBuilder.loadTexts: prtMarkerSuppliesIndex.setDescription('A unique value used by the printer to identify this\n marker supply. Although these values may change due to\n a major reconfiguration of the device (e.g. the addition\n of new marker supplies to the printer), values are\n expected to remain stable across successive power\n cycles.') prtMarkerSuppliesMarkerIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 11, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerSuppliesMarkerIndex.setDescription('The value of prtMarkerIndex corresponding to the\n marking sub-unit with which this marker supply sub-unit\n is associated.') prtMarkerSuppliesColorantIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 11, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerSuppliesColorantIndex.setDescription('The value of prtMarkerColorantIndex corresponding to\n the colorant with which this marker supply sub-unit is\n associated. This value shall be 0 if there is no\n colorant table or if this supply does not depend on a\n single specified colorant.') prtMarkerSuppliesClass = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 11, 1, 1, 4), PrtMarkerSuppliesClassTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerSuppliesClass.setDescription('Indicates whether this supply entity represents a\n supply that is consumed or a receptacle that is filled.') prtMarkerSuppliesType = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 11, 1, 1, 5), PrtMarkerSuppliesTypeTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerSuppliesType.setDescription('The type of this supply.') prtMarkerSuppliesDescription = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 11, 1, 1, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,255))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerSuppliesDescription.setDescription('The description of this supply container/receptacle in\n the localization specified by\n prtGeneralCurrentLocalization.') prtMarkerSuppliesSupplyUnit = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 11, 1, 1, 7), PrtMarkerSuppliesSupplyUnitTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerSuppliesSupplyUnit.setDescription('Unit of measure of this marker supply\n container/receptacle.') prtMarkerSuppliesMaxCapacity = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 11, 1, 1, 8), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtMarkerSuppliesMaxCapacity.setDescription('The maximum capacity of this supply\n container/receptacle expressed in\n prtMarkerSuppliesSupplyUnit. If this supply\n container/receptacle can reliably sense this value, the\n value is reported by the printer and is read-only;\n otherwise, the value may be written (by a Remote Control\n Panel or a Management Application). The value (-1) means\n other and specifically indicates that the sub-unit\n places no restrictions on this parameter. The value (-2)\n means unknown.') prtMarkerSuppliesLevel = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 11, 1, 1, 9), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtMarkerSuppliesLevel.setDescription('The current level if this supply is a container;\n remaining space if this supply is a receptacle. If this\n supply container/receptacle can reliably sense this\n value, the value is reported by the printer and is read-\n only; otherwise, the value may be written (by a Remote\n Control Panel or a Management Application). The value (-\n 1) means other and specifically indicates that the sub-\n unit places no restrictions on this parameter. The value\n (-2) means unknown. A value of (-3) means that the\n printer knows that there is some supply/remaining space,\n respectively.') prtMarkerColorant = MibIdentifier((1, 3, 6, 1, 2, 1, 43, 12)) prtMarkerColorantTable = MibTable((1, 3, 6, 1, 2, 1, 43, 12, 1), ) if mibBuilder.loadTexts: prtMarkerColorantTable.setDescription('A table of all of the colorants available on the\n printer.') prtMarkerColorantEntry = MibTableRow((1, 3, 6, 1, 2, 1, 43, 12, 1, 1), ).setIndexNames((0, "HOST-RESOURCES-MIB", "hrDeviceIndex"), (0, "Printer-MIB", "prtMarkerColorantIndex")) if mibBuilder.loadTexts: prtMarkerColorantEntry.setDescription("Attributes of a colorant available on the printer.\n Entries may exist in the table for each device index\n with a device type of 'printer'.") prtMarkerColorantIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 12, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))) if mibBuilder.loadTexts: prtMarkerColorantIndex.setDescription('A unique value used by the printer to identify this\n colorant. Although these values may change due to a major\n reconfiguration of the device (e.g. the addition of new\n colorants to the printer).') prtMarkerColorantMarkerIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 12, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerColorantMarkerIndex.setDescription('The value of prtMarkerIndex corresponding to the marker\n sub-unit with which this colorant entry is associated.') prtMarkerColorantRole = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 12, 1, 1, 3), PrtMarkerColorantRoleTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerColorantRole.setDescription('The role played by this colorant.') prtMarkerColorantValue = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 12, 1, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,255))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerColorantValue.setDescription('The name of the color of this colorant using\n standardized string names from ISO 10175 (DPA) and ISO\n 10180 (SPDL) which are:\n other\n unknown\n white\n red\n green\n blue\n cyan\n magenta\n yellow\n black\n Implementers may add additional string values. The\n naming conventions in ISO 9070 are recommended in order\n to avoid potential name clashes') prtMarkerColorantTonality = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 12, 1, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMarkerColorantTonality.setDescription('The distinct levels of tonality realizable by a marking\n sub-unit when using this colorant. This value does not\n include the number of levels of tonal difference that an\n interpreter can obtain by techniques such as half\n toning. This value must be at least 2.') prtMediaPath = MibIdentifier((1, 3, 6, 1, 2, 1, 43, 13)) prtMediaPathTable = MibTable((1, 3, 6, 1, 2, 1, 43, 13, 4), ) if mibBuilder.loadTexts: prtMediaPathTable.setDescription('') prtMediaPathEntry = MibTableRow((1, 3, 6, 1, 2, 1, 43, 13, 4, 1), ).setIndexNames((0, "HOST-RESOURCES-MIB", "hrDeviceIndex"), (0, "Printer-MIB", "prtMediaPathIndex")) if mibBuilder.loadTexts: prtMediaPathEntry.setDescription("Entries may exist in the table for each device index\n with a device type of 'printer'.") prtMediaPathIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 13, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))) if mibBuilder.loadTexts: prtMediaPathIndex.setDescription('A unique value used by the printer to identify this\n media path. Although these values may change due to a\n major reconfiguration of the device (e.g. the addition\n of new media paths to the printer), values are expected\n to remain stable across successive printer power\n cycles.') prtMediaPathMaxSpeedPrintUnit = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 13, 4, 1, 2), PrtMediaPathMaxSpeedPrintUnitTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMediaPathMaxSpeedPrintUnit.setDescription('The unit of measure used in specifying the speed of all\n media paths in the printer.') prtMediaPathMediaSizeUnit = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 13, 4, 1, 3), PrtMediaUnitTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMediaPathMediaSizeUnit.setDescription('The units of measure of media size for use in\n calculating and relaying dimensional values for all\n media paths in the printer.') prtMediaPathMaxSpeed = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 13, 4, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMediaPathMaxSpeed.setDescription("The maximum printing speed of this media path expressed\n in prtMediaPathMaxSpeedUnit's. A value of (-1) implies\n 'other'.") prtMediaPathMaxMediaFeedDir = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 13, 4, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMediaPathMaxMediaFeedDir.setDescription("The maximum physical media size in the feed direction\n of this media path expressed in units of measure\n specified by PrtMediaPathMediaSizeUnit. A value of (-1)\n implies 'unlimited' a value of (-2) implies 'unknown'") prtMediaPathMaxMediaXFeedDir = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 13, 4, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMediaPathMaxMediaXFeedDir.setDescription("The maximum physical media size across the feed\n direction of this media path expressed in units of\n measure specified by prtMediaPathMediaSizeUnit. A value\n of (-2) implies 'unknown'.") prtMediaPathMinMediaFeedDir = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 13, 4, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMediaPathMinMediaFeedDir.setDescription("The minimum physical media size in the feed direction\n of this media path expressed in units of measure\n specified by prtMediaPathMediaSizeUnit. A value of (-2)\n implies 'unknown'.") prtMediaPathMinMediaXFeedDir = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 13, 4, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMediaPathMinMediaXFeedDir.setDescription("The minimum physical media size across the feed\n direction of this media path expressed in units of\n measure specified by prtMediaPathMediaSizeUnit. A value\n of (-2) implies 'unknown'.") prtMediaPathType = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 13, 4, 1, 9), PrtMediaPathTypeTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMediaPathType.setDescription('The type of the media path for this media path.') prtMediaPathDescription = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 13, 4, 1, 10), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,255))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMediaPathDescription.setDescription('The manufacturer-provided description of this media\n path in the localization specified by\n prtGeneralCurrentLocalization.') prtMediaPathStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 13, 4, 1, 11), PrtSubUnitStatusTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtMediaPathStatus.setDescription('The current status of this media path.') prtChannel = MibIdentifier((1, 3, 6, 1, 2, 1, 43, 14)) prtChannelTable = MibTable((1, 3, 6, 1, 2, 1, 43, 14, 1), ) if mibBuilder.loadTexts: prtChannelTable.setDescription('') prtChannelEntry = MibTableRow((1, 3, 6, 1, 2, 1, 43, 14, 1, 1), ).setIndexNames((0, "HOST-RESOURCES-MIB", "hrDeviceIndex"), (0, "Printer-MIB", "prtChannelIndex")) if mibBuilder.loadTexts: prtChannelEntry.setDescription("Entries may exist in the table for each device index\n with a device type of 'printer'.") prtChannelIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 14, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))) if mibBuilder.loadTexts: prtChannelIndex.setDescription('A unique value used by the printer to identify this\n data channel. Although these values may change due to a\n major reconfiguration of the device (e.g. the addition\n of new data channels to the printer), values are\n expected to remain stable across successive printer\n power cycles.') prtChannelType = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 14, 1, 1, 2), PrtChannelTypeTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtChannelType.setDescription('The type of this print data channel. This object\n provides the linkage to ChannelType-specific groups that\n may (conceptually) extend the prtChannelTable with\n additional details about that channel.') prtChannelProtocolVersion = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 14, 1, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,63))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtChannelProtocolVersion.setDescription('The version of the protocol used on this channel. The\n format used for version numbering depends on\n prtChannelType.') prtChannelCurrentJobCntlLangIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 14, 1, 1, 4), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtChannelCurrentJobCntlLangIndex.setDescription('The value of prtInterpreterIndex corresponding to the\n Control Language Interpreter for this channel. This\n interpreter defines the syntax used for control\n functions, such as querying or changing environment\n variables and identifying job boundaries (e.g. PJL,\n PostScript, NPAP). A value of zero indicates that there\n is no current Job Control Language Interpreter for this\n channel') prtChannelDefaultPageDescLangIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 14, 1, 1, 5), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtChannelDefaultPageDescLangIndex.setDescription('The value of prtInterpreterIndex corresponding to the\n Page Description Language Interpreter for this channel.\n This interpreter defines the default Page Description\n Language interpreter to be used for the print data\n unless the Control Language is used to select a specific\n interpreter (e.g., PCL, PostScript Language, auto-\n sense). A value of zero indicates that there is no\n default page description language interpreter for this\n channel.') prtChannelState = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 14, 1, 1, 6), PrtChannelStateTC()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtChannelState.setDescription('The state of this print data channel. The value\n determines whether control information and print data is\n allowed through this channel or not.') prtChannelIfIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 14, 1, 1, 7), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtChannelIfIndex.setDescription('The value of ifIndex (in the ifTable; see the interface\n section of MIB-2/RFC 1213) which corresponds to this\n channel. When more than one row of the ifTable is\n relevant, this is the index of the row representing the\n topmost layer in the interface hierarchy. A value of\n zero indicates that no interface is associated with this\n channel.') prtChannelStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 14, 1, 1, 8), PrtSubUnitStatusTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtChannelStatus.setDescription('The current status of the channel.') prtChannelInformation = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 14, 1, 1, 9), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,255))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtChannelInformation.setDescription("Auxiliary information to allow a printing application\n to use the channel for data submission to the printer.\n An application capable of using a specific\n PrtChannelType should be able to use the combined\n information from the prtChannelInformation and other\n channel and interface group objects to 'bootstrap' its\n use of the channel. prtChannelInformation is not\n intended to provide a general channel description, nor\n to provide information that is available once the\n channel is in use.\n\n The encoding and interpretation of the\n prtChannelInformation object is specific to channel\n type. The description of each PrtChannelType enum value\n for which prtChannelInformation is defined specifies the\n appropriate encoding and interpretation, including\n interaction with other objects. For channel types that\n do not specify a prtChannelInformation value, its value\n shall be null (0 length).\n\n When a new PrtChannelType enumeration value is\n registered, its accompanying description must specify\n the encoding and interpretation of the\n prtChannelInformation value for the channel type.\n prtChannelInformation semantics for an existing\n PrtChannelType may be added or amended in the same\n manner as described in section 2.4.1 for type 2\n enumeration values.\n\n The prtChannelInformation specifies values for a\n collection of channel attributes, represented as text\n according to the following rules:\n\n 1. The prtChannelInformation is not affected by\n localization.\n\n 2. The prtChannelInformation is a list of entries\n representing the attribute values. Each entry consists\n of the following items, in order:\n\n a. a keyword, composed of alphabetic characters (A-Z,\n a-z) represented by their NVT ASCII [NVT ASCII] codes,\n that identifies a channel attribute,\n b. the NVT ASCII code for an Equals Sign (=) (code 61)\n to delimit the keyword,\n\n c. a data value encoded using rules specific to the\n PrtChannelType to with the prtChannelInformation applies\n which must in no case allow an octet with value 10 (the\n NVT ASCII Line Feed code),\n\n d. the NVT ASCII code for a Line Feed character (code\n 10) to delimit the data value.\n\n No other octets shall be present.\n\n Keywords are case-sensitive. Conventionally, keywords\n are capitalized (including each word of a multi-word\n keyword) and since they occupy space in the\n prtChannelInformation, they are kept short.\n\n 3. If a channel attribute has multiple values, it is\n represented by multiple entries with the same keyword,\n each specifying one value. Otherwise, there shall be at\n most one entry for each attribute.\n\n 4. By default, entries may appear in any order. If\n there are ordering constraints for particular entries,\n these must be specified in their definitions.\n\n 5. The prtChannelInformation value by default consists\n of text represented by NVT ASCII graphics character\n codes. However, other representations may be specified:\n\n a. In cases where the prtChannelInformation value\n contains information not normally coded in textual form,\n whatever symbolic representation is conventionally used\n for the information should be used for encoding the\n prtChannelInformation value. (For instance, a binary\n port value might be represented as a decimal number\n using NVT ASCII codes.) Such encoding must be specified\n in the definition of the value.\n\n b. The value may contain textual information in a\n character set other than NVT ASCII graphics characters.\n (For instance, an identifier might consist of ISO 10646\n text encoded using the UTF-8 encoding scheme.) Such a\n character set and its encoding must be specified in the\n definition of the value.\n\n 6. For each PrtChannelType for which\n prtChannelInformation entries are defined, the\n descriptive text associated with the PrtChannelType\n enumeration value shall specify the following\n information for each entry:\n\n Title: Brief description phrase, e.g.: 'Port\n name', 'Service Name', etc.\n\n Keyword: The keyword value, e.g.: 'Port' or\n 'Service'\n\n Syntax: The encoding of the entry value if it\n cannot be directly represented by NVT\n ASCII.\n\n Status: 'Mandatory', 'Optional', or 'Conditionally\n Mandatory'\n\n Multiplicity: 'Single' or 'Multiple' to indicate whether\n the entry may be present multiple times.\n\n Description: Description of the use of the entry, other\n information required to complete the\n definition (e.g.: ordering constraints,\n interactions between entries).\n\n Applications that interpret prtChannelInformation should\n ignore unrecognized entries, so they are not affected if\n new entry types are added.") prtInterpreter = MibIdentifier((1, 3, 6, 1, 2, 1, 43, 15)) prtInterpreterTable = MibTable((1, 3, 6, 1, 2, 1, 43, 15, 1), ) if mibBuilder.loadTexts: prtInterpreterTable.setDescription('') prtInterpreterEntry = MibTableRow((1, 3, 6, 1, 2, 1, 43, 15, 1, 1), ).setIndexNames((0, "HOST-RESOURCES-MIB", "hrDeviceIndex"), (0, "Printer-MIB", "prtInterpreterIndex")) if mibBuilder.loadTexts: prtInterpreterEntry.setDescription("Entries may exist in the table for each device index\n with a device type of 'printer'.") prtInterpreterIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 15, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))) if mibBuilder.loadTexts: prtInterpreterIndex.setDescription('A unique value for each PDL or control language for\n which there exists an interpreter or emulator in the\n printer. The value is used to identify this interpreter.\n Although these values may change due to a major\n reconfiguration of the device (e.g. the addition of new\n interpreters to the printer), values are expected to\n remain stable across successive printer power cycles.') prtInterpreterLangFamily = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 15, 1, 1, 2), PrtInterpreterLangFamilyTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtInterpreterLangFamily.setDescription('The family name of a Page Description Language (PDL) or\n control language which this interpreter in the printer\n can interpret or emulate.') prtInterpreterLangLevel = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 15, 1, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,31))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtInterpreterLangLevel.setDescription("The level of the language which this interpreter is\n interpreting or emulating. This might contain a value\n like '5e' for an interpreter which is emulating level 5e\n of the PCL language. It might contain '2' for an\n interpreter which is emulating level 2 of the PostScript\n language. Similarly it might contain '2' for an\n interpreter which is emulating level 2 of the HPGL\n language.") prtInterpreterLangVersion = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 15, 1, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,31))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtInterpreterLangVersion.setDescription('The date code or version of the language which this\n interpreter is interpreting or emulating.') prtInterpreterDescription = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 15, 1, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,255))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtInterpreterDescription.setDescription('A string to identify this interpreter in the\n localization specified by prtGeneralCurrentLocalization\n as opposed to the language which is being interpreted.\n It is anticipated that this string will allow\n manufacturers to unambiguously identify their\n interpreters.') prtInterpreterVersion = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 15, 1, 1, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,31))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtInterpreterVersion.setDescription('The date code, version number, or other product\n specific information tied to this interpreter. This\n value is associated with the interpreter, rather than\n with the version of the language which is being\n interpreted or emulated.') prtInterpreterDefaultOrientation = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 15, 1, 1, 7), PrtPrintOrientationTC()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtInterpreterDefaultOrientation.setDescription('The current orientation default for this interpreter.\n This value may be overridden for a particular job (e.g.,\n by a command in the input data stream).') prtInterpreterFeedAddressability = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 15, 1, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtInterpreterFeedAddressability.setDescription('The maximum interpreter addressability in the feed\n direction in 10000 prtMarkerAddressabilityUnits (see\n prtMarkerAddressabilityFeedDir ) for this interpreter.\n The value (-1) means other and specifically indicates\n that the sub-unit places no restrictions on this\n parameter.') prtInterpreterXFeedAddressability = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 15, 1, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtInterpreterXFeedAddressability.setDescription('The maximum interpreter addressability in the cross\n feed direction in 10000 prtMarkerAddressabilityUnits\n (see prtMarkerAddressabilityXFeedDir) for this\n interpreter. The value (-1) means other and specifically\n indicates that the sub-unit places no restrictions on\n this parameter.') prtInterpreterDefaultCharSetIn = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 15, 1, 1, 10), CodedCharSet()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtInterpreterDefaultCharSetIn.setDescription('The default coded character set for input octets\n encountered outside a context in which the Page\n Description Language established the interpretation of\n the octets. (Input octets are presented to the\n interpreter through a path defined in the channel\n group.) This value shall be (2) if there is no default.') prtInterpreterDefaultCharSetOut = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 15, 1, 1, 11), CodedCharSet()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtInterpreterDefaultCharSetOut.setDescription("The default character set for data coming from this\n interpreter through the printer's output channel (i.e.\n the 'backchannel'). This value shall be (2) if there is\n no default.") prtInterpreterTwoWay = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 15, 1, 1, 12), PrtInterpreterTwoWayTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtInterpreterTwoWay.setDescription('Indicates whether or not this interpreter returns\n information back to the host.') prtConsoleDisplayBuffer = MibIdentifier((1, 3, 6, 1, 2, 1, 43, 16)) prtConsoleDisplayBufferTable = MibTable((1, 3, 6, 1, 2, 1, 43, 16, 5), ) if mibBuilder.loadTexts: prtConsoleDisplayBufferTable.setDescription('Physical display buffer for printer console display or\n operator panel') prtConsoleDisplayBufferEntry = MibTableRow((1, 3, 6, 1, 2, 1, 43, 16, 5, 1), ).setIndexNames((0, "HOST-RESOURCES-MIB", "hrDeviceIndex"), (0, "Printer-MIB", "prtConsoleDisplayBufferIndex")) if mibBuilder.loadTexts: prtConsoleDisplayBufferEntry.setDescription("This table contains one entry for each physical line on\n the display. Lines cannot be added or deleted. Entries\n may exist in the table for each device index with a\n device type of 'printer'.") prtConsoleDisplayBufferIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 16, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))) if mibBuilder.loadTexts: prtConsoleDisplayBufferIndex.setDescription('A unique value for each console line in the printer.\n The value is used to identify this console line.\n Although these values may change due to a major\n reconfiguration of the device (e.g. the addition of new\n console lines to the printer). Values are normally\n expected to remain stable across successive printer\n power cycles.') prtConsoleDisplayBufferText = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 16, 5, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtConsoleDisplayBufferText.setDescription("The content of a line in the logical display buffer of\n the operator's console of the printer. When a write\n operation occurs, normally a critical message, to one of\n the LineText strings, the agent should make that line\n displayable if a physical display is present. Writing a\n zero length string clears the line. It is an\n implementation-specific matter as to whether the agent\n allows a line to be overwritten before it has been\n cleared. Printer generated strings shall be in the\n localization specified by prtConsoleLocalization.\n Management Application generated strings should be\n localized by the Management Application.") prtConsoleLights = MibIdentifier((1, 3, 6, 1, 2, 1, 43, 17)) prtConsoleLightTable = MibTable((1, 3, 6, 1, 2, 1, 43, 17, 6), ) if mibBuilder.loadTexts: prtConsoleLightTable.setDescription('') prtConsoleLightEntry = MibTableRow((1, 3, 6, 1, 2, 1, 43, 17, 6, 1), ).setIndexNames((0, "HOST-RESOURCES-MIB", "hrDeviceIndex"), (0, "Printer-MIB", "prtConsoleLightIndex")) if mibBuilder.loadTexts: prtConsoleLightEntry.setDescription("Entries may exist in the table for each device index\n with a device type of 'printer'.") prtConsoleLightIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 17, 6, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))) if mibBuilder.loadTexts: prtConsoleLightIndex.setDescription('A unique value used by the printer to identify this\n light. Although these values may change due to a major\n reconfiguration of the device (e.g. the addition of new\n lights to the printer). Values are normally expected to\n remain stable across successive printer power cycles.') prtConsoleOnTime = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 17, 6, 1, 2), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtConsoleOnTime.setDescription('This object, in conjunction with prtConsoleOffTime,\n defines the current status of the light. If both\n prtConsoleOnTime and prtConsoleOffTime are non-zero, the\n lamp is blinking and the values presented define the on\n time and off time, respectively, in milliseconds. If\n prtConsoleOnTime is zero and prtConsoleOffTime is non-\n zero, the lamp is off. If prtConsoleOffTime is zero and\n prtConsoleOnTime is non-zero, the lamp is on. If both\n values are zero the lamp is off.') prtConsoleOffTime = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 17, 6, 1, 3), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prtConsoleOffTime.setDescription('This object, in conjunction with prtConsoleOnTime,\n defines the current status of the light. If both\n prtConsoleOnTime and prtConsoleOffTime are non-zero, the\n lamp is blinking and the values presented define the on\n time and off time, respectively, in milliseconds. If\n prtConsoleOnTime is zero and prtConsoleOffTime is non-\n zero, the lamp is off. If prtConsoleOffTime is zero and\n prtConsoleOnTime is non-zero, the lamp is on. If both\n values are zero the lamp is off.') prtConsoleColor = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 17, 6, 1, 4), PrtConsoleColorTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtConsoleColor.setDescription('The color of this light.') prtConsoleDescription = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 17, 6, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,255))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtConsoleDescription.setDescription('The vendor description or label of this light in the\n localization specified by prtConsoleLocalization.') prtAlert = MibIdentifier((1, 3, 6, 1, 2, 1, 43, 18)) prtAlertTable = MibTable((1, 3, 6, 1, 2, 1, 43, 18, 1), ) if mibBuilder.loadTexts: prtAlertTable.setDescription('') prtAlertEntry = MibTableRow((1, 3, 6, 1, 2, 1, 43, 18, 1, 1), ).setIndexNames((0, "HOST-RESOURCES-MIB", "hrDeviceIndex"), (0, "Printer-MIB", "prtAlertIndex")) if mibBuilder.loadTexts: prtAlertEntry.setDescription("Entries may exist in the table for each device\n index with a device type of 'printer'.") prtAlertIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 18, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtAlertIndex.setDescription('The index value used to determine which alerts have\n been added or removed from the alert table. This is an\n incrementing integer starting from zero every time the\n printer is reset. When the printer adds an alert to the\n table, that alert is assigned the next higher integer\n value from the last item entered into the table. If the\n index value reaches its maximum value, the next item\n entered will cause the index value to roll over and\n start at zero again. The first event placed in the\n alert table after a reset of the printer shall have an\n index value of 1. NOTE: The management application will\n read the alert table when a trap or event notification\n occurs or at a periodic rate and then parse the table to\n determine if any new entries were added by comparing the\n last known index value with the current highest index\n value. The management application will then update its\n copy of the alert table. When the printer discovers\n that an alert is no longer active, the printer shall\n remove the row for that alert from the table and shall\n reduce the number of rows in the table. The printer may\n add or delete any number of rows from the table at any\n time. The management station can detect when binary\n change alerts have been deleted by requesting an\n attribute of each alert, and noting alerts as deleted\n when that retrieval is not possible.') prtAlertSeverityLevel = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 18, 1, 1, 2), PrtAlertSeverityLevelTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtAlertSeverityLevel.setDescription('The level of severity of this alert table entry. The\n printer determines the severity level assigned to each\n entry into the table.') prtAlertTrainingLevel = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 18, 1, 1, 3), PrtAlertTrainingLevelTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtAlertTrainingLevel.setDescription('See textual convention PrtAlertTrainingLevelTC') prtAlertGroup = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 18, 1, 1, 4), PrtAlertGroupTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtAlertGroup.setDescription('The type of sub-unit within the printer model that this\n alert is related. Input, output, and markers are\n examples of printer model groups, i.e., examples of\n types of sub-units. Wherever possible, these\n enumerations match the sub-identifier that identifies\n the relevant table in the printmib.') prtAlertGroupIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 18, 1, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtAlertGroupIndex.setDescription('An index of the row within the principle table in the\n group identified by prtAlertGroup that represents the\n sub-unit of the printer that caused this alert. The\n combination of the prtAlertGroup and the\n prtAlertGroupIndex defines exactly which printer sub-\n unit caused the alert; for example, Input #3, Output #2,\n and Marker #1. Every object in this MIB is indexed with\n hrDeviceIndex and optionally, another index variable.\n If this other index variable is present in the table\n that generated the alert, it will be used as the value\n for this object. Otherwise, this value shall be -1.') prtAlertLocation = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 18, 1, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtAlertLocation.setDescription('The sub-unit location that is defined by the printer\n manufacturer to further refine the location of this\n alert within the designated sub-unit. The location is\n used in conjunction with the Group and GroupIndex\n values; for example, there is an alert in Input #2 at\n location number 7. The value (-2) indicates unknown') prtAlertCode = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 18, 1, 1, 7), PrtAlertCodeTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtAlertCode.setDescription('See associated textual convention PrtAlertCodeTC') prtAlertDescription = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 18, 1, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0,255))).setMaxAccess("readonly") if mibBuilder.loadTexts: prtAlertDescription.setDescription("A description of this alert entry in the localization\n specified by prtGeneralCurrentLocalization. The\n description is provided by the printer to further\n elaborate on the enumerated alert or provide information\n in the case where the code is classified as 'other' or\n 'unknown'. The printer is required to return a\n description string but the string may be a null\n string.") prtAlertTime = MibTableColumn((1, 3, 6, 1, 2, 1, 43, 18, 1, 1, 9), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: prtAlertTime.setDescription('The value of sysUpTime at the time that this alert was\n generated.') printerV1Alert = ObjectIdentity((1, 3, 6, 1, 2, 1, 43, 18, 2)) if mibBuilder.loadTexts: printerV1Alert.setDescription('The value of the enterprise-specific OID in an SNMPv1\n trap sent signaling a critical event in the\n prtAlertTable.') printerV2AlertPrefix = MibIdentifier((1, 3, 6, 1, 2, 1, 43, 18, 2, 0)) printerV2Alert = NotificationType((1, 3, 6, 1, 2, 1, 43, 18, 2, 0, 1)).setObjects(*(("Printer-MIB", "prtAlertIndex"), ("Printer-MIB", "prtAlertSeverityLevel"), ("Printer-MIB", "prtAlertGroup"), ("Printer-MIB", "prtAlertGroupIndex"), ("Printer-MIB", "prtAlertLocation"), ("Printer-MIB", "prtAlertCode"),)) if mibBuilder.loadTexts: printerV2Alert.setDescription('This trap is sent whenever a critical event is added to\n the prtAlertTable.') prtMIBConformance = MibIdentifier((1, 3, 6, 1, 2, 1, 43, 2)) prtMIBCompliance = ModuleCompliance((1, 3, 6, 1, 2, 1, 43, 2, 1)).setObjects(*(("Printer-MIB", "prtGeneralGroup"), ("Printer-MIB", "prtInputGroup"), ("Printer-MIB", "prtOutputGroup"), ("Printer-MIB", "prtMarkerGroup"), ("Printer-MIB", "prtMediaPathGroup"), ("Printer-MIB", "prtChannelGroup"), ("Printer-MIB", "prtInterpreterGroup"), ("Printer-MIB", "prtConsoleGroup"), ("Printer-MIB", "prtAlertTableGroup"),)) if mibBuilder.loadTexts: prtMIBCompliance.setDescription('The compliance statement for agents that implement the\n printer MIB.') prtMIBGroups = MibIdentifier((1, 3, 6, 1, 2, 1, 43, 2, 2)) prtGeneralGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 43, 2, 2, 1)).setObjects(*(("Printer-MIB", "prtGeneralConfigChanges"), ("Printer-MIB", "prtGeneralCurrentLocalization"), ("Printer-MIB", "prtGeneralReset"), ("Printer-MIB", "prtCoverDescription"), ("Printer-MIB", "prtCoverStatus"), ("Printer-MIB", "prtLocalizationLanguage"), ("Printer-MIB", "prtLocalizationCountry"), ("Printer-MIB", "prtLocalizationCharacterSet"), ("Printer-MIB", "prtStorageRefIndex"), ("Printer-MIB", "prtDeviceRefIndex"), ("Printer-MIB", "prtGeneralPrinterName"), ("Printer-MIB", "prtGeneralSerialNumber"),)) if mibBuilder.loadTexts: prtGeneralGroup.setDescription('The general printer group.') prtResponsiblePartyGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 43, 2, 2, 2)).setObjects(*(("Printer-MIB", "prtGeneralCurrentOperator"), ("Printer-MIB", "prtGeneralServicePerson"),)) if mibBuilder.loadTexts: prtResponsiblePartyGroup.setDescription('The responsible party group contains contact\n information for humans responsible for the printer.') prtInputGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 43, 2, 2, 3)).setObjects(*(("Printer-MIB", "prtInputDefaultIndex"), ("Printer-MIB", "prtInputType"), ("Printer-MIB", "prtInputDimUnit"), ("Printer-MIB", "prtInputMediaDimFeedDirDeclared"), ("Printer-MIB", "prtInputMediaDimXFeedDirDeclared"), ("Printer-MIB", "prtInputMediaDimFeedDirChosen"), ("Printer-MIB", "prtInputMediaDimXFeedDirChosen"), ("Printer-MIB", "prtInputCapacityUnit"), ("Printer-MIB", "prtInputMaxCapacity"), ("Printer-MIB", "prtInputCurrentLevel"), ("Printer-MIB", "prtInputStatus"), ("Printer-MIB", "prtInputMediaName"),)) if mibBuilder.loadTexts: prtInputGroup.setDescription('The input group.') prtExtendedInputGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 43, 2, 2, 4)).setObjects(*(("Printer-MIB", "prtInputName"), ("Printer-MIB", "prtInputVendorName"), ("Printer-MIB", "prtInputModel"), ("Printer-MIB", "prtInputVersion"), ("Printer-MIB", "prtInputSerialNumber"), ("Printer-MIB", "prtInputDescription"), ("Printer-MIB", "prtInputSecurity"),)) if mibBuilder.loadTexts: prtExtendedInputGroup.setDescription('The extended input group.') prtInputMediaGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 43, 2, 2, 5)).setObjects(*(("Printer-MIB", "prtInputMediaWeight"), ("Printer-MIB", "prtInputMediaType"), ("Printer-MIB", "prtInputMediaColor"), ("Printer-MIB", "prtInputMediaFormParts"),)) if mibBuilder.loadTexts: prtInputMediaGroup.setDescription('The input media group.') prtOutputGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 43, 2, 2, 6)).setObjects(*(("Printer-MIB", "prtOutputDefaultIndex"), ("Printer-MIB", "prtOutputType"), ("Printer-MIB", "prtOutputCapacityUnit"), ("Printer-MIB", "prtOutputMaxCapacity"), ("Printer-MIB", "prtOutputRemainingCapacity"), ("Printer-MIB", "prtOutputStatus"),)) if mibBuilder.loadTexts: prtOutputGroup.setDescription('The output group.') prtExtendedOutputGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 43, 2, 2, 7)).setObjects(*(("Printer-MIB", "prtOutputName"), ("Printer-MIB", "prtOutputVendorName"), ("Printer-MIB", "prtOutputModel"), ("Printer-MIB", "prtOutputVersion"), ("Printer-MIB", "prtOutputSerialNumber"), ("Printer-MIB", "prtOutputDescription"), ("Printer-MIB", "prtOutputSecurity"),)) if mibBuilder.loadTexts: prtExtendedOutputGroup.setDescription('The extended output group.') prtOutputDimensionsGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 43, 2, 2, 8)).setObjects(*(("Printer-MIB", "prtOutputDimUnit"), ("Printer-MIB", "prtOutputMaxDimFeedDir"), ("Printer-MIB", "prtOutputMaxDimXFeedDir"), ("Printer-MIB", "prtOutputMinDimFeedDir"), ("Printer-MIB", "prtOutputMinDimXFeedDir"),)) if mibBuilder.loadTexts: prtOutputDimensionsGroup.setDescription('The output dimensions group') prtOutputFeaturesGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 43, 2, 2, 9)).setObjects(*(("Printer-MIB", "prtOutputStackingOrder"), ("Printer-MIB", "prtOutputPageDeliveryOrientation"), ("Printer-MIB", "prtOutputBursting"), ("Printer-MIB", "prtOutputDecollating"), ("Printer-MIB", "prtOutputPageCollated"), ("Printer-MIB", "prtOutputOffsetStacking"),)) if mibBuilder.loadTexts: prtOutputFeaturesGroup.setDescription('The output features group.') prtMarkerGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 43, 2, 2, 10)).setObjects(*(("Printer-MIB", "prtMarkerDefaultIndex"), ("Printer-MIB", "prtMarkerMarkTech"), ("Printer-MIB", "prtMarkerCounterUnit"), ("Printer-MIB", "prtMarkerLifeCount"), ("Printer-MIB", "prtMarkerPowerOnCount"), ("Printer-MIB", "prtMarkerProcessColorants"), ("Printer-MIB", "prtMarkerSpotColorants"), ("Printer-MIB", "prtMarkerAddressabilityUnit"), ("Printer-MIB", "prtMarkerAddressabilityFeedDir"), ("Printer-MIB", "prtMarkerAddressabilityXFeedDir"), ("Printer-MIB", "prtMarkerNorthMargin"), ("Printer-MIB", "prtMarkerSouthMargin"), ("Printer-MIB", "prtMarkerWestMargin"), ("Printer-MIB", "prtMarkerEastMargin"), ("Printer-MIB", "prtMarkerStatus"),)) if mibBuilder.loadTexts: prtMarkerGroup.setDescription('The marker group.') prtMarkerSuppliesGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 43, 2, 2, 11)).setObjects(*(("Printer-MIB", "prtMarkerSuppliesMarkerIndex"), ("Printer-MIB", "prtMarkerSuppliesColorantIndex"), ("Printer-MIB", "prtMarkerSuppliesClass"), ("Printer-MIB", "prtMarkerSuppliesType"), ("Printer-MIB", "prtMarkerSuppliesDescription"), ("Printer-MIB", "prtMarkerSuppliesSupplyUnit"), ("Printer-MIB", "prtMarkerSuppliesMaxCapacity"), ("Printer-MIB", "prtMarkerSuppliesLevel"),)) if mibBuilder.loadTexts: prtMarkerSuppliesGroup.setDescription('The marker supplies group.') prtMarkerColorantGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 43, 2, 2, 12)).setObjects(*(("Printer-MIB", "prtMarkerColorantMarkerIndex"), ("Printer-MIB", "prtMarkerColorantRole"), ("Printer-MIB", "prtMarkerColorantValue"), ("Printer-MIB", "prtMarkerColorantTonality"),)) if mibBuilder.loadTexts: prtMarkerColorantGroup.setDescription('The marker colorant group.') prtMediaPathGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 43, 2, 2, 13)).setObjects(*(("Printer-MIB", "prtMediaPathDefaultIndex"), ("Printer-MIB", "prtMediaPathMaxSpeedPrintUnit"), ("Printer-MIB", "prtMediaPathMediaSizeUnit"), ("Printer-MIB", "prtMediaPathMaxSpeed"), ("Printer-MIB", "prtMediaPathMaxMediaFeedDir"), ("Printer-MIB", "prtMediaPathMaxMediaXFeedDir"), ("Printer-MIB", "prtMediaPathMinMediaFeedDir"), ("Printer-MIB", "prtMediaPathMinMediaXFeedDir"), ("Printer-MIB", "prtMediaPathType"), ("Printer-MIB", "prtMediaPathDescription"), ("Printer-MIB", "prtMediaPathStatus"),)) if mibBuilder.loadTexts: prtMediaPathGroup.setDescription('The media path group.') prtChannelGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 43, 2, 2, 14)).setObjects(*(("Printer-MIB", "prtChannelType"), ("Printer-MIB", "prtChannelProtocolVersion"), ("Printer-MIB", "prtChannelCurrentJobCntlLangIndex"), ("Printer-MIB", "prtChannelDefaultPageDescLangIndex"), ("Printer-MIB", "prtChannelState"), ("Printer-MIB", "prtChannelIfIndex"), ("Printer-MIB", "prtChannelStatus"), ("Printer-MIB", "prtChannelInformation"),)) if mibBuilder.loadTexts: prtChannelGroup.setDescription('The channel group.') prtInterpreterGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 43, 2, 2, 15)).setObjects(*(("Printer-MIB", "prtInterpreterLangFamily"), ("Printer-MIB", "prtInterpreterLangLevel"), ("Printer-MIB", "prtInterpreterLangVersion"), ("Printer-MIB", "prtInterpreterDescription"), ("Printer-MIB", "prtInterpreterVersion"), ("Printer-MIB", "prtInterpreterDefaultOrientation"), ("Printer-MIB", "prtInterpreterFeedAddressability"), ("Printer-MIB", "prtInterpreterXFeedAddressability"), ("Printer-MIB", "prtInterpreterDefaultCharSetIn"), ("Printer-MIB", "prtInterpreterDefaultCharSetOut"), ("Printer-MIB", "prtInterpreterTwoWay"),)) if mibBuilder.loadTexts: prtInterpreterGroup.setDescription('The interpreter group.') prtConsoleGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 43, 2, 2, 16)).setObjects(*(("Printer-MIB", "prtConsoleLocalization"), ("Printer-MIB", "prtConsoleNumberOfDisplayLines"), ("Printer-MIB", "prtConsoleNumberOfDisplayChars"), ("Printer-MIB", "prtConsoleDisable"), ("Printer-MIB", "prtConsoleDisplayBufferText"), ("Printer-MIB", "prtConsoleOnTime"), ("Printer-MIB", "prtConsoleOffTime"), ("Printer-MIB", "prtConsoleColor"), ("Printer-MIB", "prtConsoleDescription"),)) if mibBuilder.loadTexts: prtConsoleGroup.setDescription('The console group.') prtAlertTableGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 43, 2, 2, 17)).setObjects(*(("Printer-MIB", "prtAlertIndex"), ("Printer-MIB", "prtAlertCriticalEvents"), ("Printer-MIB", "prtAlertAllEvents"), ("Printer-MIB", "prtAlertSeverityLevel"), ("Printer-MIB", "prtAlertTrainingLevel"), ("Printer-MIB", "prtAlertGroup"), ("Printer-MIB", "prtAlertGroupIndex"), ("Printer-MIB", "prtAlertLocation"), ("Printer-MIB", "prtAlertCode"), ("Printer-MIB", "prtAlertDescription"), ("Printer-MIB", "prtAlertTime"),)) if mibBuilder.loadTexts: prtAlertTableGroup.setDescription('The alert table group.') prtAuxiliarySheetGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 43, 2, 2, 19)).setObjects(*(("Printer-MIB", "prtAuxiliarySheetStartupPage"), ("Printer-MIB", "prtAuxiliarySheetBannerPage"),)) if mibBuilder.loadTexts: prtAuxiliarySheetGroup.setDescription('The auxiliary sheet group.') prtInputSwitchingGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 43, 2, 2, 20)).setObjects(*(("Printer-MIB", "prtInputMediaLoadTimeout"), ("Printer-MIB", "prtInputNextIndex"),)) if mibBuilder.loadTexts: prtInputSwitchingGroup.setDescription('The input switching group.') mibBuilder.exportSymbols("Printer-MIB", prtInputStatus=prtInputStatus, prtChannelState=prtChannelState, prtGeneralPrinterName=prtGeneralPrinterName, prtMIBCompliance=prtMIBCompliance, prtMarkerEntry=prtMarkerEntry, prtInputEntry=prtInputEntry, prtGeneralServicePerson=prtGeneralServicePerson, prtConsoleNumberOfDisplayChars=prtConsoleNumberOfDisplayChars, prtConsoleDescription=prtConsoleDescription, prtInputGroup=prtInputGroup, prtConsoleDisplayBufferText=prtConsoleDisplayBufferText, printerV2AlertPrefix=printerV2AlertPrefix, prtCoverIndex=prtCoverIndex, prtDeviceRefEntry=prtDeviceRefEntry, prtAuxiliarySheetStartupPage=prtAuxiliarySheetStartupPage, prtMarkerAddressabilityFeedDir=prtMarkerAddressabilityFeedDir, prtStorageRefIndex=prtStorageRefIndex, prtOutputBursting=prtOutputBursting, prtMediaPath=prtMediaPath, prtOutputOffsetStacking=prtOutputOffsetStacking, prtInterpreterTwoWay=prtInterpreterTwoWay, prtAlertCode=prtAlertCode, prtGeneralEntry=prtGeneralEntry, prtInputMediaDimXFeedDirChosen=prtInputMediaDimXFeedDirChosen, prtMediaPathMinMediaFeedDir=prtMediaPathMinMediaFeedDir, prtInputNextIndex=prtInputNextIndex, PrtInterpreterLangFamilyTC=PrtInterpreterLangFamilyTC, PrtPrintOrientationTC=PrtPrintOrientationTC, PrtCoverStatusTC=PrtCoverStatusTC, prtGeneralReset=prtGeneralReset, prtMediaPathGroup=prtMediaPathGroup, prtAlertDescription=prtAlertDescription, prtChannel=prtChannel, prtInputMediaDimFeedDirDeclared=prtInputMediaDimFeedDirDeclared, prtOutputRemainingCapacity=prtOutputRemainingCapacity, prtInterpreterDefaultOrientation=prtInterpreterDefaultOrientation, prtMarkerDefaultIndex=prtMarkerDefaultIndex, prtInterpreterTable=prtInterpreterTable, prtOutputCapacityUnit=prtOutputCapacityUnit, prtConsoleOnTime=prtConsoleOnTime, prtCoverTable=prtCoverTable, prtInterpreterLangLevel=prtInterpreterLangLevel, prtInterpreterGroup=prtInterpreterGroup, prtMIBConformance=prtMIBConformance, prtOutputVendorName=prtOutputVendorName, prtInputSecurity=prtInputSecurity, prtConsoleColor=prtConsoleColor, prtGeneralGroup=prtGeneralGroup, prtInputMediaName=prtInputMediaName, PrtMarkerColorantRoleTC=PrtMarkerColorantRoleTC, PrtOutputPageDeliveryOrientationTC=PrtOutputPageDeliveryOrientationTC, prtMarkerColorantIndex=prtMarkerColorantIndex, prtLocalizationIndex=prtLocalizationIndex, prtMarkerSuppliesLevel=prtMarkerSuppliesLevel, prtMediaPathType=prtMediaPathType, prtResponsiblePartyGroup=prtResponsiblePartyGroup, prtInputMediaType=prtInputMediaType, prtMarkerColorantValue=prtMarkerColorantValue, prtAuxiliarySheetGroup=prtAuxiliarySheetGroup, PrtGeneralResetTC=PrtGeneralResetTC, prtGeneralSerialNumber=prtGeneralSerialNumber, prtMarkerSuppliesClass=prtMarkerSuppliesClass, PrtMarkerSuppliesClassTC=PrtMarkerSuppliesClassTC, prtMarkerSupplies=prtMarkerSupplies, prtAlertGroupIndex=prtAlertGroupIndex, CodedCharSet=CodedCharSet, prtMarkerLifeCount=prtMarkerLifeCount, prtInputMediaWeight=prtInputMediaWeight, prtMarkerMarkTech=prtMarkerMarkTech, prtLocalizationEntry=prtLocalizationEntry, prtAlertIndex=prtAlertIndex, prtMarkerSouthMargin=prtMarkerSouthMargin, prtMarkerIndex=prtMarkerIndex, prtInputMediaGroup=prtInputMediaGroup, prtAlertCriticalEvents=prtAlertCriticalEvents, prtInputCapacityUnit=prtInputCapacityUnit, prtChannelEntry=prtChannelEntry, prtMediaPathDefaultIndex=prtMediaPathDefaultIndex, prtMarkerGroup=prtMarkerGroup, prtAlertSeverityLevel=prtAlertSeverityLevel, prtChannelTable=prtChannelTable, prtAlertTableGroup=prtAlertTableGroup, prtGeneral=prtGeneral, prtMediaPathDescription=prtMediaPathDescription, prtGeneralCurrentLocalization=prtGeneralCurrentLocalization, prtMarkerWestMargin=prtMarkerWestMargin, prtMediaPathMaxSpeedPrintUnit=prtMediaPathMaxSpeedPrintUnit, PrtChannelTypeTC=PrtChannelTypeTC, prtInputSerialNumber=prtInputSerialNumber, prtInputName=prtInputName, prtCover=prtCover, prtMarkerSpotColorants=prtMarkerSpotColorants, prtMarkerColorantRole=prtMarkerColorantRole, prtMarkerEastMargin=prtMarkerEastMargin, prtInputMediaDimXFeedDirDeclared=prtInputMediaDimXFeedDirDeclared, prtMediaPathEntry=prtMediaPathEntry, prtOutputTable=prtOutputTable, prtInterpreterFeedAddressability=prtInterpreterFeedAddressability, prtConsoleDisplayBufferEntry=prtConsoleDisplayBufferEntry, prtMediaPathMaxMediaFeedDir=prtMediaPathMaxMediaFeedDir, prtMarkerColorantGroup=prtMarkerColorantGroup, prtAlert=prtAlert, prtConsoleLightTable=prtConsoleLightTable, prtOutputVersion=prtOutputVersion, prtInterpreterDefaultCharSetIn=prtInterpreterDefaultCharSetIn, prtInputMediaColor=prtInputMediaColor, prtMarkerSuppliesColorantIndex=prtMarkerSuppliesColorantIndex, PrtInputTypeTC=PrtInputTypeTC, prtGeneralConfigChanges=prtGeneralConfigChanges, prtStorageRefEntry=prtStorageRefEntry, prtInputVendorName=prtInputVendorName, PrtAlertSeverityLevelTC=PrtAlertSeverityLevelTC, prtLocalization=prtLocalization, prtMarkerSuppliesMaxCapacity=prtMarkerSuppliesMaxCapacity, prtChannelType=prtChannelType, prtInputCurrentLevel=prtInputCurrentLevel, PrtMarkerSuppliesTypeTC=PrtMarkerSuppliesTypeTC, prtMarkerSuppliesSupplyUnit=prtMarkerSuppliesSupplyUnit, printerV2Alert=printerV2Alert, prtLocalizationLanguage=prtLocalizationLanguage, prtInterpreterDefaultCharSetOut=prtInterpreterDefaultCharSetOut, prtCoverEntry=prtCoverEntry, prtMarkerSuppliesIndex=prtMarkerSuppliesIndex, prtCoverStatus=prtCoverStatus, prtAlertAllEvents=prtAlertAllEvents, prtOutputMaxCapacity=prtOutputMaxCapacity, prtOutputPageDeliveryOrientation=prtOutputPageDeliveryOrientation, PrtAlertCodeTC=PrtAlertCodeTC, prtInputMaxCapacity=prtInputMaxCapacity, PrtSubUnitStatusTC=PrtSubUnitStatusTC, prtMediaPathTable=prtMediaPathTable, prtOutputGroup=prtOutputGroup, prtMarkerPowerOnCount=prtMarkerPowerOnCount, prtMarkerNorthMargin=prtMarkerNorthMargin, PrtMediaPathMaxSpeedPrintUnitTC=PrtMediaPathMaxSpeedPrintUnitTC, prtInputDimUnit=prtInputDimUnit, prtInputModel=prtInputModel, prtOutputModel=prtOutputModel, prtGeneralTable=prtGeneralTable, PrtOutputStackingOrderTC=PrtOutputStackingOrderTC, prtAlertTable=prtAlertTable, prtConsoleGroup=prtConsoleGroup, prtOutputMinDimFeedDir=prtOutputMinDimFeedDir, prtOutputDimensionsGroup=prtOutputDimensionsGroup, prtLocalizationCountry=prtLocalizationCountry, prtDeviceRefTable=prtDeviceRefTable, prtAlertEntry=prtAlertEntry, prtConsoleDisplayBufferTable=prtConsoleDisplayBufferTable, prtOutputMaxDimFeedDir=prtOutputMaxDimFeedDir, prtMarkerSuppliesTable=prtMarkerSuppliesTable, PrtOutputTypeTC=PrtOutputTypeTC, prtOutputName=prtOutputName, prtChannelProtocolVersion=prtChannelProtocolVersion, prtInterpreterLangFamily=prtInterpreterLangFamily, prtInputMediaFormParts=prtInputMediaFormParts, prtInputTable=prtInputTable, prtMarkerSuppliesDescription=prtMarkerSuppliesDescription, prtOutputType=prtOutputType, prtInputIndex=prtInputIndex, printerV1Alert=printerV1Alert, prtChannelGroup=prtChannelGroup, prtMarker=prtMarker, prtMarkerSuppliesEntry=prtMarkerSuppliesEntry, prtMediaPathMinMediaXFeedDir=prtMediaPathMinMediaXFeedDir, prtMediaPathStatus=prtMediaPathStatus, prtMarkerColorantEntry=prtMarkerColorantEntry, prtOutputEntry=prtOutputEntry, prtLocalizationTable=prtLocalizationTable, prtMarkerSuppliesType=prtMarkerSuppliesType, prtConsoleDisplayBuffer=prtConsoleDisplayBuffer, prtMarkerColorantMarkerIndex=prtMarkerColorantMarkerIndex, PrtMediaPathTypeTC=PrtMediaPathTypeTC, prtExtendedInputGroup=prtExtendedInputGroup, PrtMarkerMarkTechTC=PrtMarkerMarkTechTC, prtOutputStatus=prtOutputStatus, prtMarkerColorantTonality=prtMarkerColorantTonality, prtInterpreterIndex=prtInterpreterIndex, prtOutputSerialNumber=prtOutputSerialNumber, prtMarkerStatus=prtMarkerStatus, PYSNMP_MODULE_ID=printmib, prtOutputDimUnit=prtOutputDimUnit, prtMediaPathIndex=prtMediaPathIndex, prtMarkerSuppliesGroup=prtMarkerSuppliesGroup, prtOutputDefaultIndex=prtOutputDefaultIndex, prtOutputStackingOrder=prtOutputStackingOrder, prtInterpreterEntry=prtInterpreterEntry, prtConsoleDisable=prtConsoleDisable, PrtChannelStateTC=PrtChannelStateTC, PrtAlertGroupTC=PrtAlertGroupTC, prtInputDescription=prtInputDescription, prtInputSwitchingGroup=prtInputSwitchingGroup, prtAlertLocation=prtAlertLocation, prtInterpreterXFeedAddressability=prtInterpreterXFeedAddressability, prtChannelStatus=prtChannelStatus, prtChannelInformation=prtChannelInformation, prtExtendedOutputGroup=prtExtendedOutputGroup, prtConsoleLightIndex=prtConsoleLightIndex, prtInputMediaDimFeedDirChosen=prtInputMediaDimFeedDirChosen, prtMarkerTable=prtMarkerTable, prtOutputDescription=prtOutputDescription, PrtAlertTrainingLevelTC=PrtAlertTrainingLevelTC, prtInputType=prtInputType, prtChannelDefaultPageDescLangIndex=prtChannelDefaultPageDescLangIndex, PrtMarkerCounterUnitTC=PrtMarkerCounterUnitTC, prtInputMediaLoadTimeout=prtInputMediaLoadTimeout, PrtCapacityUnitTC=PrtCapacityUnitTC, prtDeviceRefIndex=prtDeviceRefIndex, prtMarkerProcessColorants=prtMarkerProcessColorants, prtChannelCurrentJobCntlLangIndex=prtChannelCurrentJobCntlLangIndex, prtConsoleLightEntry=prtConsoleLightEntry, prtInputDefaultIndex=prtInputDefaultIndex, prtOutputFeaturesGroup=prtOutputFeaturesGroup, PrtConsoleColorTC=PrtConsoleColorTC, prtAlertTrainingLevel=prtAlertTrainingLevel, prtConsoleOffTime=prtConsoleOffTime, prtCoverDescription=prtCoverDescription, prtStorageRefSeqNumber=prtStorageRefSeqNumber, prtOutput=prtOutput, prtMarkerColorant=prtMarkerColorant, prtAlertGroup=prtAlertGroup, prtOutputPageCollated=prtOutputPageCollated, prtOutputDecollating=prtOutputDecollating, prtOutputMaxDimXFeedDir=prtOutputMaxDimXFeedDir, prtInterpreterDescription=prtInterpreterDescription, prtAlertTime=prtAlertTime, prtOutputIndex=prtOutputIndex, prtMarkerColorantTable=prtMarkerColorantTable, prtOutputMinDimXFeedDir=prtOutputMinDimXFeedDir, prtInterpreter=prtInterpreter, prtInterpreterLangVersion=prtInterpreterLangVersion, prtConsoleNumberOfDisplayLines=prtConsoleNumberOfDisplayLines, PrtMediaUnitTC=PrtMediaUnitTC, printmib=printmib, prtInput=prtInput, prtMarkerAddressabilityXFeedDir=prtMarkerAddressabilityXFeedDir, prtMediaPathMaxMediaXFeedDir=prtMediaPathMaxMediaXFeedDir, prtChannelIndex=prtChannelIndex, prtChannelIfIndex=prtChannelIfIndex, prtGeneralCurrentOperator=prtGeneralCurrentOperator, prtLocalizationCharacterSet=prtLocalizationCharacterSet, prtConsoleLocalization=prtConsoleLocalization, prtMIBGroups=prtMIBGroups, prtMarkerAddressabilityUnit=prtMarkerAddressabilityUnit, PresentOnOff=PresentOnOff, prtConsoleLights=prtConsoleLights, prtAuxiliarySheetBannerPage=prtAuxiliarySheetBannerPage, PrtInterpreterTwoWayTC=PrtInterpreterTwoWayTC, prtStorageRefTable=prtStorageRefTable, PrtMarkerSuppliesSupplyUnitTC=PrtMarkerSuppliesSupplyUnitTC, prtOutputSecurity=prtOutputSecurity, prtMediaPathMediaSizeUnit=prtMediaPathMediaSizeUnit, prtMarkerSuppliesMarkerIndex=prtMarkerSuppliesMarkerIndex, prtDeviceRefSeqNumber=prtDeviceRefSeqNumber, prtConsoleDisplayBufferIndex=prtConsoleDisplayBufferIndex) mibBuilder.exportSymbols("Printer-MIB", prtMediaPathMaxSpeed=prtMediaPathMaxSpeed, prtInputVersion=prtInputVersion, prtInterpreterVersion=prtInterpreterVersion, prtMarkerCounterUnit=prtMarkerCounterUnit)
234.001742
10,859
0.735603
16,281
134,317
6.068423
0.107303
0.006073
0.006953
0.009231
0.425455
0.383532
0.336883
0.317783
0.281711
0.261103
0
0.04525
0.155952
134,317
573
10,860
234.410122
0.826233
0.002219
0
0.022346
0
0.240223
0.528274
0.046683
0
0
0.00006
0
0
1
0
false
0.001862
0.013035
0
0.173184
0.189944
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
3388d44d8af3d576a8808c5daeaa2f3d405dd800
183
py
Python
builder/Builder Pattern/BeforeBuilder3/__main__.py
Tomvictor/python-design-patterns
6b99607d721bbe03d26a0a451a10e88cd1c1d112
[ "MIT" ]
null
null
null
builder/Builder Pattern/BeforeBuilder3/__main__.py
Tomvictor/python-design-patterns
6b99607d721bbe03d26a0a451a10e88cd1c1d112
[ "MIT" ]
null
null
null
builder/Builder Pattern/BeforeBuilder3/__main__.py
Tomvictor/python-design-patterns
6b99607d721bbe03d26a0a451a10e88cd1c1d112
[ "MIT" ]
null
null
null
from computer import Computer from mycomputer import MyComputer builder = MyComputer() builder.build_computer() computer = builder.get_computer() computer.display()
14.076923
34
0.743169
19
183
7.052632
0.421053
0.253731
0
0
0
0
0
0
0
0
0
0
0.185792
183
12
35
15.25
0.899329
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
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
1
0
0
0
0
3
338d83b7371c778eb8246ad2bf2e81f4adcd89e3
540
py
Python
components/samples/policy_sample_hello_world.py
microsoft/Guardinel
bc49c4fe051c3e533064c7043e1cee39cfb25d3a
[ "MIT" ]
2
2022-01-26T07:34:44.000Z
2022-03-29T19:51:45.000Z
components/samples/policy_sample_hello_world.py
microsoft/Guardinel
bc49c4fe051c3e533064c7043e1cee39cfb25d3a
[ "MIT" ]
null
null
null
components/samples/policy_sample_hello_world.py
microsoft/Guardinel
bc49c4fe051c3e533064c7043e1cee39cfb25d3a
[ "MIT" ]
null
null
null
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from core.interfaces.task import Task from core.utils.constants import Constants class HelloWorldPolicy(Task): def execute(self, input_entity): if input_entity.project == 'TestProject': return self.result(Constants.FAIL, message="Can't execute the policy on TestProject") return self.result(Constants.SUCCESS) def overrides(self): return ['approval_override'] def name(self): return 'hello_world_policy'
25.714286
97
0.709259
65
540
5.815385
0.630769
0.042328
0.111111
0.142857
0.190476
0
0
0
0
0
0
0
0.201852
540
20
98
27
0.87703
0.125926
0
0
0
0
0.181237
0
0
0
0
0
0
1
0.272727
false
0
0.181818
0.181818
0.909091
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
33917df8bb8c466c8ba78fdbfec2000af41b6daa
295
py
Python
output/models/ms_data/particles/particles_r020_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
1
2021-08-14T17:59:21.000Z
2021-08-14T17:59:21.000Z
output/models/ms_data/particles/particles_r020_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
4
2020-02-12T21:30:44.000Z
2020-04-15T20:06:46.000Z
output/models/ms_data/particles/particles_r020_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
null
null
null
from output.models.ms_data.particles.particles_r020_xsd.particles_r020 import ( B, R, Doc, ) from output.models.ms_data.particles.particles_r020_xsd.particles_r020_imp import ( ImpElem1, ImpElem2, ) __all__ = [ "B", "R", "Doc", "ImpElem1", "ImpElem2", ]
16.388889
83
0.654237
36
295
5
0.444444
0.288889
0.177778
0.2
0.666667
0.666667
0.666667
0.666667
0.666667
0.666667
0
0.069565
0.220339
295
17
84
17.352941
0.713043
0
0
0
0
0
0.071186
0
0
0
0
0
0
1
0
false
0
0.125
0
0.125
0
0
0
0
null
1
0
1
0
0
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
3
33956487d1a7473e4e9523d340a69d50a0cca0c9
5,303
py
Python
replace_text_with_number.py
nacbotics5/web-scraping-with-python
5c5d89d58173ee2e6491283d7d5ba0a413d6961c
[ "BSD-3-Clause" ]
3
2019-07-03T13:10:21.000Z
2020-01-09T10:34:12.000Z
replace_text_with_number.py
nacbotics5/web-scraping-with-python
5c5d89d58173ee2e6491283d7d5ba0a413d6961c
[ "BSD-3-Clause" ]
null
null
null
replace_text_with_number.py
nacbotics5/web-scraping-with-python
5c5d89d58173ee2e6491283d7d5ba0a413d6961c
[ "BSD-3-Clause" ]
1
2021-11-08T18:53:12.000Z
2021-11-08T18:53:12.000Z
#-*-coding:utf8;-*- import re from random import choice class sub(object): """ a simple text to number evaluating class """ def text_to_number(self,text): '''convert a number written as text to its real number equivalence''' text = text.lower() text = re.sub(r"ten", "10", text) text = re.sub(r"eleven", "11", text) text = re.sub(r"twelve", "12", text) text = re.sub(r"thirteen", "13", text) text = re.sub(r"fourteen", "14", text) text = re.sub(r"fifteen", "15", text) text = re.sub(r"sixteen", "16", text) text = re.sub(r"seventeen", "17", text) text = re.sub(r"eighteen", "18", text) text = re.sub(r"nineteen", "19", text) text = re.sub(r"twenty one", "21", text) text = re.sub(r"twenty two", "22", text) text = re.sub(r"twenty three", "23", text) text = re.sub(r"twenty four", "24", text) text = re.sub(r"twenty five", "25", text) text = re.sub(r"twenty six", "26", text) text = re.sub(r"twenty seven", "27", text) text = re.sub(r"twenty eight", "28", text) text = re.sub(r"twenty nine", "29", text) text = re.sub(r"twenty", "20", text) text = re.sub(r"thirty one", "31", text) text = re.sub(r"thirty two", "32", text) text = re.sub(r"thirty three", "33", text) text = re.sub(r"thirty four", "34", text) text = re.sub(r"thirty five", "35", text) text = re.sub(r"thirty six", "36", text) text = re.sub(r"thirty seven", "37", text) text = re.sub(r"thirty eight", "38", text) text = re.sub(r"thirty nine", "39", text) text = re.sub(r"thirty", "30", text) text = re.sub(r"forty one", "41", text) text = re.sub(r"forty two", "42", text) text = re.sub(r"forty three", "43", text) text = re.sub(r"forty four", "44", text) text = re.sub(r"forty five", "45", text) text = re.sub(r"forty six", "46", text) text = re.sub(r"forty seven", "47", text) text = re.sub(r"forty eight", "48", text) text = re.sub(r"forty nine", "49", text) text = re.sub(r"forty", "40", text) text = re.sub(r"fifty one", "51", text) text = re.sub(r"fifty two", "52", text) text = re.sub(r"fifty three", "53", text) text = re.sub(r"fifty four", "54", text) text = re.sub(r"fifty five", "55", text) text = re.sub(r"fifty six", "56", text) text = re.sub(r"fifty seven", "57", text) text = re.sub(r"fifty eight", "58", text) text = re.sub(r"fifty nine", "59", text) text = re.sub(r"fifty", "50", text) text = re.sub(r"sixty one", "61", text) text = re.sub(r"sixty two", "62", text) text = re.sub(r"sixty three", "63", text) text = re.sub(r"sixty four", "64", text) text = re.sub(r"sixty five", "65", text) text = re.sub(r"sixty six", "66", text) text = re.sub(r"sixty seven", "67", text) text = re.sub(r"sixty eight", "68", text) text = re.sub(r"sixty nine", "69", text) text = re.sub(r"sixty", "60", text) text = re.sub(r"seventy one", "71", text) text = re.sub(r"seventy two", "72", text) text = re.sub(r"seventy three", "73", text) text = re.sub(r"seventy four", "74", text) text = re.sub(r"seventy five", "75", text) text = re.sub(r"seventy six", "76", text) text = re.sub(r"seventy seven", "77", text) text = re.sub(r"seventy eight", "78", text) text = re.sub(r"seventy nine", "79", text) text = re.sub(r"seventy", "70", text) text = re.sub(r"eighty one", "81", text) text = re.sub(r"eighty two", "82", text) text = re.sub(r"eighty three", "83", text) text = re.sub(r"eighty four", "84", text) text = re.sub(r"eighty five", "85", text) text = re.sub(r"eighty six", "86", text) text = re.sub(r"eighty seven", "87", text) text = re.sub(r"eighty eight", "88", text) text = re.sub(r"eighty nine", "89", text) text = re.sub(r"eighty", "80", text) text = re.sub(r"ninety one", "91", text) text = re.sub(r"ninety two", "92", text) text = re.sub(r"ninety three", "93", text) text = re.sub(r"ninety four", "94", text) text = re.sub(r"ninety five", "95", text) text = re.sub(r"ninety six", "96", text) text = re.sub(r"ninety seven", "97", text) text = re.sub(r"ninety eight", "98", text) text = re.sub(r"ninety nine", "99", text) text = re.sub(r"ninety", "90", text) text = re.sub(r"one", "01", text) text = re.sub(r"two", "02", text) text = re.sub(r"three", "03", text) text = re.sub(r"four", "04", text) text = re.sub(r"five", "05", text) text = re.sub(r"six", "06", text) text = re.sub(r"seven", "07", text) text = re.sub(r"eight", "08", text) text = re.sub(r"nine", "09", text) text = re.sub(r"hundred", "00", text) text = re.sub(r"thousand", "000", text) text = re.sub(r"million", "000000", text) text = re.sub(r"billion", "000000000", text) return text
44.191667
77
0.51518
833
5,303
3.277311
0.193277
0.301832
0.33956
0.377289
0.691575
0.578755
0
0
0
0
0
0.057723
0.284556
5,303
119
78
44.563025
0.661834
0.023383
0
0
0
0
0.22715
0
0
0
0
0
0
1
0.009174
false
0
0.018349
0
0.045872
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
33a86174001ff2478e49f557e437ae892e69708a
674
py
Python
vyper/interfaces/ERC20.py
Solexplorer/vyper
135edd6a91d47c72de105066d6e6c1bdfe9ea66e
[ "MIT" ]
1
2021-04-23T21:48:20.000Z
2021-04-23T21:48:20.000Z
vyper/interfaces/ERC20.py
Solexplorer/vyper
135edd6a91d47c72de105066d6e6c1bdfe9ea66e
[ "MIT" ]
null
null
null
vyper/interfaces/ERC20.py
Solexplorer/vyper
135edd6a91d47c72de105066d6e6c1bdfe9ea66e
[ "MIT" ]
1
2020-01-27T05:21:39.000Z
2020-01-27T05:21:39.000Z
interface_code = """ # Events Transfer: event({_from: indexed(address), _to: indexed(address), _value: uint256}) Approval: event({_owner: indexed(address), _spender: indexed(address), _value: uint256}) # Functions @constant @public def totalSupply() -> uint256: pass @constant @public def balanceOf(_owner: address) -> uint256: pass @constant @public def allowance(_owner: address, _spender: address) -> uint256: pass @public def transfer(_to: address, _value: uint256) -> bool: pass @public def transferFrom(_from: address, _to: address, _value: uint256) -> bool: pass @public def approve(_spender: address, _value: uint256) -> bool: pass """
19.823529
88
0.707715
77
674
5.974026
0.324675
0.117391
0.206522
0.15
0.345652
0.165217
0.165217
0.165217
0
0
0
0.042254
0.15727
674
33
89
20.424242
0.767606
0
0
0.555556
0
0
0.964392
0
0
0
0
0
0
1
0
false
0.222222
0
0
0
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
1
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
3
33acc4d1af1b7c1d0e85a3e15fd3afe129aa64f2
864
py
Python
codev/core/utils.py
baseclue/codev
7965ffc036ea217e05ca1f566e7b1917c0a67887
[ "Apache-2.0" ]
4
2016-03-21T12:20:52.000Z
2017-02-02T09:08:19.000Z
codev/core/utils.py
baseclue/codev
7965ffc036ea217e05ca1f566e7b1917c0a67887
[ "Apache-2.0" ]
null
null
null
codev/core/utils.py
baseclue/codev
7965ffc036ea217e05ca1f566e7b1917c0a67887
[ "Apache-2.0" ]
null
null
null
def parse_options(inp): parsed = inp.split(':', 1) name = parsed[0] options = parsed[1] if len(parsed) == 2 else '' return name, options class Ident(object): def __init__(self, *args): self._ident = args def as_tuple(self): return tuple(filter(None, self._ident)) def as_str_tuple(self): return tuple(map(str, self.as_tuple())) def as_file(self): return '_'.join(self.as_str_tuple()).replace('/', '-') def as_hostname(self): return '-'.join(self.as_str_tuple()).replace('/', '-').replace('_', '-') def __str__(self): return self.as_tuple() class HasIdent(object): def __init__(self, *args, ident=None, **kwargs): self.ident = ident super().__init__(*args, **kwargs) class Status(dict): def __getattr__(self, item): return self[item]
23.351351
80
0.596065
111
864
4.315315
0.333333
0.104384
0.06263
0.070981
0.23382
0.146138
0.146138
0.146138
0
0
0
0.006061
0.236111
864
36
81
24
0.719697
0
0
0
0
0
0.010417
0
0
0
0
0
0
1
0.36
false
0
0
0.24
0.76
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
33e5c4ef0a62c2a0771e4127069e6b6a46219107
58
py
Python
oo/__init__.py
anthonysilvaa/pythonbirds
776ef93ffdb3f3365967e87df6cff54020c1d65c
[ "MIT" ]
null
null
null
oo/__init__.py
anthonysilvaa/pythonbirds
776ef93ffdb3f3365967e87df6cff54020c1d65c
[ "MIT" ]
null
null
null
oo/__init__.py
anthonysilvaa/pythonbirds
776ef93ffdb3f3365967e87df6cff54020c1d65c
[ "MIT" ]
null
null
null
from oo.pessoa import Pessoa p = Pessoa() print(type(p))
11.6
28
0.706897
10
58
4.1
0.7
0
0
0
0
0
0
0
0
0
0
0
0.155172
58
5
29
11.6
0.836735
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0.333333
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
33f4d47972d31539ed3a98ea5f8f901bb19e8986
2,314
py
Python
sympycore/polynomials/tests/test_algebra.py
radovankavicky/pymaclab
21da758f64ed0b62969c9289576f677e977cfd98
[ "Apache-2.0" ]
96
2015-01-25T05:59:56.000Z
2021-12-29T14:05:22.000Z
sympycore/polynomials/tests/test_algebra.py
1zinnur9/pymaclab
21da758f64ed0b62969c9289576f677e977cfd98
[ "Apache-2.0" ]
3
2015-12-17T19:25:46.000Z
2018-06-19T07:05:20.000Z
sympycore/polynomials/tests/test_algebra.py
1zinnur9/pymaclab
21da758f64ed0b62969c9289576f677e977cfd98
[ "Apache-2.0" ]
36
2016-01-31T15:22:01.000Z
2021-03-29T07:03:07.000Z
from sympycore import * P = PolynomialRing def test_default_ring(): r = repr(P.convert(0)) assert r=="PolynomialRing('0')", r assert P.zero==P.convert(0) assert str(0)=='0' assert `P.convert(2)`=="PolynomialRing('2')",repr(P.convert(2)) def test_X(): X = PolynomialRing['x'] C = X.convert assert `X.zero`=="PolynomialRing[('x',), Calculus]('0')",`X.zero` assert `X.one`=="PolynomialRing[('x',), Calculus]('1')", repr(X.one) assert str(X.zero)=='0',`str(X.zero)` assert str(X.one)=='1',`str(X.zero)` assert `C({2:3})`=="PolynomialRing[('x',), Calculus]('3*x**2')", `C({2:3})` assert `C({2:3,4:5})`=="PolynomialRing[('x',), Calculus]('5*x**4 + 3*x**2')",`C({2:3,4:5})` assert `C([(2,3)])`=="PolynomialRing[('x',), Calculus]('3*x**2')" assert `C([(2,3),(4,5)])`=="PolynomialRing[('x',), Calculus]('5*x**4 + 3*x**2')" assert str(C({2:3}))=="3*x**2" assert str(C([(2,3),(4,5)]))=="5*x**4 + 3*x**2" assert `C('x*3*x')`=="PolynomialRing[('x',), Calculus]('3*x**2')",`C('x*3*x')` assert `C('x**4+4*x**4-3*x*x+6*x**2')`=="PolynomialRing[('x',), Calculus]('5*x**4 + 3*x**2')" assert `C([1,2,3])`=="PolynomialRing[('x',), Calculus]('3*x**2 + 2*x + 1')",repr(C([1,2,3])) def test_univariate(): X = PolynomialRing['x'] C = X.convert x = C([0,1]) assert `x`=="PolynomialRing[('x',), Calculus]('x')",`x` assert C([1, 2, 3]) == 3*x**2 + 2*x + 1,`C([1, 2, 3]).pair, (3*x**2 + 2*x + 1).pair` assert C([1, 2, 3]).degree == 2 assert C([1, 2, 3]).ldegree == 0 assert C([0]).degree == 0 assert C([0]).ldegree == 0 assert (x**3 + x) + (3*x + x**4) == x**4 + x**3 + 4*x assert C([1, 2, 3])*2 == C([2, 4, 6]) assert C([1, 2, 3])/2.0 == C([0.5, 1.0, 1.5]) assert C([4,-3,5])(6) == 166 assert C([1,2,3])(C([4,5,6])) == 108*x**4 + 180*x**3 + 231*x**2 + 130*x + 57 assert (x-1)*(x+1) == x**2 - 1 assert (x-1)*(x+1) / (x-1) == (x+1) assert (x**3 + x).diff() == 3*x**2 + 1 assert str(C([3, 0, 1])) == 'x**2 + 3',str(C([3, 0, 1])) assert str(C([0])) == '0' assert str(C([1, 1])) == 'x + 1' assert str((5 + 3*x) / 5) == '3/5*x + 1', repr((5 + 3*x) / 5) assert str(C([4, 11, 6]) / C([6, 12])) == '1/2*x + 2/3' assert str(C([2, 3, 4]) % C([1, 2, 3])) == '1/3*x + 2/3'
39.896552
97
0.474071
447
2,314
2.44519
0.087248
0.040256
0.035682
0.036597
0.433669
0.399817
0.258005
0.232388
0.174748
0.174748
0
0.114423
0.187986
2,314
57
98
40.596491
0.46727
0
0
0.083333
0
0.020833
0.252918
0.105491
0
0
0
0
0.770833
0
null
null
0
0.020833
null
null
0
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
0
0
0
null
0
0
0
1
1
0
0
0
0
0
0
0
0
3
33fd0062b63d3540dad25bfc41a907a035a81d4c
95
py
Python
tests/scripts/python2-test.py
Honzys/clearml-agent
f58071fc74e2df9bdba8ca91569e0bfd70ad4f46
[ "Apache-2.0" ]
112
2019-10-29T10:36:20.000Z
2020-12-19T08:08:27.000Z
tests/scripts/python2-test.py
Honzys/clearml-agent
f58071fc74e2df9bdba8ca91569e0bfd70ad4f46
[ "Apache-2.0" ]
53
2020-12-29T07:52:40.000Z
2022-03-31T10:11:54.000Z
tests/scripts/python2-test.py
Honzys/clearml-agent
f58071fc74e2df9bdba8ca91569e0bfd70ad4f46
[ "Apache-2.0" ]
29
2019-10-29T13:06:29.000Z
2020-12-19T08:09:24.000Z
def main(): assert 1 / 2 == 0 print('success') if __name__ == "__main__": main()
11.875
26
0.526316
12
95
3.5
0.833333
0
0
0
0
0
0
0
0
0
0
0.044776
0.294737
95
7
27
13.571429
0.58209
0
0
0
0
0
0.157895
0
0
0
0
0
0.2
1
0.2
true
0
0
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
1
0
0
0
0
0
0
3
d50148ac813ac58f82fe3db88377732cbe72a00c
137
py
Python
PythonExercicios/02-dados-e-contas/ex006.py
mateusmarinho/python3-cursoemvideo
706d419865532e156fb80b8a873e18cb90d6e0da
[ "MIT" ]
null
null
null
PythonExercicios/02-dados-e-contas/ex006.py
mateusmarinho/python3-cursoemvideo
706d419865532e156fb80b8a873e18cb90d6e0da
[ "MIT" ]
null
null
null
PythonExercicios/02-dados-e-contas/ex006.py
mateusmarinho/python3-cursoemvideo
706d419865532e156fb80b8a873e18cb90d6e0da
[ "MIT" ]
null
null
null
n = int(input('Digite um número: ')) print('O dobro é {}.\nO triplo é {}.\nA raiz quadrada é {:.2f}'.format(n * 2, n * 3, n ** (1/2)))
45.666667
98
0.540146
26
137
2.846154
0.769231
0
0
0
0
0
0
0
0
0
0
0.045455
0.19708
137
2
99
68.5
0.627273
0
0
0
0
0
0.540741
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
3
d50a6ea2da3b7fcb7f431124f710d9fb773bb4c9
142
py
Python
Homework/Lesson_8/seventh.py
Torkvamedo/smx
a5aef4f430f56ac67100c505902f55e18fba5978
[ "Unlicense" ]
null
null
null
Homework/Lesson_8/seventh.py
Torkvamedo/smx
a5aef4f430f56ac67100c505902f55e18fba5978
[ "Unlicense" ]
null
null
null
Homework/Lesson_8/seventh.py
Torkvamedo/smx
a5aef4f430f56ac67100c505902f55e18fba5978
[ "Unlicense" ]
null
null
null
import math def is_prime(n): if (math.factorial(n-1)+1) % n!=0: print ("NO") else: print ("YES") print(is_prime(13))
15.777778
38
0.535211
23
142
3.217391
0.652174
0.189189
0
0
0
0
0
0
0
0
0
0.048544
0.274648
142
8
39
17.75
0.669903
0
0
0
0
0
0.035461
0
0
0
0
0
0
1
0.142857
false
0
0.142857
0
0.285714
0.428571
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
3
d50cfe4b7fdff37beacd8c1bde6eb8b8d4fb26b2
429
py
Python
checkpasssword.py
Davidzhaojb/Python
68e0f8cce2e30bcce9baf95fc992e3916835da60
[ "MIT" ]
null
null
null
checkpasssword.py
Davidzhaojb/Python
68e0f8cce2e30bcce9baf95fc992e3916835da60
[ "MIT" ]
null
null
null
checkpasssword.py
Davidzhaojb/Python
68e0f8cce2e30bcce9baf95fc992e3916835da60
[ "MIT" ]
null
null
null
# 设计一个验证用户密码程序,用户只有三次机会输入错误,不过如果用户输入的内容中包含"*"则不计算在内。#设计一个验证用户密码程序,用户只有三次机会输入错误,不过如果用户输入的内容中包含"*"则不计算在内。 # 次数 count = 3 # 密码 password = "fishc" while count: Password = input("请输入密码:") if Password == password: print("密码输入正确") break elif '*' in Password: print("密码中不能包含'*',请重新输入,您还有",count,"次机会") continue else: print("密码输入错误,剩余",count-1,"次") count -= 1 print("游戏结束")
23.833333
103
0.610723
46
429
5.695652
0.652174
0.183206
0.290076
0.335878
0
0
0
0
0
0
0
0.009091
0.230769
429
17
104
25.235294
0.784848
0.247086
0
0
0
0
0.172956
0
0
0
0
0
0
1
0
false
0.285714
0
0
0
0.285714
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
3
1d13ffdd92866e672e85c762c9e0524a6d8a8a21
801
py
Python
orcamentos/crm/tests/_test_model_seller.py
rg3915/orcamentos
5cd8c4f6cbeabeb5e069c58f583c38f44c3af99a
[ "MIT" ]
94
2016-01-27T14:35:05.000Z
2022-02-22T00:01:02.000Z
orcamentos/crm/tests/_test_model_seller.py
pliniocefet/orcamentos
b84eaad7dbc49cb3ad13e037b12074b466b70a70
[ "MIT" ]
96
2015-07-31T21:50:28.000Z
2021-06-24T15:31:10.000Z
orcamentos/crm/tests/_test_model_seller.py
pliniocefet/orcamentos
b84eaad7dbc49cb3ad13e037b12074b466b70a70
[ "MIT" ]
43
2015-07-28T12:09:48.000Z
2021-08-06T18:20:55.000Z
from django.test import TestCase from django.contrib.auth.models import User from orcamentos.crm.models import Employee, Occupation from .data import USER_DICT # , SELLER_DICT # class SellerTest(TestCase): # def setUp(self): # self.user = User.objects.create(**USER_DICT) # self.occupation = Occupation.objects.create(occupation='Gerente') # self.employee = Employee.objects.get(user=self.user) # self.obj = Seller.objects.create(employee=self.employee, **SELLER_DICT) # def test_create(self): # self.assertTrue(Seller.objects.exists()) # def test_str(self): # self.assertEqual('regis', str(self.obj)) # def test_ordering(self): # self.assertListEqual( # ['employee__user__first_name'], Seller._meta.ordering)
33.375
81
0.684145
96
801
5.572917
0.375
0.059813
0
0
0
0
0
0
0
0
0
0
0.191011
801
23
82
34.826087
0.825617
0.755306
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
3
1d187bbc7e5fa4b6e07de45ddf33ac96bec48eae
393
py
Python
venta/urls.py
cor14095/backGaresa
6dffcff513c1812a88315d16303b90996f6b98d7
[ "MIT" ]
null
null
null
venta/urls.py
cor14095/backGaresa
6dffcff513c1812a88315d16303b90996f6b98d7
[ "MIT" ]
null
null
null
venta/urls.py
cor14095/backGaresa
6dffcff513c1812a88315d16303b90996f6b98d7
[ "MIT" ]
1
2021-08-09T00:55:17.000Z
2021-08-09T00:55:17.000Z
from django.urls import path from rest_framework.urlpatterns import format_suffix_patterns from .views import SalesViewSet urlpatterns = [ path('', SalesViewSet.as_view({'get': 'listcode'})), path('forecast/', SalesViewSet.as_view({'get': 'forecast'})), path('product_factor/', SalesViewSet.as_view({'get': 'product_factor'})), ] urlpatterns = format_suffix_patterns(urlpatterns)
35.727273
77
0.745547
45
393
6.288889
0.444444
0.14841
0.190813
0.222615
0
0
0
0
0
0
0
0
0.104326
393
11
78
35.727273
0.803977
0
0
0
0
0
0.159898
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
1d2070f0787262f30a6d4117b7ff46c3f54c3405
887
py
Python
release/stubs.min/System/Net/__init___parts/TransportContext.py
tranconbv/ironpython-stubs
a601759e6c6819beff8e6b639d18a24b7e351851
[ "MIT" ]
null
null
null
release/stubs.min/System/Net/__init___parts/TransportContext.py
tranconbv/ironpython-stubs
a601759e6c6819beff8e6b639d18a24b7e351851
[ "MIT" ]
null
null
null
release/stubs.min/System/Net/__init___parts/TransportContext.py
tranconbv/ironpython-stubs
a601759e6c6819beff8e6b639d18a24b7e351851
[ "MIT" ]
null
null
null
class TransportContext(object): """ The System.Net.TransportContext class provides additional context about the underlying transport layer. """ def ZZZ(self): """hardcoded/mock instance of the class""" return TransportContext() instance=ZZZ() """hardcoded/returns an instance of the class""" def GetChannelBinding(self,kind): """ GetChannelBinding(self: TransportContext,kind: ChannelBindingKind) -> ChannelBinding Retrieves the requested channel binding. kind: The type of channel binding to retrieve. Returns: The requested System.Security.Authentication.ExtendedProtection.ChannelBinding,or null if the channel binding is not supported by the current transport or by the operating system. """ pass def GetTlsTokenBindings(self): """ GetTlsTokenBindings(self: TransportContext) -> IEnumerable[TokenBinding] """ pass
40.318182
186
0.740699
95
887
6.915789
0.526316
0.063927
0.039574
0.054795
0
0
0
0
0
0
0
0
0.172492
887
21
187
42.238095
0.895095
0.666291
0
0.25
0
0
0
0
0
0
0
0
0
1
0.375
false
0.25
0
0
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
3
1d3f37cd6bdd6993696e9d21e1416800284f7f74
145
py
Python
examples/subscriber.py
i2y/h2pubsub
0d98b24b79fb932a3d832781ce4f950e32d20181
[ "MIT" ]
1
2016-06-14T21:54:34.000Z
2016-06-14T21:54:34.000Z
examples/subscriber.py
i2y/h2pubsub
0d98b24b79fb932a3d832781ce4f950e32d20181
[ "MIT" ]
null
null
null
examples/subscriber.py
i2y/h2pubsub
0d98b24b79fb932a3d832781ce4f950e32d20181
[ "MIT" ]
null
null
null
from h2pubsub import Client client = Client(address='localhost', port=443) client.subscribe('/test') while True: print(client.receive())
14.5
46
0.724138
18
145
5.833333
0.777778
0.228571
0
0
0
0
0
0
0
0
0
0.032
0.137931
145
9
47
16.111111
0.808
0
0
0
0
0
0.097902
0
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0.2
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
1d3fc716405a553729bd9e96eb9a365b1dce30fd
87
py
Python
python/01_Saying_Hello/saying_hello.py
lucifer1004/EFP
3be9f22ef76957c0f3ebdc0dbb415cea1ede8da9
[ "MIT" ]
1
2021-11-04T11:49:46.000Z
2021-11-04T11:49:46.000Z
python/01_Saying_Hello/saying_hello.py
lucifer1004/EFP
3be9f22ef76957c0f3ebdc0dbb415cea1ede8da9
[ "MIT" ]
8
2019-12-16T09:37:36.000Z
2020-07-02T06:00:30.000Z
python/01_Saying_Hello/saying_hello.py
lucifer1004/EFP
3be9f22ef76957c0f3ebdc0dbb415cea1ede8da9
[ "MIT" ]
null
null
null
name = input('What is your name? ') print('Hello, {}, nice to meet you!'.format(name))
29
50
0.643678
14
87
4
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.149425
87
2
51
43.5
0.756757
0
0
0
0
0
0.54023
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
3
1d934a395a0830ed466a1f51cf7e9b44cbf3358d
240
py
Python
7_adapter&facade/adapter/turkey_adapter.py
hypersport/Head-First-Design-Patterns-Python
0c8b831ae89ebbbef8b203b96508deb7e3063590
[ "MIT" ]
null
null
null
7_adapter&facade/adapter/turkey_adapter.py
hypersport/Head-First-Design-Patterns-Python
0c8b831ae89ebbbef8b203b96508deb7e3063590
[ "MIT" ]
null
null
null
7_adapter&facade/adapter/turkey_adapter.py
hypersport/Head-First-Design-Patterns-Python
0c8b831ae89ebbbef8b203b96508deb7e3063590
[ "MIT" ]
null
null
null
from duck import Duck class TurkeyAdapter(Duck): def __init__(self, turkey): self.turkey = turkey def quack(self): self.turkey.gobble() def fly(self): for _ in range(5): self.turkey.fly()
17.142857
31
0.583333
30
240
4.5
0.533333
0.296296
0
0
0
0
0
0
0
0
0
0.006024
0.308333
240
13
32
18.461538
0.807229
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.111111
0
0.555556
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
1
0
0
0
0
1
0
0
3
1d940c228fcfb56c1a9c74a6eb7e2d65108a4597
207
py
Python
__tests__/utils/time.py
celestinosalim/dialog-engine
17c7d6e06df05aa24cfb611e91ef4790ffc80cb6
[ "MIT" ]
4
2020-04-17T15:50:33.000Z
2020-04-17T16:49:00.000Z
__tests__/utils/time.py
celestinosalim/dialog-engine
17c7d6e06df05aa24cfb611e91ef4790ffc80cb6
[ "MIT" ]
6
2020-06-18T16:17:27.000Z
2020-08-24T13:21:56.000Z
__tests__/utils/time.py
esl-works/dialog-engine
f29ab486a6f193edce5bbcd2bf3b86b8ad9ceaa9
[ "MIT" ]
3
2020-04-17T16:11:35.000Z
2020-05-21T11:38:05.000Z
import datetime def get_timestamp_min_in_past(min_ago: int) -> datetime.datetime: dt = datetime.datetime.now() - datetime.timedelta(minutes=min_ago) return dt.replace(tzinfo=datetime.timezone.utc)
29.571429
70
0.772947
29
207
5.310345
0.655172
0.077922
0
0
0
0
0
0
0
0
0
0
0.115942
207
6
71
34.5
0.84153
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
3
1d9ef948608abb5888f2c512e8ac676a5c5b356c
137
py
Python
scripts-for-manuscript/figure4/src/h5-mean.py
Clinical-Genomics/d4-format
b36b441f652b1caa3d8ce49b880a0dc853547de3
[ "MIT" ]
116
2020-05-14T19:16:47.000Z
2022-03-19T21:50:19.000Z
scripts-for-manuscript/figure4/src/h5-mean.py
Clinical-Genomics/d4-format
b36b441f652b1caa3d8ce49b880a0dc853547de3
[ "MIT" ]
40
2020-08-27T17:27:31.000Z
2022-03-19T08:41:06.000Z
scripts-for-manuscript/figure4/src/h5-mean.py
Clinical-Genomics/d4-format
b36b441f652b1caa3d8ce49b880a0dc853547de3
[ "MIT" ]
11
2020-09-18T13:03:42.000Z
2022-02-18T17:27:48.000Z
import h5py import sys file = h5py.File(sys.argv[1], "r") for chr in file.keys(): data = file[chr][:] print(chr, data.mean())
13.7
34
0.605839
23
137
3.608696
0.608696
0
0
0
0
0
0
0
0
0
0
0.027523
0.20438
137
9
35
15.222222
0.733945
0
0
0
0
0
0.007353
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0.166667
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
1d9f22247e6067874f38821b8ef5cf39fb2b0283
1,205
py
Python
setup.py
stanislavlevin/k5test
9f4e490d93c92e1b92d23ff82fb605c297515e3f
[ "0BSD" ]
null
null
null
setup.py
stanislavlevin/k5test
9f4e490d93c92e1b92d23ff82fb605c297515e3f
[ "0BSD" ]
null
null
null
setup.py
stanislavlevin/k5test
9f4e490d93c92e1b92d23ff82fb605c297515e3f
[ "0BSD" ]
null
null
null
#!/usr/bin/env python from setuptools import setup setup( name='k5test', version='0.10.0', author='The Python GSSAPI Team', author_email='sross@redhat.com', packages=['k5test'], description='A library for testing Python applications in ' 'self-contained Kerberos 5 environments', long_description=open('README.md').read(), license='LICENSE.txt', url="https://github.com/pythongssapi/k5test", python_requires=">=3.6", classifiers=[ 'Development Status :: 4 - Beta', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Intended Audience :: Developers', 'License :: OSI Approved :: ISC License (ISCL)', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: Implementation :: CPython', 'Topic :: Security', ], keywords=['gssapi', 'security'], install_requires=[], extras_require={ 'extension_test': ['gssapi'] } )
32.567568
70
0.60083
122
1,205
5.885246
0.622951
0.185237
0.243733
0.181059
0
0
0
0
0
0
0
0.022026
0.246473
1,205
36
71
33.472222
0.768722
0.016598
0
0
0
0
0.565034
0
0
0
0
0
0
1
0
true
0
0.030303
0
0.030303
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
1da1ec4541fe6c8f195889f5b3381ab3a7789467
1,062
py
Python
nuage_neutron/vsdclient/common/cms_id_helper.py
jbemmel/nuage-openstack-neutron
e356c017f7e1600b72cfc26abb588c7cf636e925
[ "Apache-2.0" ]
14
2015-06-24T18:35:25.000Z
2020-09-21T07:14:06.000Z
nuage_neutron/vsdclient/common/cms_id_helper.py
jbemmel/nuage-openstack-neutron
e356c017f7e1600b72cfc26abb588c7cf636e925
[ "Apache-2.0" ]
7
2016-01-20T18:20:28.000Z
2020-11-18T16:04:14.000Z
nuage_neutron/vsdclient/common/cms_id_helper.py
jbemmel/nuage-openstack-neutron
e356c017f7e1600b72cfc26abb588c7cf636e925
[ "Apache-2.0" ]
43
2015-04-07T09:02:35.000Z
2021-02-12T07:50:19.000Z
# Copyright 2016 NOKIA # # 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. CMS_ID = None def get_cms_id(): return CMS_ID def get_vsd_external_id(neutron_id): if neutron_id and '@' not in neutron_id and CMS_ID: return neutron_id + '@' + CMS_ID return neutron_id def strip_cms_id(external_id): return external_id.split('@')[0] if external_id else external_id def extra_headers_get(): return { 'X-NUAGE-FilterType': "predicate", 'X-Nuage-Filter': "externalID ENDSWITH '@%s'" % CMS_ID }
28.702703
78
0.699623
159
1,062
4.528302
0.534591
0.048611
0.045833
0.044444
0.055556
0
0
0
0
0
0
0.010817
0.216573
1,062
36
79
29.5
0.854567
0.536723
0
0
0
0
0.144351
0
0
0
0
0
0
1
0.285714
false
0
0
0.214286
0.642857
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
d51f3ce171cefeb4ce9612bb83acf0f40ea9f6ff
3,036
py
Python
PreprocessData/all_class_files/PriceSpecification.py
wkid-neu/Schema
4854720a15894dd814691a55e03329ecbbb6f558
[ "MIT" ]
3
2021-11-06T12:29:05.000Z
2022-03-22T12:48:55.000Z
PreprocessData/all_class_files/PriceSpecification.py
DylanNEU/Schema
4854720a15894dd814691a55e03329ecbbb6f558
[ "MIT" ]
null
null
null
PreprocessData/all_class_files/PriceSpecification.py
DylanNEU/Schema
4854720a15894dd814691a55e03329ecbbb6f558
[ "MIT" ]
1
2021-11-06T12:29:12.000Z
2021-11-06T12:29:12.000Z
from PreprocessData.all_class_files.StructuredValue import StructuredValue import global_data class PriceSpecification(StructuredValue): def __init__(self, additionalType=None, alternateName=None, description=None, disambiguatingDescription=None, identifier=None, image=None, mainEntityOfPage=None, name=None, potentialAction=None, sameAs=None, url=None, eligibleQuantity=None, eligibleTransactionVolume=None, maxPrice=None, minPrice=None, price=None, priceCurrency=None, validFrom=None, validThrough=None, valueAddedTaxIncluded=None): StructuredValue.__init__(self, additionalType, alternateName, description, disambiguatingDescription, identifier, image, mainEntityOfPage, name, potentialAction, sameAs, url) self.eligibleQuantity = eligibleQuantity self.eligibleTransactionVolume = eligibleTransactionVolume self.maxPrice = maxPrice self.minPrice = minPrice self.price = price self.priceCurrency = priceCurrency self.validFrom = validFrom self.validThrough = validThrough self.valueAddedTaxIncluded = valueAddedTaxIncluded def set_eligibleQuantity(self, eligibleQuantity): self.eligibleQuantity = eligibleQuantity def get_eligibleQuantity(self): return self.eligibleQuantity def set_eligibleTransactionVolume(self, eligibleTransactionVolume): self.eligibleTransactionVolume = eligibleTransactionVolume def get_eligibleTransactionVolume(self): return self.eligibleTransactionVolume def set_maxPrice(self, maxPrice): self.maxPrice = maxPrice def get_maxPrice(self): return self.maxPrice def set_minPrice(self, minPrice): self.minPrice = minPrice def get_minPrice(self): return self.minPrice def set_price(self, price): self.price = price def get_price(self): return self.price def set_priceCurrency(self, priceCurrency): self.priceCurrency = priceCurrency def get_priceCurrency(self): return self.priceCurrency def set_validFrom(self, validFrom): self.validFrom = validFrom def get_validFrom(self): return self.validFrom def set_validThrough(self, validThrough): self.validThrough = validThrough def get_validThrough(self): return self.validThrough def set_valueAddedTaxIncluded(self, valueAddedTaxIncluded): self.valueAddedTaxIncluded = valueAddedTaxIncluded def get_valueAddedTaxIncluded(self): return self.valueAddedTaxIncluded def __setattr__(self, key, value_list): if type(value_list).__name__ == "NoneType" or key == "node_id": self.__dict__[key] = value_list return for value in value_list: str_value = type(value).__name__ if str_value not in global_data.get_table()[key]: raise ValueError("非法类型!") self.__dict__[key] = value_list
37.02439
403
0.704216
283
3,036
7.34629
0.19788
0.025974
0.060606
0.047138
0.01924
0
0
0
0
0
0
0
0.226285
3,036
81
404
37.481481
0.885057
0
0
0.338983
0
0
0.006768
0
0
0
0
0
0
1
0.338983
false
0
0.033898
0.152542
0.559322
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
d52fa52264faff6b5499de53b2e218972469ccdc
84
py
Python
monitor/test/__init__.py
ReCodEx/monitor
f461da684783888894c571e0bd08eaf6a948e0c5
[ "MIT" ]
4
2017-09-28T09:30:24.000Z
2017-12-10T19:45:51.000Z
monitor/test/__init__.py
ReCodEx/monitor
f461da684783888894c571e0bd08eaf6a948e0c5
[ "MIT" ]
null
null
null
monitor/test/__init__.py
ReCodEx/monitor
f461da684783888894c571e0bd08eaf6a948e0c5
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 __all__ = ['test_ClientConnections', 'test_websock_server']
21
59
0.761905
10
84
5.7
0.9
0
0
0
0
0
0
0
0
0
0
0.012987
0.083333
84
3
60
28
0.727273
0.25
0
0
0
0
0.66129
0.354839
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
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
d54427a0aba1c3116e4d85ec6e7cfa958b479d0b
1,220
py
Python
iamheadless_publisher_admin/mixins.py
plain-ie/iamheadless_publisher_admin
03e0406d5d6e40132fb63100f184ce5e90c0ad31
[ "MIT" ]
null
null
null
iamheadless_publisher_admin/mixins.py
plain-ie/iamheadless_publisher_admin
03e0406d5d6e40132fb63100f184ce5e90c0ad31
[ "MIT" ]
null
null
null
iamheadless_publisher_admin/mixins.py
plain-ie/iamheadless_publisher_admin
03e0406d5d6e40132fb63100f184ce5e90c0ad31
[ "MIT" ]
null
null
null
from django.urls import path from . import permissions from . import utils class ItemViewSetPermissionMixin: def has_access(self): permissions.user_can_access_item_type( self.get_request_user(), self.get_project_id(), self.get_item_type() ) class UtilsViewSetMixin: def get_client(self): return utils.get_client() def get_project_id(self): return utils.get_request_project_id(self.request) def get_tenant_id(self): return utils.get_request_tenant_id(self.request) def get_item_id(self): return utils.get_request_item_id(self.request) def get_item_type(self): item_type = utils.get_request_item_type(self.request) if item_type is not None: return item_type return getattr(self, 'item_type', None) def get_request_user_token(self): return utils.get_request_user_token(self.request) def get_request_user(self): return utils.get_request_user(self.request) def get_item_type_serializer(self, item_type=None): if item_type is not None: return utils.get_item_type_serializer(item_type) return self.pydantic_model
25.957447
61
0.690984
166
1,220
4.73494
0.204819
0.132316
0.124682
0.137405
0.395674
0.335878
0.063613
0
0
0
0
0
0.236885
1,220
46
62
26.521739
0.844253
0
0
0.0625
0
0
0.007377
0
0
0
0
0
0
1
0.28125
false
0
0.09375
0.1875
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
d55da3bd990fcd7c4231a540e95539db3b6dd742
5,696
py
Python
palabox/apis/duolingo.py
marcoboucas/palabox
d6e937db909daac0f9d3c5dff2309c29b5b68ea8
[ "MIT" ]
null
null
null
palabox/apis/duolingo.py
marcoboucas/palabox
d6e937db909daac0f9d3c5dff2309c29b5b68ea8
[ "MIT" ]
null
null
null
palabox/apis/duolingo.py
marcoboucas/palabox
d6e937db909daac0f9d3c5dff2309c29b5b68ea8
[ "MIT" ]
null
null
null
"""Duolingo API.""" from dataclasses import dataclass from datetime import datetime import dacite import requests from .base import BaseApi, BaseApiConfig from .types.duolingo import DuolingoStats @dataclass class DuolingoApiConfig(BaseApiConfig): """DuolingoApiConfig.""" login: str = "" password: str = "" login_url: str = "https://www.duolingo.com/login" user_id: str = "" jwt_token: str = "" # pylint: disable=line-too-long user_request_fields = "acquisitionSurveyReason,adsConfig,betaStatus,bio,blockedUserIds,canUseModerationTools,courses,creationDate,currentCourse,email,emailAnnouncement,emailAssignment,emailAssignmentComplete,emailClassroomJoin,emailClassroomLeave,emailComment,emailEditSuggested,emailEventsDigest,emailFollow,emailPass,emailPromotion,emailWeeklyProgressReport,emailSchoolsAnnouncement,emailStreamPost,emailVerified,emailWeeklyReport,enableMicrophone,enableSoundEffects,enableSpeaker,experiments{connect_web_remove_dictionary,courses_fr_ja_v1,courses_it_de_v1,hoots_web,hoots_web_100_crowns,hoots_web_rename,learning_det_scores_v1,learning_duolingo_score_v1,learning_fix_whitespace_grading,media_shorten_cant_speak_web,midas_new_years_2022_purchase_flow,midas_web_cta_purchase_start_my_14_day,midas_web_family_plan,midas_web_immersive_plus_v2,midas_web_longscroll,midas_web_new_years_discount_2022,midas_web_payment_requests_v2,midas_web_plus_applicable_taxes,midas_web_plus_dashboard_mobile_users,midas_web_plus_dashboard_stripe_users,nurr_web_coach_duo_in_placement_v2,nurr_web_simplify_first_skill_popouts,nurr_web_uo_home_message_v0,sigma_web_cancel_flow_crossgrade,sigma_web_direct_purchase_hide_monthly,sigma_web_family_plan_shop_promo,sigma_web_gold_empty_progress,sigma_web_legendary_partial_xp,sigma_web_legendary_price_30_lingots,sigma_web_mistakes_inbox,sigma_web_show_xp_in_skill_popover,sigma_web_split_purchase_page,spam_non_blocking_email_verification,speak_rewrite_speak_challenge,speak_web_port_speak_waveform,stories_web_column_match_challenge,stories_web_crown_pacing_new_labels,stories_web_freeform_writing_examples,stories_web_intro_callout_tier_1,stories_web_listen_mode_redesign,stories_web_newly_published_labels,unify_checkpoint_logic_web,web_alphabets_tab,web_delight_character_scaling_v2,web_delight_fullscreen_loading_v3},facebookId,fromLanguage,globalAmbassadorStatus,googleId,hasPlus,id,inviteURL,joinedClassroomIds,lastStreak{isAvailableForRepair,length},learningLanguage,lingots,location,monthlyXp,name,observedClassroomIds,persistentNotifications,picture,plusDiscounts,practiceReminderSettings,privacySettings,referralInfo,rewardBundles,roles,streak,streakData{length},timezone,timezoneOffset,totalXp,trackingProperties,unconsumedGiftIds,username,webNotificationIds,weeklyXp,xpGains,xpGoal,zhTw,_achievements" class DuolingoApi(BaseApi): """Duolingo API.""" __name__ = "DuolingoApi" config: DuolingoApiConfig api_need_connection: bool = True def __init__(self, config: DuolingoApiConfig) -> None: """Init.""" super().__init__(config) def is_connected(self) -> bool: """Check if connected.""" return self.config.jwt_token != "" and self.config.user_id != "" def can_connect(self) -> bool: """Check if able to connect.""" return self.config.login != "" and self.config.password != "" @BaseApi.__log_entry__ def connect(self) -> None: """Connect.""" if not self.can_connect(): self.logger.warning("Login or password is empty") return None try: response = self.request( url=self.config.login_url, method="post", json={"login": self.config.login, "password": self.config.password}, ) except ValueError: return None try: self.config.user_id = response.json()["user_id"] self.config.jwt_token = response.headers["jwt"] except KeyError: self.logger.debug(response.content) self.logger.error("Can't get user_id or jwt_token", exc_info=True) return None @BaseApi.__log_entry__ @BaseApi.need_connection def __get_friends_response(self) -> requests.Response: """Get data from friends.""" return self.request( url="https://www.duolingo.com/2017-06-30/users/" + f"{self.config.user_id}/subscriptions?pageSize=500&_={self.config.user_id}", method="get", headers={"Authorization": f"Bearer {self.config.jwt_token}"}, ) @BaseApi.__log_entry__ @BaseApi.need_connection def __get_user_response(self) -> requests.Response: """Get data from friends.""" return self.request( url="https://www.duolingo.com/2017-06-30/users/" + self.config.user_id + f"?fields={self.config.user_request_fields}" + f"&_={str(int(datetime.now().timestamp()))}", method="get", headers={"Authorization": f"Bearer {self.config.jwt_token}"}, ) @BaseApi.__log_entry__ @BaseApi.need_connection def get_today(self) -> DuolingoStats: """Get user stats for today.""" friends_response = self.__get_friends_response() response = self.__get_user_response() if response.ok and friends_response.ok: raw_data = response.json() raw_data["friends"] = friends_response.json()["subscriptions"] data: DuolingoStats = dacite.from_dict(DuolingoStats, raw_data) return data raise ValueError(f"Problem with the request {response}, '{response.content.decode()}'")
53.233645
2,345
0.748244
667
5,696
5.991005
0.433283
0.04004
0.021021
0.02002
0.107608
0.107608
0.107608
0.107608
0.097097
0.097097
0
0.009344
0.154494
5,696
106
2,346
53.735849
0.82039
0.036868
0
0.266667
0
0.026667
0.525667
0.468445
0
0
0
0
0
1
0.093333
false
0.066667
0.08
0
0.426667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
1
0
0
0
0
0
3
d58793b80ef5f72c4f7f559049461feeea80ac8d
107
py
Python
tutorials/prompt/placeholder.py
chouette254/quo
8979afd118e77d3d0f93f9fbe8711efada7158c5
[ "MIT" ]
5
2021-06-17T21:06:39.000Z
2022-03-11T06:45:51.000Z
tutorials/prompt/placeholder.py
chouette254/quo
8979afd118e77d3d0f93f9fbe8711efada7158c5
[ "MIT" ]
39
2021-07-19T19:36:18.000Z
2022-02-23T14:55:08.000Z
tutorials/prompt/placeholder.py
secretuminc/quo
c4f77d52f015c612d32ed0fc2fc79545af598f10
[ "MIT" ]
1
2021-05-31T17:19:15.000Z
2021-05-31T17:19:15.000Z
import quo from quo.widget.placeholder import * s = quo.Elicit() s.elicit("You said :", placeholder=grey)
17.833333
40
0.728972
16
107
4.875
0.625
0
0
0
0
0
0
0
0
0
0
0
0.130841
107
5
41
21.4
0.83871
0
0
0
0
0
0.093458
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
d595973d050f83ac64d0631fb100031b6ece759a
158
py
Python
micro_shop/staff/urls.py
SlavaSkvortsov/micro-shop
fd8ac23550da9be277a9234464fdab1213356f3d
[ "MIT" ]
1
2021-06-17T15:11:03.000Z
2021-06-17T15:11:03.000Z
micro_shop/staff/urls.py
SlavaSkvortsov/micro-shop
fd8ac23550da9be277a9234464fdab1213356f3d
[ "MIT" ]
7
2020-06-30T11:25:28.000Z
2021-06-09T18:51:55.000Z
micro_shop/staff/urls.py
SlavaSkvortsov/micro-shop
fd8ac23550da9be277a9234464fdab1213356f3d
[ "MIT" ]
5
2020-10-02T20:01:43.000Z
2021-06-21T08:57:29.000Z
from django.urls import path from .views import UserProfileUpdate urlpatterns = [ path('<int:pk>/', UserProfileUpdate.as_view(), name='profile_url') ]
17.555556
70
0.727848
19
158
5.947368
0.789474
0
0
0
0
0
0
0
0
0
0
0
0.139241
158
8
71
19.75
0.830882
0
0
0
0
0
0.126582
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
d59cd017a36d985975d03a9f718909fa314e7e24
475
py
Python
01_binary_search.py
burakaslantas/Grokking-Algorithms
2ecf73a683b11288d419cc1d8dc665ab2240e8bc
[ "MIT" ]
null
null
null
01_binary_search.py
burakaslantas/Grokking-Algorithms
2ecf73a683b11288d419cc1d8dc665ab2240e8bc
[ "MIT" ]
null
null
null
01_binary_search.py
burakaslantas/Grokking-Algorithms
2ecf73a683b11288d419cc1d8dc665ab2240e8bc
[ "MIT" ]
null
null
null
def binary_search(array, searched_value): start = 0 end = len(array) - 1 while(start <= end): mid = (start + end) // 2 guess = array[mid] if(searched_value == guess): return mid elif(searched_value < guess): end = mid - 1 elif(searched_value > guess): start = mid + 1 return -1 my_array = [32,2,25,3,11,78,-2,32] my_array.sort() print(my_array) print(binary_search(my_array, 78))
22.619048
41
0.555789
66
475
3.848485
0.393939
0.204724
0.212598
0.173228
0
0
0
0
0
0
0
0.064417
0.313684
475
20
42
23.75
0.714724
0
0
0
0
0
0
0
0
0
0
0
0
1
0.058824
false
0
0
0
0.176471
0.117647
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
d5a1f8e45bc2fd24ac139bfff6fce49d306cde0d
907
py
Python
gmso/tests/test_gsd.py
zijiewu3/gmso
49217ca8daa6c8b01f6bc667d271a321b6f6f16a
[ "MIT" ]
1
2020-11-08T23:50:09.000Z
2020-11-08T23:50:09.000Z
gmso/tests/test_gsd.py
zijiewu3/gmso
49217ca8daa6c8b01f6bc667d271a321b6f6f16a
[ "MIT" ]
null
null
null
gmso/tests/test_gsd.py
zijiewu3/gmso
49217ca8daa6c8b01f6bc667d271a321b6f6f16a
[ "MIT" ]
null
null
null
import unyt as u import pytest from gmso.formats.gsd import write_gsd from gmso.external.convert_parmed import from_parmed from gmso.tests.base_test import BaseTest from gmso.utils.io import get_fn from gmso.utils.io import import_, has_gsd, has_parmed if has_parmed: pmd = import_('parmed') @pytest.mark.skipif(not has_gsd, reason="gsd is not installed") @pytest.mark.skipif(not has_parmed, reason="ParmEd is not installed") class TestGsd(BaseTest): # TODO: Have these tests not depend on parmed def test_write_gsd(self): top = from_parmed(pmd.load_file(get_fn('ethane.top'), xyz=get_fn('ethane.gro'))) write_gsd(top, 'out.gsd') def test_write_gsd_non_orthogonal(self): top = from_parmed(pmd.load_file(get_fn('ethane.top'), xyz=get_fn('ethane.gro'))) top.box.angles = u.degree * [90, 90, 120] write_gsd(top, 'out.gsd')
30.233333
69
0.702315
144
907
4.229167
0.368056
0.065681
0.07225
0.049261
0.390805
0.19376
0.19376
0.19376
0.19376
0.19376
0
0.009447
0.183021
907
29
70
31.275862
0.812416
0.047409
0
0.285714
0
0
0.11949
0
0
0
0
0.034483
0
1
0.095238
false
0
0.380952
0
0.52381
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
1
0
0
3
d5abcbe8cfb21a7294348cb0c5948348bf4ecebf
338
py
Python
docs/components_page/components/breadcrumb/simple.py
glsdown/dash-bootstrap-components
0ebea4f7de43975f6e3a2958359c4480ae1d4927
[ "Apache-2.0" ]
776
2019-02-07T19:36:59.000Z
2022-03-31T05:53:04.000Z
docs/components_page/components/breadcrumb/simple.py
glsdown/dash-bootstrap-components
0ebea4f7de43975f6e3a2958359c4480ae1d4927
[ "Apache-2.0" ]
350
2019-02-05T10:42:19.000Z
2022-03-31T19:23:35.000Z
docs/components_page/components/breadcrumb/simple.py
glsdown/dash-bootstrap-components
0ebea4f7de43975f6e3a2958359c4480ae1d4927
[ "Apache-2.0" ]
219
2019-02-10T13:46:25.000Z
2022-03-23T17:03:39.000Z
import dash_bootstrap_components as dbc breadcrumb = dbc.Breadcrumb( items=[ {"label": "Docs", "href": "/docs", "external_link": True}, { "label": "Components", "href": "/docs/components", "external_link": True, }, {"label": "Breadcrumb", "active": True}, ], )
24.142857
66
0.511834
29
338
5.827586
0.517241
0.153846
0.189349
0.248521
0
0
0
0
0
0
0
0
0.310651
338
13
67
26
0.725322
0
0
0
0
0
0.295858
0
0
0
0
0
0
1
0
false
0
0.083333
0
0.083333
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
633589fb97c7e506f46870a065a0488ff3565e70
20
py
Python
ckan_cloud_operator/providers/ckan/deployment/drone/constants.py
pdelboca/ckan-cloud-operator
20d7e6ed8cc2f5cfce5bc6295cb5487156a53f61
[ "MIT" ]
14
2019-11-18T12:01:03.000Z
2021-09-15T15:29:50.000Z
ckan_cloud_operator/providers/ckan/deployment/drone/constants.py
pdelboca/ckan-cloud-operator
20d7e6ed8cc2f5cfce5bc6295cb5487156a53f61
[ "MIT" ]
52
2019-09-09T14:22:41.000Z
2021-09-29T08:29:24.000Z
ckan_cloud_operator/providers/ckan/deployment/drone/constants.py
pdelboca/ckan-cloud-operator
20d7e6ed8cc2f5cfce5bc6295cb5487156a53f61
[ "MIT" ]
8
2019-10-05T12:46:25.000Z
2021-09-15T15:13:05.000Z
PROVIDER_ID='drone'
10
19
0.8
3
20
5
1
0
0
0
0
0
0
0
0
0
0
0
0.05
20
1
20
20
0.789474
0
0
0
0
0
0.25
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
63446e4d927fb53761761a122344b0bc8d13ee0c
46
py
Python
captum/__init__.py
ashkan-software/captum
b8b7d4b10a9646e4da827635d6947499fbde3326
[ "BSD-3-Clause" ]
1
2020-02-02T19:23:01.000Z
2020-02-02T19:23:01.000Z
captum/__init__.py
ashkan-software/captum
b8b7d4b10a9646e4da827635d6947499fbde3326
[ "BSD-3-Clause" ]
7
2020-09-07T15:59:35.000Z
2022-02-26T19:34:09.000Z
captum/__init__.py
orionr/captum-2
06009a0c68e56f549964a132ba9c4c4f418af7bd
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python3 __version__ = "0.2.0"
11.5
22
0.652174
8
46
3.25
0.875
0
0
0
0
0
0
0
0
0
0
0.1
0.130435
46
3
23
15.333333
0.55
0.456522
0
0
0
0
0.208333
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
637d0020a33a6fdd3c4651808a9b764d4bbf5ed2
128
py
Python
member/urls.py
itssunny322/User_activity
c150b1e8e52f4cb019d6d390c6007e038fbb1688
[ "Apache-2.0" ]
null
null
null
member/urls.py
itssunny322/User_activity
c150b1e8e52f4cb019d6d390c6007e038fbb1688
[ "Apache-2.0" ]
3
2021-03-19T02:57:29.000Z
2021-09-22T18:58:45.000Z
member/urls.py
itssunny322/User_activity
c150b1e8e52f4cb019d6d390c6007e038fbb1688
[ "Apache-2.0" ]
null
null
null
from django.urls import path from .views import * urlpatterns = [ path('users', UserView.as_view(), name='user_list'), ]
14.222222
56
0.679688
17
128
5
0.823529
0
0
0
0
0
0
0
0
0
0
0
0.171875
128
8
57
16
0.801887
0
0
0
0
0
0.110236
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
63945e496bccbd028111b476e664c3eb1a506627
149
py
Python
catfact.py
machow/catfact
d316ddc399c5832827748bfd0090c9aab328be0e
[ "MIT" ]
null
null
null
catfact.py
machow/catfact
d316ddc399c5832827748bfd0090c9aab328be0e
[ "MIT" ]
1
2020-08-17T16:39:22.000Z
2020-08-17T17:26:28.000Z
catfact.py
machow/forcats-py
d316ddc399c5832827748bfd0090c9aab328be0e
[ "MIT" ]
null
null
null
__version__ = "0.0.1" # NOTE: I am moving the forcats module from siuba to here # https://github.com/machow/siuba/blob/master/siuba/dply/forcats.py
29.8
67
0.744966
26
149
4.115385
0.846154
0
0
0
0
0
0
0
0
0
0
0.022901
0.120805
149
4
68
37.25
0.793893
0.812081
0
0
0
0
0.2
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
1
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
639b89ff3173f96edbd1e584cff4ca8d08819f9f
2,532
py
Python
bike/parsing/load.py
debiancn/bicyclerepair
dd054e802d6d8ad80baeccee0396da68144f2a26
[ "ICU" ]
2
2020-05-29T06:31:53.000Z
2020-12-19T21:49:25.000Z
bike/parsing/load.py
debiancn/bicyclerepair
dd054e802d6d8ad80baeccee0396da68144f2a26
[ "ICU" ]
null
null
null
bike/parsing/load.py
debiancn/bicyclerepair
dd054e802d6d8ad80baeccee0396da68144f2a26
[ "ICU" ]
null
null
null
from bike.globals import * import os from bike.parsing.fastparser import fastparser class Cache: def __init__(self): self.reset() def reset(self): self.srcnodecache = {} self.typecache = {} self.maskedlinescache = {} instance = None Cache.instance = Cache() class CantLocateSourceNodeException(Exception): pass def getSourceNode(filename_path): #print "getSourceNode:",filename_path sourcenode = None try: sourcenode = Cache.instance.srcnodecache[filename_path] except KeyError: pass if sourcenode is None: from bike.parsing.newstuff import translateFnameToModuleName sourcenode = SourceFile.createFromFile(filename_path, translateFnameToModuleName(filename_path)) if sourcenode is None: raise CantLocateSourceNodeException(filename_path) Cache.instance.srcnodecache[filename_path]=sourcenode return sourcenode class SourceFile: def createFromString(filename, modulename, src): return SourceFile(filename,modulename,src) createFromString = staticmethod(createFromString) def createFromFile(filename,modulename): try: f = file(filename) src = f.read() f.close() except IOError: return None else: return SourceFile(filename,modulename,src) createFromFile = staticmethod(createFromFile) def __init__(self, filename, modulename, src): if os.path.isabs(filename): self.filename = filename else: self.filename = os.path.abspath(filename) self.modulename = modulename self.resetWithSource(src) def resetWithSource(self, source): # fastparser ast self.fastparseroot = fastparser(source,self.modulename,self.filename) self.fastparseroot.setSourceNode(self) self._lines = source.splitlines(1) self.sourcenode = self def __repr__(self): return "Source(%s,%s)"%('source', self.filename) def getChildNodes(self): return self.fastparseroot.getChildNodes() def getSource(self): return "".join(self.getLines()) def getLine(self,linenum): return self.getLines()[linenum-1] # TODO: rename me! def getFlattenedListOfFastParserASTNodes(self): return self.fastparseroot.getFlattenedListOfChildNodes() def getLines(self): return self._lines
26.652632
77
0.648499
234
2,532
6.92735
0.299145
0.05182
0.05182
0.040716
0.091302
0
0
0
0
0
0
0.001078
0.267378
2,532
94
78
26.93617
0.872776
0.026856
0
0.123077
0
0
0.007733
0
0
0
0
0.010638
0
1
0.2
false
0.030769
0.061538
0.107692
0.507692
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
1
1
0
0
3
639ecc093e44120c4662cc5f7f988b58d3a293ce
5,365
py
Python
test/test_parity_accounts.py
ad360io/python-ethereum-client
93c111f20ea2f7297d4462edc500cfecb1f289e0
[ "Apache-2.0" ]
3
2019-03-28T18:56:44.000Z
2020-12-30T17:00:15.000Z
test/test_parity_accounts.py
thezedwards/python-ethereum-client
93c111f20ea2f7297d4462edc500cfecb1f289e0
[ "Apache-2.0" ]
null
null
null
test/test_parity_accounts.py
thezedwards/python-ethereum-client
93c111f20ea2f7297d4462edc500cfecb1f289e0
[ "Apache-2.0" ]
null
null
null
from test_base import TestBase class TestParityAccounts(TestBase): def test_parity_all_accounts_info(self): cb = lambda: self.client.parity_all_accounts_info() self.mock(cb, True) def test_parity_change_password(self): address = '0xdae1bfb92c7c0fd23396619ee1a0d643bf609c2e' old_password = 'password' new_password = '123456' cb = lambda: self.client.parity_change_password(address, old_password, new_password) self.mock(cb, True) def test_parity_derive_address_hash(self): address = '0xdae1bfb92c7c0fd23396619ee1a0d643bf609c2e' password = 'password' derived_hash = '0x96ee0e9574959ad9e2b7b287ea59bc8741d228b6ffc9eaee8e17bb59948103bf' cb = lambda: self.client.parity_derive_address_hash(address, password, derived_hash) self.mock(cb, True) def test_parity_derive_address_index(self): address = '0xdae1bfb92c7c0fd23396619ee1a0d643bf609c2e' password = 'password' derived = [{'index': 1, 'type': 'soft'},{'index': 2,'type': 'hard'}] cb = lambda: self.client.parity_derive_address_index(address, password, derived) self.mock(cb, True) def test_parity_export_account(self): address = '0xdae1bfb92c7c0fd23396619ee1a0d643bf609c2e' password = 'password' cb = lambda: self.client.parity_export_account(address, password) self.mock(cb, True) def test_parity_get_dapp_addresses(self): dapp = 'web' cb = lambda: self.client.parity_get_dapp_addresses(dapp) self.mock(cb, True) def test_parity_get_dapp_default_address(self): dapp = 'web' cb = lambda: self.client.parity_get_dapp_default_address(dapp) self.mock(cb, True) def test_parity_get_new_dapps_addresses(self): cb = lambda: self.client.parity_get_new_dapps_addresses() self.mock(cb, True) def test_parity_get_new_dapps_default_address(self): cb = lambda: self.client.parity_get_new_dapps_default_address() self.mock(cb, True) def test_parity_import_geth_accounts(self): address = '0xdae1bfb92c7c0fd23396619ee1a0d643bf609c2e' cb = lambda: self.client.parity_import_geth_accounts(address) self.mock(cb, True) def test_parity_kill_account(self): address = '0xdae1bfb92c7c0fd23396619ee1a0d643bf609c2e' password = 'password' cb = lambda: self.client.parity_kill_account(address, password) self.mock(cb, True) def test_parity_list_geth_accounts(self): cb = lambda: self.client.parity_list_geth_accounts() self.mock(cb, True) def test_parity_list_recent_dapps(self): cb = lambda: self.client.parity_list_recent_dapps() self.mock(cb, True) def test_parity_new_account_from_phrase(self): phrase = 'this is a really long secret phrase of random words' password = 'password' cb = lambda: self.client.parity_new_account_from_phrase(phrase, password) self.mock(cb, True) def test_parity_new_account_from_secret(self): secret = '0x6bd03adce3f5828ce200cb040e1c5e4de8b8c99d726eee21521c62e4d27218aa' password = 'password' cb = lambda: self.client.parity_new_account_from_secret(secret, password) self.mock(cb, True) def test_parity_new_account_from_wallet(self): wallet = '' password = 'password' cb = lambda: self.client.parity_new_account_from_wallet(wallet, password) self.mock(cb, True) def test_parity_remove_address(self): address = '0xdae1bfb92c7c0fd23396619ee1a0d643bf609c2e' cb = lambda: self.client.parity_remove_address(address) self.mock(cb, True) def test_parity_set_account_meta(self): address = '0xdae1bfb92c7c0fd23396619ee1a0d643bf609c2e' metadata = {'hint': 'never'} cb = lambda: self.client.parity_set_account_meta(address, metadata) self.mock(cb, True) def test_parity_set_account_name(self): address = '0xdae1bfb92c7c0fd23396619ee1a0d643bf609c2e' name = 'name' cb = lambda: self.client.parity_set_account_name(address, name) self.mock(cb, True) def test_parity_set_dapp_addresses(self): dapp = 'web' address = '0xdae1bfb92c7c0fd23396619ee1a0d643bf609c2e' cb = lambda: self.client.parity_set_dapp_addresses(dapp, address) self.mock(cb, True) def test_parity_set_dapp_default_address(self): dapp = 'web' address = '0xdae1bfb92c7c0fd23396619ee1a0d643bf609c2e' cb = lambda: self.client.parity_set_dapp_default_address(dapp, address) self.mock(cb, True) def test_parity_set_new_dapps_addresses(self): address = '0xdae1bfb92c7c0fd23396619ee1a0d643bf609c2e' cb = lambda: self.client.parity_set_new_dapps_addresses(address) self.mock(cb, True) def test_parity_set_new_dapps_default_address(self): address = '0xdae1bfb92c7c0fd23396619ee1a0d643bf609c2e' cb = lambda: self.client.parity_set_new_dapps_default_address(address) self.mock(cb, True) def test_parity_test_password(self): address = '0xdae1bfb92c7c0fd23396619ee1a0d643bf609c2e' password = 'password' cb = lambda: self.client.parity_test_password(address, password) self.mock(cb, True)
39.448529
92
0.704753
603
5,365
5.960199
0.109453
0.046745
0.086811
0.1202
0.776016
0.718698
0.643851
0.565665
0.503617
0.374235
0
0.095878
0.20876
5,365
135
93
39.740741
0.750766
0
0
0.458716
0
0
0.167754
0.134203
0
0
0.134203
0
0
1
0.220183
false
0.192661
0.027523
0
0.256881
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
1
0
1
0
0
0
0
0
3
63a75ebd32da30f3a8d2044144db3a414d9879d2
265
py
Python
api/serializers.py
MarcelIrawan/django-template
03944f99979c303ee364b24385aa827a739cadf0
[ "MIT" ]
1
2020-11-28T12:55:56.000Z
2020-11-28T12:55:56.000Z
api/serializers.py
MarcelIrawan/django-template
03944f99979c303ee364b24385aa827a739cadf0
[ "MIT" ]
null
null
null
api/serializers.py
MarcelIrawan/django-template
03944f99979c303ee364b24385aa827a739cadf0
[ "MIT" ]
null
null
null
from rest_framework import serializers from .models import CustomUser class UserSerializer(serializers.ModelSerializer): """ Serilizer for user """ class Meta: model = CustomUser # fields = '__all__' fields = ['id','email']
22.083333
50
0.649057
25
265
6.68
0.76
0
0
0
0
0
0
0
0
0
0
0
0.256604
265
12
51
22.083333
0.847716
0.143396
0
0
0
0
0.033019
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
63b34b23e85c1cc079fa60870ca4a94cacd21c1e
10
py
Python
venv/lib/python3.8/site-packages/spaceone/tester/conf/global_conf.py
choonho/plugin-prometheus-mon-webhook
afa7d65d12715fd0480fb4f92a9c62da2d6128e0
[ "Apache-2.0" ]
null
null
null
venv/lib/python3.8/site-packages/spaceone/tester/conf/global_conf.py
choonho/plugin-prometheus-mon-webhook
afa7d65d12715fd0480fb4f92a9c62da2d6128e0
[ "Apache-2.0" ]
null
null
null
venv/lib/python3.8/site-packages/spaceone/tester/conf/global_conf.py
choonho/plugin-prometheus-mon-webhook
afa7d65d12715fd0480fb4f92a9c62da2d6128e0
[ "Apache-2.0" ]
null
null
null
LOG = { }
3.333333
7
0.3
1
10
3
1
0
0
0
0
0
0
0
0
0
0
0
0.4
10
2
8
5
0.5
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
63c122508ef3b38e3a6c1356ea1d1720457824fb
77
py
Python
Set/1.Create-Define-a-aset.py
manish1822510059/Python-1000-program
d03c1920fe63a7e32ac5bd9a13e2766d7a25756c
[ "Apache-2.0" ]
1
2021-03-06T03:33:42.000Z
2021-03-06T03:33:42.000Z
Set/1.Create-Define-a-aset.py
manish1822510059/Python-1000-programs
d03c1920fe63a7e32ac5bd9a13e2766d7a25756c
[ "Apache-2.0" ]
null
null
null
Set/1.Create-Define-a-aset.py
manish1822510059/Python-1000-programs
d03c1920fe63a7e32ac5bd9a13e2766d7a25756c
[ "Apache-2.0" ]
null
null
null
myset ={"C","C++","Python","Shap","Ruby","Java"} print("Set Content:",myset)
38.5
49
0.584416
11
77
4.090909
0.818182
0
0
0
0
0
0
0
0
0
0
0
0.051948
77
2
50
38.5
0.616438
0
0
0
0
0
0.441558
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
3
63c65035704dd82d0e35220cf5d131d497f11b32
133
py
Python
output/models/sun_data/attr_decl/ad_name/ad_name00110m/ad_name00110m7_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
1
2021-08-14T17:59:21.000Z
2021-08-14T17:59:21.000Z
output/models/sun_data/attr_decl/ad_name/ad_name00110m/ad_name00110m7_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
4
2020-02-12T21:30:44.000Z
2020-04-15T20:06:46.000Z
output/models/sun_data/attr_decl/ad_name/ad_name00110m/ad_name00110m7_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
null
null
null
from output.models.sun_data.attr_decl.ad_name.ad_name00110m.ad_name00110m7_xsd.ad_name00110m7 import Root __all__ = [ "Root", ]
22.166667
105
0.796992
20
133
4.75
0.75
0.273684
0
0
0
0
0
0
0
0
0
0.142857
0.105263
133
5
106
26.6
0.655462
0
0
0
0
0
0.030075
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
63d731aa59cc13a2b71fa76d81924363872807c5
1,125
py
Python
tests/102_projectstarter/002_validate.py
Sam-prog-sudo/boussole
5d6ec94356f9a91ff4d6d23c1700d3512b67006a
[ "MIT" ]
13
2016-05-19T15:18:41.000Z
2022-03-22T15:37:32.000Z
tests/102_projectstarter/002_validate.py
Sam-prog-sudo/boussole
5d6ec94356f9a91ff4d6d23c1700d3512b67006a
[ "MIT" ]
38
2016-04-07T00:30:58.000Z
2022-02-28T13:29:33.000Z
tests/102_projectstarter/002_validate.py
Sam-prog-sudo/boussole
5d6ec94356f9a91ff4d6d23c1700d3512b67006a
[ "MIT" ]
3
2016-05-20T09:21:57.000Z
2020-10-12T10:56:49.000Z
# -*- coding: utf-8 -*- import pytest from boussole.exceptions import SettingsInvalidError @pytest.mark.parametrize("paths", [ ( '/home/foo', '/home/bar', ), ( '/home', '/home/bar', '/var/lib', ), ( '/home', '/home/bar', '/home/bar.gif', '/var/lib', ), ]) def test_ok(projectstarter, paths): """ validate various correct paths """ assert projectstarter('json').valid_paths(*paths) @pytest.mark.parametrize("paths", [ ( '/home/foo', '/home/bar', '/home/foo', ), ( '/home/foo', '/home/bar', '/home/foo', '/home/foo', ), ( '/home/foo', '/home/bar', '/home/foo', '/home/bar', ), ( '/home/foo', '/home/bar', '/home/bar', '/home/foo', '/var/lib', '/var/lib', ), ]) def test_wrong(projectstarter, paths): """ fail on duplicated paths """ with pytest.raises(SettingsInvalidError): projectstarter('json').valid_paths(*paths)
17.578125
53
0.458667
102
1,125
5.019608
0.333333
0.136719
0.193359
0.164063
0.451172
0.322266
0.322266
0.322266
0.322266
0
0
0.001359
0.345778
1,125
63
54
17.857143
0.694293
0.069333
0
0.705882
0
0
0.240157
0
0
0
0
0
0.019608
1
0.039216
false
0
0.039216
0
0.078431
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
892b5e79e284470ebd59bd46fdb143b8b121f246
670
py
Python
solutions/p015.py
xianlinfeng/project_euler_python3
77eca44eb2b1d13bc70d6dc0258b737449d43a23
[ "MIT" ]
2
2019-12-10T17:10:02.000Z
2020-07-04T10:30:19.000Z
p015.py
pranayjoshi/projecteuler
238a7844654e214dff9c2f8b596af470b828113c
[ "Apache-2.0" ]
null
null
null
p015.py
pranayjoshi/projecteuler
238a7844654e214dff9c2f8b596af470b828113c
[ "Apache-2.0" ]
1
2020-01-13T17:44:40.000Z
2020-01-13T17:44:40.000Z
# # Solution to Project Euler problem 15 # Copyright (c) Project Nayuki. All rights reserved. # # https://www.nayuki.io/page/project-euler-solutions # https://github.com/nayuki/Project-Euler-solutions # import eulerlib # This is a classic combinatorics problem. To get from the top left corner to the bottom right corner of an N*N grid, # it involves making exactly N moves right and N moves down in some order. Because each individual down or right move # is indistinguishable, there are exactly 2N choose N (binomial coefficient) ways of arranging these moves. def compute(): return str(eulerlib.binomial(40, 20)) if __name__ == "__main__": print(compute())
31.904762
117
0.758209
102
670
4.901961
0.715686
0.072
0.084
0
0
0
0
0
0
0
0
0.012389
0.156716
670
20
118
33.5
0.872566
0.78806
0
0
0
0
0.061538
0
0
0
0
0
0
1
0.2
true
0
0.2
0.2
0.6
0.2
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
1
1
0
0
3
8931f5e36e69dfcbd54c87e3f84f28cc88a8724d
2,509
py
Python
pyomrx/tests/test_examples.py
ShaunHowell/py-omrx
dc76a2a286488de1ad1fe131ca552f556583b0b3
[ "X11" ]
null
null
null
pyomrx/tests/test_examples.py
ShaunHowell/py-omrx
dc76a2a286488de1ad1fe131ca552f556583b0b3
[ "X11" ]
5
2021-03-31T20:44:39.000Z
2022-02-16T10:54:11.000Z
pyomrx/tests/test_examples.py
ShaunHowell/py-omrx
dc76a2a286488de1ad1fe131ca552f556583b0b3
[ "X11" ]
null
null
null
import os import pytest from pathlib import Path from pyomrx.core.form_maker import FormMaker from pyomrx.core.omr_factory import OmrFactory import pandas as pd from pyomrx.utils.test_utils import * def test_attendance_register_example(request, res_folder): attendance_example_folder = Path('examples/attendance_register/') excel_file_path = attendance_example_folder / 'example attendance register.xlsx' def delete_temp_files(): for path in attendance_example_folder.iterdir(): if str(path) == str(excel_file_path): continue os.remove(str(path)) request.addfinalizer(delete_temp_files) omr_file_path = attendance_example_folder / 'example attendance register.omr' example_output_file_path = attendance_example_folder / 'example_output.csv' form_maker = FormMaker(str(excel_file_path), str(omr_file_path)) form_maker.make_form() omr_factory = OmrFactory.from_omr_file(str(omr_file_path)) omr_factory.process_images_folder( str(attendance_example_folder), str(example_output_file_path)) correct_result_path = Path( res_folder ) / 'correct_examples_answers/correct_result_attendance_register.csv' correct_df = pd.read_csv(str(correct_result_path)) df = pd.read_csv(str(example_output_file_path)) assert_correct_result(df, correct_df) def test_exam_form_example(request, res_folder): exam_example_folder = Path('examples/example_exam_score_form/') excel_file_path = exam_example_folder / 'example exam score form.xlsx' def delete_temp_files(): for path in exam_example_folder.iterdir(): if str(path) == str(excel_file_path): continue os.remove(str(path)) request.addfinalizer(delete_temp_files) omr_file_path = exam_example_folder / 'example exam score form.omr' example_output_file_path = exam_example_folder / 'example_output.csv' form_maker = FormMaker(str(excel_file_path), str(omr_file_path)) form_maker.make_form() omr_factory = OmrFactory.from_omr_file(str(omr_file_path)) omr_factory.process_images_folder( str(exam_example_folder), str(example_output_file_path)) correct_result_path = Path( res_folder) / 'correct_examples_answers/correct_result_exam_form.csv' correct_df = pd.read_csv(str(correct_result_path)) df = pd.read_csv(str(example_output_file_path)) assert_correct_result(df, correct_df) if __name__ == '__main__': pytest.main(['-s'])
39.825397
84
0.749701
342
2,509
5.064327
0.166667
0.083141
0.079677
0.072748
0.747113
0.728637
0.711316
0.711316
0.615473
0.568129
0
0
0.165803
2,509
62
85
40.467742
0.82752
0
0
0.5
0
0
0.136309
0.070945
0
0
0
0
0.038462
1
0.076923
false
0
0.134615
0
0.211538
0
0
0
0
null
0
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
895398c9cdc502909c0f77aea4669469831c7687
169
py
Python
application/__init__.py
amcodec1/Flask-aws-app
205aed34629c345ea82d6228be2c6bf47d6686ef
[ "MIT" ]
1
2017-08-10T06:45:51.000Z
2017-08-10T06:45:51.000Z
application/__init__.py
amcodec1/Flask-aws-app
205aed34629c345ea82d6228be2c6bf47d6686ef
[ "MIT" ]
null
null
null
application/__init__.py
amcodec1/Flask-aws-app
205aed34629c345ea82d6228be2c6bf47d6686ef
[ "MIT" ]
null
null
null
from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy application = Flask(__name__) application.config.from_object('config') db = SQLAlchemy(application)
24.142857
43
0.822485
21
169
6.380952
0.47619
0.134328
0
0
0
0
0
0
0
0
0
0
0.094675
169
6
44
28.166667
0.875817
0
0
0
0
0
0.035503
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
8960f936e80553661cf0be04471dadc4290fc3b4
976
py
Python
src/zeo_connector_defaults/__init__.py
Bystroushaak/zeo_connector_defaults
b54ecb99ddb4665db00fba183ef1d7252b0ca62b
[ "MIT" ]
null
null
null
src/zeo_connector_defaults/__init__.py
Bystroushaak/zeo_connector_defaults
b54ecb99ddb4665db00fba183ef1d7252b0ca62b
[ "MIT" ]
null
null
null
src/zeo_connector_defaults/__init__.py
Bystroushaak/zeo_connector_defaults
b54ecb99ddb4665db00fba183ef1d7252b0ca62b
[ "MIT" ]
null
null
null
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Interpreter version: python 2.7 # # Imports ===================================================================== import os.path from environment_generator import tmp_context from environment_generator import tmp_context_name from environment_generator import generate_environment from environment_generator import cleanup_environment # Functions =================================================================== def _in_path(fn, dirname="default_data"): pwd = os.path.dirname(__file__) return os.path.join(os.path.abspath(pwd), dirname, fn) # Variables =================================================================== SERVER_CONF_PATH = _in_path(fn="zeo.conf", dirname="default_data") CLIENT_CONF_PATH = _in_path(fn="zeo_client.conf", dirname="default_data") _SERVER_CONF_PATH = _in_path(fn="zeo.conf", dirname="template_data") _CLIENT_CONF_PATH = _in_path(fn="zeo_client.conf", dirname="template_data")
34.857143
79
0.615779
111
976
5.054054
0.369369
0.053476
0.071301
0.213904
0.434938
0.434938
0.292335
0.292335
0.292335
0.163993
0
0.003359
0.085041
976
27
80
36.148148
0.62486
0.316598
0
0
0
0
0.163885
0
0
0
0
0
0
1
0.083333
false
0
0.416667
0
0.583333
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
8961ecebf2ca4b4e071b2aa1e8778032bdcb8a52
576
py
Python
AST/block.py
CorentinGoet/miniC-Compiler
8631b1ce47e9de1c3a3255d7c0a941242ad48292
[ "MIT" ]
null
null
null
AST/block.py
CorentinGoet/miniC-Compiler
8631b1ce47e9de1c3a3255d7c0a941242ad48292
[ "MIT" ]
null
null
null
AST/block.py
CorentinGoet/miniC-Compiler
8631b1ce47e9de1c3a3255d7c0a941242ad48292
[ "MIT" ]
null
null
null
""" @author Corentin Goetghebeur (github.com/CorentinGoet) """ from AST.node import Node class Block(Node): """ Class representation for the Block node. The Block node has the following syntax: Block = {Statements} """ def __init__(self, statements: list = None): """ Constructor for the Block node. :param statements: list of Statements nodes """ self.statements = statements def accept(self, visitor): visitor.visitBlock(self) def get_statements(self): return self.statements
18.580645
54
0.631944
63
576
5.698413
0.52381
0.100279
0.100279
0.083565
0
0
0
0
0
0
0
0
0.274306
576
30
55
19.2
0.858852
0.409722
0
0
0
0
0
0
0
0
0
0
0
1
0.375
false
0
0.125
0.125
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
9828b45924c30d21484d0de726dd951478e26894
1,157
py
Python
tests/queues_test.py
Cormen-Lib-Developers/Cormen-Lib
7877f1180cb76b56c909b70a35d85af8a83e530a
[ "MIT" ]
8
2022-01-24T00:34:59.000Z
2022-03-15T01:34:51.000Z
tests/queues_test.py
Cormen-Lib-Developers/Cormen-Lib
7877f1180cb76b56c909b70a35d85af8a83e530a
[ "MIT" ]
8
2022-02-09T22:07:35.000Z
2022-03-17T16:23:08.000Z
tests/queues_test.py
Cormen-Lib-Developers/Cormen-Lib
7877f1180cb76b56c909b70a35d85af8a83e530a
[ "MIT" ]
null
null
null
import unittest from dalpy.queues import Queue, QueueUnderflowError class QueueTest(unittest.TestCase): def test_init(self): q = Queue() self.assertTrue(q.is_empty()) self.assertEqual(q.size(), 0) def test_empty_ops(self): q = Queue() self.assertRaises(QueueUnderflowError, lambda: q.front()) self.assertRaises(QueueUnderflowError, lambda: q.dequeue()) def test_enqueue(self): q = Queue() q.enqueue(2) self.assertEqual(q.front(), 2) self.assertEqual(q.size(), 1) self.assertFalse(q.is_empty()) def test_enqueue_dequeue(self): q = Queue() q.enqueue(2) self.assertEqual(q.dequeue(), 2) self.assertEqual(q.size(), 0) self.assertTrue(q.is_empty()) def test_many_enqueue(self): q = Queue() for i in range(3): q.enqueue(i) self.assertEqual(q.front(), 0) for i in range(3): self.assertEqual(q.front(), i) self.assertEqual(q.dequeue(), i) self.assertEqual(q.size(), 3 - i - 1) if __name__ == '__main__': unittest.main()
26.295455
67
0.581677
143
1,157
4.573427
0.272727
0.206422
0.220183
0.122324
0.470948
0.107034
0.107034
0.107034
0.107034
0
0
0.01444
0.281763
1,157
43
68
26.906977
0.772563
0
0
0.382353
0
0
0.006914
0
0
0
0
0
0.411765
1
0.147059
false
0
0.058824
0
0.235294
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
1
0
0
0
0
0
0
0
0
0
3
982afcb70f3962008c7930849e69e44a06c6f4d3
57
py
Python
app/__init__.py
martyni/jenkins_test
5e941d025531f6c3d2eaab99433a35b4d3561dfd
[ "MIT" ]
null
null
null
app/__init__.py
martyni/jenkins_test
5e941d025531f6c3d2eaab99433a35b4d3561dfd
[ "MIT" ]
null
null
null
app/__init__.py
martyni/jenkins_test
5e941d025531f6c3d2eaab99433a35b4d3561dfd
[ "MIT" ]
null
null
null
__version__="v.0.0.1" def main(): print("I'm an app")
14.25
22
0.596491
12
57
2.5
0.916667
0
0
0
0
0
0
0
0
0
0
0.0625
0.157895
57
3
23
19
0.5625
0
0
0
0
0
0.298246
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.333333
0.333333
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
3
9835c7cc4a39384752be9935949cb467e753607d
3,318
py
Python
tests.py
kylefox/openmerch
eee28c67789fcc053031a1e15addf366316e8590
[ "BSD-3-Clause" ]
1
2016-05-08T18:18:53.000Z
2016-05-08T18:18:53.000Z
tests.py
kylefox/openmerch
eee28c67789fcc053031a1e15addf366316e8590
[ "BSD-3-Clause" ]
1
2021-02-05T02:55:02.000Z
2021-02-05T02:59:45.000Z
tests.py
kylefox/openmerch
eee28c67789fcc053031a1e15addf366316e8590
[ "BSD-3-Clause" ]
1
2021-07-13T07:16:05.000Z
2021-07-13T07:16:05.000Z
from gateways.authorizenet import AuthorizeNet from creditcard import CreditCard from datetime import datetime LOGIN = '' PASSWORD = '' def setup_authorize(): options = { 'order_id': '1', 'description': 'Test of AUTH code', 'email': 'john@doe.com', 'customer': '947', 'ip': '192.168.1.1', } billing_address = { 'address1': '444 Main St.', 'company': 'ACME Software', 'phone': '222-222-2222', 'zip': '77777', 'city': 'Dallas', 'country': 'USA', 'state': 'TX' } options['billing_address'] = billing_address return options def setup_purchase(): options = { 'order_id': '1', 'description': 'Test of AUTH code', 'email': 'john@doe.com', 'customer': '947', 'ip': '192.168.1.1', } billing_address = { 'address1': '444 Main St.', 'company': 'ACME Software', 'phone': '222-222-2222', 'zip': '77777', 'city': 'Dallas', 'country': 'USA', 'state': 'TX' } options['billing_address'] = billing_address return options def setup_capture(): options = { 'email': 'john@doe.com', 'customer': '947', 'ip': '192.168.1.1', } return options def setup_void(): pass def setup_credit(): options = { 'order_id': '1', 'description': 'Test of AUTH code', } return options def setup_subscribe(): interval = { 'length': '1', 'unit': 'months' } duration = { 'start_date': datetime.now().strftime("%Y-%m-%d"), 'occurrences': '2' } billing_address = { 'first_name': 'Mal', 'last_name': 'Reynolds' } options = { 'interval': interval, 'duration': duration, 'billing_address': billing_address, 'login': LOGIN, 'password': PASSWORD } cc = CreditCard('4111111111111111', 6, 2010, 'visa', '', '') return cc, options def setup_update(): duration = { 'start_date': datetime.now().strftime("%Y-%m-%d"), 'occurrences': '3' } billing_address = { 'first_name': 'Mal', 'last_name': 'Reynolds' } options = { 'duration': duration, 'billing_address': billing_address, 'login': LOGIN, 'password': PASSWORD } cc = CreditCard('4111111111111111', 6, 2010, 'visa', '', '') return cc, options #integration tests def subscribe(): cc, options = setup_subscribe() gateway = AuthorizeNet(options, gateway_mode='test') result = gateway.recurring('100', cc, **options) print unicode(result) return result['subscriptionId'] def update_subscription(sub_id=None): cc, options = setup_update() options['subscription_id'] = sub_id gateway = AuthorizeNet(options, gateway_mode='test') result = gateway.update_recurring('100', cc, **options) print unicode(result) def cancel_subscription(sub_id=None): cc, options = setup_subscribe() gateway = AuthorizeNet(options, gateway_mode='test') result = gateway.cancel_recurring(sub_id) print unicode(result) if __name__ == '__main__': sub_id = subscribe() update_subscription(sub_id) cancel_subscription(sub_id)
22.418919
64
0.566004
339
3,318
5.374631
0.286136
0.092206
0.041164
0.061471
0.726674
0.726674
0.726674
0.653128
0.623491
0.54775
0
0.052323
0.279988
3,318
147
65
22.571429
0.710339
0.005124
0
0.618644
0
0
0.230303
0
0
0
0
0
0
0
null
null
0.033898
0.025424
null
null
0.025424
0
0
0
null
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
3
984957707b9c7d7b3eba54240e2b89bd9acc85f0
1,645
py
Python
restaurant_project/sales/models.py
deepaksood619/Projects
93f09db22ad65e72e2a2ffc909b2bb3e1e5c5fa7
[ "MIT" ]
null
null
null
restaurant_project/sales/models.py
deepaksood619/Projects
93f09db22ad65e72e2a2ffc909b2bb3e1e5c5fa7
[ "MIT" ]
5
2021-03-19T03:52:50.000Z
2022-02-10T11:43:51.000Z
sales/models.py
deepchatterjeevns/SmartQHiringChallenge
1151e8ac69325461179a7c15dec2e7709b811a74
[ "MIT" ]
null
null
null
from datetime import time, datetime from django.db import models # Create your models here. class FoodAvailabilityTimings(models.Model): shift_name = models.CharField(max_length=255, unique=True, blank=False, null=False) start_time = models.TimeField(default=time(hour=0, minute=0)) end_time = models.TimeField(default=time(hour=23, minute=59)) def __str__(self): return f'{self.shift_name}' class Food(models.Model): item_name = models.CharField(max_length=255, unique=True, blank=False, null=False) available_time = models.ManyToManyField(to=FoodAvailabilityTimings, blank=False) price = models.PositiveIntegerField(blank=False, null=False) def __str__(self): return f'{self.item_name}' class Restaurant(models.Model): name = models.CharField(max_length=255, unique=True, blank=False, null=False) def __str__(self): return f'{self.name}' class Order(models.Model): food = models.ForeignKey(Food, blank=False, null=False, on_delete=models.CASCADE) quantity = models.PositiveIntegerField(blank=False, null=False) def __str__(self): return f'{self.food}' class OrderedItems(models.Model): order_id = models.CharField(max_length=255, unique=True, blank=False, null=False) restaurant = models.ForeignKey(to=Restaurant, blank=False, null=False, on_delete=models.CASCADE) items = models.ManyToManyField(to=Order, blank=False) bill_amount = models.PositiveIntegerField(blank=False, null=False) timestamp = models.DateTimeField(default=datetime.now, blank=False, null=False) def __str__(self): return f'{self.order_id}'
33.571429
100
0.731915
215
1,645
5.432558
0.27907
0.10274
0.119863
0.162671
0.550514
0.550514
0.435788
0.435788
0.367295
0.367295
0
0.012857
0.148936
1,645
48
101
34.270833
0.821429
0.01459
0
0.16129
0
0
0.043237
0
0
0
0
0
0
1
0.16129
false
0
0.064516
0.16129
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
3
98861ad043d727327fb39c7ecee6e55bdc8d3211
311
py
Python
project/stocks/__init__.py
YellowFlash2012/stock-portfolio-io
0a39c9a692aecc8d6b39e728efd63061112bc975
[ "MIT" ]
null
null
null
project/stocks/__init__.py
YellowFlash2012/stock-portfolio-io
0a39c9a692aecc8d6b39e728efd63061112bc975
[ "MIT" ]
null
null
null
project/stocks/__init__.py
YellowFlash2012/stock-portfolio-io
0a39c9a692aecc8d6b39e728efd63061112bc975
[ "MIT" ]
null
null
null
""" The stocks blueprint handles the user management for this application. Specifically, this blueprint allows for users to add, edit, and delete stock data from their portfolio. """ from flask import Blueprint stocks_blueprint = Blueprint('stocks', __name__, template_folder='templates') from . import routes
31.1
77
0.794212
41
311
5.878049
0.707317
0.124481
0
0
0
0
0
0
0
0
0
0
0.135048
311
10
78
31.1
0.895911
0.559486
0
0
0
0
0.115385
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0.666667
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
1
0
3
98aa1c3ed547c9ca4fbd19509bd3c22693bda976
389
py
Python
Section4/appcode/security.py
ntnshrm87/FlaskDevTest
f5af6c57280950eb56b735476ab38953d1c25033
[ "MIT" ]
null
null
null
Section4/appcode/security.py
ntnshrm87/FlaskDevTest
f5af6c57280950eb56b735476ab38953d1c25033
[ "MIT" ]
null
null
null
Section4/appcode/security.py
ntnshrm87/FlaskDevTest
f5af6c57280950eb56b735476ab38953d1c25033
[ "MIT" ]
null
null
null
from werkzeug.security import safe_str_cmp from appcode.models.user import UserModel # Function to authenticate the user def authenticate(username, password): user = UserModel.find_by_username(username) if user and safe_str_cmp(UserModel.password, password): return user def identity(payload): user_id = payload['identity'] return UserModel.find_by_id(user_id)
25.933333
59
0.768638
53
389
5.45283
0.490566
0.048443
0.069204
0
0
0
0
0
0
0
0
0
0.159383
389
14
60
27.785714
0.883792
0.084833
0
0
0
0
0.022599
0
0
0
0
0
0
1
0.222222
false
0.222222
0.222222
0
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
3
98b4ddc8a925b89655f9356aeabab166b6a518d9
113
py
Python
erpnext_biotrack/__init__.py
webonyx/erpnext_biotrack
eb2384a6c3fda84a91c81c959f095a5386a89665
[ "MIT" ]
11
2017-05-29T23:35:21.000Z
2022-03-12T04:29:21.000Z
erpnext_biotrack/__init__.py
webonyx/erpnext_biotrack
eb2384a6c3fda84a91c81c959f095a5386a89665
[ "MIT" ]
1
2016-12-11T16:58:36.000Z
2016-12-11T16:58:36.000Z
erpnext_biotrack/__init__.py
webonyx/erpnext_biotrack
eb2384a6c3fda84a91c81c959f095a5386a89665
[ "MIT" ]
14
2016-12-17T11:01:03.000Z
2021-11-01T10:21:45.000Z
# -*- coding: utf-8 -*- from __future__ import unicode_literals __version__ = "0.0.1" __title__ = "Traceability"
22.6
39
0.716814
14
113
4.857143
0.928571
0
0
0
0
0
0
0
0
0
0
0.040816
0.132743
113
5
40
22.6
0.653061
0.185841
0
0
0
0
0.186813
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
98b4ea7878ad705aedb7d3edb6e3d8b9abcf6219
612
py
Python
fora/models/user.py
WayStudios/fora
1dea5fadeb0e8245a48c547d0c5b260e888583e5
[ "BSD-3-Clause" ]
null
null
null
fora/models/user.py
WayStudios/fora
1dea5fadeb0e8245a48c547d0c5b260e888583e5
[ "BSD-3-Clause" ]
null
null
null
fora/models/user.py
WayStudios/fora
1dea5fadeb0e8245a48c547d0c5b260e888583e5
[ "BSD-3-Clause" ]
null
null
null
# fora # class UserModel # Xu [xw901103@gmail.com] Copyright 2015 from fora.core.model import Model from sqlalchemy import ( Column, Integer, Boolean, String, DateTime ) class UserModel(Model): __tablename__ = 'users' id = Column(Integer, primary_key = True, autoincrement = True) uuid = Column(String, unique = True) email_address = Column(String, unique = True) username = Column(String, unique = True) password = Column(String) is_active = Column(Boolean) is_deleted = Column(Boolean) create_date = Column(DateTime) update_date = Column(DateTime)
24.48
66
0.687908
71
612
5.788732
0.535211
0.116788
0.131387
0.160584
0
0
0
0
0
0
0
0.020877
0.21732
612
24
67
25.5
0.837161
0.096405
0
0
0
0
0.009107
0
0
0
0
0
0
1
0
false
0.052632
0.105263
0
0.684211
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
3
7f27580713d4e95daa65183a504423139e12ff45
33,823
py
Python
tests/integration/test_web.py
raiden-network/raiden-wizard
faea0f3075b748b6a1e204518e84b0fd1950d5b5
[ "MIT" ]
9
2020-05-27T12:19:29.000Z
2022-03-20T05:55:36.000Z
tests/integration/test_web.py
raiden-network/raiden-wizard
faea0f3075b748b6a1e204518e84b0fd1950d5b5
[ "MIT" ]
178
2020-02-26T17:03:22.000Z
2021-12-28T14:21:00.000Z
tests/integration/test_web.py
raiden-network/raiden-wizard
faea0f3075b748b6a1e204518e84b0fd1950d5b5
[ "MIT" ]
9
2020-03-30T13:35:28.000Z
2022-03-01T17:24:20.000Z
import asyncio import json import os from unittest.mock import patch import pytest from eth_utils import encode_hex, to_canonical_address, to_checksum_address from tornado.httpclient import HTTPRequest from tornado.websocket import websocket_connect from raiden_installer import load_settings from raiden_installer.account import find_keystore_folder_path from raiden_installer.base import RaidenConfigurationFile from raiden_installer.ethereum_rpc import Infura, make_web3_provider from raiden_installer.network import Network from raiden_installer.raiden import RaidenClient from raiden_installer.shared_handlers import get_passphrase, set_passphrase from raiden_installer.tokens import ETH, Erc20Token, EthereumAmount, TokenAmount, Wei from raiden_installer.transactions import get_token_balance, get_token_deposit from raiden_installer.utils import TransactionTimeoutError from raiden_installer.web import get_app from raiden_installer.web_testnet import get_app as get_app_testnet from tests.constants import TESTING_TEMP_FOLDER from tests.fixtures import create_account, test_account, test_password from tests.utils import empty_account INFURA_PROJECT_ID = os.getenv("TEST_RAIDEN_INSTALLER_INFURA_PROJECT_ID") UNLOCK_PAGE_HEADLINE = "<h2>Unlock your Raiden Account</h2>" pytestmark = pytest.mark.skipif(not INFURA_PROJECT_ID, reason="missing configuration for infura") def successful_html_response(response): return response.code == 200 and response.headers["Content-Type"] == "text/html; charset=UTF-8" def successful_json_response(response): return (response.code == 200 and response.headers["Content-Type"] == "application/json") def is_unlock_page(body): return UNLOCK_PAGE_HEADLINE in body.decode("utf-8") def check_balances(w3, account, settings, check_func): balance = account.get_ethereum_balance(w3) service_token = Erc20Token.find_by_ticker(settings.service_token.ticker, settings.network) udc_balance = get_token_deposit(w3, account, service_token) transfer_token = Erc20Token.find_by_ticker(settings.transfer_token.ticker, settings.network) transfer_token_balance = get_token_balance(w3, account, transfer_token) return ( check_func(balance.as_wei) and check_func(udc_balance.as_wei) and check_func(transfer_token_balance.as_wei) ) class SharedHandlersTests: @pytest.fixture def infura(self, test_account, network_name): assert INFURA_PROJECT_ID network = Network.get_by_name(network_name) return Infura.make(network, INFURA_PROJECT_ID) @pytest.fixture def settings(self, settings_name): return load_settings(settings_name) @pytest.fixture def patch_config_folder(self, monkeypatch): monkeypatch.setattr( RaidenConfigurationFile, "FOLDER_PATH", TESTING_TEMP_FOLDER.joinpath("config") ) @pytest.fixture def config(self, patch_config_folder, test_account, infura, settings): config = RaidenConfigurationFile( test_account.keystore_file_path, settings, infura.url, ) config.save() yield config config.path.unlink() @pytest.fixture def unlocked(self, test_password): set_passphrase(test_password) yield set_passphrase(None) @pytest.fixture def ws_client(self, http_client, http_port): loop = asyncio.get_event_loop() url = f"ws://localhost:{http_port}/ws" client = loop.run_until_complete(websocket_connect(url)) yield client client.close() for task in asyncio.all_tasks(loop): task.cancel() @pytest.mark.gen_test def test_index_handler(self, http_client, base_url): response = yield http_client.fetch(base_url) assert successful_html_response(response) @pytest.mark.gen_test def test_home_handler(self, http_client, base_url): response = yield http_client.fetch(f"{base_url}/home") assert successful_html_response(response) @pytest.mark.gen_test def test_terms_handler(self, http_client, base_url): response = yield http_client.fetch(f"{base_url}/terms") assert successful_html_response(response) @pytest.mark.gen_test def test_create_wallet_handler(self, http_client, base_url): response = yield http_client.fetch(f"{base_url}/create_wallet") assert successful_html_response(response) @pytest.mark.gen_test def test_setup_handler(self, http_client, base_url, test_account): response = yield http_client.fetch(f"{base_url}/setup/{test_account.keystore_file_path}") assert successful_html_response(response) @pytest.mark.gen_test def test_account_handler(self, http_client, base_url, config, unlocked): response = yield http_client.fetch(f"{base_url}/account/{config.file_name}") assert successful_html_response(response) assert not is_unlock_page(response.body) @pytest.mark.gen_test def test_locked_account_handler(self, http_client, base_url, config): response = yield http_client.fetch(f"{base_url}/account/{config.file_name}") assert successful_html_response(response) assert is_unlock_page(response.body) @pytest.mark.gen_test def test_launch_handler(self, http_client, base_url, config, unlocked): response = yield http_client.fetch(f"{base_url}/launch/{config.file_name}") assert successful_html_response(response) assert not is_unlock_page(response.body) @pytest.mark.gen_test def test_locked_launch_handler(self, http_client, base_url, config): response = yield http_client.fetch(f"{base_url}/launch/{config.file_name}") assert successful_html_response(response) assert is_unlock_page(response.body) @pytest.mark.gen_test def test_keystore_handler(self, http_client, base_url, test_account, config): response = yield http_client.fetch( f"{base_url}/keystore/{config.file_name}/{test_account.keystore_file_path.name}" ) json_response = json.loads(response.body) assert successful_json_response(response) assert to_canonical_address(json_response["address"]) == test_account.address @pytest.mark.gen_test(timeout=10) def test_gas_price_handler(self, http_client, base_url, config): response = yield http_client.fetch( f"{base_url}/gas_price/{config.file_name}" ) json_response = json.loads(response.body) assert successful_json_response(response) assert json_response["gas_price"] > 0 @pytest.mark.gen_test def test_configuration_item_handler(self, http_client, base_url, config): response = yield http_client.fetch( f"{base_url}/api/configuration/{config.file_name}" ) json_response = json.loads(response.body) assert successful_json_response(response) assert json_response["file_name"] == config.file_name assert to_canonical_address(json_response["account"]) == config.account.address assert json_response["network"] == config.network.name assert json_response["balance"]["ETH"]["as_wei"] == 0 assert json_response["balance"]["service_token"]["as_wei"] == 0 assert json_response["balance"]["transfer_token"]["as_wei"] == 0 # Websocket methods tests @pytest.mark.gen_test def test_create_wallet(self, ws_client, test_password, test_account): with patch( "raiden_installer.account.Account.create", return_value=test_account ) as mock_create_account: data = { "method": "create_wallet", "passphrase1": test_password, "passphrase2": test_password } ws_client.write_message(json.dumps(data)) message = json.loads((yield ws_client.read_message())) assert message["type"] == "status-update" message = json.loads((yield ws_client.read_message())) assert message["type"] == "redirect" assert message["redirect_url"] == f"/setup/{test_account.keystore_file_path}" mock_create_account.assert_called_once_with( find_keystore_folder_path(), test_password ) @pytest.mark.gen_test def test_unlock(self, ws_client, test_password, test_account): data = { "method": "unlock", "passphrase": test_password, "keystore_file_path": str(test_account.keystore_file_path), "return_to": f"/setup/{test_account.keystore_file_path}" } ws_client.write_message(json.dumps(data)) message = json.loads((yield ws_client.read_message())) assert message["type"] == "redirect" assert message["redirect_url"] == f"/setup/{test_account.keystore_file_path}" assert get_passphrase() == test_password set_passphrase(None) @pytest.mark.gen_test def test_unlock_with_wrong_passphrase(self, ws_client, test_password, test_account): data = { "method": "unlock", "passphrase": "wrong" + test_password, "keystore_file_path": str(test_account.keystore_file_path), "return_to": f"/setup/{test_account.keystore_file_path}" } ws_client.write_message(json.dumps(data)) message = json.loads((yield ws_client.read_message())) assert message["type"] == "error-message" assert get_passphrase() == None @pytest.mark.gen_test def test_setup( self, ws_client, test_account, infura, network_name, patch_config_folder, settings ): data = { "method": "setup", "endpoint": f"https://{network_name}.infura.io/v3/{infura.project_id}", "account_file": str(test_account.keystore_file_path) } ws_client.write_message(json.dumps(data)) message = json.loads((yield ws_client.read_message())) assert message["type"] == "status-update" account_address = to_checksum_address(test_account.address) config_file_name = f"config-{account_address}-{settings.name}.toml" message = json.loads((yield ws_client.read_message())) assert message["type"] == "redirect" assert message["redirect_url"] == f"/account/{config_file_name}" config = RaidenConfigurationFile.get_by_filename(config_file_name) assert config.account.keystore_file_path == test_account.keystore_file_path assert config.settings == settings assert config.ethereum_client_rpc_endpoint == infura.url assert config.routing_mode == settings.routing_mode assert config.enable_monitoring == settings.monitoring_enabled config.path.unlink() @pytest.mark.gen_test def test_setup_with_invalid_infura_url( self, ws_client, test_account, infura, patch_config_folder, settings ): data = { "method": "setup", "endpoint": f"https://invalid-network.infura.io/v3/{infura.project_id}", "account_file": str(test_account.keystore_file_path) } ws_client.write_message(json.dumps(data)) message = json.loads((yield ws_client.read_message())) assert message["type"] == "error-message" with pytest.raises(ValueError): RaidenConfigurationFile.get_by_filename( f"config-{to_checksum_address(test_account.address)}-{settings.name}.toml" ) @pytest.mark.gen_test def test_setup_with_invalid_endpoint( self, ws_client, test_account, patch_config_folder, settings ): data = { "method": "setup", "endpoint": "https://no.infura.node", "account_file": str(test_account.keystore_file_path) } ws_client.write_message(json.dumps(data)) message = json.loads((yield ws_client.read_message())) assert message["type"] == "error-message" with pytest.raises(ValueError): RaidenConfigurationFile.get_by_filename( f"config-{to_checksum_address(test_account.address)}-{settings.name}.toml" ) @pytest.mark.gen_test def test_launch(self, ws_client, config, unlocked): with patch("raiden_installer.raiden.RaidenClient.get_client") as mock_get_client: mock_client = mock_get_client() mock_client.is_installed = False mock_client.is_running = False data = { "method": "launch", "configuration_file_name": config.file_name, } ws_client.write_message(json.dumps(data)) for _ in range(3): message = json.loads((yield ws_client.read_message())) assert message["type"] == "status-update" message = json.loads((yield ws_client.read_message())) assert message["type"] == "task-complete" message = json.loads((yield ws_client.read_message())) assert message["type"] == "redirect" assert message["redirect_url"] == RaidenClient.WEB_UI_INDEX_URL mock_client.install.assert_called_once() mock_client.launch.assert_called_once() mock_client.wait_for_web_ui_ready.assert_called_once() @pytest.mark.gen_test def test_locked_launch(self, ws_client, config): with patch("raiden_installer.raiden.RaidenClient.get_client") as mock_get_client: mock_client = mock_get_client() mock_client.is_installed = False mock_client.is_running = False data = { "method": "launch", "configuration_file_name": config.file_name, } ws_client.write_message(json.dumps(data)) message = json.loads((yield ws_client.read_message())) assert message["type"] == "error-message" mock_client.install.assert_not_called() mock_client.launch.assert_not_called() mock_client.wait_for_web_ui_ready.assert_not_called() class TestWeb(SharedHandlersTests): @pytest.fixture def app(self): return get_app() @pytest.fixture def network_name(self): return "mainnet" @pytest.fixture def settings_name(self): return "mainnet" @pytest.fixture def mock_get_exchange(self): with patch("raiden_installer.token_exchange.Exchange.get_by_name") as mock_get_exchange: yield mock_get_exchange @pytest.fixture def mock_deposit_service_tokens(self): with patch( "raiden_installer.shared_handlers.deposit_service_tokens", return_value=os.urandom(32) ) as mock_deposit_service_tokens: yield mock_deposit_service_tokens @pytest.fixture def mock_wait_for_transaction(self): with patch( "raiden_installer.web.wait_for_transaction" ), patch( "raiden_installer.shared_handlers.wait_for_transaction" ): yield @pytest.mark.gen_test def test_swap_handler(self, http_client, base_url, config, settings, unlocked): response = yield http_client.fetch( f"{base_url}/swap/{config.file_name}/{settings.service_token.ticker}" ) assert successful_html_response(response) assert not is_unlock_page(response.body) @pytest.mark.gen_test def test_locked_swap_handler(self, http_client, base_url, config, settings): response = yield http_client.fetch( f"{base_url}/swap/{config.file_name}/{settings.service_token.ticker}" ) assert successful_html_response(response) assert is_unlock_page(response.body) @pytest.mark.gen_test(timeout=15) def test_cost_estimation_handler( self, http_client, base_url, config, settings, mock_get_exchange ): exchange = "Kyber" exchange_costs = { "gas_price": EthereumAmount(Wei(1000000000)), "gas": Wei(500000), "eth_sold": EthereumAmount(0.5), "total": EthereumAmount(0.505), "exchange_rate": EthereumAmount(0.05), } mock_exchange = mock_get_exchange()() mock_exchange.name = exchange mock_exchange.calculate_transaction_costs.return_value = exchange_costs currency = settings.transfer_token.ticker target_amount = 3 data = { "exchange": exchange, "currency": currency, "target_amount": target_amount, } request = HTTPRequest( url=f"{base_url}/api/cost-estimation/{config.file_name}", method="POST", body=json.dumps(data) ) response = yield http_client.fetch(request) json_response = json.loads(response.body) assert successful_json_response(response) assert json_response["exchange"] == exchange assert json_response["currency"] == currency assert json_response["target_amount"] == target_amount assert json_response["as_wei"] == exchange_costs["total"].as_wei assert json_response["formatted"] == exchange_costs["total"].formatted # Websocket methods tests @pytest.mark.gen_test def test_track_transaction(self, ws_client, config, settings): with patch("raiden_installer.web.wait_for_transaction") as mock_wait_for_transaction: tx_hash_bytes = os.urandom(32) tx_hash = encode_hex(tx_hash_bytes) data = { "method": "track_transaction", "configuration_file_name": config.file_name, "tx_hash": tx_hash } ws_client.write_message(json.dumps(data)) message = json.loads((yield ws_client.read_message())) assert message["type"] == "hash" assert message["tx_hash"] == tx_hash message = json.loads((yield ws_client.read_message())) assert message["type"] == "status-update" message = json.loads((yield ws_client.read_message())) assert message["type"] == "redirect" assert message["redirect_url"] == ( f"/swap/{config.file_name}/{settings.service_token.ticker}" ) mock_wait_for_transaction.assert_called_once() args, _ = mock_wait_for_transaction.call_args assert tx_hash_bytes in args loaded_config = RaidenConfigurationFile.get_by_filename(config.file_name) assert loaded_config._initial_funding_txhash == None @pytest.mark.gen_test def test_track_transaction_with_invalid_config(self, ws_client, config, io_loop): with patch("raiden_installer.web.wait_for_transaction") as mock_wait_for_transaction: tx_hash = encode_hex(os.urandom(32)) data = { "method": "track_transaction", "configuration_file_name": "invalid" + config.file_name, "tx_hash": tx_hash } ws_client.write_message(json.dumps(data)) message = json.loads((yield ws_client.read_message())) assert message["type"] == "error-message" mock_wait_for_transaction.assert_not_called() @pytest.mark.gen_test(timeout=10) def test_swap( self, ws_client, config, settings, unlocked, mock_get_exchange, mock_deposit_service_tokens, mock_wait_for_transaction ): def token_balance(w3, account, token): return ( TokenAmount(0, token) if token.ticker == settings.transfer_token.ticker else TokenAmount(10, token) ) eth_balance_patch = patch( "raiden_installer.account.Account.get_ethereum_balance", return_value=EthereumAmount(100) ) token_balance_patch = patch( "raiden_installer.web.get_token_balance", side_effect=token_balance ) total_tokens_patch = patch( "raiden_installer.web.get_total_token_owned", side_effect=lambda w3, account, token: TokenAmount(10, token) ) token_deposit_patch = patch( "raiden_installer.shared_handlers.get_token_deposit", side_effect=lambda w3, account, token: TokenAmount(10, token) ) with eth_balance_patch, token_balance_patch, total_tokens_patch, token_deposit_patch: mock_exchange = mock_get_exchange()() mock_exchange.calculate_transaction_costs.return_value = { "gas_price": EthereumAmount(Wei(1000000000)), "gas": Wei(500000), "eth_sold": EthereumAmount(0.5), "total": EthereumAmount(0.505), "exchange_rate": EthereumAmount(0.05), } mock_exchange.buy_tokens.return_value = os.urandom(32) mock_exchange.name = "uniswap" data = { "method": "swap", "configuration_file_name": config.file_name, "amount": "10000000000000000000", "token": settings.service_token.ticker, "exchange": "uniswap" } ws_client.write_message(json.dumps(data)) for _ in range(8): message = json.loads((yield ws_client.read_message())) assert message["type"] == "status-update" message = json.loads((yield ws_client.read_message())) assert message["type"] == "summary" message = json.loads((yield ws_client.read_message())) assert message["type"] == "redirect" assert message["redirect_url"] == ( f"/swap/{config.file_name}/{settings.transfer_token.ticker}" ) mock_exchange.calculate_transaction_costs.assert_called_once() mock_exchange.buy_tokens.assert_called_once() mock_deposit_service_tokens.assert_called_once() @pytest.mark.gen_test def test_swap_with_invalid_exchange( self, ws_client, config, settings, unlocked, mock_get_exchange, mock_deposit_service_tokens ): mock_exchange = mock_get_exchange()() data = { "method": "swap", "configuration_file_name": config.file_name, "amount": "10000000000000000000", "token": settings.service_token.ticker, "exchange": "invalid exchange" } ws_client.write_message(json.dumps(data)) message = json.loads((yield ws_client.read_message())) assert message["type"] == "error-message" mock_exchange.calculate_transaction_costs.assert_not_called() mock_exchange.buy_tokens.assert_not_called() mock_deposit_service_tokens.assert_not_called() @pytest.mark.gen_test(timeout=10) def test_swap_without_enough_eth( self, ws_client, config, settings, unlocked, mock_get_exchange, mock_deposit_service_tokens, mock_wait_for_transaction ): with patch( "raiden_installer.account.Account.get_ethereum_balance", return_value=EthereumAmount(0) ): mock_exchange = mock_get_exchange()() mock_exchange.calculate_transaction_costs.return_value = { "gas_price": EthereumAmount(Wei(1000000000)), "gas": Wei(500000), "eth_sold": EthereumAmount(0.5), "total": EthereumAmount(0.505), "exchange_rate": EthereumAmount(0.05), } data = { "method": "swap", "configuration_file_name": config.file_name, "amount": "10000000000000000000", "token": settings.service_token.ticker, "exchange": "uniswap" } ws_client.write_message(json.dumps(data)) message = json.loads((yield ws_client.read_message())) assert message["type"] == "status-update" message = json.loads((yield ws_client.read_message())) assert message["type"] == "summary" message = json.loads((yield ws_client.read_message())) assert message["type"] == "redirect" assert message["redirect_url"] == ( f"/swap/{config.file_name}/{settings.service_token.ticker}" ) mock_exchange.calculate_transaction_costs.assert_called_once() mock_exchange.buy_tokens.assert_not_called() mock_deposit_service_tokens.assert_not_called() @pytest.mark.gen_test(timeout=10) def test_swap_with_enough_transfer_tokens( self, ws_client, config, settings, unlocked, mock_get_exchange, mock_deposit_service_tokens, mock_wait_for_transaction ): eth_balance_patch = patch( "raiden_installer.account.Account.get_ethereum_balance", return_value=EthereumAmount(100) ) token_balance_patch = patch( "raiden_installer.web.get_token_balance", side_effect=lambda w3, account, token: TokenAmount(10, token) ) total_tokens_patch = patch( "raiden_installer.web.get_total_token_owned", side_effect=lambda w3, account, token: TokenAmount(10, token) ) token_deposit_patch = patch( "raiden_installer.shared_handlers.get_token_deposit", side_effect=lambda w3, account, token: TokenAmount(10, token) ) with eth_balance_patch, token_balance_patch, total_tokens_patch, token_deposit_patch: mock_exchange = mock_get_exchange()() mock_exchange.calculate_transaction_costs.return_value = { "gas_price": EthereumAmount(Wei(1000000000)), "gas": Wei(500000), "eth_sold": EthereumAmount(0.5), "total": EthereumAmount(0.505), "exchange_rate": EthereumAmount(0.05), } mock_exchange.buy_tokens.return_value = os.urandom(32) mock_exchange.name = "uniswap" data = { "method": "swap", "configuration_file_name": config.file_name, "amount": "10000000000000000000", "token": settings.service_token.ticker, "exchange": "uniswap" } ws_client.write_message(json.dumps(data)) for _ in range(8): message = json.loads((yield ws_client.read_message())) assert message["type"] == "status-update" message = json.loads((yield ws_client.read_message())) assert message["type"] == "summary" message = json.loads((yield ws_client.read_message())) assert message["type"] == "redirect" assert message["redirect_url"] == ( f"/launch/{config.file_name}" ) mock_exchange.calculate_transaction_costs.assert_called_once() mock_exchange.buy_tokens.assert_called_once() mock_deposit_service_tokens.assert_called_once() @pytest.mark.gen_test(timeout=15) def test_udc_deposit( self, ws_client, config, settings, unlocked, mock_deposit_service_tokens, mock_wait_for_transaction ): token_balance_patch = patch( "raiden_installer.web.get_token_balance", side_effect=lambda w3, account, token: TokenAmount(10, token) ) token_deposit_patch_web = patch( "raiden_installer.web.get_token_deposit", side_effect=lambda w3, account, token: TokenAmount(0, token) ) token_deposit_patch_shared = patch( "raiden_installer.shared_handlers.get_token_deposit", side_effect=lambda w3, account, token: TokenAmount(10, token) ) with token_balance_patch, token_deposit_patch_web, token_deposit_patch_shared: data = { "method": "udc_deposit", "configuration_file_name": config.file_name, } ws_client.write_message(json.dumps(data)) for _ in range(3): message = json.loads((yield ws_client.read_message())) assert message["type"] == "status-update" message = json.loads((yield ws_client.read_message())) assert message["type"] == "summary" message = json.loads((yield ws_client.read_message())) assert message["type"] == "redirect" assert message["redirect_url"] == ( f"/launch/{config.file_name}" ) mock_deposit_service_tokens.assert_called_once() @pytest.mark.gen_test def test_udc_deposit_without_config( self, ws_client, config, settings, unlocked, mock_deposit_service_tokens ): data = { "method": "udc_deposit", } ws_client.write_message(json.dumps(data)) message = json.loads((yield ws_client.read_message())) assert message["type"] == "error-message" mock_deposit_service_tokens.assert_not_called() @pytest.mark.gen_test(timeout=15) def test_udc_deposit_when_already_deposited( self, ws_client, config, settings, unlocked, mock_deposit_service_tokens ): required_deposit = Wei(settings.service_token.amount_required) token_balance_patch = patch( "raiden_installer.web.get_token_balance", side_effect=lambda w3, account, token: TokenAmount(10, token) ) token_deposit_patch = patch( "raiden_installer.web.get_token_deposit", side_effect=lambda w3, account, token: TokenAmount(required_deposit, token) ) with token_balance_patch, token_deposit_patch: data = { "method": "udc_deposit", "configuration_file_name": config.file_name, } ws_client.write_message(json.dumps(data)) message = json.loads((yield ws_client.read_message())) assert message["type"] == "status-update" message = json.loads((yield ws_client.read_message())) assert message["type"] == "summary" message = json.loads((yield ws_client.read_message())) assert message["type"] == "redirect" assert message["redirect_url"] == ( f"/launch/{config.file_name}" ) mock_deposit_service_tokens.assert_not_called() class TestWebTestnet(SharedHandlersTests): @pytest.fixture def app(self): return get_app_testnet() @pytest.fixture def network_name(self): return "goerli" @pytest.fixture def settings_name(self): return "demo_env" @pytest.mark.gen_test(timeout=900) def test_funding(self, ws_client, config, test_account, unlocked, settings): data = { "method": "fund", "configuration_file_name": config.file_name, } ws_client.write_message(json.dumps(data)) for _ in range(2): message = json.loads((yield ws_client.read_message())) assert message["type"] == "status-update" message = json.loads((yield ws_client.read_message())) assert message["type"] == "next-step" for _ in range(3): message = json.loads((yield ws_client.read_message())) assert message["type"] == "status-update" message = json.loads((yield ws_client.read_message())) assert message["type"] == "next-step" message = json.loads((yield ws_client.read_message())) assert message["type"] == "redirect" assert message["redirect_url"] == f"/launch/{config.file_name}" w3 = make_web3_provider(config.ethereum_client_rpc_endpoint, test_account) assert check_balances(w3, test_account, settings, lambda x: x > 0) empty_account(w3, test_account) @pytest.mark.gen_test def test_funding_with_invalid_config_file( self, ws_client, config, test_account, unlocked, settings ): data = { "method": "fund", "configuration_file_name": "invalid" + config.file_name, } ws_client.write_message(json.dumps(data)) message = json.loads((yield ws_client.read_message())) assert message["type"] == "error-message" w3 = make_web3_provider(config.ethereum_client_rpc_endpoint, test_account) assert check_balances(w3, test_account, settings, lambda x: x == 0) @pytest.mark.gen_test def test_locked_funding(self, ws_client, config, test_account, settings): data = { "method": "fund", "configuration_file_name": config.file_name, } ws_client.write_message(json.dumps(data)) message = json.loads((yield ws_client.read_message())) assert message["type"] == "error-message" w3 = make_web3_provider(config.ethereum_client_rpc_endpoint, test_account) assert check_balances(w3, test_account, settings, lambda x: x == 0)
36.644637
98
0.635958
3,772
33,823
5.379109
0.072375
0.032331
0.031543
0.0414
0.767866
0.737753
0.714736
0.683144
0.6483
0.6207
0
0.011831
0.265293
33,823
922
99
36.684382
0.804668
0.00139
0
0.6326
0
0
0.138928
0.077429
0
0
0
0
0.15912
1
0.071151
false
0.020699
0.029754
0.01423
0.121604
0
0
0
0
null
0
0
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
7f5b76a3577f86fe28ed46f2364b13beeed8f550
402
py
Python
test.py
activerankextension/methodology
8ae182d420163dae8433a0003c50618798a0f46f
[ "MIT" ]
null
null
null
test.py
activerankextension/methodology
8ae182d420163dae8433a0003c50618798a0f46f
[ "MIT" ]
null
null
null
test.py
activerankextension/methodology
8ae182d420163dae8433a0003c50618798a0f46f
[ "MIT" ]
null
null
null
import unittest from feminist_api import * class FeministAPI(unittest.TestCase): def test_ranking(self): self.assertNotEqual((None, None, None, None), get_ranking_for_company('zara')) self.assertNotEqual((None, None, None, None), get_ranking_for_company('facebook')) self.assertNotEqual((None, None, None, None), get_ranking_for_company('apple')) if __name__ == '__main__': unittest.main()
36.545455
84
0.758706
52
402
5.5
0.442308
0.251748
0.251748
0.272727
0.566434
0.566434
0.566434
0.566434
0.566434
0.566434
0
0
0.104478
402
11
85
36.545455
0.794444
0
0
0
0
0
0.062035
0
0
0
0
0
0.333333
1
0.111111
false
0
0.222222
0
0.444444
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
7f651f1517a0884732ef21c2c571ce9f78614a71
304
py
Python
thenewboston_node/core/management/commands/generate_signing_key.py
nishp77/thenewboston-node
158b1f1739b2c6c9c21c80e9da854ca141f1cf8f
[ "MIT" ]
30
2021-03-05T22:08:17.000Z
2021-09-23T02:45:45.000Z
thenewboston_node/core/management/commands/generate_signing_key.py
nishp77/thenewboston-node
158b1f1739b2c6c9c21c80e9da854ca141f1cf8f
[ "MIT" ]
148
2021-03-05T23:37:50.000Z
2021-11-02T02:18:58.000Z
thenewboston_node/core/management/commands/generate_signing_key.py
nishp77/thenewboston-node
158b1f1739b2c6c9c21c80e9da854ca141f1cf8f
[ "MIT" ]
14
2021-03-05T21:58:46.000Z
2021-10-15T17:27:52.000Z
from django.core.management import BaseCommand from thenewboston_node.core.utils.cryptography import generate_key_pair class Command(BaseCommand): help = 'Generate signing (private) key' # noqa: A003 def handle(self, *args, **options): self.stdout.write(generate_key_pair().private)
27.636364
71
0.753289
38
304
5.894737
0.710526
0.098214
0.133929
0
0
0
0
0
0
0
0
0.011583
0.148026
304
10
72
30.4
0.853282
0.032895
0
0
1
0
0.10274
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0
0.833333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
7f6f5b004757129f756542df01444d1d418496a6
309
py
Python
examples/demo/demo_payments/models.py
bartels/satchless
4d333014333dc4fd5815f9e0bbea565959919a30
[ "BSD-4-Clause" ]
1
2015-11-05T10:26:46.000Z
2015-11-05T10:26:46.000Z
examples/demo/demo_payments/models.py
bartels/satchless
4d333014333dc4fd5815f9e0bbea565959919a30
[ "BSD-4-Clause" ]
null
null
null
examples/demo/demo_payments/models.py
bartels/satchless
4d333014333dc4fd5815f9e0bbea565959919a30
[ "BSD-4-Clause" ]
null
null
null
from django.db import models from orders.app import order_app from satchless.contrib.payment.django_payments_provider.models import DjangoPaymentsPayment class Payment(DjangoPaymentsPayment): order = models.OneToOneField(order_app.Order, related_name='paymentvariant')
30.9
91
0.754045
33
309
6.909091
0.575758
0.070175
0
0
0
0
0
0
0
0
0
0
0.187702
309
9
92
34.333333
0.908367
0
0
0
0
0
0.045307
0
0
0
0
0
0
1
0
false
0
0.5
0
0.833333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
7f777087518551b0eec6e2af3c5f3d647f6bd44e
1,143
py
Python
install/app_store/tk-framework-shotgunutils/v5.2.4/tests/fixtures/config/bundles/test_engine/engine.py
JoanAzpeitia/lp_sg
e0ee79555e419dd2ae3a5f31e5515b3f40b22a62
[ "MIT" ]
4
2019-01-11T03:41:28.000Z
2019-09-12T06:57:17.000Z
bundle_cache/app_store/tk-multi-breakdown/v1.5.0/tests/fixtures/config/bundles/test_engine/engine.py
ColinKennedy/tk-config-default2-respawn
855fb8033daa549b92615792442f19a7f9c4f55c
[ "Linux-OpenIB" ]
null
null
null
bundle_cache/app_store/tk-multi-breakdown/v1.5.0/tests/fixtures/config/bundles/test_engine/engine.py
ColinKennedy/tk-config-default2-respawn
855fb8033daa549b92615792442f19a7f9c4f55c
[ "Linux-OpenIB" ]
2
2019-01-10T05:00:18.000Z
2020-02-15T16:32:56.000Z
# Copyright (c) 2013 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to the Shotgun Pipeline Toolkit Source Code License. All rights # not expressly granted therein are reserved by Shotgun Software Inc. """ A simple engine to support unit tests. """ from tank.platform import Engine import tank import sys class TestEngine(Engine): def init_engine(self): pass ########################################################################################## # logging interfaces def log_debug(self, msg): if self.get_setting("debug_logging", False): sys.stdout.write("DEBUG: %s\n" % msg) def log_info(self, msg): sys.stdout.write("%s\n" % msg) def log_warning(self, msg): sys.stdout.write("WARNING: %s\n" % msg) def log_error(self, msg): sys.stdout.write("ERROR: %s\n" % msg)
28.575
94
0.608924
144
1,143
4.784722
0.541667
0.034833
0.081277
0.034833
0.267054
0.127721
0.127721
0.127721
0
0
0
0.00453
0.227472
1,143
39
95
29.307692
0.775764
0.429571
0
0
0
0
0.095413
0
0
0
0
0
0
1
0.333333
false
0.066667
0.2
0
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
3
7f7e5421cd569f07ea56ab7d15d596eb794887ff
1,687
py
Python
vulntracker/vulnalert/util.py
jonaustin/advisoryscan
ba452c155f0d478450e0c91de5ea00f404e98616
[ "MIT" ]
null
null
null
vulntracker/vulnalert/util.py
jonaustin/advisoryscan
ba452c155f0d478450e0c91de5ea00f404e98616
[ "MIT" ]
null
null
null
vulntracker/vulnalert/util.py
jonaustin/advisoryscan
ba452c155f0d478450e0c91de5ea00f404e98616
[ "MIT" ]
1
2018-12-06T12:50:52.000Z
2018-12-06T12:50:52.000Z
""" Utility Functions """ ### From the Python Cookbook ## Generate a human readable 'random' password ## password will be generated in the form 'word'+digits+'word' ## eg.,nice137pass ## parameters: number of 'characters' , number of 'digits' ## Pradeep Kishore Gowda <pradeep at btbytes.com > ## License : GPL ## Date : 2005.April.15 ## Revision 1.2 ## ChangeLog: ## 1.1 - fixed typos ## 1.2 - renamed functions _apart & _npart to a_part & n_part as zope does not allow functions to ## start with _ def nicepass(alpha=6,numeric=2): """ returns a human-readble password (say rol86din instead of a difficult to remember K8Yn9muL ) """ import string import random vowels = ['a','e','i','o','u'] consonants = [a for a in string.ascii_lowercase if a not in vowels] digits = string.digits ####utility functions def a_part(slen): ret = '' for i in range(slen): if i%2 ==0: randid = random.randint(0,20) #number of consonants ret += consonants[randid] else: randid = random.randint(0,4) #number of vowels ret += vowels[randid] return ret def n_part(slen): ret = '' for i in range(slen): randid = random.randint(0,9) #number of digits ret += digits[randid] return ret #### fpl = alpha/2 if alpha % 2 : fpl = int(alpha/2) + 1 lpl = alpha - fpl start = a_part(fpl) mid = n_part(numeric) end = a_part(lpl) return "%s%s%s" % (start,mid,end) if __name__ == "__main__": print nicepass(6,2)
26.777778
98
0.567279
222
1,687
4.225225
0.454955
0.042644
0.060768
0.063966
0.055437
0.055437
0.055437
0.055437
0
0
0
0.031088
0.313574
1,687
62
99
27.209677
0.778929
0.301719
0
0.1875
1
0
0.019038
0
0
0
0
0
0
0
null
null
0.0625
0.0625
null
null
0.03125
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
1
0
0
0
0
0
3
7f8d5a04fa22a72def6576019a66f48aed48a68f
1,831
py
Python
roblox/utilities/shared.py
Boegie19/ro.py
68b8acb506ab3057670168434fbf90ea0d05943f
[ "MIT" ]
null
null
null
roblox/utilities/shared.py
Boegie19/ro.py
68b8acb506ab3057670168434fbf90ea0d05943f
[ "MIT" ]
null
null
null
roblox/utilities/shared.py
Boegie19/ro.py
68b8acb506ab3057670168434fbf90ea0d05943f
[ "MIT" ]
1
2021-06-28T14:57:39.000Z
2021-06-28T14:57:39.000Z
""" This module contains the ClientSharedObject, which is shared between the client and all objects it generates. """ from __future__ import annotations from typing import TYPE_CHECKING, Optional from .requests import Requests from .url import URLGenerator if TYPE_CHECKING: from ..client import Client from ..presence import PresenceProvider from ..thumbnails import ThumbnailProvider from ..delivery import DeliveryProvider from ..chat import ChatProvider from ..account import AccountProvider class ClientSharedObject: """ This object is shared between the client and all objects it generates. Attributes: client: The main client. requests: The requests object. url_generator: The URL generator object. presence_provider: A provider for presence information. thumbnail_provider: A provider for thumbnail information. delivery_provider: A provider for delivery information. chat_provider: A provider for chat information. account_provider: A provider for account information. """ def __init__(self, client: Client, requests: Requests, url_generator: URLGenerator): """ Arguments: client: method used for the request requests: Everything and noting. url_generator: Everything and noting. """ self.client: Client = client self.requests: Requests = requests self.url_generator: URLGenerator = url_generator self.presence_provider: Optional[PresenceProvider] = None self.thumbnail_provider: Optional[ThumbnailProvider] = None self.delivery_provider: Optional[DeliveryProvider] = None self.chat_provider: Optional[ChatProvider] = None self.account_provider: Optional[AccountProvider] = None
34.54717
109
0.713271
195
1,831
6.569231
0.292308
0.056206
0.066354
0.078064
0.074941
0.074941
0.074941
0.074941
0.074941
0.074941
0
0
0.229929
1,831
52
110
35.211538
0.908511
0.395958
0
0
1
0
0
0
0
0
0
0
0
1
0.047619
false
0
0.47619
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
1
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
7f9b1d895482976485b1998550d8af3dc65dcd05
1,544
py
Python
miniworld/model/network/backends/InterfaceFilter.py
miniworld-project/miniworld_core
c591bad232b78eae99e8f55cb1b907c1e228484b
[ "MIT" ]
5
2019-05-11T14:57:15.000Z
2021-07-05T00:35:25.000Z
miniworld/model/network/backends/InterfaceFilter.py
miniworld-project/miniworld_core
c591bad232b78eae99e8f55cb1b907c1e228484b
[ "MIT" ]
27
2017-03-17T07:11:02.000Z
2019-05-26T23:36:56.000Z
miniworld/model/network/backends/InterfaceFilter.py
miniworld-project/miniworld_core
c591bad232b78eae99e8f55cb1b907c1e228484b
[ "MIT" ]
6
2017-05-03T12:11:33.000Z
2020-04-03T11:44:27.000Z
class InterfaceFilter: def __init__(self, *args, **kwargs): pass def get_interfaces(self, emulation_node_x, emulation_node_y): """ Attributes ---------- emulation_node_x: EmulationNode emulation_node_y: EmulationNode Returns ------- generator<(Interface, Interface)> """ pass class EqualInterfaceNumbers(InterfaceFilter): """ Assumes each node has the same number of interfaces. And that the interfaces are sorted! """ def __init__(self, *args, **kwargs): self.cnt_interfaces = None def get_interfaces(self, emulation_node_x, emulation_node_y): self.cnt_interfaces = len(emulation_node_x.network_mixin.interfaces.filter_normal_interfaces()) interfaces_x = emulation_node_x.network_mixin.interfaces.filter_normal_interfaces() interfaces_y = emulation_node_y.network_mixin.interfaces.filter_normal_interfaces() for i in range(self.cnt_interfaces): yield interfaces_x[i], interfaces_y[i] class CoreInterfaces(InterfaceFilter): pass class AllInterfaces(InterfaceFilter): def get_interfaces(self, emulation_node_x, emulation_node_y): # TODO: speed improvement by not calling the filter every time? for interface_x in emulation_node_x.network_mixin.interfaces.filter_normal_interfaces(): for interface_y in emulation_node_y.network_mixin.interfaces.filter_normal_interfaces(): yield interface_x, interface_y
28.592593
103
0.695596
176
1,544
5.744318
0.301136
0.167161
0.096934
0.138477
0.496538
0.454995
0.454995
0.44906
0.44906
0.276954
0
0
0.22215
1,544
53
104
29.132075
0.841799
0.186529
0
0.380952
0
0
0
0
0
0
0
0.018868
0
1
0.238095
false
0.142857
0
0
0.428571
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
1
0
0
0
0
0
3
7fa52d2551135b3c9ef42b725887c7c6e432166a
834
py
Python
kyper/nbconvert/tests/files/nbconvert_v4_kyper_config_1.py
wusung/ipython-notebook-tabs
ee7b3922c7d01cf6182bce63ef69e8a20f7229f9
[ "Apache-2.0" ]
null
null
null
kyper/nbconvert/tests/files/nbconvert_v4_kyper_config_1.py
wusung/ipython-notebook-tabs
ee7b3922c7d01cf6182bce63ef69e8a20f7229f9
[ "Apache-2.0" ]
null
null
null
kyper/nbconvert/tests/files/nbconvert_v4_kyper_config_1.py
wusung/ipython-notebook-tabs
ee7b3922c7d01cf6182bce63ef69e8a20f7229f9
[ "Apache-2.0" ]
null
null
null
c = get_config() #Export all the notebooks in the current directory to the sphinx_howto format. c.NbConvertApp.notebooks = ['Untitled.ipynb'] c.NbConvertApp.export_format = 'notebook' #c.NbConvertApp.writer = 'stdoutwriter' c.Exporter.default_preprocessors = ['kyper.nbconvert.preprocessors.coalesce_streams', 'kyper.nbconvert.preprocessors.SVG2PDFPreprocessor', 'kyper.nbconvert.preprocessors.ExtractOutputPreprocessor', 'kyper.nbconvert.preprocessors.CSSHTMLHeaderPreprocessor', 'kyper.nbconvert.preprocessors.RevealHelpPreprocessor', 'kyper.nbconvert.preprocessors.LatexPreprocessor', 'kyper.nbconvert.preprocessors.HighlightMagicsPreprocessor'] c.Application.verbose_crash=True #c.TerminalIPythonApp.subcommands['nbconvert'] = ('kyper.nbconvert.nbconvertapp.NbConvertApp', 'xxxxxxxx') #c.NbConvertApp.postprocessor_class = 'pdf'
75.818182
424
0.833333
82
834
8.390244
0.52439
0.162791
0.274709
0
0
0
0
0
0
0
0
0.001263
0.05036
834
10
425
83.4
0.867424
0.314149
0
0
0
0
0.674296
0.635563
0
0
0
0
0
1
0
false
0
0
0
0
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
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
7fa7f852d4cb0a061dab991f8c7bedad11c82bbc
727
py
Python
tests/test_tools/test_sort.py
Massiil/wordlistools
45edc94200130e87b444fd5c04e24e6093160f93
[ "MIT" ]
17
2022-02-06T21:23:27.000Z
2022-02-07T22:33:40.000Z
tests/test_tools/test_sort.py
Massiil/wordlistools
45edc94200130e87b444fd5c04e24e6093160f93
[ "MIT" ]
1
2022-02-06T21:52:30.000Z
2022-02-06T21:52:30.000Z
tests/test_tools/test_sort.py
Massiil/wordlistools
45edc94200130e87b444fd5c04e24e6093160f93
[ "MIT" ]
2
2022-02-06T21:29:42.000Z
2022-02-06T21:31:06.000Z
from wordlistools.helpertest import AsStdinWordlist, AsWordlist, runtest def test_simple(): runtest("sort", args=(AsStdinWordlist(["a", "b"]),), ret=AsWordlist(["a", "b"])) runtest("sort", args=(AsStdinWordlist(["b", "a"]),), ret=AsWordlist(["a", "b"])) def test_multiple_wordlists(): runtest( "sort", args=(AsWordlist(["b", "a"]), AsStdinWordlist(["c"])), ret=AsWordlist(["a", "b", "c"]), ) runtest( "sort", args=(AsWordlist(["b", "a"]), AsStdinWordlist(["a"])), ret=AsWordlist(["a", "a", "b"]), ) runtest( "sort", args=(AsWordlist(["d", "b"]), AsStdinWordlist(["c", "a"])), ret=AsWordlist(["a", "b", "c", "d"]), )
25.964286
84
0.518569
75
727
4.986667
0.253333
0.032086
0.200535
0.160428
0.446524
0.224599
0.224599
0
0
0
0
0
0.220083
727
27
85
26.925926
0.659612
0
0
0.3
0
0
0.066025
0
0
0
0
0
0
1
0.1
true
0
0.05
0
0.15
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
f69d983260154b7c587e7a2f65e955149432f5db
99
py
Python
CodeChef/Python Codes/TSORT.py
khaleeque-ansari/Online-Coding-Problems-Solutions-Python
c8378ccad88ce5f50239f82cf9569344e1b92f18
[ "Apache-2.0" ]
null
null
null
CodeChef/Python Codes/TSORT.py
khaleeque-ansari/Online-Coding-Problems-Solutions-Python
c8378ccad88ce5f50239f82cf9569344e1b92f18
[ "Apache-2.0" ]
null
null
null
CodeChef/Python Codes/TSORT.py
khaleeque-ansari/Online-Coding-Problems-Solutions-Python
c8378ccad88ce5f50239f82cf9569344e1b92f18
[ "Apache-2.0" ]
null
null
null
import sys n=int(raw_input()) a=[] a=map(int,sys.stdin) a.sort() for _ in a: print _
11
21
0.565657
18
99
2.944444
0.722222
0
0
0
0
0
0
0
0
0
0
0
0.262626
99
8
22
12.375
0.726027
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0.142857
null
null
0.142857
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
1
0
0
0
0
0
0
0
0
3
f6a2c7e0854b4bfb4bdf91f358afcc75ceac053b
167
py
Python
app.py
Pandelytics/pandelytics
5950d4a95595dadf076ac9270be0dbcdcfa59a1a
[ "Apache-2.0" ]
null
null
null
app.py
Pandelytics/pandelytics
5950d4a95595dadf076ac9270be0dbcdcfa59a1a
[ "Apache-2.0" ]
11
2020-04-02T22:36:36.000Z
2020-09-27T11:19:23.000Z
app.py
Pandelytics/pandelytics
5950d4a95595dadf076ac9270be0dbcdcfa59a1a
[ "Apache-2.0" ]
1
2020-10-07T15:48:06.000Z
2020-10-07T15:48:06.000Z
import json from pandelytics import search if __name__ == "__main__": news = search.search("jhu", "Data") if news: print(json.dumps(news, indent=4))
18.555556
41
0.652695
22
167
4.590909
0.681818
0
0
0
0
0
0
0
0
0
0
0.007634
0.215569
167
8
42
20.875
0.763359
0
0
0
0
0
0.08982
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0.166667
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
f6a940ae1fea232392cf90b5597c48422a8248e7
626
py
Python
37_function.py
onowdev/python-selflearning
3d7245de0207a5bfcbce4f7adde60e7316b70a8e
[ "MIT" ]
null
null
null
37_function.py
onowdev/python-selflearning
3d7245de0207a5bfcbce4f7adde60e7316b70a8e
[ "MIT" ]
null
null
null
37_function.py
onowdev/python-selflearning
3d7245de0207a5bfcbce4f7adde60e7316b70a8e
[ "MIT" ]
null
null
null
# A function is a block of organized, reusable code that is used to perform a single, related action. # Functions provide better modularity for your application and a high degree of code reusing. # As you already know, Python gives you many built-in functions like print(), # etc. but you can also create your own functions. These functions are called # user-defined functions. def printme( str ): "This prints a passed string into this function" print (str) return # Now you can call printme function printme("This is first call to the user defined function!") printme("Again second call to the same function")
41.733333
102
0.758786
99
626
4.79798
0.646465
0.025263
0.037895
0
0
0
0
0
0
0
0
0
0.185304
626
15
103
41.733333
0.931373
0.722045
0
0
0
0
0.611111
0
0
0
0
0
0
1
0.166667
false
0.166667
0
0
0.333333
0.833333
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
1
0
0
0
1
0
3
f6ad4eb8b29be724bdb073d946e7e0063a5425fb
95
py
Python
classTest.py
csitedexperts/Python2.xPractice
fd03ceebe920a76ca47aec3651a69ba5a1cc412b
[ "Apache-2.0" ]
3
2019-04-13T04:00:42.000Z
2020-10-02T01:14:42.000Z
classTest.py
csitedexperts/Python2.xPractice
fd03ceebe920a76ca47aec3651a69ba5a1cc412b
[ "Apache-2.0" ]
null
null
null
classTest.py
csitedexperts/Python2.xPractice
fd03ceebe920a76ca47aec3651a69ba5a1cc412b
[ "Apache-2.0" ]
2
2019-03-30T18:55:32.000Z
2020-05-10T16:30:34.000Z
class things(object): def test(hi): print "Hi" t = things() t.test("hello world")
13.571429
21
0.578947
14
95
3.928571
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.252632
95
6
22
15.833333
0.774648
0
0
0
0
0
0.136842
0
0
0
0
0
0
0
null
null
0
0
null
null
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
1
0
0
0
0
0
0
0
0
3
f6ce139e91ce806c7fc0cc9832e37d0e3f9265fe
279
py
Python
arlobot_common/src/common/utils.py
tslator/arlobot_tx2
5b6b0ead86e54ec7ba5664f32263a1c8c27249c9
[ "MIT" ]
null
null
null
arlobot_common/src/common/utils.py
tslator/arlobot_tx2
5b6b0ead86e54ec7ba5664f32263a1c8c27249c9
[ "MIT" ]
null
null
null
arlobot_common/src/common/utils.py
tslator/arlobot_tx2
5b6b0ead86e54ec7ba5664f32263a1c8c27249c9
[ "MIT" ]
null
null
null
import rospy # Wraps Rate so that the hz parameter can be retrieved ''' class RateWrapper(rospy.Rate): def __init__(self, rate): self.super(self, RateWrapper).__init__(rate) self._hz = rate @attr.getter def Rate(self): return self._hz '''
17.4375
54
0.641577
37
279
4.567568
0.567568
0.142012
0
0
0
0
0
0
0
0
0
0
0.250896
279
16
55
17.4375
0.808612
0.18638
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
3
f6ceb83178b7c8b4ff2b9f133bd2f18c84b420ff
247
py
Python
output/models/nist_data/atomic/any_uri/schema_instance/nistschema_sv_iv_atomic_any_uri_pattern_1_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
1
2021-08-14T17:59:21.000Z
2021-08-14T17:59:21.000Z
output/models/nist_data/atomic/any_uri/schema_instance/nistschema_sv_iv_atomic_any_uri_pattern_1_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
4
2020-02-12T21:30:44.000Z
2020-04-15T20:06:46.000Z
output/models/nist_data/atomic/any_uri/schema_instance/nistschema_sv_iv_atomic_any_uri_pattern_1_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
null
null
null
from output.models.nist_data.atomic.any_uri.schema_instance.nistschema_sv_iv_atomic_any_uri_pattern_1_xsd.nistschema_sv_iv_atomic_any_uri_pattern_1 import NistschemaSvIvAtomicAnyUriPattern1 __all__ = [ "NistschemaSvIvAtomicAnyUriPattern1", ]
41.166667
189
0.890688
31
247
6.387097
0.612903
0.136364
0.181818
0.20202
0.343434
0.343434
0.343434
0.343434
0
0
0
0.017167
0.05668
247
5
190
49.4
0.832618
0
0
0
0
0
0.137652
0.137652
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
f6df8963235e108bc0bff3c2625f3b6d7e38a0ef
6,634
py
Python
autolens/lens/plotters/sensitivity_fit_plotters.py
AshKelly/PyAutoLens
043795966338a655339e61782253ad67cc3c14e6
[ "MIT" ]
null
null
null
autolens/lens/plotters/sensitivity_fit_plotters.py
AshKelly/PyAutoLens
043795966338a655339e61782253ad67cc3c14e6
[ "MIT" ]
null
null
null
autolens/lens/plotters/sensitivity_fit_plotters.py
AshKelly/PyAutoLens
043795966338a655339e61782253ad67cc3c14e6
[ "MIT" ]
null
null
null
from matplotlib import pyplot as plt from autolens.data.array.plotters import plotter_util from autolens.lens.plotters import lens_plotter_util def plot_fit_subplot( fit, should_plot_mask=True, extract_array_from_mask=False, zoom_around_mask=False, positions=None, should_plot_image_plane_pix=True, units='arcsec', figsize=None, aspect='equal', cmap='jet', norm='linear', norm_min=None, norm_max=None, linthresh=0.05, linscale=0.01, cb_ticksize=10, cb_fraction=0.047, cb_pad=0.01, titlesize=10, xlabelsize=10, ylabelsize=10, xyticksize=10, mask_pointsize=10, position_pointsize=10.0, grid_pointsize=1, output_path=None, output_filename='sensitivity_fit', output_format='show'): """Plot the model datas of an analysis, using the *Fitter* class object. The visualization and output type can be fully customized. Parameters ----------- fit : autolens.sensitivity_fitting.SensitivityProfileFit Class containing fitting between the model datas and observed lens datas (including residual_map, chi_squared_map etc.) """ rows, columns, figsize_tool = plotter_util.get_subplot_rows_columns_figsize(number_subplots=9) mask = lens_plotter_util.get_mask(fit=fit.fit_normal, should_plot_mask=should_plot_mask) image_plane_pix_grid = lens_plotter_util.get_image_plane_pix_grid(should_plot_image_plane_pix, fit) if figsize is None: figsize = figsize_tool plt.figure(figsize=figsize) plt.subplot(rows, columns, 1) kpc_per_arcsec = fit.tracer_normal.image_plane.kpc_per_arcsec_proper lens_plotter_util.plot_image( fit=fit.fit_normal, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask, positions=positions, image_plane_pix_grid=image_plane_pix_grid, as_subplot=True, units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect, cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale, cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize, grid_pointsize=grid_pointsize, position_pointsize=position_pointsize, mask_pointsize=mask_pointsize, output_path=output_path, output_filename='', output_format=output_format) plt.subplot(rows, columns, 4) lens_plotter_util.plot_model_data( fit=fit.fit_normal, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask, as_subplot=True, units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect, cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale, cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize, output_path=output_path, output_filename='', output_format=output_format) plt.subplot(rows, columns, 5) lens_plotter_util.plot_residual_map( fit=fit.fit_normal, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask, as_subplot=True, units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect, cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale, cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize, output_path=output_path, output_filename='', output_format=output_format) plt.subplot(rows, columns, 6) lens_plotter_util.plot_chi_squared_map( fit=fit.fit_normal, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask, as_subplot=True, units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect, cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale, cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize, output_path=output_path, output_filename='', output_format=output_format) plt.subplot(rows, columns, 7) lens_plotter_util.plot_model_data( fit=fit.fit_sensitive, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask, as_subplot=True, units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect, cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale, cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize, output_path=output_path, output_filename='', output_format=output_format) plt.subplot(rows, columns, 8) lens_plotter_util.plot_residual_map( fit=fit.fit_sensitive, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask, as_subplot=True, units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect, cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale, cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize, output_path=output_path, output_filename='', output_format=output_format) plt.subplot(rows, columns, 9) lens_plotter_util.plot_chi_squared_map( fit=fit.fit_sensitive, mask=mask, extract_array_from_mask=extract_array_from_mask, zoom_around_mask=zoom_around_mask, as_subplot=True, units=units, kpc_per_arcsec=kpc_per_arcsec, figsize=figsize, aspect=aspect, cmap=cmap, norm=norm, norm_min=norm_min, norm_max=norm_max, linthresh=linthresh, linscale=linscale, cb_ticksize=cb_ticksize, cb_fraction=cb_fraction, cb_pad=cb_pad, titlesize=titlesize, xlabelsize=xlabelsize, ylabelsize=ylabelsize, xyticksize=xyticksize, output_path=output_path, output_filename='', output_format=output_format) plotter_util.output_subplot_array(output_path=output_path, output_filename=output_filename, output_format=output_format) plt.close()
55.747899
127
0.763793
911
6,634
5.194292
0.127333
0.035926
0.040575
0.063398
0.725275
0.715554
0.715554
0.699704
0.699704
0.676458
0
0.006553
0.14893
6,634
119
128
55.747899
0.831562
0.050347
0
0.62069
0
0
0.00622
0
0
0
0
0
0
1
0.011494
false
0
0.034483
0
0.045977
0
0
0
0
null
0
0
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
f6e3b5434694dec731a462ebd8a18fdc17ccf073
1,044
py
Python
lcm/lcm_optimal_euclidean.py
mingrammer/funmath
c9b6105c0058519e8ed3c7ce155030b4ecdfd3db
[ "MIT" ]
106
2017-07-15T18:48:56.000Z
2021-03-10T07:45:06.000Z
lcm/lcm_optimal_euclidean.py
stzminjae/funmath
3319b8ccfb67346a410bc2e40ca3398288c03244
[ "MIT" ]
7
2017-07-16T01:48:37.000Z
2018-02-16T12:57:37.000Z
lcm/lcm_optimal_euclidean.py
stzminjae/funmath
3319b8ccfb67346a410bc2e40ca3398288c03244
[ "MIT" ]
13
2017-07-15T19:47:00.000Z
2020-10-19T08:17:34.000Z
def gcd_optimal_euclidean(a: int, b: int) -> int: if b == 0: return a a, b = b, a % b return gcd_optimal_euclidean(a, b) def lcm_optimal_euclidean(a: int, b: int) -> int: """Return a LCM (Lowest Common Multiple) of given two integers using euclidean algorithm This function uses euclidean algorithm to get LCM of two integers. The LCM can be obtained by (a * b) / gcd(a, b), so we can use euclidean algorithm to get LCM by (a * b) / GCD. This algorithm works as follows. gcd(100, 36) = gcd(36, 28 (= 100 mod 36)) = gcd(28, 8 (= 36 mod 28)) = gcd(8, 4 (= 28 mod 8)) = gcd(4, 0 (= 8 mod 4)) = 4 (do until smaller one being 0, so then the other becomes GCD) So, the LCM will be (100 * 36) / 4 equals 900. >>> lcm_optimal_euclidean(3, 10) 30 >>> lcm_optimal_euclidean(42, 63) 126 >>> lcm_optimal_euclidean(4041, 8012) 32376492 >>> lcm_optimal_euclidean(-20, 30) 60 """ gcd = gcd_optimal_euclidean(a, b) return abs(int((a * b) / gcd))
29.828571
114
0.60728
173
1,044
3.572254
0.375723
0.20712
0.153722
0.097087
0.239482
0.087379
0.087379
0
0
0
0
0.099869
0.271073
1,044
34
115
30.705882
0.712221
0.66092
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0
0
0.625
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
1
0
0
0
0
1
0
0
3
f6e9f1782f7b241fd84b50ed1c1ec48c21643259
1,357
py
Python
src/peering/azext_peering/_client_factory.py
michimune/azure-cli-extensions
697e2c674e5c0825d44c72d714542fe01331e107
[ "MIT" ]
1
2022-03-22T15:02:32.000Z
2022-03-22T15:02:32.000Z
src/peering/azext_peering/_client_factory.py
michimune/azure-cli-extensions
697e2c674e5c0825d44c72d714542fe01331e107
[ "MIT" ]
1
2018-11-19T05:12:58.000Z
2018-11-19T05:12:58.000Z
src/peering/azext_peering/_client_factory.py
michimune/azure-cli-extensions
697e2c674e5c0825d44c72d714542fe01331e107
[ "MIT" ]
1
2021-06-03T19:31:10.000Z
2021-06-03T19:31:10.000Z
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- def cf_peering(cli_ctx, *_): from azure.cli.core.commands.client_factory import get_mgmt_service_client from .vendored_sdks.peering import PeeringManagementClient return get_mgmt_service_client(cli_ctx, PeeringManagementClient) def cf_legacy_peerings(cli_ctx, *_): return cf_peering(cli_ctx).legacy_peerings def cf_operations(cli_ctx, *_): return cf_peering(cli_ctx).operations def cf_peer_asns(cli_ctx, *_): return cf_peering(cli_ctx).peer_asns def cf_peering_locations(cli_ctx, *_): return cf_peering(cli_ctx).peering_locations def cf_peerings(cli_ctx, *_): return cf_peering(cli_ctx).peerings def cf_peering_service_locations(cli_ctx, *_): return cf_peering(cli_ctx).peering_service_locations def cf_prefixes(cli_ctx, *_): return cf_peering(cli_ctx).prefixes def cf_peering_service_providers(cli_ctx, *_): return cf_peering(cli_ctx).peering_service_providers def cf_peering_services(cli_ctx, *_): return cf_peering(cli_ctx).peering_services
28.87234
94
0.67944
168
1,357
5.053571
0.279762
0.141343
0.141343
0.176678
0.375736
0.375736
0.375736
0.28033
0.157833
0
0
0
0.113486
1,357
46
95
29.5
0.705736
0.247605
0
0
0
0
0
0
0
0
0
0
0
1
0.454545
false
0
0.090909
0.409091
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
3
f6f4cecab3f86f240ef8bcd0d1c2f63037857663
910
py
Python
API/main/migrations/0006_auto_20200414_0908.py
Ju99ernaut/grapeflowAPI
0d6599775e5b666ad735160b65262624fea0bf99
[ "MIT" ]
null
null
null
API/main/migrations/0006_auto_20200414_0908.py
Ju99ernaut/grapeflowAPI
0d6599775e5b666ad735160b65262624fea0bf99
[ "MIT" ]
null
null
null
API/main/migrations/0006_auto_20200414_0908.py
Ju99ernaut/grapeflowAPI
0d6599775e5b666ad735160b65262624fea0bf99
[ "MIT" ]
null
null
null
# Generated by Django 3.0.3 on 2020-04-14 07:08 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('main', '0005_auto_20200413_2105'), ] operations = [ migrations.AlterField( model_name='block', name='project', field=models.ForeignKey(default='0', on_delete=django.db.models.deletion.CASCADE, to='main.Project'), ), migrations.AlterField( model_name='logic', name='project', field=models.ForeignKey(default='0', on_delete=django.db.models.deletion.CASCADE, to='main.Project'), ), migrations.AlterField( model_name='page', name='project', field=models.ForeignKey(default='0', on_delete=django.db.models.deletion.CASCADE, to='main.Project'), ), ]
30.333333
113
0.60989
100
910
5.46
0.39
0.07326
0.102564
0.161172
0.600733
0.600733
0.600733
0.600733
0.600733
0.600733
0
0.050222
0.256044
910
29
114
31.37931
0.756278
0.049451
0
0.521739
1
0
0.117034
0.026651
0
0
0
0
0
1
0
false
0
0.086957
0
0.217391
0
0
0
0
null
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
f6fa50ab9078aecf83c16af63647f98d64bc3aa7
106
py
Python
super_material/__init__.py
pleroux0/super_material
b64d74afdeab7639dd1b220f8b23ade22d87c481
[ "BSD-2-Clause" ]
3
2020-10-20T00:37:59.000Z
2021-07-17T12:59:52.000Z
super_material/__init__.py
pleroux0/super_material
b64d74afdeab7639dd1b220f8b23ade22d87c481
[ "BSD-2-Clause" ]
null
null
null
super_material/__init__.py
pleroux0/super_material
b64d74afdeab7639dd1b220f8b23ade22d87c481
[ "BSD-2-Clause" ]
2
2020-10-02T14:31:07.000Z
2021-08-15T10:00:29.000Z
__version__ = "1.0.0a" __author__ = "Paul le Roux" from .conductivity import * from .gap_energy import *
17.666667
27
0.726415
15
106
4.533333
0.866667
0
0
0
0
0
0
0
0
0
0
0.033708
0.160377
106
5
28
21.2
0.730337
0
0
0
0
0
0.169811
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
100e34c61df61bc865eac40d88e70b3034c2db4a
276
py
Python
clean.py
rayjustinhuang/BitesofPy
03b694c5259ff607621419d9677c5caff90a6057
[ "MIT" ]
null
null
null
clean.py
rayjustinhuang/BitesofPy
03b694c5259ff607621419d9677c5caff90a6057
[ "MIT" ]
null
null
null
clean.py
rayjustinhuang/BitesofPy
03b694c5259ff607621419d9677c5caff90a6057
[ "MIT" ]
null
null
null
def remove_punctuation(input_string): """Return a str with punctuation chars stripped out""" tran_table = str.maketrans('','', '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~') output_string = input_string.translate(tran_table) return output_string pass
30.666667
75
0.594203
28
276
5.571429
0.642857
0.141026
0
0
0
0
0
0
0
0
0
0
0.195652
276
9
76
30.666667
0.702703
0.173913
0
0
0
0
0.03139
0
0
0
0
0
0
1
0.2
false
0.2
0
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
1
0
0
0
0
0
3
100f59c47d54d766ba3ff5cc46102e95afc2ab33
431
py
Python
bflib/spells/magicuser/darkvision.py
ChrisLR/BasicDungeonRL
b293d40bd9a0d3b7aec41b5e1d58441165997ff1
[ "MIT" ]
3
2017-10-28T11:28:38.000Z
2018-09-12T09:47:00.000Z
bflib/spells/magicuser/darkvision.py
ChrisLR/BasicDungeonRL
b293d40bd9a0d3b7aec41b5e1d58441165997ff1
[ "MIT" ]
null
null
null
bflib/spells/magicuser/darkvision.py
ChrisLR/BasicDungeonRL
b293d40bd9a0d3b7aec41b5e1d58441165997ff1
[ "MIT" ]
null
null
null
from bflib import units from bflib.characters import classes from bflib.spells import listing from bflib.spells.base import Spell from bflib.spells.duration import SpellDuration from bflib.spells.range import Touch @listing.register_spell class Darkvision(Spell): name = "Darkvision" class_level_map = { classes.MagicUser: 3, } duration = SpellDuration(duration_per_level=units.Hour(1)) range = Touch
25.352941
62
0.763341
56
431
5.785714
0.446429
0.166667
0.185185
0
0
0
0
0
0
0
0
0.005571
0.167053
431
16
63
26.9375
0.896936
0
0
0
0
0
0.023202
0
0
0
0
0
0
1
0
false
0
0.428571
0
0.785714
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
63f2138c7f6ecd04713fbbea646ddb3dcb6f6400
93
py
Python
ch06/matplotlib_demo.py
jabrena/space-math
313d66f48ef642d7ce4d2c9765d55bc4bdade17b
[ "Apache-2.0" ]
1
2021-07-26T18:40:15.000Z
2021-07-26T18:40:15.000Z
ch06/matplotlib_demo.py
jabrena/space-math
313d66f48ef642d7ce4d2c9765d55bc4bdade17b
[ "Apache-2.0" ]
24
2021-07-10T15:31:05.000Z
2022-03-17T06:43:36.000Z
ch06/matplotlib_demo.py
jabrena/space-math
313d66f48ef642d7ce4d2c9765d55bc4bdade17b
[ "Apache-2.0" ]
null
null
null
import matplotlib.pyplot as plt plt.plot([1,23,2,4]) plt.ylabel('some numbers') plt.show()
13.285714
31
0.709677
17
93
3.882353
0.823529
0
0
0
0
0
0
0
0
0
0
0.060241
0.107527
93
6
32
15.5
0.73494
0
0
0
0
0
0.129032
0
0
0
0
0
0
1
0
true
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
1
0
0
0
0
0
0
3
120b99a0975e33345360483fef0a78b371c52141
2,633
py
Python
ai/split-chinese/jieba-base.py
veaba/ncov
6019f6b90761fd39363f8a7182ffcee22b9cb7ed
[ "MIT" ]
288
2020-01-21T06:12:03.000Z
2022-01-16T08:03:13.000Z
ai/split-chinese/jieba-base.py
veaba/ncov
6019f6b90761fd39363f8a7182ffcee22b9cb7ed
[ "MIT" ]
26
2020-01-20T05:07:31.000Z
2022-03-12T00:24:56.000Z
ai/split-chinese/jieba-base.py
veaba/ncov
6019f6b90761fd39363f8a7182ffcee22b9cb7ed
[ "MIT" ]
48
2020-01-22T09:05:59.000Z
2022-01-16T08:03:11.000Z
# encoding=utf-8 import jieba.posseg as psg # string="来到北京清华大学" string ="""  4月12日0—24时,31个省(自治区、直辖市)和新疆生产建设兵团报告新增确诊病例108例,其中98例为境外输入病例,10例为本土病例(黑龙江7例,广东3例);新增死亡病例2例(湖北2例);新增疑似病例6例,均为境外输入病例(黑龙江4例,上海2例)。   当日新增治愈出院病例88例,解除医学观察的密切接触者1092人,重症病例减少18例。   境外输入现有确诊病例867例(含重症病例38例),现有疑似病例72例。累计确诊病例1378例,累计治愈出院病例511例,无死亡病例。   截至4月12日24时,据31个省(自治区、直辖市)和新疆生产建设兵团报告,现有确诊病例1156例(其中重症病例121例),累计治愈出院病例77663例,累计死亡病例3341例,累计报告确诊病例82160例,现有疑似病例72例。累计追踪到密切接触者719908人,尚在医学观察的密切接触者9655人。   湖北无新增确诊病例,新增治愈出院病例57例(武汉57例),新增死亡病例2例(武汉2例),现有确诊病例244例(武汉243例),其中重症病例75例(武汉74例)。累计治愈出院病例64338例(武汉47186例),累计死亡病例3221例(武汉2579例),累计确诊病例67803例(武汉50008例)。无新增疑似病例,无现有疑似病例。   31个省(自治区、直辖市)和新疆生产建设兵团报告新增无症状感染者61例,其中境外输入无症状感染者12例;当日转为确诊病例28例(境外输入28例);当日解除医学观察55例(境外输入9例);尚在医学观察无症状感染者1064例(境外输入307例)。   累计收到港澳台地区通报确诊病例1437例:香港特别行政区1004例(出院360例,死亡4例),澳门特别行政区45例(出院13例),台湾地区388例(出院109例,死亡6例)。 """ seg_list=psg.cut(string) # print("精确模式===>","| ".join(seg_list)) # 结果===》 """ 精确模式===> |  | 4| 月| 12| 日| 0| —| 24| 时| ,| 31| 个省| (| 自治区| 、| 直辖市| )| 和| 新疆生产建设兵团| 报告| 新增| 确诊| 病例| 108| 例| ,| 其中| 98| 例为| 境外| 输入| 病例| ,| 10| 例为| 本土| 病例| (| 黑龙江| 7| 例| ,| 广东| 3| 例| )| ;| 新增| 死亡| 病例| 2| 例| (| 湖北| 2| 例| )| ;| 新增| 疑似病例| 6| 例| ,| 均| 为| 境外| 输入| 病例| (| 黑龙江| 4| 例| ,| 上海| 2| 例| )| 。| |  |  | 当日| 新增| 治愈| 出院| 病例| 88| 例| ,| 解除| 医学观察| 的| 密切接触| 者| 1092| 人| ,| 重症| 病例| 减少| 18| 例| 。| |  |  | 境外| 输入| 现有| 确诊| 病例| 867| 例| (| 含| 重症| 病例| 38| 例| )| ,| 现有| 疑似病例| 72| 例| 。| 累计| 确诊| 病例| 1378| 例| ,| 累计| 治愈| 出院| 病例| 511| 例| ,| 无| 死亡| 病例| 。| |  |  | 截至| 4| 月| 12| 日| 24| 时| ,| 据| 31| 个省| (| 自治区| 、| 直辖市| )| 和| 新疆生产建设兵团| 报告| ,| 现有| 确诊| 病例| 1156| 例| (| 其中| 重症| 病例| 121| 例| )| ,| 累计| 治愈| 出院| 病例| 77663| 例| ,| 累计| 死亡| 病 例| 3341| 例| ,| 累计| 报告| 确诊| 病例| 82160| 例| ,| 现有| 疑似病例| 72| 例| 。| 累计| 追踪| 到| 密切接触| 者| 719908| 人| ,| 尚| 在| 医学观察| 的| 密切接触| 者| 9655| 人| 。| |  |  | 湖北| 无| 新增| 确诊| 病例| ,| 新增| 治愈| 出院| 病例| 57| 例| (| 武汉| 57| 例| )| ,| 新增| 死亡| 病例| 2| 例| (| 武汉| 2| 例| )| ,| 现有| 确诊| 病例| 244| 例| (| 武汉| 243| 例| )| ,| 其中| 重症| 病例| 75| 例| (| 武汉 | 74| 例| )| 。| 累计| 治愈| 出院| 病例| 64338| 例| (| 武汉| 47186| 例| )| ,| 累计| 死亡| 病例| 3221| 例| (| 武汉| 2579| 例| )| ,| 累计| 确诊| 病例| 67803| 例| (| 武汉| 50008| 例| )| 。| 无| 新增| 疑似病例| ,| 无| 现有| 疑似病例 | 。| |  |  | 31| 个省| (| 自治区| 、| 直辖市| )| 和| 新疆生产建设兵团| 报告| 新增| 无症状| 感染者| 61| 例| ,| 其中| 境外| 输入| 无症状| 感染者| 12| 例| ;| 当日| 转为| 确诊| 病例| 28| 例| (| 境外| 输入| 28| 例| )| ;| 当日| 解除| 医学观 察| 55| 例| (| 境外| 输入| 9| 例| )| ;| 尚| 在| 医学观察| 无症状| 感染者| 1064| 例| (| 境外| 输入| 307| 例| )| 。| |  |  | 累计| 收到| 港澳台地区| 通报| 确诊| 病例| 1437| 例| :| 香港特别行政区| 1004| 例| (| 出院| 360| 例| ,| 死亡| 4| 例| )| ,| 澳门特别行政区| 45| 例| (| 出院| 13| 例| )| ,| 台湾地区| 388| 例| (| 出院| 109| 例| ,| 死亡| 6| 例| )| 。| | """ for i in seg_list: print("==>",type(i),i)
65.825
179
0.550703
429
2,633
3.377622
0.463869
0.027605
0.020704
0.020704
0.093858
0.075224
0.046239
0.031746
0
0
0
0.161033
0.191037
2,633
40
180
65.825
0.51831
0.029244
0
0
0
0.307692
0.866667
0.838889
0
0
0
0
0
1
0
false
0
0.076923
0
0.076923
0.076923
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
120dee089b6cc07493a0c81d69883ab91214ae37
187
py
Python
storage/urls.py
Robin8Put/pmes
338bec94162098f05b75bad035417317e1252fd2
[ "Apache-2.0" ]
5
2018-07-31T07:37:09.000Z
2019-05-27T04:40:38.000Z
storage/urls.py
Robin8Put/pmes
338bec94162098f05b75bad035417317e1252fd2
[ "Apache-2.0" ]
4
2018-08-01T11:11:54.000Z
2022-03-11T23:20:53.000Z
storage/urls.py
Robin8Put/pmes
338bec94162098f05b75bad035417317e1252fd2
[ "Apache-2.0" ]
5
2018-06-09T07:42:04.000Z
2018-12-28T21:15:52.000Z
import tornado.web import settings import views storage_router = tornado.web.Application([ (settings.ENDPOINTS["storage"], views.StorageHandler) ], debug=settings.DEBUG)
26.714286
62
0.73262
20
187
6.8
0.55
0.147059
0
0
0
0
0
0
0
0
0
0
0.160428
187
7
63
26.714286
0.866242
0
0
0
0
0
0.037234
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
12280aa5408dc93a80e62d7f0a71a4647ad5b226
5,088
py
Python
branches/old/python/ansi-C-generator/generate_source_a4d.py
jeffhammond/spaghetty
e2dbe2dd2621110b899b21dff590906a579e8bf5
[ "BSD-2-Clause" ]
1
2018-01-05T16:13:08.000Z
2018-01-05T16:13:08.000Z
branches/old/python/ansi-C-generator/generate_source_a4d.py
jeffhammond/spaghetty
e2dbe2dd2621110b899b21dff590906a579e8bf5
[ "BSD-2-Clause" ]
null
null
null
branches/old/python/ansi-C-generator/generate_source_a4d.py
jeffhammond/spaghetty
e2dbe2dd2621110b899b21dff590906a579e8bf5
[ "BSD-2-Clause" ]
null
null
null
import fileinput import string import sys import os c_compiler = 'icc' c_link_flags = '-g -O1 -xT -march=core2 -mtune=core2 -align'# -strict-ansi' c_opt_flags = '-g -O3 -xT -march=core2 -mtune=core2 -funroll-loops -align'# -strict-ansi' fortran_compiler = 'ifort' fortran_link_flags = '-g -O1 -xT -march=core2 -mtune=core2 -align ' fortran_opt_flags = '-g -O3 -xT -march=core2 -mtune=core2 -funroll-loops -align ' src_dir = '/home/jeff/code/spaghetty/trunk/source/ansi-C/' exe_dir = '/home/jeff/code/spaghetty/trunk/binary/ansi-C/' modlabel = 'a4d' lib_name = 'tce_sort_'+modlabel+'.a' cind = ' ' ctab = ' ' def perm(l): sz = len(l) if sz <= 1: return [l] return [p[:i]+[l[0]]+p[i:] for i in xrange(sz) for p in perm(l[1:])] #indices = ['1','2','3','4'] #indices = ['4','3','2','1'] all_permutations = perm(['1','2','3','4']) #transpose_list = [indices] #transpose_list = perm(indices) transpose_list = all_permutations #transpose_list = [['2','1','3','4'],['1','2','4','3']] #loop_list = [indices] #loop_list = perm(indices) loop_list = all_permutations for transpose_order in transpose_list: A = transpose_order[0] B = transpose_order[1] C = transpose_order[2] D = transpose_order[3] for loop_order in loop_list: a = loop_order[0] b = loop_order[1] c = loop_order[2] d = loop_order[3] subroutine_name = 'trans_a4d_'+A+B+C+D+'_loop_'+a+b+c+d+'_' source_name = subroutine_name+'.c' source_file = open(source_name,'w') source_file.write(cind+'#include <stdlib.h>\n') source_file.write(cind+'#include <stdio.h>\n\n') source_file.write(cind+'void '+subroutine_name+'( double ****unsorted, double ****sorted,\n') source_file.write(cind+8*ctab+'int *p_dim1, int *p_dim2, int *p_dim3, int *p_dim4, double *p_factor ) {\n\n') source_file.write(cind+'int dim1,dim2,dim3,dim4;\n') source_file.write(cind+'int j1,j2,j3,j4;\n') source_file.write(cind+'int i,j,k,l;\n') source_file.write(cind+'double factor;\n') # source_file.write(cind+'double**** _sorted;\n\n') source_file.write(cind+'factor = *p_factor;\n\n') source_file.write(cind+'dim1 = *p_dim1;\n') source_file.write(cind+'dim2 = *p_dim2;\n') source_file.write(cind+'dim3 = *p_dim3;\n') source_file.write(cind+'dim4 = *p_dim4;\n\n') # source_file.write(cind+'_sorted = (double ****) malloc (dim1*sizeof(double ***));\n\n') # source_file.write(cind+0*ctab+'for (i=0; i<dim1; i++) {\n') # source_file.write(cind+1*ctab+'_sorted[i] = (double ***) malloc (dim2*sizeof(double **));\n') # source_file.write(cind+0*ctab+'}\n\n') # source_file.write(cind+0*ctab+'for (i=0; i<dim1; i++) {\n') # source_file.write(cind+1*ctab+'for (j=0; j<dim2; j++) {\n') # source_file.write(cind+2*ctab+'_sorted[i][j] = (double **) malloc (dim3*sizeof(double *));\n') # source_file.write(cind+1*ctab+'}\n') # source_file.write(cind+0*ctab+'}\n\n') # source_file.write(cind+0*ctab+'for (i=0; i<dim1; i++) {\n') # source_file.write(cind+1*ctab+'for (j=0; j<dim2; j++) {\n') # source_file.write(cind+2*ctab+'for (k=0; k<dim3; k++) {\n') # source_file.write(cind+3*ctab+'_sorted[i][j][k] = sorted[dim1*dim2*dim3*i + dim2*dim3*j + dim3*k];\n') # source_file.write(cind+2*ctab+'}\n') # source_file.write(cind+1*ctab+'}\n') # source_file.write(cind+0*ctab+'}\n\n') #source_file.write(cind+'printf(" ****** BEFORE LOOPS ******\\n");\n') source_file.write(cind+'/* pluto start (dim1,dim2,dim3,dim4) */\n') source_file.write(cind+0*ctab+'for( j'+a+' = 0; j'+a+'<dim'+a+'; j'+a+'++) {\n') source_file.write(cind+1*ctab+'for( j'+b+' = 0; j'+b+'<dim'+b+'; j'+b+'++) {\n') source_file.write(cind+2*ctab+'for( j'+c+' = 0; j'+c+'<dim'+c+'; j'+c+'++) {\n') source_file.write(cind+3*ctab+'for( j'+d+' = 0; j'+d+'<dim'+d+'; j'+d+'++) {\n') #source_file.write(cind+4*ctab+'printf("j'+a+'=%d j'+b+'=%d j'+c+'=%d j'+d+'=%d\\n",j'+a+', j'+b+', j'+c+', j'+d+');\n') #source_file.write(cind+4*ctab+'sorted[j4][j3][j2][j1] = unsorted[j1][j2][j3][j4] * factor;\n') source_file.write(cind+4*ctab+'sorted[j1][j2][j3][j4] = unsorted[j'+a+'][j'+b+'][j'+c+'][j'+d+'] * factor;\n') source_file.write(cind+3*ctab+'}\n') source_file.write(cind+2*ctab+'}\n') source_file.write(cind+1*ctab+'}\n') source_file.write(cind+0*ctab+'}\n') source_file.write(cind+'/* pluto end */\n') #source_file.write(cind+'printf(" ****** AFTER LOOPS ******\\n");\n') source_file.write(cind+'return;\n') source_file.write(cind+'}\n\n') source_file.close() print c_compiler+' '+c_opt_flags+' -c '+source_name os.system(c_compiler+' '+c_opt_flags+' -c '+source_name) os.system('ar -r '+lib_name+' '+subroutine_name+'.o') os.system('rm '+subroutine_name+'.o') os.system('mv '+subroutine_name+'.c '+src_dir)
47.551402
128
0.584906
824
5,088
3.461165
0.139563
0.171809
0.247195
0.313114
0.595722
0.525947
0.427419
0.370968
0.319776
0.265428
0
0.03175
0.17669
5,088
106
129
48
0.649081
0.338836
0
0
0
0.014493
0.289016
0.047119
0
0
0
0
0
0
null
null
0
0.057971
null
null
0.014493
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
3
12309dafba73623c841ad45a9bf13a6868d28f00
182
py
Python
scripts/dir.py
DEMON1A/EasyShell
d37589b616f844c4d6f01ad594642033463f346b
[ "MIT" ]
3
2021-02-02T15:07:27.000Z
2021-05-21T10:02:08.000Z
scripts/dir.py
DEMON1A/EasyShell
d37589b616f844c4d6f01ad594642033463f346b
[ "MIT" ]
7
2021-02-03T11:14:04.000Z
2021-02-18T19:39:25.000Z
scripts/dir.py
DEMON1A/EasyShell
d37589b616f844c4d6f01ad594642033463f346b
[ "MIT" ]
null
null
null
from os import system , name def Run(Input): if name == "nt": # Windows Machine system('dir') else: # Linux/Unix Machine system('ls')
20.222222
29
0.505495
21
182
4.380952
0.809524
0.282609
0
0
0
0
0
0
0
0
0
0
0.379121
182
9
30
20.222222
0.814159
0.186813
0
0
0
0
0.050725
0
0
0
0
0
0
1
0.166667
false
0
0.166667
0
0.333333
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
1266741504356d2c9f8af5c310226fc914cad6c6
663
py
Python
homedisplay/info_internet_connection/views.py
ojarva/home-info-display
873d022308732baff94d0dc2381cf9dc7dce23b7
[ "BSD-3-Clause" ]
1
2016-11-28T04:35:06.000Z
2016-11-28T04:35:06.000Z
homedisplay/info_internet_connection/views.py
ojarva/home-info-display
873d022308732baff94d0dc2381cf9dc7dce23b7
[ "BSD-3-Clause" ]
160
2015-01-01T20:59:29.000Z
2016-04-25T13:36:52.000Z
homedisplay/info_internet_connection/views.py
ojarva/home-info-display
873d022308732baff94d0dc2381cf9dc7dce23b7
[ "BSD-3-Clause" ]
1
2015-02-25T21:24:01.000Z
2015-02-25T21:24:01.000Z
from .models import get_latest_serialized from django.core import serializers from django.http import HttpResponse from django.views.generic import View from django.conf import settings import json class GetJson(View): def get(self, _): # pylint:disable=no-self-use return HttpResponse(json.dumps(get_latest_serialized()), content_type="application/json") class WifiInfo(View): def get(self, _): # pylint:disable=no-self-use wifi_settings = { "ssid": settings.WIFI_SSID, "passphrase": settings.WIFI_PASSPHRASE } return HttpResponse(json.dumps(wifi_settings), content_type="application/json")
30.136364
97
0.720965
82
663
5.682927
0.414634
0.085837
0.081545
0.060086
0.154506
0.154506
0.154506
0.154506
0.154506
0
0
0
0.182504
663
21
98
31.571429
0.859779
0.07994
0
0.125
0
0
0.075783
0
0
0
0
0
0
1
0.125
false
0.0625
0.375
0.0625
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
1
0
0
3
126b7d17b9178997cd2b9b067f78352641394f99
375
py
Python
supervised/regression/ridgeRegression.py
SaadChaouki/ml-eli5-cli5
625a69edadf4737e41c58193873cf8a54273d7f0
[ "MIT" ]
1
2021-05-04T19:53:12.000Z
2021-05-04T19:53:12.000Z
supervised/regression/ridgeRegression.py
SaadChaouki/ml-eli5-cli5
625a69edadf4737e41c58193873cf8a54273d7f0
[ "MIT" ]
null
null
null
supervised/regression/ridgeRegression.py
SaadChaouki/ml-eli5-cli5
625a69edadf4737e41c58193873cf8a54273d7f0
[ "MIT" ]
null
null
null
from supervised.base.baseRegression import BaseRegression from processing.regularization import L2Regularization class RidgeRegression(BaseRegression): def __init__(self, iterations=5000, learning_rate=.01, alpha=1): super(RidgeRegression, self).__init__(iterations=iterations, learning_rate=learning_rate) self.regularization = L2Regularization(alpha)
41.666667
97
0.808
38
375
7.684211
0.552632
0.123288
0
0
0
0
0
0
0
0
0
0.027108
0.114667
375
8
98
46.875
0.85241
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
89ca9e1945a597daeaa0428e522ece404164bfa6
3,819
py
Python
fully_colorization/preprocess/change_conv2d.py
HamsterBiz/Automatic-Video-Colorization-1
e110650d130d3eadfe29073bf445513d10a5b3f6
[ "MIT" ]
3
2020-06-11T13:10:52.000Z
2022-02-14T05:44:23.000Z
fully_colorization/preprocess/change_conv2d.py
HamsterBiz/Automatic-Video-Colorization-1
e110650d130d3eadfe29073bf445513d10a5b3f6
[ "MIT" ]
1
2022-03-12T00:28:57.000Z
2022-03-12T00:28:57.000Z
fully_colorization/preprocess/change_conv2d.py
HamsterBiz/Automatic-Video-Colorization-1
e110650d130d3eadfe29073bf445513d10a5b3f6
[ "MIT" ]
2
2020-10-31T11:54:53.000Z
2021-03-26T10:57:34.000Z
# -*- coding: utf-8 -*- # pretrained model parameter에서 slim.conv2d의 variable들을 tf.layers.conv2d로 바꿔줌. old_check_file = "ckpt_woflow/model.ckpt" #기존 파일이름 new_check_file = "ckpt_woflow/model_renamed.ckpt" # 저장할 새로운 파일이름 import tensorflow as tf tf.compat.v1.disable_eager_execution() vars_to_rename = { "individual/g_conv1_1/weights": "individual/g_conv1_1/kernel", "individual/g_conv1_1/biases": "individual/g_conv1_1/bias", "individual/g_conv1_2/weights": "individual/g_conv1_2/kernel", "individual/g_conv1_2/biases": "individual/g_conv1_2/bias", "individual/g_conv2_1/weights": "individual/g_conv2_1/kernel", "individual/g_conv2_1/biases": "individual/g_conv2_1/bias", "individual/g_conv2_2/weights": "individual/g_conv2_2/kernel", "individual/g_conv2_2/biases": "individual/g_conv2_2/bias", "individual/g_conv3_1/weights": "individual/g_conv3_1/kernel", "individual/g_conv3_1/biases": "individual/g_conv3_1/bias", "individual/g_conv3_2/weights": "individual/g_conv3_2/kernel", "individual/g_conv3_2/biases": "individual/g_conv3_2/bias", "individual/g_conv4_1/weights": "individual/g_conv4_1/kernel", "individual/g_conv4_1/biases": "individual/g_conv4_1/bias", "individual/g_conv4_2/weights": "individual/g_conv4_2/kernel", "individual/g_conv4_2/biases": "individual/g_conv4_2/bias", "individual/g_conv5_1/weights": "individual/g_conv5_1/kernel", "individual/g_conv5_1/biases": "individual/g_conv5_1/bias", "individual/g_conv5_2/weights": "individual/g_conv5_2/kernel", "individual/g_conv5_2/biases": "individual/g_conv5_2/bias", "individual/g_conv6_1/weights": "individual/g_conv6_1/kernel", "individual/g_conv6_1/biases": "individual/g_conv6_1/bias", "individual/g_conv6_2/weights": "individual/g_conv6_2/kernel", "individual/g_conv6_2/biases": "individual/g_conv6_2/bias", "individual/g_conv7_1/weights": "individual/g_conv7_1/kernel", "individual/g_conv7_1/biases": "individual/g_conv7_1/bias", "individual/g_conv7_2/weights": "individual/g_conv7_2/kernel", "individual/g_conv7_2/biases": "individual/g_conv7_2/bias", "individual/g_conv8_1/weights": "individual/g_conv8_1/kernel", "individual/g_conv8_1/biases": "individual/g_conv8_1/bias", "individual/g_conv8_2/weights": "individual/g_conv8_2/kernel", "individual/g_conv8_2/biases": "individual/g_conv8_2/bias", "individual/g_conv9_1/weights": "individual/g_conv9_1/kernel", "individual/g_conv9_1/biases": "individual/g_conv9_1/bias", "individual/g_conv9_2/weights": "individual/g_conv9_2/kernel", "individual/g_conv9_2/biases": "individual/g_conv9_2/bias", "individual/g_up_1/up_conv1/weights": "individual/g_up_1/up_conv1/kernel", "individual/g_up_1/up_conv1/biases": "individual/g_up_1/up_conv1/bias", "individual/g_up_2/up_conv1/weights": "individual/g_up_2/up_conv1/kernel", "individual/g_up_2/up_conv1/biases": "individual/g_up_2/up_conv1/bias", "individual/g_up_3/up_conv1/weights": "individual/g_up_3/up_conv1/kernel", "individual/g_up_3/up_conv1/biases": "individual/g_up_3/up_conv1/bias", "individual/g_up_4/up_conv1/weights": "individual/g_up_4/up_conv1/kernel", "individual/g_up_4/up_conv1/biases": "individual/g_up_4/up_conv1/bias" } new_checkpoint_vars = {} reader = tf.compat.v1.train.NewCheckpointReader(old_check_file) for old_name in reader.get_variable_to_shape_map(): if old_name in vars_to_rename: new_name = vars_to_rename[old_name] else: new_name = old_name new_checkpoint_vars[new_name] = tf.Variable(reader.get_tensor(old_name)) init = tf.compat.v1.global_variables_initializer() saver = tf.compat.v1.train.Saver(new_checkpoint_vars) with tf.compat.v1.Session() as sess: sess.run(init) saver.save(sess, new_check_file)
53.788732
78
0.758576
603
3,819
4.419569
0.131012
0.363227
0.148593
0.064165
0.177111
0.159099
0
0
0
0
0
0.053473
0.098979
3,819
70
79
54.557143
0.721011
0.030636
0
0
0
0
0.676765
0.676765
0
0
0
0
0
1
0
false
0
0.015873
0
0.015873
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
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
89cb794317763c2361b3ee494c9f942ea5e6b4de
23
py
Python
pyshinobicctvapi/const.py
xannor/yshinobicctvapi
6f96ef103ea10e9cfe4897b690430ea5480d98ba
[ "Unlicense" ]
null
null
null
pyshinobicctvapi/const.py
xannor/yshinobicctvapi
6f96ef103ea10e9cfe4897b690430ea5480d98ba
[ "Unlicense" ]
null
null
null
pyshinobicctvapi/const.py
xannor/yshinobicctvapi
6f96ef103ea10e9cfe4897b690430ea5480d98ba
[ "Unlicense" ]
null
null
null
STREAM_MJPEG = "mjpeg"
11.5
22
0.73913
3
23
5.333333
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.130435
23
1
23
23
0.8
0
0
0
0
0
0.217391
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
89d177050e0f9c43ee5d6213695249987e195575
1,407
py
Python
test/test_tags_api.py
hi-artem/twistlock-py
9888e905f5b9d3cc00f9b84244588c0992f8e4f4
[ "RSA-MD" ]
null
null
null
test/test_tags_api.py
hi-artem/twistlock-py
9888e905f5b9d3cc00f9b84244588c0992f8e4f4
[ "RSA-MD" ]
null
null
null
test/test_tags_api.py
hi-artem/twistlock-py
9888e905f5b9d3cc00f9b84244588c0992f8e4f4
[ "RSA-MD" ]
null
null
null
# coding: utf-8 """ Prisma Cloud Compute API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: 21.04.439 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import unittest import openapi_client from openapi_client.api.tags_api import TagsApi # noqa: E501 from openapi_client.rest import ApiException class TestTagsApi(unittest.TestCase): """TagsApi unit test stubs""" def setUp(self): self.api = openapi_client.api.tags_api.TagsApi() # noqa: E501 def tearDown(self): pass def test_api_v1_tags_get(self): """Test case for api_v1_tags_get """ pass def test_api_v1_tags_id_delete(self): """Test case for api_v1_tags_id_delete """ pass def test_api_v1_tags_id_put(self): """Test case for api_v1_tags_id_put """ pass def test_api_v1_tags_id_vuln_delete(self): """Test case for api_v1_tags_id_vuln_delete """ pass def test_api_v1_tags_id_vuln_post(self): """Test case for api_v1_tags_id_vuln_post """ pass def test_api_v1_tags_post(self): """Test case for api_v1_tags_post """ pass if __name__ == '__main__': unittest.main()
20.1
124
0.656006
195
1,407
4.358974
0.312821
0.070588
0.127059
0.103529
0.451765
0.390588
0.338824
0.284706
0.115294
0
0
0.027778
0.257996
1,407
69
125
20.391304
0.786398
0.405117
0
0.291667
1
0
0.010309
0
0
0
0
0
0
1
0.333333
false
0.291667
0.208333
0
0.583333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
3
89dcd41c1b43c62ebd5fac901007bae71bac0d77
385
py
Python
dbbackup/utils.py
lefeverd/dbbackup
cbd9f09567efa7e34a450dac462875582f8e02b2
[ "Apache-2.0" ]
null
null
null
dbbackup/utils.py
lefeverd/dbbackup
cbd9f09567efa7e34a450dac462875582f8e02b2
[ "Apache-2.0" ]
1
2021-06-02T00:38:37.000Z
2021-06-02T00:38:37.000Z
dbbackup/utils.py
lefeverd/dbbackup
cbd9f09567efa7e34a450dac462875582f8e02b2
[ "Apache-2.0" ]
null
null
null
import os def get_file_size(absolute_path): return os.stat(absolute_path).st_size def sizeof_fmt(num, suffix='B'): # Thanks https://stackoverflow.com/a/1094933 for unit in ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi']: if abs(num) < 1024.0: return "%3.1f%s%s" % (num, unit, suffix) num /= 1024.0 return "%.1f%s%s" % (num, 'Yi', suffix)
25.666667
63
0.561039
60
385
3.5
0.666667
0.114286
0.07619
0.133333
0
0
0
0
0
0
0
0.067797
0.233766
385
14
64
27.5
0.644068
0.109091
0
0
0
0
0.099707
0
0
0
0
0
0
1
0.222222
false
0
0.111111
0.111111
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
89f93f80f884d8be4061c9cfd378e03b3f3d6fbb
214
py
Python
bitmovin_api_sdk/models/file_input_stream_type.py
hofmannben/bitmovin-api-sdk-python
71aae5cd8a31aa0ad54ca07a6f546a624e8686a9
[ "MIT" ]
null
null
null
bitmovin_api_sdk/models/file_input_stream_type.py
hofmannben/bitmovin-api-sdk-python
71aae5cd8a31aa0ad54ca07a6f546a624e8686a9
[ "MIT" ]
1
2020-07-06T07:13:43.000Z
2020-07-06T07:13:43.000Z
bitmovin_api_sdk/models/file_input_stream_type.py
hofmannben/bitmovin-api-sdk-python
71aae5cd8a31aa0ad54ca07a6f546a624e8686a9
[ "MIT" ]
1
2020-07-06T07:07:26.000Z
2020-07-06T07:07:26.000Z
# coding: utf-8 from enum import Enum from six import string_types, iteritems from bitmovin_api_sdk.common.poscheck import poscheck_model class FileInputStreamType(Enum): TTML = "TTML" WEBVTT = "WEBVTT"
19.454545
59
0.766355
29
214
5.517241
0.689655
0
0
0
0
0
0
0
0
0
0
0.005587
0.163551
214
10
60
21.4
0.888268
0.060748
0
0
0
0
0.050251
0
0
0
0
0
0
1
0
false
0
0.5
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
d64e30f234f26d2076908cbc1a63b9953e0bde12
694
py
Python
thread_support.py
loretoparisi/python-threading
f06f809fd830e3e930bbc748df6f6217e03ad6c2
[ "MIT" ]
4
2019-05-23T19:55:09.000Z
2019-06-12T19:24:12.000Z
thread_support.py
loretoparisi/python-threading
f06f809fd830e3e930bbc748df6f6217e03ad6c2
[ "MIT" ]
1
2019-09-04T13:41:08.000Z
2019-09-23T16:29:31.000Z
thread_support.py
loretoparisi/python-threading
f06f809fd830e3e930bbc748df6f6217e03ad6c2
[ "MIT" ]
null
null
null
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Copyright (c) 2019 loretoparisi@gmail.com # from functools import wraps from .bounded_pool_executor import BoundedThreadPoolExecutor from .bounded_pool_executor import BoundedProcessPoolExecutor _DEFAULT_POOL = BoundedThreadPoolExecutor(max_workers=5) _PROCESS_POOL = BoundedProcessPoolExecutor(max_workers=5) def threadpool(f, executor=None): @wraps(f) def wrap(*args, **kwargs): return (executor or _DEFAULT_POOL).submit(f, *args, **kwargs) return wrap def processpool(f, executor=None): @wraps(f) def wrap(*args, **kwargs): return (executor or _PROCESS_POOL).submit(f, *args, **kwargs) return wrap
25.703704
69
0.729107
84
694
5.857143
0.440476
0.081301
0.130081
0.093496
0.455285
0.337398
0.337398
0.211382
0.211382
0.211382
0
0.013629
0.154179
694
26
70
26.692308
0.824532
0.116715
0
0.4
0
0
0
0
0
0
0
0
0
1
0.266667
false
0
0.2
0.133333
0.733333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3