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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3d4f4e1a387238d7b4f549edc3f2b67a707cc34d | 635 | py | Python | exasol_data_science_utils_python/preprocessing/sql/schema/schema_name.py | exasol/data-science-utils-python | 44f4019b30f4945e14a8ee19c1a4f6bed68692d9 | [
"MIT"
] | null | null | null | exasol_data_science_utils_python/preprocessing/sql/schema/schema_name.py | exasol/data-science-utils-python | 44f4019b30f4945e14a8ee19c1a4f6bed68692d9 | [
"MIT"
] | 27 | 2021-06-04T15:45:21.000Z | 2022-02-14T12:16:34.000Z | exasol_data_science_utils_python/preprocessing/sql/schema/schema_name.py | exasol/data-science-utils-python | 44f4019b30f4945e14a8ee19c1a4f6bed68692d9 | [
"MIT"
] | null | null | null | from typeguard import typechecked
from exasol_data_science_utils_python.preprocessing.sql.schema.identifier import ExasolIdentifier
from exasol_data_science_utils_python.utils.repr_generation_for_object import generate_repr_for_object
class SchemaName(ExasolIdentifier):
@typechecked
def __init__(self, schema_name: str):
super().__init__(schema_name)
def fully_qualified(self) -> str:
return self.quoted_name()
def __eq__(self, other):
return isinstance(other, SchemaName) and \
self.name == other.name
def __repr__(self):
return generate_repr_for_object(self)
| 30.238095 | 102 | 0.749606 | 77 | 635 | 5.701299 | 0.454545 | 0.061503 | 0.063781 | 0.095672 | 0.145786 | 0.145786 | 0 | 0 | 0 | 0 | 0 | 0 | 0.179528 | 635 | 20 | 103 | 31.75 | 0.84261 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.214286 | 0.214286 | 0.785714 | 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 |
3d57527c27d305bc9bbefac505d77c1f418f95ca | 2,883 | py | Python | release/stubs.min/Autodesk/Revit/DB/Analysis_parts/EnergyAnalysisDetailModelOptions.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/Autodesk/Revit/DB/Analysis_parts/EnergyAnalysisDetailModelOptions.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/Autodesk/Revit/DB/Analysis_parts/EnergyAnalysisDetailModelOptions.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class EnergyAnalysisDetailModelOptions(object,IDisposable):
"""
Options that govern the calculations for the generation of the energy analysis detail model.
EnergyAnalysisDetailModelOptions()
"""
def Dispose(self):
""" Dispose(self: EnergyAnalysisDetailModelOptions) """
pass
def ReleaseUnmanagedResources(self,*args):
""" ReleaseUnmanagedResources(self: EnergyAnalysisDetailModelOptions,disposing: bool) """
pass
def __enter__(self,*args):
""" __enter__(self: IDisposable) -> object """
pass
def __exit__(self,*args):
""" __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """
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 __repr__(self,*args):
""" __repr__(self: object) -> str """
pass
EnergyModelType=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""It indicates whether the energy model is based on rooms/spaces or building elements.
Get: EnergyModelType(self: EnergyAnalysisDetailModelOptions) -> EnergyModelType
Set: EnergyModelType(self: EnergyAnalysisDetailModelOptions)=value
"""
ExportMullions=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Indicates if to specify the setting for exporting mullions.
Get: ExportMullions(self: EnergyAnalysisDetailModelOptions) -> bool
Set: ExportMullions(self: EnergyAnalysisDetailModelOptions)=value
"""
IncludeShadingSurfaces=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Indicates if to set and get the setting for if shading surfaces should be included.
Get: IncludeShadingSurfaces(self: EnergyAnalysisDetailModelOptions) -> bool
Set: IncludeShadingSurfaces(self: EnergyAnalysisDetailModelOptions)=value
"""
IsValidObject=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Specifies whether the .NET object represents a valid Revit entity.
Get: IsValidObject(self: EnergyAnalysisDetailModelOptions) -> bool
"""
SimplifyCurtainSystems=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Indicates if to specify the setting for simplified curtain systems.
Get: SimplifyCurtainSystems(self: EnergyAnalysisDetailModelOptions) -> bool
Set: SimplifyCurtainSystems(self: EnergyAnalysisDetailModelOptions)=value
"""
Tier=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Level of computation for energy analysis model.
Get: Tier(self: EnergyAnalysisDetailModelOptions) -> EnergyAnalysisDetailModelTier
Set: Tier(self: EnergyAnalysisDetailModelOptions)=value
"""
| 27.721154 | 215 | 0.741242 | 296 | 2,883 | 6.993243 | 0.293919 | 0.086957 | 0.052174 | 0.069565 | 0.246377 | 0.246377 | 0.246377 | 0.246377 | 0.246377 | 0.246377 | 0 | 0 | 0.154006 | 2,883 | 103 | 216 | 27.990291 | 0.848708 | 0.214707 | 0 | 0.315789 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.315789 | false | 0.315789 | 0 | 0 | 0.684211 | 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 |
3d60ff192c7219fdcc31632658fcf63aa0c8704e | 89 | py | Python | python/79.word-search.py | stavanmehta/leetcode | 1224e43ce29430c840e65daae3b343182e24709c | [
"Apache-2.0"
] | null | null | null | python/79.word-search.py | stavanmehta/leetcode | 1224e43ce29430c840e65daae3b343182e24709c | [
"Apache-2.0"
] | null | null | null | python/79.word-search.py | stavanmehta/leetcode | 1224e43ce29430c840e65daae3b343182e24709c | [
"Apache-2.0"
] | null | null | null | class Solution:
def exist(self, board: List[List[str]], word: str) -> bool:
| 22.25 | 63 | 0.58427 | 12 | 89 | 4.333333 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.258427 | 89 | 3 | 64 | 29.666667 | 0.787879 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
e9e6d94ab842c52fdb40f0c276f03fa34b9dff05 | 595 | py | Python | api/api/models/survey_result.py | arunrapolu4491/representation-grant-app | e9e70cb095be68211539a533708023c8842cded4 | [
"Apache-2.0"
] | 4 | 2020-04-06T23:42:41.000Z | 2022-03-20T18:32:59.000Z | api/api/models/survey_result.py | arunrapolu4491/representation-grant-app | e9e70cb095be68211539a533708023c8842cded4 | [
"Apache-2.0"
] | 86 | 2020-03-11T01:33:07.000Z | 2022-03-31T21:45:04.000Z | api/api/models/survey_result.py | arunrapolu4491/representation-grant-app | e9e70cb095be68211539a533708023c8842cded4 | [
"Apache-2.0"
] | 10 | 2020-01-22T17:28:35.000Z | 2021-07-29T20:42:22.000Z | from django.db import models
class SurveyResult(models.Model):
create_timestamp = models.DateTimeField(auto_now_add=True, blank=True, null=True)
update_timestamp = models.DateTimeField(auto_now=True, blank=True, null=True)
completed_timestamp = models.DateTimeField(auto_now=True, blank=True, null=True)
collection = models.CharField(max_length=100, default="", blank=True)
survey_type = models.CharField(max_length=100)
result = models.JSONField(blank=True)
user = models.ForeignKey(
"User", related_name="survey_results", on_delete=models.CASCADE
)
| 37.1875 | 85 | 0.74958 | 76 | 595 | 5.697368 | 0.486842 | 0.103926 | 0.193995 | 0.221709 | 0.512702 | 0.258661 | 0.258661 | 0.258661 | 0.258661 | 0.258661 | 0 | 0.011719 | 0.139496 | 595 | 15 | 86 | 39.666667 | 0.833984 | 0 | 0 | 0 | 0 | 0 | 0.030252 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.090909 | 0 | 0.818182 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
e9ef5c1ee243ed64ce35307bcb6b5ce545612639 | 702 | py | Python | dsvfile/Models/PowerSystem/PowerNetwork.py | phoenixx-666/dsvread | 8a073c12343b2f0d34f9b728282dfefe10999f24 | [
"MIT"
] | 2 | 2021-03-01T19:57:20.000Z | 2021-08-02T20:54:48.000Z | dsvfile/Models/PowerSystem/PowerNetwork.py | phoenixx-666/dsvread | 8a073c12343b2f0d34f9b728282dfefe10999f24 | [
"MIT"
] | null | null | null | dsvfile/Models/PowerSystem/PowerNetwork.py | phoenixx-666/dsvread | 8a073c12343b2f0d34f9b728282dfefe10999f24 | [
"MIT"
] | null | null | null | from . import Model, Int32Field, ModelField, ArrayField
from .PowerNetworkNode import PowerNetworkNode
class PowerNetwork(Model):
version = Int32Field()
id = Int32Field()
numNodes = Int32Field()
numConsumers = Int32Field()
numGenerators = Int32Field()
numAccumulators = Int32Field()
numExchangers = Int32Field()
nodes = ArrayField(ModelField(PowerNetworkNode), length_field='numNodes')
consumers = ArrayField(Int32Field, length_field='numConsumers')
generators = ArrayField(Int32Field, length_field='numGenerators')
accumulators = ArrayField(Int32Field, length_field='numAccumulators')
exchangers = ArrayField(Int32Field, length_field='numExchangers')
| 39 | 77 | 0.757835 | 58 | 702 | 9.086207 | 0.396552 | 0.104364 | 0.197343 | 0.235294 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.040134 | 0.148148 | 702 | 17 | 78 | 41.294118 | 0.841137 | 0 | 0 | 0 | 0 | 0 | 0.086895 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.133333 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
1803934c9fe32d26c1f1613306081145e75d26af | 19,760 | py | Python | tests/test_validator.py | TangoMan75/pyvalidator | 277743353bc03b660c420228d355d59f10f944b6 | [
"MIT"
] | null | null | null | tests/test_validator.py | TangoMan75/pyvalidator | 277743353bc03b660c420228d355d59f10f944b6 | [
"MIT"
] | null | null | null | tests/test_validator.py | TangoMan75/pyvalidator | 277743353bc03b660c420228d355d59f10f944b6 | [
"MIT"
] | null | null | null | #!/bin/python3
# -*- coding: utf-8 -*-
"""
This file is part of the TangoMan PyValidator package.
(c) "Matthias Morin" <mat@tangoman.io>
This source file is subject to the MIT license that is bundled
with this source code in the file LICENSE.
"""
import collections.abc
from unittest import TestCase
from pyvalidator.validator import Validator
from tests.dummy import Dummy
class Empty():
def __init__(self, alias=None):
pass
class TestValidator(TestCase):
def setUp(self):
self.dummy = Dummy()
self.validator = Validator()
##################################################
# Test ABC Collections
##################################################
def test_validator_invalid_values_for_abc_collections_should_raise_typeerror(self):
"""==> validator invalid values for ABC collections should raise TypeError"""
with self.assertRaises(TypeError):
self.dummy.abc_async_generator = Empty('AsyncGenerator')
with self.assertRaises(TypeError):
self.dummy.abc_async_iterable = Empty('AsyncIterable')
with self.assertRaises(TypeError):
self.dummy.abc_async_iterator = Empty('AsyncIterator')
with self.assertRaises(TypeError):
self.dummy.abc_awaitable = Empty('Awaitable')
with self.assertRaises(TypeError):
self.dummy.abc_byte_string = Empty('ByteString')
with self.assertRaises(TypeError):
self.dummy.abc_callable = Empty('Callable')
with self.assertRaises(TypeError):
self.dummy.abc_collection = Empty('Collection')
with self.assertRaises(TypeError):
self.dummy.abc_container = Empty('Container')
with self.assertRaises(TypeError):
self.dummy.abc_coroutine = Empty('Coroutine')
with self.assertRaises(TypeError):
self.dummy.abc_generator = Empty('Generator')
with self.assertRaises(TypeError):
self.dummy.abc_hashable = Empty('Hashable')
with self.assertRaises(TypeError):
self.dummy.abc_items_view = Empty('ItemsView')
with self.assertRaises(TypeError):
self.dummy.abc_iterable = Empty('Iterable')
with self.assertRaises(TypeError):
self.dummy.abc_iterator = Empty('Iterator')
with self.assertRaises(TypeError):
self.dummy.abc_keys_view = Empty('KeysView')
with self.assertRaises(TypeError):
self.dummy.abc_mapping = Empty('Mapping')
with self.assertRaises(TypeError):
self.dummy.abc_mapping_view = Empty('MappingView')
with self.assertRaises(TypeError):
self.dummy.abc_mutable_mapping = Empty('MutableMapping')
with self.assertRaises(TypeError):
self.dummy.abc_mutable_sequence = Empty('MutableSequence')
with self.assertRaises(TypeError):
self.dummy.abc_mutable_set = Empty('MutableSet')
with self.assertRaises(TypeError):
self.dummy.abc_reversible = Empty('Reversible')
with self.assertRaises(TypeError):
self.dummy.abc_sequence = Empty('Sequence')
with self.assertRaises(TypeError):
self.dummy.abc_set = Empty('Set')
with self.assertRaises(TypeError):
self.dummy.abc_sized = Empty('Sized')
with self.assertRaises(TypeError):
self.dummy.abc_values_view = Empty('ValuesView')
def test_validator_valid_values_for_abc_collections_should_not_raise_exception(self):
"""==> validator valid values for ABC collections should not raise Exception"""
try:
self.dummy.abc_async_generator = collections.abc.AsyncGenerator
self.dummy.abc_async_iterable = collections.abc.AsyncIterable
self.dummy.abc_async_iterator = collections.abc.AsyncIterator
self.dummy.abc_awaitable = collections.abc.Awaitable
self.dummy.abc_byte_string = collections.abc.ByteString
self.dummy.abc_callable = collections.abc.Callable
self.dummy.abc_collection = collections.abc.Collection
self.dummy.abc_container = collections.abc.Container
self.dummy.abc_coroutine = collections.abc.Coroutine
self.dummy.abc_generator = collections.abc.Generator
self.dummy.abc_hashable = collections.abc.Hashable
self.dummy.abc_items_view = collections.abc.ItemsView
self.dummy.abc_iterable = collections.abc.Iterable
self.dummy.abc_iterator = collections.abc.Iterator
self.dummy.abc_keys_view = collections.abc.KeysView
self.dummy.abc_mapping = collections.abc.Mapping
self.dummy.abc_mapping_view = collections.abc.MappingView
self.dummy.abc_mutable_mapping = collections.abc.MutableMapping
self.dummy.abc_mutable_sequence = collections.abc.MutableSequence
self.dummy.abc_mutable_set = collections.abc.MutableSet
self.dummy.abc_reversible = collections.abc.Reversible
self.dummy.abc_sequence = collections.abc.Sequence
self.dummy.abc_set = collections.abc.Set
self.dummy.abc_sized = collections.abc.Sized
self.dummy.abc_values_view = collections.abc.ValuesView
except Exception as e:
self.fail(e)
def test_validator_nullable_properties_for_abc_collection_should_not_raise_valueerror(self):
"""==> validator nullable properties for abc collection should not raise ValueError"""
try:
self.dummy.nullable_abc_async_generator = None
self.dummy.nullable_abc_async_iterable = None
self.dummy.nullable_abc_async_iterator = None
self.dummy.nullable_abc_awaitable = None
self.dummy.nullable_abc_byte_string = None
self.dummy.nullable_abc_callable = None
self.dummy.nullable_abc_collection = None
self.dummy.nullable_abc_container = None
self.dummy.nullable_abc_coroutine = None
self.dummy.nullable_abc_generator = None
self.dummy.nullable_abc_hashable = None
self.dummy.nullable_abc_items_view = None
self.dummy.nullable_abc_iterable = None
self.dummy.nullable_abc_iterator = None
self.dummy.nullable_abc_keys_view = None
self.dummy.nullable_abc_mapping = None
self.dummy.nullable_abc_mapping_view = None
self.dummy.nullable_abc_mutable_mapping = None
self.dummy.nullable_abc_mutable_sequence = None
self.dummy.nullable_abc_mutable_set = None
self.dummy.nullable_abc_reversible = None
self.dummy.nullable_abc_sequence = None
self.dummy.nullable_abc_set = None
self.dummy.nullable_abc_sized = None
self.dummy.nullable_abc_values_view = None
except Exception as e:
self.fail(e)
##################################################
# Test Builtin Types
##################################################
def test_validator_invalid_values_for_stdtype_should_raise_typeerror(self):
"""==> invalid values for stdtype should raise TypeError"""
with self.assertRaises(TypeError):
self.dummy.stdtype_bytearray = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.stdtype_bytes = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.stdtype_complex = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.stdtype_dict = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.stdtype_float = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.stdtype_frozenset = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.stdtype_int = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.stdtype_list = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.stdtype_memoryview = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.stdtype_range = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.stdtype_set = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.stdtype_str = ['invalid_type']
with self.assertRaises(TypeError):
self.dummy.stdtype_tuple = 'invalid_type'
def test_validator_valid_stdtype_values_should_not_raise_exception(self):
"""==> valid stdtype values should not raise exception"""
try:
self.dummy.stdtype_bool = True
self.dummy.stdtype_bytearray = bytearray(b'bytearray')
self.dummy.stdtype_bytes = b'bytes'
self.dummy.stdtype_complex = 1j
self.dummy.stdtype_dict = {'Dictionary': True}
self.dummy.stdtype_float = 1.1
self.dummy.stdtype_frozenset = frozenset({1, 2, 3})
self.dummy.stdtype_int = 666
self.dummy.stdtype_list = ['List']
self.dummy.stdtype_memoryview = memoryview(b'')
self.dummy.stdtype_range = range(1, 10)
self.dummy.stdtype_set = {1, 2, 3}
self.dummy.stdtype_str = 'String'
self.dummy.stdtype_tuple = ('Tuple',)
self.dummy.stdtype_type = type
except Exception as e:
self.fail(e)
def test_validator_nullable_properties_for_stdtype_should_not_raise_valueerror(self):
"""==> validator nullable properties for stdtype should not raise ValueError"""
try:
self.dummy.nullable_stdtype_bool = None
self.dummy.nullable_stdtype_bytearray = None
self.dummy.nullable_stdtype_bytes = None
self.dummy.nullable_stdtype_complex = None
self.dummy.nullable_stdtype_dict = None
self.dummy.nullable_stdtype_float = None
self.dummy.nullable_stdtype_frozenset = None
self.dummy.nullable_stdtype_int = None
self.dummy.nullable_stdtype_list = None
self.dummy.nullable_stdtype_range = None
self.dummy.nullable_stdtype_set = None
self.dummy.nullable_stdtype_str = None
self.dummy.nullable_stdtype_tuple = None
self.dummy.nullable_stdtype_type = None
except Exception as e:
self.fail(e)
def test_validator_invalid_values_in_nullable_properties_should_raise_typeerror(self):
"""==> invalid values in nullable properties should raise TypeError"""
with self.assertRaises(TypeError):
self.dummy.nullable_stdtype_bytearray = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.nullable_stdtype_bytes = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.nullable_stdtype_complex = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.nullable_stdtype_dict = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.nullable_stdtype_float = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.nullable_stdtype_frozenset = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.nullable_stdtype_int = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.nullable_stdtype_list = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.nullable_stdtype_memoryview = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.nullable_stdtype_range = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.nullable_stdtype_set = 'invalid_type'
with self.assertRaises(TypeError):
self.dummy.nullable_stdtype_str = ['invalid_type']
with self.assertRaises(TypeError):
self.dummy.nullable_stdtype_tuple = 'invalid_type'
def test_validator_non_nullable_properties_should_raise_typeerror(self):
"""==> non-nullable properties should raise TypeError"""
with self.assertRaises(TypeError):
self.dummy.stdtype_bytearray = None
with self.assertRaises(TypeError):
self.dummy.stdtype_bytes = None
with self.assertRaises(TypeError):
self.dummy.stdtype_complex = None
with self.assertRaises(TypeError):
self.dummy.stdtype_dict = None
with self.assertRaises(TypeError):
self.dummy.stdtype_float = None
with self.assertRaises(TypeError):
self.dummy.stdtype_frozenset = None
with self.assertRaises(TypeError):
self.dummy.stdtype_int = None
with self.assertRaises(TypeError):
self.dummy.stdtype_list = None
with self.assertRaises(TypeError):
self.dummy.stdtype_memoryview = None
with self.assertRaises(TypeError):
self.dummy.stdtype_range = None
with self.assertRaises(TypeError):
self.dummy.stdtype_set = None
with self.assertRaises(TypeError):
self.dummy.stdtype_str = None
with self.assertRaises(TypeError):
self.dummy.stdtype_tuple = None
##################################################
# Test Aliases
##################################################
def test_validator_invalid_values_for_alias_should_raise_typeerror(self):
"""==> invalid values for alias should raise TypeError"""
with self.assertRaises(TypeError):
self.dummy.typing_async_generator = Empty('AsyncGenerator')
with self.assertRaises(TypeError):
self.dummy.typing_async_iterable = Empty('AsyncIterable')
with self.assertRaises(TypeError):
self.dummy.typing_async_iterator = Empty('AsyncIterator')
with self.assertRaises(TypeError):
self.dummy.typing_abstract_set = Empty('AbstractSet')
with self.assertRaises(TypeError):
self.dummy.typing_async_context_manager = Empty('AsyncContextManager')
with self.assertRaises(TypeError):
self.dummy.typing_awaitable = Empty('Awaitable')
with self.assertRaises(TypeError):
self.dummy.typing_byte_string = Empty('ByteString')
with self.assertRaises(TypeError):
self.dummy.typing_callable = Empty('Callable')
with self.assertRaises(TypeError):
self.dummy.typing_chain_map = Empty('ChainMap')
with self.assertRaises(TypeError):
self.dummy.typing_collection = Empty('Collection')
with self.assertRaises(TypeError):
self.dummy.typing_container = Empty('Container')
with self.assertRaises(TypeError):
self.dummy.typing_context_manager = Empty('ContextManager')
with self.assertRaises(TypeError):
self.dummy.typing_coroutine = Empty('Coroutine')
with self.assertRaises(TypeError):
self.dummy.typing_counter = Empty('Counter')
with self.assertRaises(TypeError):
self.dummy.typing_default_dict = Empty('DefaultDict')
with self.assertRaises(TypeError):
self.dummy.typing_deque = Empty('Deque')
with self.assertRaises(TypeError):
self.dummy.typing_dict = Empty('Dict')
with self.assertRaises(TypeError):
self.dummy.typing_frozen_set = Empty('FrozenSet')
with self.assertRaises(TypeError):
self.dummy.typing_generator = Empty('Generator')
with self.assertRaises(TypeError):
self.dummy.typing_hashable = Empty('Hashable')
with self.assertRaises(TypeError):
self.dummy.typing_items_view = Empty('ItemsView')
with self.assertRaises(TypeError):
self.dummy.typing_iterable = Empty('Iterable')
with self.assertRaises(TypeError):
self.dummy.typing_iterator = Empty('Iterator')
with self.assertRaises(TypeError):
self.dummy.typing_keys_view = Empty('KeysView')
with self.assertRaises(TypeError):
self.dummy.typing_list = Empty('List')
with self.assertRaises(TypeError):
self.dummy.typing_mapping = Empty('Mapping')
with self.assertRaises(TypeError):
self.dummy.typing_mapping_view = Empty('MappingView')
with self.assertRaises(TypeError):
self.dummy.typing_mutable_mapping = Empty('MutableMapping')
with self.assertRaises(TypeError):
self.dummy.typing_mutable_sequence = Empty('MutableSequence')
with self.assertRaises(TypeError):
self.dummy.typing_mutable_set = Empty('MutableSet')
with self.assertRaises(TypeError):
self.dummy.typing_ordered_dict = Empty('OrderedDict')
with self.assertRaises(TypeError):
self.dummy.typing_reversible = Empty('Reversible')
with self.assertRaises(TypeError):
self.dummy.typing_sequence = Empty('Sequence')
with self.assertRaises(TypeError):
self.dummy.typing_set = Empty('Set')
with self.assertRaises(TypeError):
self.dummy.typing_sized = Empty('Sized')
with self.assertRaises(TypeError):
self.dummy.typing_tuple = Empty('Tuple')
with self.assertRaises(TypeError):
self.dummy.typing_type = Empty('Type')
with self.assertRaises(TypeError):
self.dummy.typing_values_view = Empty('ValuesView')
def test_validator_nullable_properties_for_aliases_should_not_raise_valueerror(self):
"""==> validator nullable properties for aliases should not raise ValueError"""
try:
self.dummy.nullable_abstract_set = None
self.dummy.nullable_any = None
self.dummy.nullable_async_context_manager = None
self.dummy.nullable_async_generator = None
self.dummy.nullable_async_iterable = None
self.dummy.nullable_async_iterator = None
self.dummy.nullable_awaitable = None
self.dummy.nullable_byte_string = None
self.dummy.nullable_callable = None
self.dummy.nullable_chain_map = None
self.dummy.nullable_collection = None
self.dummy.nullable_container = None
self.dummy.nullable_context_manager = None
self.dummy.nullable_coroutine = None
self.dummy.nullable_counter = None
self.dummy.nullable_default_dict = None
self.dummy.nullable_deque = None
self.dummy.nullable_dict = None
self.dummy.nullable_frozen_set = None
self.dummy.nullable_generator = None
self.dummy.nullable_hashable = None
self.dummy.nullable_items_view = None
self.dummy.nullable_iterable = None
self.dummy.nullable_iterator = None
self.dummy.nullable_keys_view = None
self.dummy.nullable_list = None
self.dummy.nullable_mapping = None
self.dummy.nullable_mapping_view = None
self.dummy.nullable_mutable_mapping = None
self.dummy.nullable_mutable_sequence = None
self.dummy.nullable_mutable_set = None
self.dummy.nullable_ordered_dict = None
self.dummy.nullable_reversible = None
self.dummy.nullable_sequence = None
self.dummy.nullable_set = None
self.dummy.nullable_sized = None
self.dummy.nullable_tuple = None
self.dummy.nullable_type = None
self.dummy.nullable_values_view = None
except Exception as e:
self.fail(e)
| 48.312958 | 96 | 0.651872 | 2,107 | 19,760 | 5.895112 | 0.068818 | 0.160132 | 0.164238 | 0.238145 | 0.828919 | 0.703728 | 0.617825 | 0.53635 | 0.459464 | 0.290798 | 0 | 0.001145 | 0.248482 | 19,760 | 408 | 97 | 48.431373 | 0.835286 | 0.04752 | 0 | 0.326816 | 0 | 0 | 0.050881 | 0 | 0 | 0 | 0 | 0 | 0.284916 | 1 | 0.03352 | false | 0.002793 | 0.011173 | 0 | 0.050279 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1808740ce9cc15bfa5e574c55720583f44fef138 | 165 | py | Python | calendar_aoc.py | Panurus/aoc_2021 | 528676e5ae6cc818e78c55c625a3d8d74e92bb4c | [
"MIT"
] | null | null | null | calendar_aoc.py | Panurus/aoc_2021 | 528676e5ae6cc818e78c55c625a3d8d74e92bb4c | [
"MIT"
] | null | null | null | calendar_aoc.py | Panurus/aoc_2021 | 528676e5ae6cc818e78c55c625a3d8d74e92bb4c | [
"MIT"
] | null | null | null | import day1, day2, day3, day4, day5, day6
if __name__ == "__main__":
day1.main()
day2.main()
day3.main()
day4.main()
day5.main()
day6.main() | 18.333333 | 41 | 0.581818 | 22 | 165 | 4 | 0.454545 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.096774 | 0.248485 | 165 | 9 | 42 | 18.333333 | 0.612903 | 0 | 0 | 0 | 0 | 0 | 0.048193 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.125 | 0 | 0.125 | 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 |
1820418523ac40300014a648740b99f3512f6016 | 274 | py | Python | social/managers.py | zhongmei57485/SwiperPro | b00dde5af05f158d7cd2c649e8a07a2c19623b69 | [
"Apache-2.0"
] | null | null | null | social/managers.py | zhongmei57485/SwiperPro | b00dde5af05f158d7cd2c649e8a07a2c19623b69 | [
"Apache-2.0"
] | 9 | 2019-12-04T23:48:54.000Z | 2021-06-10T18:31:57.000Z | social/managers.py | zhongmei57485/SwiperPro | b00dde5af05f158d7cd2c649e8a07a2c19623b69 | [
"Apache-2.0"
] | null | null | null | from django.db import models
class FriendManager(models.Manager):
"""
Friend模型,自定义管理器
"""
def make_friends(self,uid1,uid2):
uid1, uid2 = (uid1, uid2) if uid1 < uid2 else (uid2, uid1)
return self.objects.get_or_create(uid1=uid1, uid2=uid2) | 22.833333 | 66 | 0.656934 | 37 | 274 | 4.783784 | 0.621622 | 0.225989 | 0.135593 | 0.180791 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.065728 | 0.222628 | 274 | 12 | 67 | 22.833333 | 0.765258 | 0.054745 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0 | 0.8 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
182272fa7c9d40f9d895f6f6eeb1b30757963454 | 386 | py | Python | sleepyscripts/border.py | anthonybench/Envi | eb1191699c38d149bea5ea0b4fbff763aa5f1379 | [
"MIT"
] | null | null | null | sleepyscripts/border.py | anthonybench/Envi | eb1191699c38d149bea5ea0b4fbff763aa5f1379 | [
"MIT"
] | null | null | null | sleepyscripts/border.py | anthonybench/Envi | eb1191699c38d149bea5ea0b4fbff763aa5f1379 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
s=10
m=20
l=50
if len(sys.argv) < 2:
print("="*l)
elif sys.argv[1] == 's':
print("="*s)
elif sys.argv[1] == 'm':
print("="*m)
elif sys.argv[1] == 'l':
print("="*l)
elif sys.argv[1] == 'ss':
print("="*s + "\n")
elif sys.argv[1] == 'ms':
print("="*m + "\n")
elif sys.argv[1] == 'ls':
print("="*l + "\n")
else:
print("="*l)
sys.exit(0) | 14.846154 | 25 | 0.494819 | 70 | 386 | 2.728571 | 0.371429 | 0.256545 | 0.34555 | 0.376963 | 0.324607 | 0.188482 | 0 | 0 | 0 | 0 | 0 | 0.047468 | 0.181347 | 386 | 26 | 26 | 14.846154 | 0.556962 | 0.054404 | 0 | 0.142857 | 0 | 0 | 0.063014 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.047619 | 0 | 0.047619 | 0.380952 | 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 |
182a1d194185689131677ad7bd60a5f9bdca7e2d | 15,044 | py | Python | tests/functional/gtcs/test_conversion_error_from_string.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2022-02-05T11:37:13.000Z | 2022-02-05T11:37:13.000Z | tests/functional/gtcs/test_conversion_error_from_string.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2021-09-03T11:47:00.000Z | 2021-09-03T12:42:10.000Z | tests/functional/gtcs/test_conversion_error_from_string.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2021-06-30T14:14:16.000Z | 2021-06-30T14:14:16.000Z | #coding:utf-8
#
# id: functional.gtcs.conversion_error_from_string
# title: GTCS/tests/CF_ISQL_31. Script issues conversion error from string ""
# decription:
# ::: NB :::
# ### Name of original test has no any relation with actual task of this test: ###
# https://github.com/FirebirdSQL/fbtcs/blob/master/GTCS/tests/CF_ISQL_31.script
#
# Source description of problem with script for reproducing:
# https://sourceforge.net/p/firebird/mailman/message/17016915/
#
# Issue in original test:
# bug in devel-list / Reported by lobolo2000 18-May-2004
#
# Checked on: 4.0.0.1804 SS; 3.0.6.33271 SS; 2.5.9.27149 SC.
#
# tracker_id:
# min_versions: ['2.5.0']
# versions: 2.5
# qmid: None
import pytest
from firebird.qa import db_factory, isql_act, Action
# version: 2.5
# resources: None
substitutions_1 = [('[ \t]+', ' ')]
init_script_1 = """"""
db_1 = db_factory(sql_dialect=3, init=init_script_1)
test_script_1 = """
create domain dm_id as bigint
not null;
create domain dm_amount as numeric(18,4)
default 0
not null;
create domain dm_quantity as numeric(18,3)
default 0
not null;
create table items (
uid dm_id primary key ,
description varchar(80));
create table mitems (
uid dm_id primary key,
item_uid dm_id references items(uid) on delete cascade,
mfield1 varchar(15) default '' not null,
mfield2 varchar(15) default '' not null,
mfield3 varchar(15) default '' not null,
mfield4 varchar(15) default '' not null);
create table bs (
uid dm_id primary key,
mitem_uid dm_id references mitems(uid) on delete cascade,
be varchar(25));
create table mitems_expiry (
uid dm_id primary key,
mitem_uid dm_id references mitems(uid) on delete cascade,
expiry_date date);
create table mitems_expiry_warehouses (
uid dm_id primary key,
mitem_expiry_uid dm_id references mitems_expiry(uid) on delete cascade,
reorder_lvl dm_quantity,
restock_lvl dm_quantity,
qoh dm_quantity,
qoc dm_quantity,
qty_on_order dm_quantity,
qty_reserved dm_quantity,
dtd_qty_purchased dm_quantity,
mtd_qty_purchased dm_quantity,
ytd_qty_purchased dm_quantity,
dtd_qty_sold dm_quantity,
mtd_qty_sold dm_quantity,
ytd_qty_sold dm_quantity);
alter table mitems_expiry
add reorder_lvl computed by (coalesce((select sum(reorder_lvl) from
mitems_expiry_warehouses),0)),
add restock_lvl computed by (coalesce((select sum(restock_lvl) from
mitems_expiry_warehouses),0)),
add qoh computed by (coalesce((select sum(qoh) from
mitems_expiry_warehouses),0)),
add qoc computed by (coalesce((select sum(qoc) from
mitems_expiry_warehouses),0)),
add qty_on_order computed by (coalesce((select sum(qty_on_order) from
mitems_expiry_warehouses),0)),
add qty_reserved computed by (coalesce((select sum(qty_reserved) from
mitems_expiry_warehouses),0)),
add dtd_qty_purchased computed by (coalesce((select sum(dtd_qty_purchased)
from
mitems_expiry_warehouses),0)),
add mtd_qty_purchased computed by (coalesce((select sum(mtd_qty_purchased)
from
mitems_expiry_warehouses),0)),
add ytd_qty_purchased computed by (coalesce((select sum(ytd_qty_purchased)
from
mitems_expiry_warehouses),0)),
add dtd_qty_sold computed by (coalesce((select sum(dtd_qty_sold) from
mitems_expiry_warehouses),0)),
add mtd_qty_sold computed by (coalesce((select sum(mtd_qty_sold) from
mitems_expiry_warehouses),0)),
add ytd_qty_sold computed by (coalesce((select sum(ytd_qty_sold) from
mitems_expiry_warehouses),0));
alter table mitems
add reorder_lvl computed by (coalesce((select sum(reorder_lvl) from
mitems_expiry),0)),
add restock_lvl computed by (coalesce((select sum(restock_lvl) from
mitems_expiry),0)),
add qoh computed by (coalesce((select sum(qoh) from mitems_expiry),0)),
add qoc computed by (coalesce((select sum(qoc) from mitems_expiry),0)),
add qty_on_order computed by (coalesce((select sum(qty_on_order) from
mitems_expiry),0)),
add qty_reserved computed by (coalesce((select sum(qty_reserved) from
mitems_expiry),0)),
add dtd_qty_purchased computed by (coalesce((select sum(dtd_qty_purchased)
from
mitems_expiry),0)),
add mtd_qty_purchased computed by (coalesce((select sum(mtd_qty_purchased)
from
mitems_expiry),0)),
add ytd_qty_purchased computed by (coalesce((select sum(ytd_qty_purchased)
from
mitems_expiry),0)),
add dtd_qty_sold computed by (coalesce((select sum(dtd_qty_sold) from
mitems_expiry),0)),
add mtd_qty_sold computed by (coalesce((select sum(mtd_qty_sold) from
mitems_expiry),0)),
add ytd_qty_sold computed by (coalesce((select sum(ytd_qty_sold) from
mitems_expiry),0));
alter table items
add reorder_lvl computed by (coalesce((select sum(reorder_lvl) from
mitems),0)),
add restock_lvl computed by (coalesce((select sum(restock_lvl) from
mitems),0)),
add qoh computed by (coalesce((select sum(qoh) from mitems),0)),
add qoc computed by (coalesce((select sum(qoc) from mitems),0)),
add qty_on_order computed by (coalesce((select sum(qty_on_order) from
mitems),0)),
add qty_reserved computed by (coalesce((select sum(qty_reserved) from
mitems),0)),
add dtd_qty_purchased computed by (coalesce((select sum(dtd_qty_purchased)
from
mitems),0)),
add mtd_qty_purchased computed by (coalesce((select sum(mtd_qty_purchased)
from
mitems),0)),
add ytd_qty_purchased computed by (coalesce((select sum(ytd_qty_purchased)
from
mitems),0)),
add dtd_qty_sold computed by (coalesce((select sum(dtd_qty_sold) from
mitems),0)),
add mtd_qty_sold computed by (coalesce((select sum(mtd_qty_sold) from
mitems),0)),
add ytd_qty_sold computed by (coalesce((select sum(ytd_qty_sold) from
mitems),0));
set term ^;
create generator items_gen^
create trigger items_tr0 for items
active before insert position 0 as
begin
if (new.uid is null or new.uid<0) then new.uid=gen_id(items_gen,1);
end^
create trigger items_tr2 for items
active after insert position 2 as
begin
insert into mitems(item_uid) values(new.uid);
end^
create generator mitems_gen^
create trigger mitems_tr0 for mitems
active before insert position 0 as
begin
if (new.uid is null or new.uid<0) then new.uid=gen_id(mitems_gen,1);
end^
create generator bs_gen^
create trigger bs_tr0 for bs
active before insert position 0 as
begin
if (new.uid is null or new.uid<0) then new.uid=gen_id(bs_gen,1);
end^
create generator mitems_expiry_gen^
create trigger mitems_expiry_tr0 for mitems_expiry
active before insert position 0 as
begin
if (new.uid is null or new.uid<0) then
new.uid=gen_id(mitems_expiry_gen,1);
end^
create generator mitems_expiry_warehouses_gen^
create trigger mitems_expiry_warehouses_tr0 for mitems_expiry_warehouses
active before insert position 0 as
begin
if (new.uid is null or new.uid<0) then
new.uid=gen_id(mitems_expiry_warehouses_gen,1);
end^
set term ;^
commit;
insert into items(description) values('pa');
insert into items(description) values('fa');
insert into items(description) values('sa');
insert into items(description) values('la');
insert into items(description) values('ma');
insert into items(description) values('ka');
commit;
set list on;
set count on;
select 'point-1' msg, m.* from items m;
select 'point-2' msg, m.qoh, m.qoh, m.qoh, m.qoh, m.qoh, m.qoh, m.qoh, m.qoh, m.qoh, m.qoh from items m;
"""
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
expected_stdout_1 = """
MSG point-1
UID 1
DESCRIPTION pa
REORDER_LVL 0.000
RESTOCK_LVL 0.000
QOH 0.000
QOC 0.000
QTY_ON_ORDER 0.000
QTY_RESERVED 0.000
DTD_QTY_PURCHASED 0.000
MTD_QTY_PURCHASED 0.000
YTD_QTY_PURCHASED 0.000
DTD_QTY_SOLD 0.000
MTD_QTY_SOLD 0.000
YTD_QTY_SOLD 0.000
MSG point-1
UID 2
DESCRIPTION fa
REORDER_LVL 0.000
RESTOCK_LVL 0.000
QOH 0.000
QOC 0.000
QTY_ON_ORDER 0.000
QTY_RESERVED 0.000
DTD_QTY_PURCHASED 0.000
MTD_QTY_PURCHASED 0.000
YTD_QTY_PURCHASED 0.000
DTD_QTY_SOLD 0.000
MTD_QTY_SOLD 0.000
YTD_QTY_SOLD 0.000
MSG point-1
UID 3
DESCRIPTION sa
REORDER_LVL 0.000
RESTOCK_LVL 0.000
QOH 0.000
QOC 0.000
QTY_ON_ORDER 0.000
QTY_RESERVED 0.000
DTD_QTY_PURCHASED 0.000
MTD_QTY_PURCHASED 0.000
YTD_QTY_PURCHASED 0.000
DTD_QTY_SOLD 0.000
MTD_QTY_SOLD 0.000
YTD_QTY_SOLD 0.000
MSG point-1
UID 4
DESCRIPTION la
REORDER_LVL 0.000
RESTOCK_LVL 0.000
QOH 0.000
QOC 0.000
QTY_ON_ORDER 0.000
QTY_RESERVED 0.000
DTD_QTY_PURCHASED 0.000
MTD_QTY_PURCHASED 0.000
YTD_QTY_PURCHASED 0.000
DTD_QTY_SOLD 0.000
MTD_QTY_SOLD 0.000
YTD_QTY_SOLD 0.000
MSG point-1
UID 5
DESCRIPTION ma
REORDER_LVL 0.000
RESTOCK_LVL 0.000
QOH 0.000
QOC 0.000
QTY_ON_ORDER 0.000
QTY_RESERVED 0.000
DTD_QTY_PURCHASED 0.000
MTD_QTY_PURCHASED 0.000
YTD_QTY_PURCHASED 0.000
DTD_QTY_SOLD 0.000
MTD_QTY_SOLD 0.000
YTD_QTY_SOLD 0.000
MSG point-1
UID 6
DESCRIPTION ka
REORDER_LVL 0.000
RESTOCK_LVL 0.000
QOH 0.000
QOC 0.000
QTY_ON_ORDER 0.000
QTY_RESERVED 0.000
DTD_QTY_PURCHASED 0.000
MTD_QTY_PURCHASED 0.000
YTD_QTY_PURCHASED 0.000
DTD_QTY_SOLD 0.000
MTD_QTY_SOLD 0.000
YTD_QTY_SOLD 0.000
Records affected: 6
MSG point-2
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
MSG point-2
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
MSG point-2
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
MSG point-2
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
MSG point-2
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
MSG point-2
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
QOH 0.000
Records affected: 6
"""
@pytest.mark.version('>=2.5')
def test_1(act_1: Action):
act_1.expected_stdout = expected_stdout_1
act_1.execute()
assert act_1.clean_stdout == act_1.clean_expected_stdout
| 34.268793 | 108 | 0.500133 | 1,795 | 15,044 | 3.987187 | 0.106407 | 0.073774 | 0.064552 | 0.067067 | 0.73215 | 0.659075 | 0.648037 | 0.63141 | 0.623026 | 0.623026 | 0 | 0.08357 | 0.439245 | 15,044 | 438 | 109 | 34.347032 | 0.764817 | 0.059559 | 0 | 0.721739 | 0 | 0.011594 | 0.964584 | 0.058649 | 0 | 0 | 0 | 0 | 0.002899 | 1 | 0.002899 | false | 0 | 0.005797 | 0 | 0.008696 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
182e7493a035970910f969c8ce752e0a6c45f6f5 | 1,833 | py | Python | src/the_tale/the_tale/game/places/migrations/0005_auto_20160319_1713.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | 85 | 2017-11-21T12:22:02.000Z | 2022-03-27T23:07:17.000Z | src/the_tale/the_tale/game/places/migrations/0005_auto_20160319_1713.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | 545 | 2017-11-04T14:15:04.000Z | 2022-03-27T14:19:27.000Z | src/the_tale/the_tale/game/places/migrations/0005_auto_20160319_1713.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | 45 | 2017-11-11T12:36:30.000Z | 2022-02-25T06:10:44.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-03-19 17:13
from django.db import migrations, models
import rels.django
class Migration(migrations.Migration):
dependencies = [
('places', '0004_add_none_specialilization'),
]
operations = [
migrations.AlterModelOptions(
name='place',
options={},
),
migrations.RemoveField(
model_name='place',
name='expected_size',
),
migrations.RemoveField(
model_name='place',
name='freedom',
),
migrations.RemoveField(
model_name='place',
name='goods',
),
migrations.RemoveField(
model_name='place',
name='keepers_goods',
),
migrations.RemoveField(
model_name='place',
name='name',
),
migrations.RemoveField(
model_name='place',
name='production',
),
migrations.RemoveField(
model_name='place',
name='safety',
),
migrations.RemoveField(
model_name='place',
name='size',
),
migrations.RemoveField(
model_name='place',
name='stability',
),
migrations.RemoveField(
model_name='place',
name='tax',
),
migrations.RemoveField(
model_name='place',
name='transport',
),
migrations.AddField(
model_name='place',
name='power',
field=models.FloatField(default=0.0),
),
migrations.AlterField(
model_name='place',
name='modifier',
field=rels.django.RelationIntegerField(default=9),
),
]
| 24.44 | 62 | 0.497545 | 144 | 1,833 | 6.208333 | 0.375 | 0.14094 | 0.203579 | 0.261745 | 0.5 | 0.5 | 0.194631 | 0 | 0 | 0 | 0 | 0.019486 | 0.38407 | 1,833 | 74 | 63 | 24.77027 | 0.772365 | 0.035461 | 0 | 0.575758 | 1 | 0 | 0.114448 | 0.016997 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.030303 | 0 | 0.075758 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
18433cd9edf760cde27b11ec5743e2d543b0acdf | 9,895 | py | Python | website/members/migrations/0001_initial.py | eduzen/asoc_members | 4466a714a6f3980227a2340f81cda795f51d4d61 | [
"MIT"
] | 9 | 2019-03-24T21:56:52.000Z | 2022-03-14T04:21:48.000Z | website/members/migrations/0001_initial.py | eduzen/asoc_members | 4466a714a6f3980227a2340f81cda795f51d4d61 | [
"MIT"
] | 111 | 2018-04-30T03:26:58.000Z | 2021-12-01T13:06:24.000Z | website/members/migrations/0001_initial.py | eduzen/asoc_members | 4466a714a6f3980227a2340f81cda795f51d4d61 | [
"MIT"
] | 23 | 2018-09-06T21:39:56.000Z | 2022-03-25T15:08:52.000Z | # Generated by Django 2.0.4 on 2018-04-30 00:33
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
('name', models.CharField(max_length=317)),
('description', models.TextField()),
('fee', models.DecimalField(decimal_places=2, max_digits=18)),
],
options={
'get_latest_by': 'modified',
'ordering': ('-modified', '-created'),
'abstract': False,
},
),
migrations.CreateModel(
name='Member',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
('legal_id', models.PositiveIntegerField(unique=True)),
('registration_date', models.DateField()),
('has_student_certificate', models.BooleanField(default=False)),
('has_subscription_letter', models.BooleanField(default=False)),
('category', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='members', to='members.Category')),
],
options={
'get_latest_by': 'modified',
'ordering': ('-modified', '-created'),
'abstract': False,
},
),
migrations.CreateModel(
name='Organization',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
('name', models.CharField(blank=True, max_length=317)),
('contact_info', models.TextField(blank=True)),
('document_number', models.CharField(blank=True, help_text='CUIT, etc.', max_length=317)),
('address', models.CharField(blank=True, max_length=2048)),
('social_media', models.TextField(blank=True)),
('membership', models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='organization', to='members.Member')),
],
options={
'get_latest_by': 'modified',
'ordering': ('-modified', '-created'),
'abstract': False,
},
),
migrations.CreateModel(
name='Patron',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
('name', models.CharField(max_length=317)),
('email', models.EmailField(max_length=1024)),
('comments', models.TextField(blank=True)),
],
options={
'get_latest_by': 'modified',
'ordering': ('-modified', '-created'),
'abstract': False,
},
),
migrations.CreateModel(
name='Payment',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
('timestamp', models.DateTimeField()),
('amount', models.DecimalField(decimal_places=2, max_digits=18)),
('comments', models.TextField(blank=True)),
],
options={
'get_latest_by': 'modified',
'ordering': ('-modified', '-created'),
'abstract': False,
},
),
migrations.CreateModel(
name='PaymentStrategy',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
('platform', models.CharField(choices=[('mercado pago', 'Mercado Pago'), ('todo pago', 'Todo Pago'), ('transfer', 'transferencia bancaria')], default='mercado pago', max_length=317)),
('id_in_platform', models.CharField(max_length=317)),
('comments', models.TextField(blank=True)),
('patron', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='members.Patron')),
],
options={
'get_latest_by': 'modified',
'ordering': ('-modified', '-created'),
'abstract': False,
},
),
migrations.CreateModel(
name='Person',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
('first_name', models.CharField(max_length=317)),
('last_name', models.CharField(max_length=317)),
('document_number', models.CharField(blank=True, max_length=317)),
('email', models.EmailField(max_length=1024)),
('nickname', models.CharField(blank=True, max_length=317)),
('picture', models.ImageField(null=True, upload_to='')),
('nationality', models.CharField(blank=True, max_length=317)),
('marital_status', models.CharField(blank=True, max_length=317)),
('occupation', models.CharField(blank=True, max_length=317)),
('birth_date', models.DateField(blank=True, null=True)),
('street_address', models.CharField(blank=True, max_length=317)),
('zip_code', models.CharField(blank=True, max_length=317)),
('city', models.CharField(blank=True, max_length=317)),
('province', models.CharField(blank=True, max_length=317)),
('country', models.CharField(blank=True, max_length=317)),
('membership', models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='person', to='members.Member')),
],
options={
'get_latest_by': 'modified',
'ordering': ('-modified', '-created'),
'abstract': False,
},
),
migrations.CreateModel(
name='Quota',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
('month', models.PositiveSmallIntegerField(validators=[django.core.validators.MaxValueValidator(12), django.core.validators.MinValueValidator(1)])),
('year', models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(2015)])),
('amount', models.DecimalField(decimal_places=2, max_digits=18)),
('invoice_id', models.CharField(blank=True, max_length=317)),
('member', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='members.Member')),
('payment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='members.Payment')),
],
options={
'get_latest_by': 'modified',
'ordering': ('-modified', '-created'),
'abstract': False,
},
),
migrations.AddField(
model_name='payment',
name='strategy',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='members.PaymentStrategy'),
),
migrations.AddField(
model_name='member',
name='patron',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='beneficiary', to='members.Patron'),
),
]
| 55.589888 | 199 | 0.589692 | 934 | 9,895 | 6.068522 | 0.162741 | 0.046577 | 0.040226 | 0.071983 | 0.774171 | 0.763761 | 0.716831 | 0.637085 | 0.629499 | 0.598095 | 0 | 0.013765 | 0.265791 | 9,895 | 177 | 200 | 55.903955 | 0.766414 | 0.004548 | 0 | 0.594118 | 1 | 0 | 0.14937 | 0.007007 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.023529 | 0 | 0.047059 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1848d71a8e2caafacc33750e4b9c4a9231a328a4 | 149 | py | Python | Python/pyramid_pattern_alternate_numbers.py | Chanchal2125/Hacktoberfest2021_PatternMaking | c962f1e93f45a97351fbffc49ed1fc526741d772 | [
"MIT"
] | 1 | 2021-10-09T11:48:21.000Z | 2021-10-09T11:48:21.000Z | Python/pyramid_pattern_alternate_numbers.py | Chanchal2125/Hacktoberfest2021_PatternMaking | c962f1e93f45a97351fbffc49ed1fc526741d772 | [
"MIT"
] | null | null | null | Python/pyramid_pattern_alternate_numbers.py | Chanchal2125/Hacktoberfest2021_PatternMaking | c962f1e93f45a97351fbffc49ed1fc526741d772 | [
"MIT"
] | null | null | null | n = int(input())
i = 1
while(i < n):
j = 1
while(j <= i):
print((i*2-1), end=" ")
j = j+1
i = i + 1
print()
| 14.9 | 32 | 0.328859 | 25 | 149 | 1.96 | 0.4 | 0.081633 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.074074 | 0.456376 | 149 | 9 | 33 | 16.555556 | 0.530864 | 0 | 0 | 0 | 0 | 0 | 0.007143 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.222222 | 1 | 0 | 1 | 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 |
1859058503754ac4f7714fe1818f9491893789b6 | 400 | py | Python | video/management/commands/loadvideos.py | chandojo/climbbeta | 17b393535413d035d6cf831cab700c5fd2dc703c | [
"MIT"
] | 1 | 2019-01-25T03:57:54.000Z | 2019-01-25T03:57:54.000Z | video/management/commands/loadvideos.py | chandojo/climbbeta | 17b393535413d035d6cf831cab700c5fd2dc703c | [
"MIT"
] | 39 | 2019-03-29T17:13:06.000Z | 2022-02-10T08:26:46.000Z | video/management/commands/loadvideos.py | chandojo/climbbeta | 17b393535413d035d6cf831cab700c5fd2dc703c | [
"MIT"
] | 1 | 2019-12-10T18:19:59.000Z | 2019-12-10T18:19:59.000Z | from django.core import management
from django.core.management.base import BaseCommand, CommandError
from django.core.management.commands import loaddata
from datetime import date
class Command(BaseCommand):
help = "Uploads video fixtures to database"
def handle(self, *args, **options):
today = str(date.today())
return management.call_command('loaddata', today + '.json')
| 33.333333 | 67 | 0.745 | 49 | 400 | 6.061224 | 0.612245 | 0.10101 | 0.141414 | 0.161616 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.16 | 400 | 11 | 68 | 36.363636 | 0.883929 | 0 | 0 | 0 | 0 | 0 | 0.1175 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.444444 | 0 | 0.888889 | 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 |
185dd226dc4f81404f239f815af6e20db9f04e0c | 866 | py | Python | estimate_nft.py | pettitpeon/doe-nft-contract | 0b1da9323df4c2a045d7979f7fe6f38db5d5406b | [
"MIT"
] | null | null | null | estimate_nft.py | pettitpeon/doe-nft-contract | 0b1da9323df4c2a045d7979f7fe6f38db5d5406b | [
"MIT"
] | null | null | null | estimate_nft.py | pettitpeon/doe-nft-contract | 0b1da9323df4c2a045d7979f7fe6f38db5d5406b | [
"MIT"
] | null | null | null | from web3 import Web3
import contracts.slp_doe_staking_contract as slp_doe_staking_contract
import contracts.slp_eth_doe_contract as slp_eth_doe_contract
import contracts.doe_doe_staking_contract as doe_doe_staking_contract
import contracts.doe_nft_staking_contract as doe_nft_staking_contract
import contracts.nft_contract as nft_contract
import contracts.doe_token_contract as doe_token_contract
import hidden_details as hidden_details
import lib.nft_data as nft_data
import requests, json
#############################################################
wallet = hidden_details.whale
#############################################################
w3_eth = Web3(Web3.HTTPProvider(hidden_details.eth_mainnet))
collection_stats = nft_data.get_collection_stats()
estimated = nft_data.get_estimated_price(891, collection_stats)
print(json.dumps(estimated, indent=3))
| 37.652174 | 69 | 0.750577 | 115 | 866 | 5.252174 | 0.286957 | 0.149007 | 0.190397 | 0.149007 | 0.109272 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01118 | 0.070439 | 866 | 22 | 70 | 39.363636 | 0.73913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0.066667 | 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 |
186d8a5c78de629178eeaad2ac9db2296421165c | 2,487 | py | Python | tests/TestComplex_ptbf.py | Axonny/Protobuf | 709e7d77f94e7482021c17fc18c441a1f2af5a1e | [
"MIT"
] | null | null | null | tests/TestComplex_ptbf.py | Axonny/Protobuf | 709e7d77f94e7482021c17fc18c441a1f2af5a1e | [
"MIT"
] | null | null | null | tests/TestComplex_ptbf.py | Axonny/Protobuf | 709e7d77f94e7482021c17fc18c441a1f2af5a1e | [
"MIT"
] | null | null | null | from protobuf.protobuf_types import Message
from protobuf.protobuf_types import Int32Serializer
from protobuf.protobuf_types import SignedInt32Serializer
from protobuf.protobuf_types import DoubleSerializer
from protobuf.protobuf_types import StringSerializer
from protobuf.protobuf_types import Int64Serializer
from protobuf.protobuf_types import FloatSerializer
from protobuf.protobuf_types import BoolSerializer
from TestInner_ptbf import TestInner
class TestComplex(Message):
def _get_a(self):
return self.a
def _set_a(self, val):
self.a = val
def _get_b(self):
return self.b
def _set_b(self, val):
self.b = val
def _get_c(self):
return self.c
def _set_c(self, val):
self.c = val
def _get_d(self):
return self.d
def _set_d(self, val):
self.d = val
def _get_e(self):
return self.e
def _set_e(self, val):
self.e = val
def _get_f(self):
return self.f
def _set_f(self, val):
self.f = val
def _get_g(self):
return self.g
def _set_g(self, val):
self.g = val
def _get_h(self):
return self.h
def _set_h(self, val):
self.h = val
def _get_i(self):
return self.i
def _set_i(self, val):
self.i = val
def _get_t(self):
return self.t
def _set_t(self, val):
self.t = val
def __init__(self, a=0, b=0, c=0, d=0, e=0, f=0.0, g=0.0, h=0, i=None, t=None):
super().__init__()
self.a = a
self.b = b
self.c = c
self.d = d
self.e = e
self.f = f
self.g = g
self.h = h
self.i = i
self.t = t
self.fields = \
{
1: [self._get_a, self._set_a, Int32Serializer, False],
2: [self._get_b, self._set_b, Int64Serializer, False],
3: [self._get_c, self._set_c, Int32Serializer, False],
4: [self._get_d, self._set_d, Int64Serializer, False],
5: [self._get_e, self._set_e, SignedInt32Serializer, False],
7: [self._get_f, self._set_f, DoubleSerializer, False],
8: [self._get_g, self._set_g, FloatSerializer, False],
9: [self._get_h, self._set_h, BoolSerializer, False],
10: [self._get_i, self._set_i, StringSerializer, False],
12: [self._get_t, self._set_t, TestInner, False]
}
| 25.377551 | 83 | 0.583032 | 355 | 2,487 | 3.811268 | 0.135211 | 0.044346 | 0.103474 | 0.14782 | 0.183296 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022287 | 0.314435 | 2,487 | 97 | 84 | 25.639175 | 0.771261 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.28 | false | 0 | 0.12 | 0.133333 | 0.546667 | 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 |
186e392cab1f680ac6ac37c636b050c2d3923dbe | 120 | py | Python | fixture/base_fixture.py | daryakoryakina/python_training | 6988d1aa76e743130e3a2922538a9fcfbc2b4664 | [
"Apache-2.0"
] | null | null | null | fixture/base_fixture.py | daryakoryakina/python_training | 6988d1aa76e743130e3a2922538a9fcfbc2b4664 | [
"Apache-2.0"
] | null | null | null | fixture/base_fixture.py | daryakoryakina/python_training | 6988d1aa76e743130e3a2922538a9fcfbc2b4664 | [
"Apache-2.0"
] | null | null | null | from selenium.webdriver.common.by import By
class BaseHelper:
def __init__(self, app):
self.app = app
| 10.909091 | 43 | 0.666667 | 16 | 120 | 4.75 | 0.75 | 0.184211 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 120 | 10 | 44 | 12 | 0.844444 | 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 | 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 |
1879a605e2a9fdc18abfb0de0fabe7e8852fd704 | 1,364 | py | Python | src/lib/test_environment/external_test_environment_parameter.py | SimonDudanski/integration-test-docker-environment | 3ea81172248f770596d81ff378772677ab5656ea | [
"MIT"
] | 4 | 2020-06-25T20:47:31.000Z | 2021-09-10T15:22:51.000Z | src/lib/test_environment/external_test_environment_parameter.py | SimonDudanski/integration-test-docker-environment | 3ea81172248f770596d81ff378772677ab5656ea | [
"MIT"
] | 113 | 2020-06-02T08:51:08.000Z | 2022-03-31T08:47:41.000Z | src/lib/test_environment/external_test_environment_parameter.py | SimonDudanski/integration-test-docker-environment | 3ea81172248f770596d81ff378772677ab5656ea | [
"MIT"
] | 2 | 2020-05-19T10:57:47.000Z | 2020-06-22T13:32:20.000Z | import luigi
from luigi import Config
from luigi.parameter import ParameterVisibility
class ExternalDatabaseXMLRPCParameter(Config):
external_exasol_xmlrpc_host = luigi.OptionalParameter()
external_exasol_xmlrpc_port = luigi.IntParameter(443)
external_exasol_xmlrpc_user = luigi.OptionalParameter()
external_exasol_xmlrpc_cluster_name = luigi.OptionalParameter()
external_exasol_xmlrpc_password = luigi.OptionalParameter(significant=False,
visibility=ParameterVisibility.HIDDEN)
class ExternalDatabaseHostParameter(Config):
external_exasol_db_host = luigi.OptionalParameter()
external_exasol_db_port = luigi.IntParameter(8563)
external_exasol_bucketfs_port = luigi.IntParameter(6583)
class ExternalDatabaseCredentialsParameter(ExternalDatabaseHostParameter,
ExternalDatabaseXMLRPCParameter):
external_exasol_db_user = luigi.OptionalParameter()
external_exasol_db_password = luigi.OptionalParameter(significant=False,
visibility=ParameterVisibility.HIDDEN)
external_exasol_bucketfs_write_password = luigi.OptionalParameter(significant=False,
visibility=ParameterVisibility.HIDDEN)
| 47.034483 | 108 | 0.703812 | 107 | 1,364 | 8.64486 | 0.28972 | 0.166486 | 0.108108 | 0.194595 | 0.498378 | 0.262703 | 0.262703 | 0.262703 | 0 | 0 | 0 | 0.010711 | 0.247067 | 1,364 | 28 | 109 | 48.714286 | 0.889971 | 0 | 0 | 0.142857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.142857 | 0.142857 | 0 | 0.809524 | 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 |
43eb3edf359536c3bb0ab62597b0860b333a0f7f | 5,773 | py | Python | nsz/ParseArguments.py | KWottrich/nsz | d0f97022f46078f6d5863f7bcdf9ec3fb317e83e | [
"MIT"
] | null | null | null | nsz/ParseArguments.py | KWottrich/nsz | d0f97022f46078f6d5863f7bcdf9ec3fb317e83e | [
"MIT"
] | null | null | null | nsz/ParseArguments.py | KWottrich/nsz | d0f97022f46078f6d5863f7bcdf9ec3fb317e83e | [
"MIT"
] | null | null | null | from argparse import ArgumentParser
class ParseArguments:
@staticmethod
def parse():
parser = ArgumentParser()
parser.add_argument('file',nargs='*')
parser.add_argument('-C', action="store_true", help='Compress NSP/XCI')
parser.add_argument('-D', action="store_true", help='Decompress NSZ/XCZ/NCZ')
parser.add_argument('-l', '--level', type=int, default=18, help='Compression Level: Trade-off between compression speed and compression ratio. Default: 18, Max: 22')
parser.add_argument('-B', '--block', action="store_true", default=False, help="Use block compression option. This mode allows highly multi-threaded compression/decompression with random read access allowing compressed games to be played without decompression in the future however this comes with a slightly lower compression ratio cost. This is the default option for XCZ.")
parser.add_argument('-S', '--solid', action="store_true", default=False, help="Use solid compression option. Slightly higher compression ratio but won't allow for random read access. File compressed this way will never be mountable (have to be installed or decompressed first to run). This is the default option for NSZ.")
parser.add_argument('-s', '--bs', type=int, default=20, help='Block Size for random read access 2^x while x between 14 and 32. Default: 20 => 1 MB')
parser.add_argument('-V', '--verify', action="store_true", default=False, help='Verifies files after compression raising an unhandled exception on hash mismatch and verify existing NSP and NSZ files when given as parameter')
parser.add_argument('-p', '--parseCnmt', action="store_true", default=False, help='Extract TitleId/Version from Cnmt if this information cannot be obtained from the filename. Required for skipping/overwriting existing files and --rm-old-version to work properly if some not every file is named properly. Supported filenames: *TitleID*[vVersion]*')
parser.add_argument('-P', '--alwaysParseCnmt', action="store_true", default=False, help='Always extract TitleId/Version from Cnmt and never trust filenames')
parser.add_argument('-t', '--threads', type=int, default=-1, help='Number of threads to compress with. Numbers < 1 corresponds to the number of logical CPU cores for block compression and 3 for solid compression')
parser.add_argument('-m', '--multi', type=int, default=4, help='Executes multiple compression tasks in parallel. Take a look at available RAM especially if compression level is over 18.')
parser.add_argument('-o', '--output', nargs='?', help='Directory to save the output NSZ files')
parser.add_argument('-w', '--overwrite', action="store_true", default=False, help='Continues even if there already is a file with the same name or title id inside the output directory')
parser.add_argument('-r', '--rm-old-version', action="store_true", default=False, help='Removes older versions if found')
parser.add_argument('--rm-source', action='store_true', default=False, help="Deletes source file/s after compressing/decompressing. It's recommended to only use this in combination with --verify")
parser.add_argument('-i', '--info', action='store_true', default=False, help='Show info about title or file')
parser.add_argument('--depth', type=int, default=1, help='Max depth for file info and extraction')
parser.add_argument('-x', '--extract', action="store_true", help='Extract a NSP/XCI/NSZ/XCZ/NSPZ')
parser.add_argument('--extractregex', type=str, default="", help='Regex specifying which files inside the container should be extracted. Example: "^.*\.(cert|tik)$"')
parser.add_argument('--titlekeys', action='store_true', default=False, help="Extracts titlekeys from your NSP/NSZ files and adds missing keys to ./titlekeys.txt and JSON files inside ./titledb/ (obtainable from https://github.com/blawar/titledb). Titlekeys can be used to unlock updates using NUT OG (OG fork obtainable from https://github.com/plato79/nut). There is currently no publicly known way of optioning NSX files. To MitM: Apply disable_ca_verification & disable_browser_ca_verification patches, use your device's nx_tls_client_cert.pfx (Password: switch, Install to OS and import for Fiddler or import into Charles/OWASP ZAP). Use it for aauth-lp1.ndas.srv.nintendo.net:443, dauth-lp1.ndas.srv.nintendo.net:443 and app-b01-lp1.npns.srv.nintendo.net:443. Try with your WiiU first as there you won't get banned if you mess up.")
parser.add_argument('--undupe', action='store_true', help="Deleted all duplicates (games with same ID and Version). The Files folder will get parsed in order so the later in the argument list the more likely the file is to be deleted")
parser.add_argument('--undupe-dryrun' , action='store_true', help="Shows what files would get deleted using --undupe")
parser.add_argument('--undupe-rename' , action='store_true', help="Renames files to minimal standard: [TitleId][vVersion].nsz")
parser.add_argument('--undupe-prioritylist', type=str, default="", help='Regex specifying which dublicates delegtion should be prioritized before following the normal deletion order. Example: "^.*\.(nsp|xci)$"')
parser.add_argument('--undupe-whitelist', type=str, default="", help='Regex specifying which dublicates should under no circumstances be deleted. Example: "^.*\.(nsz|xcz)$"')
parser.add_argument('--undupe-blacklist', type=str, default="", help='Regex specifying which files should always be deleted - even if they are not even a dublicate! Be careful! Example: "^.*\.(nsp|xci)$"')
parser.add_argument('--undupe-old-versions',action="store_true", default=False, help='Removes every old version as long there is a newer one of the same titleID.')
parser.add_argument('-c', '--create', help='create / pack a NSP')
args = parser.parse_args()
return args
| 148.025641 | 838 | 0.756452 | 864 | 5,773 | 4.990741 | 0.378472 | 0.060529 | 0.114332 | 0.056122 | 0.205937 | 0.165353 | 0.092301 | 0.042208 | 0 | 0 | 0 | 0.007667 | 0.118829 | 5,773 | 38 | 839 | 151.921053 | 0.839984 | 0 | 0 | 0 | 0 | 0.333333 | 0.68907 | 0.052139 | 0 | 0 | 0 | 0 | 0 | 1 | 0.027778 | false | 0.027778 | 0.055556 | 0 | 0.138889 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
43f407d0e3d4029807e02d1d7438b60d0a37c8c9 | 648 | py | Python | blog/templatetags/blog_tags.py | guokepo/myblog2 | 19cac164628685dced1ce667b7307490193983b6 | [
"MIT"
] | null | null | null | blog/templatetags/blog_tags.py | guokepo/myblog2 | 19cac164628685dced1ce667b7307490193983b6 | [
"MIT"
] | null | null | null | blog/templatetags/blog_tags.py | guokepo/myblog2 | 19cac164628685dced1ce667b7307490193983b6 | [
"MIT"
] | null | null | null | from ..models import Post,Category,Tag
from django import template
from django.db.models.aggregates import Count
register = template.Library()
#实例化一个template.Library类,将get_recent_posts装饰为register.simple_tag
@register.simple_tag
def get_recent_posts(num=5):
return Post.objects.all().order_by('-created_time')[:num]
@register.simple_tag
def archives():
return Post.objects.dates('created_time','month',order='DESC')
@register.simple_tag
def get_categories():
#计算分类下的文章数,Count接受的是计数的模型的名称
return Category.objects.annotate(num_posts=Count('post')).filter(num_posts__gt=0)
tag_list = Tag.objects.annotate(num_posts=Count('post')) | 28.173913 | 85 | 0.785494 | 89 | 648 | 5.516854 | 0.483146 | 0.07332 | 0.10387 | 0.1222 | 0.224033 | 0.130346 | 0 | 0 | 0 | 0 | 0 | 0.003384 | 0.087963 | 648 | 23 | 86 | 28.173913 | 0.827411 | 0.137346 | 0 | 0.214286 | 0 | 0 | 0.075269 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.214286 | false | 0 | 0.214286 | 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 |
a104d3bdc9d1bb9f724481bb9b9cae12f55c55cc | 3,469 | py | Python | zhaquirks/yale/realliving.py | WolfRevo/zha-device-handlers | 0fa4ca1c03c611be0cf2c38c4fec2a197e3dd1d3 | [
"Apache-2.0"
] | 213 | 2020-04-16T10:48:31.000Z | 2022-03-30T20:48:07.000Z | zhaquirks/yale/realliving.py | WolfRevo/zha-device-handlers | 0fa4ca1c03c611be0cf2c38c4fec2a197e3dd1d3 | [
"Apache-2.0"
] | 1,088 | 2020-04-03T13:23:29.000Z | 2022-03-31T23:55:03.000Z | zhaquirks/yale/realliving.py | WolfRevo/zha-device-handlers | 0fa4ca1c03c611be0cf2c38c4fec2a197e3dd1d3 | [
"Apache-2.0"
] | 280 | 2020-04-24T08:44:27.000Z | 2022-03-31T12:58:04.000Z | """Device handler for Yale Real Living."""
from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.closures import DoorLock
from zigpy.zcl.clusters.general import Alarms, Basic, Identify, Ota, PollControl, Time
from zhaquirks import DoublingPowerConfigurationCluster
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODELS_INFO,
OUTPUT_CLUSTERS,
PROFILE_ID,
)
class YRD210PBDB220TSLL(CustomDevice):
"""Yale YRD210 PB BP and Yale YRL220 TS LL Locks."""
signature = {
# <SimpleDescriptor endpoint=1 profile=260 device_type=10
# device_version=0
# input_clusters=[0, 1, 3, 9, 10, 257, 32]
# output_clusters=[10, 25]>
MODELS_INFO: [("Yale", "YRD210 PB DB"), ("Yale", "YRL220 TS LL")],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.DOOR_LOCK,
INPUT_CLUSTERS: [
Basic.cluster_id,
DoublingPowerConfigurationCluster.cluster_id,
Identify.cluster_id,
Alarms.cluster_id,
Time.cluster_id,
DoorLock.cluster_id,
PollControl.cluster_id,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
}
},
}
replacement = {
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.DOOR_LOCK,
INPUT_CLUSTERS: [
Basic.cluster_id,
DoublingPowerConfigurationCluster,
Identify.cluster_id,
Alarms.cluster_id,
Time.cluster_id,
DoorLock.cluster_id,
PollControl.cluster_id,
],
OUTPUT_CLUSTERS: [DoorLock.cluster_id, Ota.cluster_id],
}
}
}
class YRD220240TSDB(CustomDevice):
"""Yale YRD220/240 TSDB Lock."""
signature = {
# <SimpleDescriptor endpoint=1 profile=260 device_type=10
# device_version=0
# input_clusters=[0, 1, 9, 10, 32, 257]
# output_clusters=[10, 25]>
MODELS_INFO: [("Yale", "YRD220/240 TSDB")],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.DOOR_LOCK,
INPUT_CLUSTERS: [
Basic.cluster_id,
DoublingPowerConfigurationCluster.cluster_id,
Alarms.cluster_id,
Time.cluster_id,
PollControl.cluster_id,
DoorLock.cluster_id,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
}
},
}
replacement = {
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.DOOR_LOCK,
INPUT_CLUSTERS: [
Basic.cluster_id,
DoublingPowerConfigurationCluster,
Alarms.cluster_id,
Time.cluster_id,
PollControl.cluster_id,
DoorLock.cluster_id,
],
OUTPUT_CLUSTERS: [DoorLock.cluster_id, Ota.cluster_id],
}
}
}
| 32.12037 | 86 | 0.521188 | 308 | 3,469 | 5.63961 | 0.220779 | 0.165803 | 0.044905 | 0.043754 | 0.70236 | 0.70236 | 0.70236 | 0.665515 | 0.665515 | 0.665515 | 0 | 0.039637 | 0.396368 | 3,469 | 107 | 87 | 32.420561 | 0.789876 | 0.114154 | 0 | 0.666667 | 0 | 0 | 0.016721 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.068966 | 0 | 0.137931 | 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 |
a13338ad3215393efd27213829b7d79ef32f4404 | 178 | py | Python | core/api/urls.py | code-review-doctor/lite-frontend-1 | cb3b885bb389ea33ef003c916bea7b03a36d86bb | [
"MIT"
] | 1 | 2021-10-16T16:36:58.000Z | 2021-10-16T16:36:58.000Z | core/api/urls.py | code-review-doctor/lite-frontend-1 | cb3b885bb389ea33ef003c916bea7b03a36d86bb | [
"MIT"
] | 45 | 2020-08-11T14:37:46.000Z | 2022-03-29T17:03:02.000Z | core/api/urls.py | code-review-doctor/lite-frontend-1 | cb3b885bb389ea33ef003c916bea7b03a36d86bb | [
"MIT"
] | 3 | 2021-02-01T06:26:19.000Z | 2022-02-21T23:02:46.000Z | from django.urls import path
from . import queues
app_name = "api"
urlpatterns = [
path("teams/<uuid:pk>/queues/", queues.TeamQueuesList.as_view(), name="team-queues"),
]
| 17.8 | 89 | 0.696629 | 24 | 178 | 5.083333 | 0.708333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.140449 | 178 | 9 | 90 | 19.777778 | 0.797386 | 0 | 0 | 0 | 0 | 0 | 0.207865 | 0.129213 | 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 |
a14a818e00f4f3d4b2e7ec5907533ba3e985862d | 19 | py | Python | src/Selenium2Library/version.py | piaoransk/selenium2libForMyself | b6bb880c3aa8ab6e5ddaffdb574aab6150ae3604 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/Selenium2Library/version.py | piaoransk/selenium2libForMyself | b6bb880c3aa8ab6e5ddaffdb574aab6150ae3604 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/Selenium2Library/version.py | piaoransk/selenium2libForMyself | b6bb880c3aa8ab6e5ddaffdb574aab6150ae3604 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | VERSION = '1.8.xu'
| 9.5 | 18 | 0.578947 | 4 | 19 | 2.75 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 0.157895 | 19 | 1 | 19 | 19 | 0.5625 | 0 | 0 | 0 | 0 | 0 | 0.315789 | 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 |
a14a90482424e9b3ea73e8c184df9e17339a424f | 15,369 | py | Python | src/spaceone/inventory/connector/aws_redshift_connector/schema/data.py | spaceone-dev/plugin-aws-cloud-service-inven-collector | aa252a41940e0941d4b0f7be7fc05d152da654dd | [
"Apache-2.0"
] | 4 | 2020-06-22T01:48:07.000Z | 2020-08-24T00:51:09.000Z | src/spaceone/inventory/connector/aws_redshift_connector/schema/data.py | spaceone-dev/plugin-aws-cloudservices | d685cf91edfbc2e570964fb95e5d4c1676f566f8 | [
"Apache-2.0"
] | 1 | 2022-02-10T04:38:11.000Z | 2022-02-10T04:38:11.000Z | src/spaceone/inventory/connector/aws_redshift_connector/schema/data.py | spaceone-dev/plugin-aws-cloudservices | d685cf91edfbc2e570964fb95e5d4c1676f566f8 | [
"Apache-2.0"
] | 6 | 2020-06-22T09:19:40.000Z | 2020-09-17T06:35:37.000Z | from schematics import Model
from spaceone.inventory.libs.schema.resource import CloudWatchModel, CloudWatchDimensionModel
from schematics.types import ModelType, StringType, IntType, DateTimeType, ListType, BooleanType, \
FloatType
class Tags(Model):
key = StringType(deserialize_from="Key")
value = StringType(deserialize_from="Value")
'''
SCHEDULED ACTION
'''
class ResizeCluster(Model):
cluster_identifier = StringType(deserialize_from="ClusterIdentifier")
cluster_type = StringType(deserialize_from="ClusterType")
node_type = StringType(deserialize_from="NodeType")
number_of_nodes = IntType(deserialize_from="NumberOfNodes")
classic = BooleanType(deserialize_from="Classic")
class PauseCluster(Model):
cluster_identifier = StringType(deserialize_from="ClusterIdentifier")
class ResumeCluster(Model):
cluster_identifier = StringType(deserialize_from="ClusterIdentifier")
class TargetAction(Model):
resize_cluster = ModelType(ResizeCluster,deserialize_from="ResizeCluster")
pause_cluster = ModelType(PauseCluster,deserialize_from="PauseCluster")
resume_cluster = ModelType(ResumeCluster,deserialize_from="ResumeCluster")
class ScheduledAction(Model):
scheduled_action_name = StringType(deserialize_from="ScheduledActionName")
target_action = ModelType(TargetAction,deserialize_from="TargetAction")
schedule = StringType(deserialize_from="Schedule")
iam_role = StringType(deserialize_from="IamRole")
scheduled_action_description = StringType(deserialize_from="ScheduledActionDescription")
state = StringType(deserialize_from="State", choices=("ACTIVE","DISABLED"))
next_invocations = DateTimeType(deserialize_from="NextInvocations")
start_time = DateTimeType(deserialize_from="StartTime")
end_time = DateTimeType(deserialize_from="EndTime")
'''
SNAPSHOT SCHEDULE
'''
class SnapshotScheduleAssociatedClusters(Model):
cluster_identifier = StringType(deserialize_from="ClusterIdentifier")
schedule_association_state = StringType(deserialize_from="ScheduleAssociationState",
choices=("MODIFYING", "ACTIVE", "FAILED"))
class SnapshotSchedule(Model):
schedule_definitions = ListType(StringType, deserialize_from="ScheduleDefinitions")
schedule_identifier = StringType(deserialize_from="ScheduleIdentifier")
schedule_description = StringType(deserialize_from="ScheduleDescription")
tags = ListType(ModelType(Tags), deserialize_from="Tags")
next_invocations = ListType(DateTimeType, deserialize_from="NextInvocations")
associated_cluster_count = IntType(deserialize_from="AssociatedClusterCount")
associated_clusters = ListType(ModelType(SnapshotScheduleAssociatedClusters),
deserialize_from="AssociatedClusters")
associated_state = StringType()
'''
SNAPSHOT
'''
class SnapshotAccountsWithRestoreAccess(Model):
account_id = StringType(deserialize_from="AccountId")
account_alias = StringType(deserialize_from="AccountAlias")
class Snapshot(Model):
snapshot_identifier = StringType(deserialize_from="SnapshotIdentifier")
cluster_identifier = StringType(deserialize_from="ClusterIdentifier")
snapshot_create_time = DateTimeType(deserialize_from="SnapshotCreateTime")
status = StringType(deserialize_from="Status")
port = IntType(deserialize_from="Port")
availability_zone = StringType(deserialize_from="AvailabilityZone")
cluster_create_time = DateTimeType(deserialize_from="ClusterCreateTime")
master_username = StringType(deserialize_from="MasterUsername")
cluster_version = StringType(deserialize_from="ClusterVersion")
snapshot_type = StringType(deserialize_from="SnapshotType")
node_type = StringType(deserialize_from="NodeType")
number_of_nodes = IntType(deserialize_from="NumberOfNodes")
db_name = StringType(deserialize_from="DBName")
vpc_id = StringType(deserialize_from="VpcId")
encrypted = BooleanType(deserialize_from="Encrypted")
kms_key_id = StringType(deserialize_from="KmsKeyId")
encrypted_with_hsm = BooleanType(deserialize_from="EncryptedWithHSM")
accounts_with_restore_access = ListType(ModelType(SnapshotAccountsWithRestoreAccess),
deserialize_from="AccountsWithRestoreAccess")
owner_account = StringType(deserialize_from="OwnerAccount")
total_backup_size_in_mega_bytes = FloatType(deserialize_from="TotalBackupSizeInMegaBytes")
actual_incremental_backup_size_in_mega_bytes = FloatType(deserialize_from="ActualIncrementalBackupSizeInMegaBytes")
backup_progress_in_mega_bytes = FloatType(deserialize_from="BackupProgressInMegaBytes")
current_backup_rate_in_mega_bytes_per_second = FloatType(deserialize_from="CurrentBackupRateInMegaBytesPerSecond")
estimated_seconds_to_completion = IntType(deserialize_from="EstimatedSecondsToCompletion")
elapsed_time_in_seconds = IntType(deserialize_from="ElapsedTimeInSeconds")
source_region = StringType(deserialize_from="SourceRegion")
tags = ListType(ModelType(Tags), deserialize_from="Tags", default=[])
restorable_node_types = ListType(StringType, deserialize_from="RestorableNodeTypes")
enhanced_vpc_routing = BooleanType(deserialize_from="EnhancedVpcRouting")
maintenance_track_name = StringType(deserialize_from="MaintenanceTrackName")
manual_snapshot_retention_period = IntType(deserialize_from="ManualSnapshotRetentionPeriod")
manual_snapshot_remaining_days = IntType(deserialize_from="ManualSnapshotRemainingDays")
snapshot_retention_start_time = DateTimeType(deserialize_from="SnapshotRetentionStartTime")
'''
CLUSTER
'''
class Endpoint(Model):
address = StringType(deserialize_from="Address")
port = IntType(deserialize_from="Port")
class PendingModifiedValues(Model):
master_user_password = StringType(deserialize_from="MasterUserPassword")
node_type = StringType(deserialize_from="NodeType")
number_of_nodes = IntType(deserialize_from="NumberOfNodes")
cluster_type = StringType(deserialize_from="ClusterType")
cluster_version = StringType(deserialize_from="ClusterVersion")
automated_snapshot_retention_period = IntType(deserialize_from="AutomatedSnapshotRetentionPeriod")
cluster_identifier = StringType(deserialize_from="ClusterIdentifier")
publicly_accessible = BooleanType(deserialize_from="PubliclyAccessible")
enhanced_vpc_routing = BooleanType(deserialize_from="EnhancedVpcRouting")
maintenance_track_name = StringType(deserialize_from="MaintenanceTrackName")
encryption_type = StringType(deserialize_from="EncryptionType")
class RestoreStatus(Model):
status = StringType(deserialize_from="Status")
current_restore_rate_in_mega_bytes_per_second = FloatType(deserialize_from="CurrentRestoreRateInMegaBytesPerSecond")
snapshot_size_in_mega_bytes = IntType(deserialize_from="SnapshotSizeInMegaBytes")
progress_in_mega_bytes = IntType(deserialize_from="ProgressInMegaBytes")
elapsed_time_in_seconds = IntType(deserialize_from="ElapsedTimeInSeconds")
estimated_time_to_completion_in_seconds = IntType(deserialize_from="EstimatedTimeToCompletionInSeconds")
class DataTransferProgress(Model):
status = StringType(deserialize_from="Status")
current_rate_in_mega_bytes_per_second = FloatType(deserialize_from="CurrentRateInMegaBytesPerSecond")
total_data_in_mega_bytes = IntType(deserialize_from="TotalDataInMegaBytes")
data_transferred_in_mega_bytes = IntType(deserialize_from="DataTransferredInMegaBytes")
estimated_time_to_completion_in_seconds = IntType(deserialize_from="EstimatedTimeToCompletionInSeconds")
elapsed_time_in_seconds = IntType(deserialize_from="ElapsedTimeInSeconds")
class HsmStatus(Model):
hsm_client_certificate_identifier = StringType(deserialize_from="HsmClientCertificateIdentifier")
hsm_configuration_identifier = StringType(deserialize_from="HsmConfigurationIdentifier")
status = StringType(deserialize_from="Status")
class ClusterSnapshotCopyStatus(Model):
destination_region = StringType(deserialize_from="DestinationRegion")
retention_period = IntType(deserialize_from="RetentionPeriod")
manual_snapshot_retention_period = IntType(deserialize_from="ManualSnapshotRetentionPeriod")
snapshot_copy_grant_name = StringType(deserialize_from="SnapshotCopyGrantName")
class ElasticIpStatus(Model):
elastic_ip = StringType(deserialize_from="ElasticIp")
status = StringType(deserialize_from="Status")
class ResizeInfo(Model):
resize_type = StringType(deserialize_from="ResizeType")
allow_cancel_resize = BooleanType(deserialize_from="AllowCancelResize")
class ClusterSecurityGroups(Model):
cluster_security_group_name = StringType(deserialize_from="ClusterSecurityGroupName")
status = StringType(deserialize_from="Status")
class ClusterVpcSecurityGroups(Model):
vpc_security_group_id = StringType(deserialize_from="VpcSecurityGroupId")
status = StringType(deserialize_from="Status")
class ClusterParameterGroupsStatusList(Model):
parameter_name = StringType(deserialize_from="ParameterName")
parameter_apply_status = StringType(deserialize_from="ParameterApplyStatus")
parameter_apply_error_description = StringType(deserialize_from="ParameterApplyErrorDescription")
class ClusterParameterGroups(Model):
parameter_group_name = StringType(deserialize_from="ParameterGroupName")
parameter_apply_status = StringType(deserialize_from="ParameterApplyStatus")
cluster_parameter_status_list = ListType(ModelType(ClusterParameterGroupsStatusList),
deserialize_from="ClusterParameterStatusList")
class ClusterNodes(Model):
node_role = StringType(deserialize_from="NodeRole")
private_ip_address = StringType(deserialize_from="PrivateIPAddress")
public_ip_address = StringType(deserialize_from="PublicIPAddress")
class ClusterIamRoles(Model):
iam_role_arn = StringType(deserialize_from="IamRoleArn")
apply_status = StringType(deserialize_from="ApplyStatus")
class ClusterDeferredMaintenanceWindows(Model):
defer_maintenance_identifier = StringType(deserialize_from="DeferMaintenanceIdentifier")
defer_maintenance_start_time = DateTimeType(deserialize_from="DeferMaintenanceStartTime")
defer_maintenance_end_time = DateTimeType(deserialize_from="DeferMaintenanceEndTime")
class Cluster(Model):
arn = StringType()
cluster_identifier = StringType(deserialize_from="ClusterIdentifier")
node_type = StringType(deserialize_from="NodeType")
cluster_status = StringType(deserialize_from="ClusterStatus")
cluster_availability_status = StringType(deserialize_from="ClusterAvailabilityStatus")
modify_status = StringType(deserialize_from="ModifyStatus")
master_username = StringType(deserialize_from="MasterUsername")
db_name = StringType(deserialize_from="DBName")
endpoint = ModelType(Endpoint, deserialize_from="Endpoint")
cluster_create_time = DateTimeType(deserialize_from="ClusterCreateTime")
automated_snapshot_retention_period = IntType(deserialize_from="AutomatedSnapshotRetentionPeriod")
manual_snapshot_retention_period = IntType(deserialize_from="ManualSnapshotRetentionPeriod")
cluster_security_groups = ListType(ModelType(ClusterSecurityGroups), deserialize_from="ClusterSecurityGroups")
vpc_security_groups = ListType(ModelType(ClusterVpcSecurityGroups), deserialize_from="VpcSecurityGroups")
cluster_parameter_groups = ListType(ModelType(ClusterParameterGroups),
deserialize_from="ClusterParameterGroups")
cluster_subnet_group_name = StringType(deserialize_from="ClusterSubnetGroupName")
vpc_id = StringType(deserialize_from="VpcId")
availability_zone = StringType(deserialize_from="AvailabilityZone")
preferred_maintenance_window = StringType(deserialize_from="PreferredMaintenanceWindow")
pending_modified_values = ModelType(PendingModifiedValues, deserialize_from="PendingModifiedValues")
cluster_version = StringType(deserialize_from="ClusterVersion")
allow_version_upgrade = BooleanType(deserialize_from="AllowVersionUpgrade")
number_of_nodes = IntType(deserialize_from="NumberOfNodes")
publicly_accessible = BooleanType(deserialize_from="PubliclyAccessible")
encrypted = BooleanType(deserialize_from="Encrypted")
restore_status = ModelType(RestoreStatus, deserialize_from="RestoreStatus")
data_transfer_progress = ModelType(DataTransferProgress, deserialize_from="DataTransferProgress")
hsm_status = ModelType(HsmStatus, deserialize_from="HsmStatus")
cluster_snapshot_copy_status = ModelType(ClusterSnapshotCopyStatus, deserialize_from="ClusterSnapshotCopyStatus")
cluster_public_key = StringType(deserialize_from="ClusterPublicKey")
cluster_nodes = ListType(ModelType(ClusterNodes), deserialize_from="ClusterNodes", default=[])
elastic_ip_status = ModelType(ElasticIpStatus, deserialize_from="ElasticIpStatus")
cluster_revision_number = StringType(deserialize_from="ClusterRevisionNumber")
tags = ListType(ModelType(Tags), deserialize_from="Tags", default=[])
kms_key_id = StringType(deserialize_from="KmsKeyId")
enhanced_vpc_routing = BooleanType(deserialize_from="EnhancedVpcRouting")
iam_roles = ListType(ModelType(ClusterIamRoles), deserialize_from="IamRoles")
pending_actions = ListType(StringType, deserialize_from="PendingActions")
maintenance_track_name = StringType(deserialize_from="MaintenanceTrackName")
elastic_resize_number_of_node_options = StringType(deserialize_from="ElasticResizeNumberOfNodeOptions")
deferred_maintenance_windows = ListType(ModelType(ClusterDeferredMaintenanceWindows),
deserialize_from="DeferredMaintenanceWindows")
snapshot_schedule_identifier = StringType(deserialize_from="SnapshotScheduleIdentifier")
snapshot_schedule_state = StringType(deserialize_from="SnapshotScheduleState",
choices=("MODIFYING", "ACTIVE", "FAILED"))
expected_next_snapshot_schedule_time = DateTimeType(deserialize_from="ExpectedNextSnapshotScheduleTime")
expected_next_snapshot_schedule_time_status = StringType(deserialize_from="ExpectedNextSnapshotScheduleTimeStatus")
next_maintenance_window_start_time = DateTimeType(deserialize_from="NextMaintenanceWindowStartTime")
resize_info = ModelType(ResizeInfo, deserialize_from="ResizeInfo")
snapshots = ListType(ModelType(Snapshot), default=[])
snapshot_schedules = ListType(ModelType(SnapshotSchedule))
scheduled_actions = ListType(ModelType(ScheduledAction))
account_id = StringType(default="")
cloudwatch = ModelType(CloudWatchModel, serialize_when_none=False)
def reference(self, region_code):
return {
"resource_id": self.arn,
"external_link": f"https://console.aws.amazon.com/redshiftv2/home?region={region_code}#cluster-details?cluster={self.cluster_identifier}"
}
def set_cloudwatch(self, region_code):
return {
"namespace": "AWS/Redshift",
"dimensions": [CloudWatchDimensionModel({"Name": "ClusterIdentifier", "Value": self.cluster_identifier})],
"region_name": region_code
}
| 53.926316 | 149 | 0.79771 | 1,364 | 15,369 | 8.639296 | 0.223607 | 0.210031 | 0.186694 | 0.03683 | 0.396555 | 0.326375 | 0.216565 | 0.150458 | 0.071707 | 0.059487 | 0 | 0.000074 | 0.117119 | 15,369 | 284 | 150 | 54.116197 | 0.868376 | 0 | 0 | 0.313636 | 0 | 0.004545 | 0.199294 | 0.082412 | 0 | 0 | 0 | 0 | 0 | 1 | 0.009091 | false | 0.004545 | 0.013636 | 0.009091 | 0.931818 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
a1642fe5a9d21e048e92ffd84c031fb4f8f08f43 | 265 | py | Python | src/handlers/helix.py | lamas1901/telegram__pdf-bot | 995bd3a41edba744efc07a99296ff109427ed310 | [
"MIT"
] | null | null | null | src/handlers/helix.py | lamas1901/telegram__pdf-bot | 995bd3a41edba744efc07a99296ff109427ed310 | [
"MIT"
] | null | null | null | src/handlers/helix.py | lamas1901/telegram__pdf-bot | 995bd3a41edba744efc07a99296ff109427ed310 | [
"MIT"
] | null | null | null | from .keyboards import certificate_keyboard
from aiogram.types import Message
async def helix(message: Message) -> None:
with open('previews/helix_preview.pdf', 'rb') as file:
await message.answer_document(file, reply_markup=certificate_keyboard('helix'))
| 29.444444 | 83 | 0.781132 | 35 | 265 | 5.771429 | 0.714286 | 0.188119 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.116981 | 265 | 8 | 84 | 33.125 | 0.863248 | 0 | 0 | 0 | 0 | 0 | 0.124528 | 0.098113 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.4 | 0 | 0.4 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
a168726dab7bf91bc09d6e9e808f287009fdbe34 | 179 | py | Python | Python/IterTools/Medium/Compress the String/groupby.py | navjindervirdee/hackerrank | d0d0f77f770e4b092440a15f2740f63b65deb60b | [
"MIT"
] | 2 | 2017-10-12T13:28:42.000Z | 2020-07-28T11:25:05.000Z | Python/IterTools/Medium/Compress the String/groupby.py | navjindervirdee/hackerrank | d0d0f77f770e4b092440a15f2740f63b65deb60b | [
"MIT"
] | null | null | null | Python/IterTools/Medium/Compress the String/groupby.py | navjindervirdee/hackerrank | d0d0f77f770e4b092440a15f2740f63b65deb60b | [
"MIT"
] | 5 | 2018-02-05T21:53:18.000Z | 2021-10-03T06:27:45.000Z | from itertools import groupby
string = str(input())
values = groupby(string)
for key,group in values:
print('(' + str(len(list(group))) + ', ' + str(key) + ') ',end = '')
| 29.833333 | 72 | 0.597765 | 23 | 179 | 4.652174 | 0.695652 | 0.242991 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.195531 | 179 | 6 | 73 | 29.833333 | 0.743056 | 0 | 0 | 0 | 0 | 0 | 0.027778 | 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 |
a1952b2ab69913f713d2a1d9ea34b021ccd0dd5c | 496 | py | Python | VolNodes/Nodes/SleepNode.py | n1ckfg/volumetricpipeline | 374fc479817132030ef6e001e38d603847832a01 | [
"MIT"
] | null | null | null | VolNodes/Nodes/SleepNode.py | n1ckfg/volumetricpipeline | 374fc479817132030ef6e001e38d603847832a01 | [
"MIT"
] | null | null | null | VolNodes/Nodes/SleepNode.py | n1ckfg/volumetricpipeline | 374fc479817132030ef6e001e38d603847832a01 | [
"MIT"
] | null | null | null | from Nodes.TemplateNode import TemplateNode
import ryvencore_qt as rc
import time
class SleepNode(TemplateNode):
"A Debugging node that will do nothing for 10 seconds"
title = 'Sleep'
init_inputs = [
rc.NodeInputBP()
]
color = '#af3ecf'
def __init__(self, params):
super().__init__(params)
def setupInputs(self):
return self.input(0)
def doStuff(self, inputData):
time.sleep(10)
def setupOutputs(self, outputData):
pass | 26.105263 | 58 | 0.657258 | 59 | 496 | 5.355932 | 0.694915 | 0.113924 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016173 | 0.252016 | 496 | 19 | 59 | 26.105263 | 0.83558 | 0.104839 | 0 | 0 | 0 | 0 | 0.128773 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0.055556 | 0.166667 | 0.055556 | 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 |
a1a160a4ff352f43a74a0868c0a6170a3f52836b | 40 | py | Python | constant.py | mjj2000/SublimeUnitTestFileToggler | 8eb8efd643d2bb6af9a5b21b25968d05934fd8ea | [
"MIT"
] | 2 | 2016-12-09T08:31:59.000Z | 2017-01-16T12:46:10.000Z | constant.py | mjj2000/SublimeUnitTestFileToggler | 8eb8efd643d2bb6af9a5b21b25968d05934fd8ea | [
"MIT"
] | null | null | null | constant.py | mjj2000/SublimeUnitTestFileToggler | 8eb8efd643d2bb6af9a5b21b25968d05934fd8ea | [
"MIT"
] | null | null | null | DEFAULT_TEST_FILE_NAME_SUFFIX = '.spec'
| 20 | 39 | 0.825 | 6 | 40 | 4.833333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.075 | 40 | 1 | 40 | 40 | 0.783784 | 0 | 0 | 0 | 0 | 0 | 0.125 | 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 |
a1b7572727756ba0c7ba2acb378e24f9e6bda4c9 | 237 | py | Python | flexipy/api.py | JakubJecminek/flexipy | f6ac1cd6cb5028c56e1d747be87afdcd4eabbdae | [
"BSD-3-Clause"
] | 3 | 2016-03-30T16:11:09.000Z | 2017-12-05T12:11:54.000Z | flexipy/api.py | JakubJecminek/flexipy | f6ac1cd6cb5028c56e1d747be87afdcd4eabbdae | [
"BSD-3-Clause"
] | 2 | 2017-02-16T15:19:55.000Z | 2021-02-18T16:21:31.000Z | flexipy/api.py | JakubJecminek/flexipy | f6ac1cd6cb5028c56e1d747be87afdcd4eabbdae | [
"BSD-3-Clause"
] | 3 | 2017-07-10T22:38:53.000Z | 2021-01-28T16:29:53.000Z | # -*- coding: utf-8 -*-
"""
This module implements the flexipy API.
:copyright: (c) 2012 by Jakub Ječmínek.
:license: BSD, see LICENSE for more details.
"""
from adresar import Adresar
from faktura import Faktura
from bank import Banka | 21.545455 | 44 | 0.729958 | 34 | 237 | 5.088235 | 0.794118 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025253 | 0.164557 | 237 | 11 | 45 | 21.545455 | 0.848485 | 0.624473 | 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 |
a1c03cc58e300d518c61886f08766195f9b53676 | 216 | py | Python | imp_flask/tasks/rowapplymods.py | thijsmie/imp_flask | 2cad9f628c54572c02a5f893ef9c0cb1149b18ea | [
"MIT"
] | 1 | 2019-06-13T07:28:02.000Z | 2019-06-13T07:28:02.000Z | imp_flask/tasks/rowapplymods.py | k-automation/imp_flask | 2cad9f628c54572c02a5f893ef9c0cb1149b18ea | [
"MIT"
] | 4 | 2016-12-06T11:25:36.000Z | 2021-04-29T07:43:14.000Z | imp_flask/tasks/rowapplymods.py | k-automation/imp_flask | 2cad9f628c54572c02a5f893ef9c0cb1149b18ea | [
"MIT"
] | 2 | 2017-09-06T14:26:04.000Z | 2018-02-03T18:55:36.000Z |
def rowapplymods(transactionrow):
value = transactionrow.prevalue
for mod in transactionrow.includes_mods:
value = mod.apply(transactionrow.amount, value)[0]
transactionrow.value = value
| 27 | 59 | 0.712963 | 22 | 216 | 6.954545 | 0.590909 | 0.248366 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005848 | 0.208333 | 216 | 7 | 60 | 30.857143 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 0 | 0.2 | 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 |
a1cae34cad8bbc044f60429d1deb63279fc1ee1f | 272 | py | Python | tests/detectable_api/v0_0_2/__init__.py | ccharlesgb/fastapi-versioned | 5488cda86665de5cb2d0cfce7ff5660e90c6358f | [
"MIT"
] | null | null | null | tests/detectable_api/v0_0_2/__init__.py | ccharlesgb/fastapi-versioned | 5488cda86665de5cb2d0cfce7ff5660e90c6358f | [
"MIT"
] | null | null | null | tests/detectable_api/v0_0_2/__init__.py | ccharlesgb/fastapi-versioned | 5488cda86665de5cb2d0cfce7ff5660e90c6358f | [
"MIT"
] | null | null | null | from fastapi.requests import Request
from semantic_version import Version
from fastapi_versioned import VersionRouter
version = VersionRouter(Version("0.0.2"))
@version.router.get("/test2")
def route(request: Request):
return {"version": str(request.app.version)}
| 22.666667 | 48 | 0.775735 | 35 | 272 | 5.971429 | 0.542857 | 0.105263 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016529 | 0.110294 | 272 | 11 | 49 | 24.727273 | 0.847107 | 0 | 0 | 0 | 0 | 0 | 0.066176 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.428571 | 0.142857 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
a1d0f0e8152ce639b96c4b485d9c232287132417 | 3,001 | py | Python | onirim/card/_base.py | cwahbong/onirim-py | d1110c4280d54e3b8b2d1dcef31ee433f32cb7e3 | [
"MIT"
] | null | null | null | onirim/card/_base.py | cwahbong/onirim-py | d1110c4280d54e3b8b2d1dcef31ee433f32cb7e3 | [
"MIT"
] | null | null | null | onirim/card/_base.py | cwahbong/onirim-py | d1110c4280d54e3b8b2d1dcef31ee433f32cb7e3 | [
"MIT"
] | null | null | null | """
Inner module for enumerations and base types.
"""
import logging
from onirim import util
LOGGER = logging.getLogger(__name__)
class Color(util.AutoNumberEnum):
"""
Enumerated colors of cards.
Attributes:
red
blue
green
yellow
"""
red = ()
blue = ()
green = ()
yellow = ()
class Card:
"""
A card in onirim.
All cards in onirim inherits from this class. Methods called by some event
has a single parameter `core` (:py:class:`onirim.core.Core`) for accessing the game
information.
"""
_color = None
_kind = None
def _color_name(self):
return self._color.name if self._color else "nocolor"
def _kind_name(self):
return self._kind.name if self._kind else "nokind"
def _class_name(self):
return self.__class__.__name__[1:].lower()
@property
def color(self):
"""
Color of a card.
Returns:
The color of card if it has color, None otherwise.
Currently only nightmare cards have no color.
"""
return self._color
@property
def kind(self):
"""
Kind of a card if it is a location.
Returns:
The kind of card if it is a location, None otherwise.
"""
return self._kind
def _do_drawn(self, core):
raise NotImplementedError
def drawn(self, core):
"""
Called while this card is drawn.
"""
LOGGER.debug("A card is drawn, %r.", self)
self._do_drawn(core)
def _do_play(self, core):
raise NotImplementedError
def play(self, core):
"""
Called while this card is played.
"""
LOGGER.debug(
"A card is played, color=%s, kind=%s.",
self._color_name(),
self._kind_name())
self._do_play(core)
def _do_discard(self, core):
raise NotImplementedError
def discard(self, core):
"""
Called while this card is discarded.
"""
LOGGER.debug(
"A card is discarded, color=%s, kind=%s.",
self._color_name(),
self._kind_name())
self._do_discard(core)
def __eq__(self, other):
return self._kind == other.kind and self._color == other.color
def __hash__(self):
key_int = self.kind.value if self.kind else 0
color_int = self.color.value if self.color else 0
return key_int * 10 + color_int
def __str__(self):
return "{1} {0} card".format(self._class_name(), self._color_name())
def __repr__(self):
return "Card{{color: {}, kind: {}}}".format(self._color, self._kind)
class ColorCard(Card):
"""A card with color."""
def __init__(self, color):
# pylint is not smart enough to recognize enum class so we disable the
# function arguments check here.
self._color = Color(color) #pylint: disable=too-many-function-args
| 23.263566 | 87 | 0.58114 | 375 | 3,001 | 4.44 | 0.298667 | 0.07027 | 0.031231 | 0.032432 | 0.221021 | 0.125526 | 0.102703 | 0.05045 | 0.05045 | 0.05045 | 0 | 0.003405 | 0.314895 | 3,001 | 128 | 88 | 23.445313 | 0.80642 | 0.27091 | 0 | 0.192982 | 0 | 0 | 0.075153 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.280702 | false | 0 | 0.035088 | 0.105263 | 0.631579 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
a1d300f34c732b7b2dd3171e610863735e7905a2 | 381 | py | Python | api/uwkgm/database/drivers/data/mongo/triples/add.py | ichise-laboratory/uwkgm | 6505fa5d524336b30505804a3d241143cb1fa4bf | [
"BSD-3-Clause"
] | null | null | null | api/uwkgm/database/drivers/data/mongo/triples/add.py | ichise-laboratory/uwkgm | 6505fa5d524336b30505804a3d241143cb1fa4bf | [
"BSD-3-Clause"
] | 6 | 2020-11-25T10:49:45.000Z | 2021-09-22T18:50:03.000Z | api/uwkgm/database/drivers/data/mongo/triples/add.py | ichise-laboratory/uwkgm | 6505fa5d524336b30505804a3d241143cb1fa4bf | [
"BSD-3-Clause"
] | 1 | 2020-12-24T02:15:42.000Z | 2020-12-24T02:15:42.000Z | """MongoDB driver: Add triples to the triple modifier database
The UWKGM project
:copyright: (c) 2020 Ichise Laboratory at NII & AIST
:author: Rungsiman Nararatwong
"""
from database.drivers.data.mongo import mongo
def single(document: dict) -> str:
"""Adds a document containing an add-triple modifier"""
return str(mongo['triples'].insert_one(document).inserted_id)
| 25.4 | 65 | 0.748031 | 52 | 381 | 5.442308 | 0.788462 | 0.09894 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012308 | 0.146982 | 381 | 14 | 66 | 27.214286 | 0.858462 | 0.55643 | 0 | 0 | 0 | 0 | 0.044586 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.333333 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
b806c5a25846dc229d73d030fdf2f791672bc49a | 47 | py | Python | server/manipulator/default_settings.py | aditya-mitra/featherify | 9ccd7935c7984a6eeeae219786c10f3446d11f83 | [
"MIT"
] | null | null | null | server/manipulator/default_settings.py | aditya-mitra/featherify | 9ccd7935c7984a6eeeae219786c10f3446d11f83 | [
"MIT"
] | null | null | null | server/manipulator/default_settings.py | aditya-mitra/featherify | 9ccd7935c7984a6eeeae219786c10f3446d11f83 | [
"MIT"
] | null | null | null | CONFIGURATION = "css"
WIDTH = 30
HEIGHT = 30
| 7.833333 | 21 | 0.659574 | 6 | 47 | 5.166667 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 0.234043 | 47 | 5 | 22 | 9.4 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0.06383 | 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 |
b81365cba153387849a7525d7cbfe340b28594e4 | 1,446 | py | Python | HyperSphere/feature_map/modules/reduce_threshold.py | tomrunia/HyperSphere | 4c3ff808970452840e300761f15cfa3aee5a0bbe | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2020-11-01T17:15:44.000Z | 2020-11-01T17:15:44.000Z | HyperSphere/feature_map/modules/reduce_threshold.py | tomrunia/HyperSphere | 4c3ff808970452840e300761f15cfa3aee5a0bbe | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | HyperSphere/feature_map/modules/reduce_threshold.py | tomrunia/HyperSphere | 4c3ff808970452840e300761f15cfa3aee5a0bbe | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | import scipy.stats as stats
import sampyl as smp
import torch
from torch.nn.parameter import Parameter
from HyperSphere.GP.modules.gp_modules import GPModule
from HyperSphere.feature_map.functions import reduce_threshold
from HyperSphere.feature_map.functionals import sigmoid_numpy, sigmoid_inv_numpy
class ReduceThreshold(GPModule):
def __init__(self):
super(ReduceThreshold, self).__init__()
self.sigmoid_inv_threshold = Parameter(torch.FloatTensor(1))
self.alpha = 2.0
self.beta = 10.0
def reset_parameters(self):
self.sigmoid_inv_threshold.data.fill_(sigmoid_inv_numpy(stats.beta.rvs(a=self.alpha, b=self.beta)))
def init_parameters(self):
self.sigmoid_inv_threshold.data.fill_(sigmoid_inv_numpy((self.alpha - 1.0)/(self.alpha + self.beta - 2.0)))
def out_of_bounds(self, vec=None):
if vec is None:
return (self.sigmoid_inv_threshold.data < -10).any()
else:
return (vec < -10).any()
def n_params(self):
return 1
def param_to_vec(self):
return self.sigmoid_inv_threshold.data.clone()
def vec_to_param(self, vec):
self.sigmoid_inv_threshold.data = vec
def prior(self, vec):
return smp.beta(sigmoid_numpy(vec), alpha=self.alpha, beta=self.beta)
def forward(self, input):
return reduce_threshold.ReduceThreshold.apply(input, torch.sigmoid(self.sigmoid_inv_threshold))
| 31.434783 | 115 | 0.70816 | 201 | 1,446 | 4.865672 | 0.308458 | 0.102249 | 0.100205 | 0.164622 | 0.217791 | 0.190184 | 0.122699 | 0.122699 | 0.122699 | 0.122699 | 0 | 0.01281 | 0.19018 | 1,446 | 45 | 116 | 32.133333 | 0.822374 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.28125 | false | 0 | 0.21875 | 0.125 | 0.71875 | 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 |
62a999bdef638a22597b73a418414e014b8d750e | 75 | py | Python | ml_prepare/_tfds/__init__.py | SamuelMarks/ml_prepare | 7547c78ce500702c7f3d8142d430b4c591dc255a | [
"Apache-2.0",
"MIT"
] | null | null | null | ml_prepare/_tfds/__init__.py | SamuelMarks/ml_prepare | 7547c78ce500702c7f3d8142d430b4c591dc255a | [
"Apache-2.0",
"MIT"
] | null | null | null | ml_prepare/_tfds/__init__.py | SamuelMarks/ml_prepare | 7547c78ce500702c7f3d8142d430b4c591dc255a | [
"Apache-2.0",
"MIT"
] | null | null | null | from .base import BaseImageLabelFolder
__all__ = ["BaseImageLabelFolder"]
| 18.75 | 38 | 0.813333 | 6 | 75 | 9.5 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.106667 | 75 | 3 | 39 | 25 | 0.850746 | 0 | 0 | 0 | 0 | 0 | 0.266667 | 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 |
62ba9b7d79041173170e8d9faf6325e88c6a67e7 | 295 | py | Python | tests/utils_testing.py | awesome-archive/urh | c8c3aabc9d637ca660d8c72c3d8372055e0f3ec7 | [
"Apache-2.0"
] | 1 | 2017-06-21T02:37:16.000Z | 2017-06-21T02:37:16.000Z | tests/utils_testing.py | dspmandavid/urh | 30643c1a68634b1c97eb9989485a4e96a3b038ae | [
"Apache-2.0"
] | null | null | null | tests/utils_testing.py | dspmandavid/urh | 30643c1a68634b1c97eb9989485a4e96a3b038ae | [
"Apache-2.0"
] | null | null | null | import os
from PyQt5.QtWidgets import QApplication
import sys
app = QApplication(sys.argv)
f = os.readlink(__file__) if os.path.islink(__file__) else __file__
path = os.path.realpath(os.path.join(f, ".."))
def get_path_for_data_file(filename):
return os.path.join(path, "data", filename) | 24.583333 | 67 | 0.752542 | 46 | 295 | 4.478261 | 0.521739 | 0.116505 | 0.097087 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003846 | 0.118644 | 295 | 12 | 68 | 24.583333 | 0.788462 | 0 | 0 | 0 | 0 | 0 | 0.02027 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.375 | 0.125 | 0.625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
62bebe8a63fc00ff648a094be918a0aa3b81e935 | 259 | py | Python | reverseSentence.py | VivekWesley/DS_and_Algo_Python | 991a3f738e34c00c0480e0780989d46038fba47c | [
"MIT"
] | null | null | null | reverseSentence.py | VivekWesley/DS_and_Algo_Python | 991a3f738e34c00c0480e0780989d46038fba47c | [
"MIT"
] | null | null | null | reverseSentence.py | VivekWesley/DS_and_Algo_Python | 991a3f738e34c00c0480e0780989d46038fba47c | [
"MIT"
] | null | null | null | # reverse given string
# Sample output:
# string this reverse
def reverse_sentence(sentence):
words = sentence.split(" ")
reverse = ' '.join(reversed(words))
return reverse
sentence = "reverse this string"
print (reverse_sentence(sentence)) | 17.266667 | 39 | 0.706564 | 29 | 259 | 6.241379 | 0.482759 | 0.248619 | 0.254144 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.185328 | 259 | 15 | 40 | 17.266667 | 0.85782 | 0.216216 | 0 | 0 | 0 | 0 | 0.105 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0 | 0 | 0.333333 | 0.166667 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
62c554ed5c0a1867dbdeee7c29c5e6ebd9b11fd3 | 1,431 | py | Python | python/plugins/processing/tests/TestData.py | dyna-mis/Hilabeling | cb7d5d4be29624a20c8a367162dbc6fd779b2b52 | [
"MIT"
] | null | null | null | python/plugins/processing/tests/TestData.py | dyna-mis/Hilabeling | cb7d5d4be29624a20c8a367162dbc6fd779b2b52 | [
"MIT"
] | null | null | null | python/plugins/processing/tests/TestData.py | dyna-mis/Hilabeling | cb7d5d4be29624a20c8a367162dbc6fd779b2b52 | [
"MIT"
] | 1 | 2021-12-25T08:40:30.000Z | 2021-12-25T08:40:30.000Z | # -*- coding: utf-8 -*-
"""
***************************************************************************
TestData.py
---------------------
Date : March 2013
Copyright : (C) 2013 by Victor Olaya
Email : volayaf at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************
"""
__author__ = 'Victor Olaya'
__date__ = 'March 2013'
__copyright__ = '(C) 2013, Victor Olaya'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '176c06ceefb5f555205e72b20c962740cc0ec183'
import os.path
testDataPath = os.path.join(os.path.dirname(__file__), 'testdata')
def table():
return os.path.join(testDataPath, 'table.dbf')
def points():
return os.path.join(testDataPath, 'points.gml')
def invalid_geometries():
return os.path.join(testDataPath, 'invalidgeometries.gml')
| 33.27907 | 75 | 0.467505 | 129 | 1,431 | 5.023256 | 0.604651 | 0.055556 | 0.061728 | 0.074074 | 0.212963 | 0.083333 | 0 | 0 | 0 | 0 | 0 | 0.044248 | 0.289308 | 1,431 | 42 | 76 | 34.071429 | 0.59292 | 0.667365 | 0 | 0 | 0 | 0 | 0.282655 | 0.130621 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.083333 | 0.25 | 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 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
62cb66402feef395045b24bb89066ab3de09e25f | 7,357 | py | Python | app/engine/item_components/usable_components.py | ViolaBuddy/EscapeFromPlegia | 5228b42e8525b445854d742dccf85ca65b320d70 | [
"MIT"
] | null | null | null | app/engine/item_components/usable_components.py | ViolaBuddy/EscapeFromPlegia | 5228b42e8525b445854d742dccf85ca65b320d70 | [
"MIT"
] | null | null | null | app/engine/item_components/usable_components.py | ViolaBuddy/EscapeFromPlegia | 5228b42e8525b445854d742dccf85ca65b320d70 | [
"MIT"
] | null | null | null | from app.data.item_components import ItemComponent
from app.data.components import Type
from app.engine import action
class Uses(ItemComponent):
nid = 'uses'
desc = "Number of uses of item"
tag = 'uses'
expose = Type.Int
value = 1
def init(self, item):
item.data['uses'] = self.value
item.data['starting_uses'] = self.value
def available(self, unit, item) -> bool:
return item.data['uses'] > 0
def is_broken(self, unit, item) -> bool:
return item.data['uses'] <= 0
def on_hit(self, actions, playback, unit, item, target, target_pos, mode):
actions.append(action.SetObjData(item, 'uses', item.data['uses'] - 1))
actions.append(action.UpdateRecords('item_use', (unit.nid, item.nid)))
def on_miss(self, actions, playback, unit, item, target, target_pos, mode):
actions.append(action.SetObjData(item, 'uses', item.data['uses'] - 1))
actions.append(action.UpdateRecords('item_use', (unit.nid, item.nid)))
def on_broken(self, unit, item):
from app.engine.game_state import game
if self.is_broken(unit, item):
if item in unit.items:
action.do(action.RemoveItem(unit, item))
elif item in game.party.convoy:
action.do(action.RemoveItemFromConvoy(item))
return True
return False
def reverse_use(self, unit, item):
if self.is_broken(unit, item):
action.do(action.GiveItem(unit, item))
action.do(action.SetObjData(item, 'uses', item.data['uses'] + 1))
action.do(action.ReverseRecords('item_use', (unit.nid, item.nid)))
def special_sort(self, unit, item):
return item.data['uses']
class ChapterUses(ItemComponent):
nid = 'c_uses'
desc = "Number of uses per chapter for item. (Refreshes after each chapter)"
tag = 'uses'
expose = Type.Int
value = 1
def init(self, item):
item.data['c_uses'] = self.value
item.data['starting_c_uses'] = self.value
def available(self, unit, item) -> bool:
return item.data['c_uses'] > 0
def is_broken(self, unit, item) -> bool:
return item.data['c_uses'] <= 0
def on_hit(self, actions, playback, unit, item, target, target_pos, mode):
actions.append(action.SetObjData(item, 'c_uses', item.data['c_uses'] - 1))
actions.append(action.UpdateRecords('item_use', (unit.nid, item.nid)))
def on_miss(self, actions, playback, unit, item, target, target_pos, mode):
actions.append(action.SetObjData(item, 'c_uses', item.data['c_uses'] - 1))
actions.append(action.UpdateRecords('item_use', (unit.nid, item.nid)))
def on_broken(self, unit, item):
if self.is_broken(unit, item):
if unit.equipped_weapon is item:
action.do(action.UnequipItem(unit, item))
return True
return False
def on_end_chapter(self, unit, item):
# Don't need to use action here because it will be end of chapter
item.data['c_uses'] = item.data['starting_c_uses']
def reverse_use(self, unit, item):
action.do(action.SetObjData(item, 'c_uses', item.data['c_uses'] + 1))
action.do(action.ReverseRecords('item_use', (unit.nid, item.nid)))
def special_sort(self, unit, item):
return item.data['c_uses']
class HPCost(ItemComponent):
nid = 'hp_cost'
desc = "Item costs HP to use"
tag = 'uses'
expose = Type.Int
value = 1
def available(self, unit, item) -> bool:
return unit.get_hp() > self.value
def start_combat(self, playback, unit, item, target, mode):
action.do(action.ChangeHP(unit, -self.value))
def reverse_use(self, unit, item):
action.do(action.ChangeHP(unit, self.value))
class ManaCost(ItemComponent):
nid = 'mana_cost'
desc = "Item costs mana to use"
tag = 'uses'
expose = Type.Int
value = 1
def available(self, unit, item) -> bool:
return unit.get_mana() >= self.value
def start_combat(self, playback, unit, item, target, mode):
action.do(action.ChangeMana(unit, -self.value))
def reverse_use(self, unit, item):
action.do(action.ChangeMana(unit, self.value))
class Cooldown(ItemComponent):
nid = 'cooldown'
desc = "After use, item cannot be used until X turns have passed"
tag = 'uses'
expose = Type.Int
value = 1
def init(self, item):
item.data['cooldown'] = 0
item.data['starting_cooldown'] = self.value
self._used_in_combat = False
def available(self, unit, item) -> bool:
return item.data['cooldown'] == 0
def is_broken(self, unit, item) -> bool:
return item.data['cooldown'] != 0
def on_hit(self, actions, playback, unit, item, target, target_pos, mode):
self._used_in_combat = True
def on_miss(self, actions, playback, unit, item, target, target_pos, mode):
self._used_in_combat = True
def end_combat(self, playback, unit, item, target, mode):
if self._used_in_combat:
action.do(action.SetObjData(item, 'cooldown', self.value))
self._used_in_combat = False
def reverse_use(self, unit, item):
action.do(action.SetObjData(item, 'cooldown', 0))
def on_broken(self, unit, item):
if unit.equipped_weapon is item:
action.do(action.UnequipItem(unit, item))
return False
def on_upkeep(self, actions, playback, unit, item):
if item.data['cooldown'] > 0:
# Doesn't use actions list in order to prevent
# requiring the status phase to show health bar
action.do(action.SetObjData(item, 'cooldown', item.data['cooldown'] - 1))
def on_end_chapter(self, unit, item):
# Don't need to use action here because it will be end of chapter
item.data['cooldown'] = 0
class PrfUnit(ItemComponent):
nid = 'prf_unit'
desc = 'Item can only be wielded by certain units'
tag = 'uses'
expose = (Type.List, Type.Unit)
def available(self, unit, item) -> bool:
return unit.nid in self.value
class PrfClass(ItemComponent):
nid = 'prf_class'
desc = 'Item can only be wielded by certain classes'
tag = 'uses'
expose = (Type.List, Type.Class)
def available(self, unit, item) -> bool:
return unit.klass in self.value
class PrfTag(ItemComponent):
nid = 'prf_tags'
desc = 'Item can only be wielded by units with certain tags'
tag = 'uses'
expose = (Type.List, Type.Tag)
def available(self, unit, item) -> bool:
return any(tag in self.value for tag in unit.tags)
class PrfAffinity(ItemComponent):
nid = 'prf_affinity'
desc = 'Item can only be wielded by units with certain affinity'
tag = 'uses'
expose = (Type.List, Type.Affinity)
def available(self, unit, item) -> bool:
return unit.affinity in self.value
class Locked(ItemComponent):
nid = 'locked'
desc = 'Item cannot be discarded, traded, or stolen'
tag = 'uses'
def locked(self, unit, item) -> bool:
return True
| 32.84375 | 86 | 0.613293 | 976 | 7,357 | 4.533811 | 0.139344 | 0.075932 | 0.067797 | 0.047006 | 0.750282 | 0.720904 | 0.661017 | 0.614689 | 0.56678 | 0.536045 | 0 | 0.004074 | 0.266005 | 7,357 | 223 | 87 | 32.991031 | 0.81537 | 0.029768 | 0 | 0.521739 | 0 | 0 | 0.119103 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.236025 | false | 0.006211 | 0.024845 | 0.093168 | 0.720497 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
1a1b5763046690a755bb00c0f60bed15c26b769e | 1,039 | py | Python | p2/core/migrations/0018_auto_20190515_0951.py | BeryJu/p2 | 80b5c6a821f90cef73d6e8cd3c6cdb05ffa86b27 | [
"MIT"
] | null | null | null | p2/core/migrations/0018_auto_20190515_0951.py | BeryJu/p2 | 80b5c6a821f90cef73d6e8cd3c6cdb05ffa86b27 | [
"MIT"
] | null | null | null | p2/core/migrations/0018_auto_20190515_0951.py | BeryJu/p2 | 80b5c6a821f90cef73d6e8cd3c6cdb05ffa86b27 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2019-05-15 09:51
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('p2_core', '0017_auto_20190503_1755'),
]
operations = [
migrations.AlterField(
model_name='blob',
name='tags',
field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict),
),
migrations.AlterField(
model_name='component',
name='tags',
field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict),
),
migrations.AlterField(
model_name='storage',
name='tags',
field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict),
),
migrations.AlterField(
model_name='volume',
name='tags',
field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict),
),
]
| 29.685714 | 91 | 0.603465 | 107 | 1,039 | 5.785047 | 0.401869 | 0.105008 | 0.169628 | 0.218094 | 0.670436 | 0.61874 | 0.61874 | 0.61874 | 0.61874 | 0.61874 | 0 | 0.042553 | 0.276227 | 1,039 | 34 | 92 | 30.558824 | 0.780585 | 0.043311 | 0 | 0.571429 | 1 | 0 | 0.072581 | 0.023185 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.071429 | 0 | 0.178571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1a2116fb04f3c46be6f9f198c0ebc75d200f43c2 | 280 | py | Python | tests/unit_tests.py | VamshiKrishnaUM/flask-social | 08bebaa90b004088142141fb3f6c06af107d814c | [
"MIT"
] | 173 | 2015-01-07T19:31:57.000Z | 2022-02-01T18:01:15.000Z | tests/unit_tests.py | VamshiKrishnaUM/flask-social | 08bebaa90b004088142141fb3f6c06af107d814c | [
"MIT"
] | 19 | 2015-02-17T19:29:36.000Z | 2018-06-05T21:55:26.000Z | tests/unit_tests.py | VamshiKrishnaUM/flask-social | 08bebaa90b004088142141fb3f6c06af107d814c | [
"MIT"
] | 99 | 2015-01-02T06:40:17.000Z | 2021-05-26T10:03:37.000Z | from unittest import TestCase
from flask_social.core import _SocialState
class FlaskSocialUnitTests(TestCase):
def test_social_state_raises_attribute_error(self):
state = _SocialState(providers={})
self.assertRaises(AttributeError, lambda: state.something)
| 28 | 66 | 0.785714 | 30 | 280 | 7.066667 | 0.733333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.146429 | 280 | 9 | 67 | 31.111111 | 0.887029 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 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 |
1a2648d43bfe9da70d8134bd60f2d026f42a47c5 | 761 | py | Python | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/EGL/NV/post_sub_buffer.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/EGL/NV/post_sub_buffer.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/EGL/NV/post_sub_buffer.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.EGL import _types as _cs
# End users want this...
from OpenGL.raw.EGL._types import *
from OpenGL.raw.EGL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_EXTENSION_NAME = 'EGL_NV_post_sub_buffer'
def _f( function ):
return _p.createFunction( function,_p.PLATFORM.EGL,'EGL_NV_post_sub_buffer',error_checker=_errors._error_checker)
EGL_POST_SUB_BUFFER_SUPPORTED_NV=_C('EGL_POST_SUB_BUFFER_SUPPORTED_NV',0x30BE)
@_f
@_p.types(_cs.EGLBoolean,_cs.EGLDisplay,_cs.EGLSurface,_cs.EGLint,_cs.EGLint,_cs.EGLint,_cs.EGLint)
def eglPostSubBufferNV(dpy,surface,x,y,width,height):pass
| 42.277778 | 118 | 0.795007 | 119 | 761 | 4.714286 | 0.478992 | 0.089127 | 0.092692 | 0.085562 | 0.338681 | 0.153298 | 0 | 0 | 0 | 0 | 0 | 0.004425 | 0.109067 | 761 | 17 | 119 | 44.764706 | 0.823009 | 0.131406 | 0 | 0 | 1 | 0 | 0.119309 | 0.119309 | 0 | 0 | 0.009419 | 0 | 0 | 1 | 0.153846 | false | 0.076923 | 0.461538 | 0.076923 | 0.692308 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 3 |
1a2d288648b64347a9029b3ffb9c3cc739f863de | 321 | py | Python | mdm_inventory/products/graphql/query.py | TeamWalls/mdm-backend-django | 4e23f9abc8531eb786d5e6cf958c9ffa8acd6b1d | [
"MIT"
] | null | null | null | mdm_inventory/products/graphql/query.py | TeamWalls/mdm-backend-django | 4e23f9abc8531eb786d5e6cf958c9ffa8acd6b1d | [
"MIT"
] | null | null | null | mdm_inventory/products/graphql/query.py | TeamWalls/mdm-backend-django | 4e23f9abc8531eb786d5e6cf958c9ffa8acd6b1d | [
"MIT"
] | null | null | null | import graphene
#models
from mdm_inventory.products.models import Product
#types
from mdm_inventory.products.graphql.types import ProductType
class QueryProduct(graphene.ObjectType):
products = graphene.List(ProductType)
def resolve_products(root, info):
return Product.objects.filter(is_active=True)
| 22.928571 | 60 | 0.794393 | 39 | 321 | 6.435897 | 0.641026 | 0.055777 | 0.12749 | 0.191235 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130841 | 321 | 13 | 61 | 24.692308 | 0.899642 | 0.034268 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.428571 | 0.142857 | 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 | 1 | 0 | 0 | 0 | 3 |
a7e61ed25750841569d4835ed5d5aa9a20818435 | 127 | py | Python | django_otp/fields/__init__.py | brucedockeray-projects/django-good-otp | 7328ff84c4f31947bc92a529edbfad613730a671 | [
"MIT"
] | 19 | 2018-09-04T12:16:16.000Z | 2021-11-04T18:07:37.000Z | django_otp/fields/__init__.py | brucedockeray-projects/django-good-otp | 7328ff84c4f31947bc92a529edbfad613730a671 | [
"MIT"
] | 40 | 2016-12-31T05:01:11.000Z | 2022-01-29T02:51:52.000Z | django_otp/fields/__init__.py | brucedockeray-projects/django-good-otp | 7328ff84c4f31947bc92a529edbfad613730a671 | [
"MIT"
] | 5 | 2019-04-04T21:38:31.000Z | 2021-03-09T05:33:45.000Z | #!/usr/bin/env python
# coding=utf-8
"""Django OTP fields."""
from .otp_gen import OTPGenField
__all__ = ("OTPGenField", )
| 12.7 | 32 | 0.677165 | 17 | 127 | 4.764706 | 0.882353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009259 | 0.149606 | 127 | 9 | 33 | 14.111111 | 0.740741 | 0.409449 | 0 | 0 | 0 | 0 | 0.161765 | 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 |
c515bb2ac1c1a4f7273f3655985d6a9d1fe0d45d | 979 | py | Python | data_facility_admin/migrations/0036_auto_20190619_1759.py | NYU-CI/dfadmin | 071f38c62aea8ef8bf4ae82dbd672694e719b9bf | [
"CC0-1.0"
] | 1 | 2021-04-08T05:22:35.000Z | 2021-04-08T05:22:35.000Z | data_facility_admin/migrations/0036_auto_20190619_1759.py | NYU-CI/dfadmin | 071f38c62aea8ef8bf4ae82dbd672694e719b9bf | [
"CC0-1.0"
] | 8 | 2019-08-05T18:16:07.000Z | 2019-10-29T18:42:53.000Z | data_facility_admin/migrations/0036_auto_20190619_1759.py | NYU-CI/dfadmin | 071f38c62aea8ef8bf4ae82dbd672694e719b9bf | [
"CC0-1.0"
] | 2 | 2019-09-11T15:24:32.000Z | 2020-01-08T20:34:05.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.21 on 2019-06-19 21:59
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('data_facility_admin', '0035_auto_20190515_0920'),
]
operations = [
migrations.AddField(
model_name='historicalproject',
name='end',
field=models.DateTimeField(blank=True, null=True),
),
migrations.AddField(
model_name='historicalproject',
name='start',
field=models.DateTimeField(blank=True, null=True),
),
migrations.AddField(
model_name='project',
name='end',
field=models.DateTimeField(blank=True, null=True),
),
migrations.AddField(
model_name='project',
name='start',
field=models.DateTimeField(blank=True, null=True),
),
]
| 27.194444 | 62 | 0.581205 | 95 | 979 | 5.842105 | 0.473684 | 0.12973 | 0.165766 | 0.194595 | 0.634234 | 0.634234 | 0.524324 | 0.524324 | 0.524324 | 0.425225 | 0 | 0.049708 | 0.301328 | 979 | 35 | 63 | 27.971429 | 0.761696 | 0.07048 | 0 | 0.714286 | 1 | 0 | 0.116869 | 0.025358 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.071429 | 0 | 0.178571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c51e24fa1b6c1e0a26426f3543d4b6c41f2d824e | 144 | py | Python | pythonProject1/2.py | viniTWL/Python-Projects | 1c4d2417efd896623263287b1d2391f7c551674c | [
"MIT"
] | 1 | 2021-10-17T13:00:19.000Z | 2021-10-17T13:00:19.000Z | pythonProject1/2.py | viniTWL/Python-Projects | 1c4d2417efd896623263287b1d2391f7c551674c | [
"MIT"
] | null | null | null | pythonProject1/2.py | viniTWL/Python-Projects | 1c4d2417efd896623263287b1d2391f7c551674c | [
"MIT"
] | null | null | null | n = (int(input('Digite um número:')))
print('O seu dobro é {}, o seu triplo é {}, e sua raiz quadrada é {:.1f}.'.format(n*2, n*3, n**(1/2)))
| 28.8 | 102 | 0.5625 | 29 | 144 | 2.793103 | 0.724138 | 0.098765 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.042373 | 0.180556 | 144 | 4 | 103 | 36 | 0.644068 | 0 | 0 | 0 | 0 | 0 | 0.591549 | 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 |
c53179980d45fbf474d4d38d76a20a7e71119e8f | 20,308 | py | Python | test/conftest.py | cvisionai/tator-py | 89d5ed3bfc3e824bdf73b6c0fc43180e09dc3782 | [
"MIT"
] | 2 | 2020-06-11T02:17:43.000Z | 2021-01-27T14:41:07.000Z | test/conftest.py | cvisionai/tator-py | 89d5ed3bfc3e824bdf73b6c0fc43180e09dc3782 | [
"MIT"
] | 39 | 2020-06-08T15:12:47.000Z | 2022-03-31T20:05:17.000Z | test/conftest.py | cvisionai/tator-py | 89d5ed3bfc3e824bdf73b6c0fc43180e09dc3782 | [
"MIT"
] | 1 | 2020-06-13T00:09:10.000Z | 2020-06-13T00:09:10.000Z | import datetime
import os
import shutil
import time
import tarfile
import yaml
from uuid import uuid1
import pytest
import requests
def pytest_addoption(parser):
parser.addoption('--host', help='Tator host', default='https://adamant.duckdns.org')
parser.addoption('--token', help='API token', default='')
parser.addoption('--bucket', help='Optional path to yaml file containing bucket spec. If '
'given, the project will use this bucket.')
parser.addoption('--keep', help='Do not delete project when done', action='store_true')
def pytest_generate_tests(metafunc):
if 'host' in metafunc.fixturenames:
metafunc.parametrize('host', [metafunc.config.getoption('host')])
if 'token' in metafunc.fixturenames:
metafunc.parametrize('token', [metafunc.config.getoption('token')])
def make_attribute_types():
return [
dict(
name='test_bool',
dtype='bool',
default=True,
),
dict(
name='test_int',
dtype='int',
default=0,
minimum=-1000,
maximum=1000,
),
dict(
name='test_float',
dtype='float',
default=0.0,
minimum=-1000.0,
maximum=1000.0,
),
dict(
name='test_enum',
dtype='enum',
choices=['a', 'b', 'c'],
default='a',
),
dict(
name='test_string',
dtype='string',
default='asdf',
),
dict(
name='test_datetime',
dtype='datetime',
use_current=True,
),
dict(
name='test_geopos',
dtype='geopos',
default=[-179.0, -89.0],
),
dict(
name='test_float_array',
dtype='float_array',
default=[0.0, 0.0, 0.0],
size=3,
)
]
@pytest.fixture(scope='session')
def organization(request):
""" Organization ID for a created organization. """
import tator
host = request.config.option.host
token = request.config.option.token
keep = request.config.option.keep
tator_api = tator.get_api(host, token)
current_dt = datetime.datetime.now()
dt_str = current_dt.strftime('%Y_%m_%d__%H_%M_%S')
response = tator_api.create_organization(organization_spec={
'name': f'test_organization_{dt_str}',
})
organization_id = response.id
yield organization_id
if not keep:
status = tator_api.delete_organization(organization_id)
@pytest.fixture(scope='session')
def project(request, organization):
""" Project ID for a created project. """
import tator
host = request.config.option.host
token = request.config.option.token
bucket = request.config.option.bucket
keep = request.config.option.keep
tator_api = tator.get_api(host, token)
current_dt = datetime.datetime.now()
dt_str = current_dt.strftime('%Y_%m_%d__%H_%M_%S')
project_spec = {
'name': f'test_project_{dt_str}',
'summary': f'Test project created by tator-py unit tests on {current_dt}',
'organization': organization,
}
# Create bucket object if bucket spec is given.
if bucket is not None:
with open(bucket, 'r') as f:
bucket_spec = yaml.safe_load(f)
response = tator_api.create_bucket(organization, bucket_spec=bucket_spec)
project_spec['bucket'] = response.id
response = tator_api.create_project(project_spec=project_spec)
project_id = response.id
yield project_id
if not keep:
status = tator_api.delete_project(project_id)
@pytest.fixture(scope='session')
def algo_project(request, organization):
""" Project ID for a created project. """
import tator
host = request.config.option.host
token = request.config.option.token
keep = request.config.option.keep
tator_api = tator.get_api(host, token)
current_dt = datetime.datetime.now()
dt_str = current_dt.strftime('%Y_%m_%d__%H_%M_%S')
response = tator_api.create_project(project_spec={
'name': f'algo_test_project_{dt_str}',
'summary': f'Algo test project created by tator-py unit tests on {current_dt}',
'organization': organization,
})
project_id = response.id
yield project_id
if not keep:
status = tator_api.delete_project(project_id)
@pytest.fixture(scope='session')
def image_type(request, project):
import tator
host = request.config.option.host
token = request.config.option.token
tator_api = tator.get_api(host, token)
response = tator_api.create_media_type(project, media_type_spec={
'name': 'image_type',
'description': 'Test image type',
'project': project,
'dtype': 'image',
'attribute_types': make_attribute_types(),
})
image_type_id = response.id
yield image_type_id
@pytest.fixture(scope='session')
def image_file(request):
out_path = '/tmp/test1.jpg'
if not os.path.exists(out_path):
url = 'https://www.gstatic.com/webp/gallery/1.jpg'
with requests.get(url, stream=True) as r:
r.raise_for_status()
with open(out_path, 'wb') as f:
for chunk in r.iter_content(chunk_size=8192):
if chunk:
f.write(chunk)
yield out_path
@pytest.fixture(scope='session')
def image(request, project, image_type, image_file):
import tator
host = request.config.option.host
token = request.config.option.token
tator_api = tator.get_api(host, token)
for progress, response in tator.util.upload_media(tator_api, image_type, image_file):
print(f"Upload image progress: {progress}%")
print(response.message)
num_retries = 0
while True:
medias = tator_api.get_media_list(project, name='test1.jpg')
if len(medias) > 0:
image_id = medias[0].id
break
num_retries += 1
max_retries = 30
assert num_retries < max_retries
time.sleep(0.5)
yield image_id
@pytest.fixture(scope='session')
def image_set(request):
out_path = '/tmp/lfw.tgz'
extract_path = '/tmp/lfw'
# Download Labeled Faces in the Wild dataset.
if not os.path.exists(out_path):
url = 'http://vis-www.cs.umass.edu/lfw/lfw.tgz'
with requests.get(url, stream=True) as r:
r.raise_for_status()
with open(out_path, 'wb') as f:
for chunk in r.iter_content(chunk_size=8192):
if chunk:
f.write(chunk)
# Extract the images.
if not os.path.exists(extract_path):
os.makedirs(extract_path, exist_ok=True)
tar = tarfile.open(out_path)
for item in tar:
tar.extract(item, extract_path)
image_path = os.path.join(extract_path, 'lfw')
yield image_path
shutil.rmtree(extract_path)
@pytest.fixture(scope='session')
def video_type(request, project):
import tator
host = request.config.option.host
token = request.config.option.token
tator_api = tator.get_api(host, token)
response = tator_api.create_media_type(project, media_type_spec={
'name': 'video_type',
'description': 'Test video type',
'project': project,
'dtype': 'video',
'attribute_types': make_attribute_types(),
})
video_type_id = response.id
yield video_type_id
@pytest.fixture(scope='session')
def multi_type(request, project):
import tator
host = request.config.option.host
token = request.config.option.token
tator_api = tator.get_api(host, token)
response = tator_api.create_media_type(project, media_type_spec={
'name': 'multi_type',
'description': 'Test multi type',
'project': project,
'dtype': 'multi',
'attribute_types': make_attribute_types(),
})
multi_type_id = response.id
yield multi_type_id
@pytest.fixture(scope='session')
def video_file(request):
out_path = '/tmp/AudioVideoSyncTest_BallastMedia.mp4'
if not os.path.exists(out_path):
url = 'http://www.ballastmedia.com/wp-content/uploads/AudioVideoSyncTest_BallastMedia.mp4'
with requests.get(url, stream=True) as r:
r.raise_for_status()
with open(out_path, 'wb') as f:
for chunk in r.iter_content(chunk_size=8192):
if chunk:
f.write(chunk)
yield out_path
@pytest.fixture(scope='session')
def video(request, project, video_type, video_file):
import tator
host = request.config.option.host
token = request.config.option.token
tator_api = tator.get_api(host, token)
attributes = {"test_string": str(uuid1())}
for progress, response in tator.util.upload_media(tator_api, video_type, video_file, attributes=attributes):
print(f"Upload video progress: {progress}%")
print(response.message)
while True:
response = tator_api.get_media_list(project, name='AudioVideoSyncTest_BallastMedia.mp4')
print("Waiting for transcode...")
time.sleep(2.5)
if len(response) == 0:
continue
if response[0].media_files is None:
continue
streaming = response[0].media_files.streaming
have_archival = response[0].media_files.archival is not None
if streaming and have_archival and len(streaming) == 4:
video_id = response[0].id
break
# Check for proper attribute setting via upload_file
assert response[0].attributes.get("test_string") == attributes.get("test_string")
# If all is kosher return the video_id
yield video_id
@pytest.fixture(scope='function')
def video_temp(request, project, video_type, video_file):
import tator
host = request.config.option.host
token = request.config.option.token
tator_api = tator.get_api(host, token)
for progress, response in tator.util.upload_media(tator_api, video_type, video_file):
print(f"Upload video progress: {progress}%")
print(response.message)
while True:
response = tator_api.get_media_list(project, name='AudioVideoSyncTest_BallastMedia.mp4')
print("Waiting for transcode...")
time.sleep(2.5)
if len(response) == 0:
continue
if response[0].media_files is None:
continue
have_streaming = response[0].media_files.streaming is not None
have_archival = response[0].media_files.archival is not None
if have_streaming and have_archival:
video_id = response[0].id
break
yield video_id
@pytest.fixture(scope='session')
def multi(request, project, multi_type, video):
import tator
host = request.config.option.host
token = request.config.option.token
tator_api = tator.get_api(host, token)
response = tator.util.make_multi_stream(tator_api, multi_type, [1, 1],
'Test multi', [video], 'Multi Videos')
multi_id = response.id
yield multi_id
@pytest.fixture(scope='session')
def dot_type(request, project, video_type, image_type):
import tator
host = request.config.option.host
token = request.config.option.token
tator_api = tator.get_api(host, token)
response = tator_api.create_localization_type(project, localization_type_spec={
'name': 'dot_type',
'description': 'Test dot type',
'project': project,
'media_types': [video_type, image_type],
'dtype': 'dot',
'attribute_types': make_attribute_types(),
})
dot_type_id = response.id
yield dot_type_id
@pytest.fixture(scope='session')
def line_type(request, project, video_type, image_type):
import tator
host = request.config.option.host
token = request.config.option.token
tator_api = tator.get_api(host, token)
response = tator_api.create_localization_type(project, localization_type_spec={
'name': 'line_type',
'description': 'Test line type',
'project': project,
'media_types': [video_type, image_type],
'dtype': 'line',
'attribute_types': make_attribute_types(),
})
line_type_id = response.id
yield line_type_id
@pytest.fixture(scope='session')
def box_type(request, project, video_type, image_type):
import tator
host = request.config.option.host
token = request.config.option.token
tator_api = tator.get_api(host, token)
response = tator_api.create_localization_type(project, localization_type_spec={
'name': 'box_type',
'description': 'Test box type',
'project': project,
'media_types': [video_type, image_type],
'dtype': 'box',
'attribute_types': make_attribute_types(),
})
box_type_id = response.id
yield box_type_id
@pytest.fixture(scope='session')
def poly_type(request, project, video_type, image_type):
import tator
host = request.config.option.host
token = request.config.option.token
tator_api = tator.get_api(host, token)
response = tator_api.create_localization_type(project, localization_type_spec={
'name': 'poly_type',
'description': 'Test poly type',
'project': project,
'media_types': [video_type, image_type],
'dtype': 'poly',
'attribute_types': make_attribute_types(),
})
poly_type_id = response.id
yield poly_type_id
@pytest.fixture(scope='session')
def state_type(request, project, video_type):
import tator
host = request.config.option.host
token = request.config.option.token
tator_api = tator.get_api(host, token)
response = tator_api.create_state_type(project, state_type_spec={
'name': 'state_type',
'description': 'Test state type',
'project': project,
'media_types': [video_type],
'association': 'Frame',
'attribute_types': make_attribute_types(),
})
state_type_id = response.id
yield state_type_id
@pytest.fixture(scope='session')
def track_type(request, project, video_type):
import tator
host = request.config.option.host
token = request.config.option.token
tator_api = tator.get_api(host, token)
response = tator_api.create_state_type(project, state_type_spec={
'name': 'track_type',
'description': 'Test track type',
'project': project,
'media_types': [video_type],
'association': 'Localization',
'attribute_types': make_attribute_types(),
})
state_type_id = response.id
yield state_type_id
@pytest.fixture(scope='session')
def collection_type(request, project, video_type):
import tator
host = request.config.option.host
token = request.config.option.token
tator_api = tator.get_api(host, token)
response = tator_api.create_state_type(project, state_type_spec={
'name': 'collection_type',
'description': 'Test collection type',
'project': project,
'media_types': [video_type],
'association': 'Media',
'attribute_types': make_attribute_types(),
})
state_type_id = response.id
yield state_type_id
@pytest.fixture(scope='session')
def leaf_type(request, project):
import tator
host = request.config.option.host
token = request.config.option.token
tator_api = tator.get_api(host, token)
response = tator_api.create_leaf_type(project, leaf_type_spec={
'name': 'leaf_type',
'description': 'Test leaf type',
'attribute_types': make_attribute_types(),
})
leaf_type_id = response.id
yield leaf_type_id
@pytest.fixture(scope='session')
def clone_project(request, organization):
""" Project ID for a created project. """
import tator
host = request.config.option.host
token = request.config.option.token
keep = request.config.option.keep
tator_api = tator.get_api(host, token)
current_dt = datetime.datetime.now()
dt_str = current_dt.strftime('%Y_%m_%d__%H_%M_%S')
response = tator_api.create_project(project_spec={
'name': f'test_clone_project_{dt_str}',
'summary': f'Test clone project created by tator-py unit tests on {current_dt}',
'organization': organization,
})
project_id = response.id
yield project_id
if not keep:
status = tator_api.delete_project(project_id)
@pytest.fixture(scope='session')
def clone_leaf_type(request, clone_project):
import tator
host = request.config.option.host
token = request.config.option.token
tator_api = tator.get_api(host, token)
response = tator_api.create_leaf_type(clone_project, leaf_type_spec={
'name': 'leaf_type',
'description': 'Test leaf type',
'attribute_types': make_attribute_types(),
})
leaf_type_id = response.id
yield leaf_type_id
# Video fixtures for attribute tests
@pytest.fixture(scope='session')
def attribute_video_type(request, project):
import tator
host = request.config.option.host
token = request.config.option.token
tator_api = tator.get_api(host, token)
response = tator_api.create_media_type(project, media_type_spec={
'name': 'attribute_video_type',
'description': 'Test video type',
'project': project,
'dtype': 'video',
'attribute_types': make_attribute_types(),
})
video_type_id = response.id
yield video_type_id
@pytest.fixture(scope="session")
def attribute_video_file(request):
out_path = f"/tmp/AudioVideoSyncTest_BallastMedia_attribute.mp4"
if not os.path.exists(out_path):
url = "http://www.ballastmedia.com/wp-content/uploads/AudioVideoSyncTest_BallastMedia.mp4"
with requests.get(url, stream=True) as r:
r.raise_for_status()
with open(out_path, "wb") as f:
for chunk in r.iter_content(chunk_size=8192):
if chunk:
f.write(chunk)
yield out_path
@pytest.fixture(scope="session")
def attribute_video(request, project, attribute_video_type, attribute_video_file):
import tator
host = request.config.option.host
token = request.config.option.token
tator_api = tator.get_api(host, token)
for progress, response in tator.util.upload_media(tator_api, attribute_video_type, attribute_video_file):
print(f"Upload video progress: {progress}%")
print(response.message)
while True:
response = tator_api.get_media_list(
project, name="AudioVideoSyncTest_BallastMedia_attribute.mp4"
)
print("Waiting for transcode...")
time.sleep(2.5)
if len(response) == 0:
continue
if response[0].media_files is None:
continue
have_streaming = response[0].media_files.streaming is not None
have_archival = response[0].media_files.archival is not None
if have_streaming and have_archival:
video_id = response[0].id
break
yield video_id
@pytest.fixture(scope='session')
def attribute_image_type(request, project):
import tator
host = request.config.option.host
token = request.config.option.token
tator_api = tator.get_api(host, token)
response = tator_api.create_media_type(project, media_type_spec={
'name': 'attribute_image_type',
'description': 'Test image type',
'project': project,
'dtype': 'image',
'attribute_types': make_attribute_types(),
})
image_type_id = response.id
yield image_type_id
@pytest.fixture(scope='session')
def attribute_box_type(request, project, attribute_video_type, attribute_image_type):
import tator
host = request.config.option.host
token = request.config.option.token
tator_api = tator.get_api(host, token)
response = tator_api.create_localization_type(project, localization_type_spec={
'name': 'box_type',
'description': 'Test box type',
'project': project,
'media_types': [attribute_video_type, attribute_image_type],
'dtype': 'box',
'attribute_types': make_attribute_types(),
})
box_type_id = response.id
yield box_type_id
| 34.478778 | 112 | 0.650926 | 2,542 | 20,308 | 4.980724 | 0.0893 | 0.036016 | 0.079536 | 0.053313 | 0.789353 | 0.75081 | 0.721744 | 0.688176 | 0.6708 | 0.668352 | 0 | 0.006188 | 0.236114 | 20,308 | 588 | 113 | 34.537415 | 0.809966 | 0.01886 | 0 | 0.659176 | 0 | 0 | 0.147876 | 0.01533 | 0 | 0 | 0 | 0 | 0.003745 | 1 | 0.058052 | false | 0 | 0.061798 | 0.001873 | 0.121723 | 0.020599 | 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 |
c53349a360226e0998719b19857cacefa52a61bb | 444 | py | Python | src/step1.py | mrboran/mnist_digit_classifier | f44260f68fcc8447f8687e18ddade6ee6aed7e8e | [
"MIT"
] | null | null | null | src/step1.py | mrboran/mnist_digit_classifier | f44260f68fcc8447f8687e18ddade6ee6aed7e8e | [
"MIT"
] | null | null | null | src/step1.py | mrboran/mnist_digit_classifier | f44260f68fcc8447f8687e18ddade6ee6aed7e8e | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import keras
from keras.models import Sequential
from keras.datasets import mnist
from keras.layers import Dense
from keras.optimizers import Adam
from keras.utils.np_utils import to_categorical
import random
np.random.seed(0)
#import 6000 images from mnist data set
(X_train, y_train), (X_test, y_test) = mnist.load_data()
print(X_train.shape)
print(X_test.shape)
print(y_train.shape[0])
| 22.2 | 56 | 0.804054 | 76 | 444 | 4.565789 | 0.447368 | 0.129683 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015345 | 0.119369 | 444 | 19 | 57 | 23.368421 | 0.872123 | 0.085586 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.642857 | 0 | 0.642857 | 0.214286 | 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 |
c54ac09678041d25e009085127b18e1c151f7847 | 1,162 | py | Python | km/decorators.py | SDTakeuchi/kiitePRJCT | ca9712ec435971a916e206b760b88a10e7ccbb28 | [
"MIT"
] | 1 | 2021-07-29T02:28:05.000Z | 2021-07-29T02:28:05.000Z | km/decorators.py | SDTakeuchi/kiitePRJCT | ca9712ec435971a916e206b760b88a10e7ccbb28 | [
"MIT"
] | null | null | null | km/decorators.py | SDTakeuchi/kiitePRJCT | ca9712ec435971a916e206b760b88a10e7ccbb28 | [
"MIT"
] | null | null | null | #restricting access to certain pages depending on the user's status---------------------
from django.http import HttpResponse
from django.shortcuts import redirect
def unauthenticated_user(view_func):
def wrapper_func(request, *arg, **kwargs):
if request.user.is_authenticated:
return redirect('postIndex')
else:
return view_func(request, *arg, **kwargs)
return wrapper_func
def allowed_users(allowed_roles=[]):
def decorator(view_func):
def wrapper_func(request, *arg, **kwargs):
group = None
if request.user.groups.exists():
group = request.user.groups.all()[0].name
if group in allowed_roles:
return view_func(request, *arg, **kwargs)
else:
return HttpResponse('アクセス権限がありません。ブラウザから戻ってください。')
return wrapper_func
return decorator
def poster_only(view_func):
def wrapper_func(request, *arg, **kwargs):
if Post.user == request.user:
return view_func(request, *arg, **kwargs)
else:
return redirect('postIndex')
return wrapper_func | 30.578947 | 88 | 0.6179 | 129 | 1,162 | 5.426357 | 0.379845 | 0.068571 | 0.12 | 0.171429 | 0.325714 | 0.325714 | 0.282857 | 0.282857 | 0.114286 | 0 | 0 | 0.001183 | 0.272806 | 1,162 | 38 | 89 | 30.578947 | 0.827219 | 0.074871 | 0 | 0.5 | 0 | 0 | 0.04186 | 0.025116 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.071429 | 0 | 0.678571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
c5607b7d4c355ff699cdf2895e32163cd35dbb84 | 228 | py | Python | 01 Fundamental/Session 03/homework/ex2-2.py | culee/c4e | 775c53fa92a31696431760f58a79a52889bfb46f | [
"MIT"
] | null | null | null | 01 Fundamental/Session 03/homework/ex2-2.py | culee/c4e | 775c53fa92a31696431760f58a79a52889bfb46f | [
"MIT"
] | null | null | null | 01 Fundamental/Session 03/homework/ex2-2.py | culee/c4e | 775c53fa92a31696431760f58a79a52889bfb46f | [
"MIT"
] | null | null | null | sheep_size = [5,7,300,90,24,50,75]
print("Hello, my name is Duy Anh and these are my sheep sizes")
print(sheep_size)
biggest_sheep = max(sheep_size)
print()
print("Now my biggest sheep has size",biggest_sheep,"let's shear it")
| 28.5 | 69 | 0.741228 | 44 | 228 | 3.727273 | 0.636364 | 0.164634 | 0.195122 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.065327 | 0.127193 | 228 | 7 | 70 | 32.571429 | 0.758794 | 0 | 0 | 0 | 0 | 0 | 0.425439 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.666667 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
c56c75791cb8f369ae318a24ceb8f28c183ce656 | 540 | py | Python | plugins/penguin/Penguin.py | Aberdeener/slippers | 14a2fa507b7898ec062f791bd2c24af67178d45e | [
"MIT"
] | null | null | null | plugins/penguin/Penguin.py | Aberdeener/slippers | 14a2fa507b7898ec062f791bd2c24af67178d45e | [
"MIT"
] | null | null | null | plugins/penguin/Penguin.py | Aberdeener/slippers | 14a2fa507b7898ec062f791bd2c24af67178d45e | [
"MIT"
] | 1 | 2021-10-31T20:09:05.000Z | 2021-10-31T20:09:05.000Z | from world.dataHandler.pluginManager.Plugin import Plugin
class Penguin(Plugin):
"""
A plugin that enables essential player features.
"""
def __init__(self, users, rooms, packet):
super(Penguin, self).__init__(users, rooms, packet)
def heartbeat(self, data, user):
user.send(["h", "-1"])
def buddy_list(self, data, user):
user.send(["bl", "-1"])
def ignore_list(self, data, user):
user.send(["nl", "-1"])
def item_list(self, data, user):
user.send(["il", "-1"])
| 24.545455 | 59 | 0.598148 | 69 | 540 | 4.521739 | 0.492754 | 0.102564 | 0.153846 | 0.205128 | 0.294872 | 0.230769 | 0 | 0 | 0 | 0 | 0 | 0.009662 | 0.233333 | 540 | 21 | 60 | 25.714286 | 0.743961 | 0.088889 | 0 | 0 | 0 | 0 | 0.031513 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.416667 | false | 0 | 0.083333 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
c57188341cbca15c52683b1808d1c9e6fb472c00 | 666 | py | Python | crawler_mongo.py | 9527A/practice | 03a20a8e4a3554b18d9809d32f51712e1adf0f02 | [
"MIT"
] | null | null | null | crawler_mongo.py | 9527A/practice | 03a20a8e4a3554b18d9809d32f51712e1adf0f02 | [
"MIT"
] | null | null | null | crawler_mongo.py | 9527A/practice | 03a20a8e4a3554b18d9809d32f51712e1adf0f02 | [
"MIT"
] | null | null | null | import pymongo
def data_seve(mydict):
myclient = pymongo.MongoClient("mongodb://localhost:27017/")
mydb = myclient["cralwer"]
mycol = mydb["data"]
for m in mydict:
if m in mycol.find():
pass
else:
x = mycol.insert_one(m)
def data_get():
myclient = pymongo.MongoClient("mongodb://localhost:27017/")
mydb = myclient["cralwer"]
mycol = mydb["data"]
m = mycol.find()
return m
def delete():
myclient = pymongo.MongoClient("mongodb://localhost:27017/")
mydb = myclient["cralwer"]
mycol = mydb["data"]
x = mycol.delete_many({})
| 19.588235 | 65 | 0.56006 | 72 | 666 | 5.125 | 0.388889 | 0.121951 | 0.211382 | 0.268293 | 0.642276 | 0.642276 | 0.642276 | 0.642276 | 0.642276 | 0.642276 | 0 | 0.032258 | 0.301802 | 666 | 33 | 66 | 20.181818 | 0.76129 | 0 | 0 | 0.428571 | 0 | 0 | 0.175911 | 0.123613 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0.047619 | 0.047619 | 0 | 0.238095 | 0 | 0 | 0 | 0 | null | 0 | 1 | 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 |
c575e7ce6af1c25c8265bcf17ee6efccc95db94e | 1,816 | py | Python | python-burp-crypto/2-external/library.py | parsiya/Parsia-Code | e75bd9f7f295e6d8e584de67f90dd02cb75ae915 | [
"MIT"
] | 21 | 2018-09-10T03:09:17.000Z | 2022-02-07T09:20:03.000Z | python-burp-crypto/2-external/library.py | parsiya/Parsia-Code | e75bd9f7f295e6d8e584de67f90dd02cb75ae915 | [
"MIT"
] | 1 | 2019-11-10T21:17:23.000Z | 2020-01-19T04:36:19.000Z | python-burp-crypto/2-external/library.py | parsiya/Parsia-Code | e75bd9f7f295e6d8e584de67f90dd02cb75ae915 | [
"MIT"
] | 8 | 2019-10-11T23:29:58.000Z | 2021-05-26T12:11:43.000Z | # 2-external/library.py
from subprocess import Popen, PIPE
import sys
# getInfo processes the request/response and returns info
def getInfo(content, isRequest, helpers):
if isRequest:
return helpers.analyzeRequest(content)
else:
return helpers.analyzeResponse(content)
# getBody returns the body of a request/response
def getBody(content, isRequest, helpers):
info = getInfo(content, isRequest, helpers)
return content[info.getBodyOffset():]
# setBody replaces the body of request/response with newBody and returns the result
# should I check for sizes or does Python automatically increase the array size?
def setBody(newBody, content, isRequest, helpers):
info = getInfo(content, isRequest, helpers)
content[info.getBodyOffset():] = newBody
return content
# decode64 decodes a base64 encoded byte array and returns another byte array
def decode64(encoded, helpers):
return helpers.base64Decode(encoded)
# encode64 encodes a byte array and returns a base64 encoded byte array
def encode64(plaintext, helpers):
return helpers.base64Encode(plaintext)
# runExternal executes an external python script with two arguments and returns the output
def runExternal(script, arg1, arg2):
proc = Popen(["python", script, arg1, arg2], stdout=PIPE, stderr=PIPE)
output = proc.stdout.read()
proc.stdout.close()
err = proc.stderr.read()
proc.stderr.close()
sys.stdout.write(err)
return output
# encrypt uses the external prototype to encrypt the payload
def encrypt(payload):
return runExternal("crypto.py", "encrypt", payload.tostring())
# decrypt uses the external prototype to decrypt the payload
def decrypt(payload):
return runExternal("crypto.py", "decrypt", payload.tostring())
| 36.32 | 91 | 0.730176 | 226 | 1,816 | 5.867257 | 0.371681 | 0.037707 | 0.086727 | 0.067873 | 0.208145 | 0.085973 | 0.085973 | 0.085973 | 0 | 0 | 0 | 0.014228 | 0.187225 | 1,816 | 49 | 92 | 37.061224 | 0.884146 | 0.351322 | 0 | 0.066667 | 0 | 0 | 0.033989 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.266667 | false | 0 | 0.066667 | 0.133333 | 0.633333 | 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 |
3d772633bfb1ee390692f8f41b74efdaf2c64e45 | 2,069 | py | Python | core/parser.py | Weenkus/on_power_efficient_virtual_network_function_placement_algorithm | 09621bd083ff13afdfb76a6629478cb16e6c8a9c | [
"MIT"
] | 1 | 2019-12-09T17:52:05.000Z | 2019-12-09T17:52:05.000Z | core/parser.py | Weenkus/on_power_efficient_virtual_network_function_placement_algorithm | 09621bd083ff13afdfb76a6629478cb16e6c8a9c | [
"MIT"
] | null | null | null | core/parser.py | Weenkus/on_power_efficient_virtual_network_function_placement_algorithm | 09621bd083ff13afdfb76a6629478cb16e6c8a9c | [
"MIT"
] | null | null | null | from numpy import loadtxt
from io import StringIO
class Parser(object):
integer_variables = ('numServers', 'numVms', 'numRes', 'numNodes', 'numServiceChains')
list_variables = ('lat', 'P_max', 'P_min', 'P')
matrix_variables = ('req', 'av', 'al', 'sc')
list_vector_variables = ('Edges', 'VmDemands')
def __init__(self, file_path):
assert isinstance(file_path, str), 'File path must be string'
self.file_path = file_path
self.data = dict()
self.parser_factory = {
self.integer_variables: self.__parse_integers,
self.list_variables: self.__parse_lists,
self.matrix_variables: self.__parse_matrices,
self.list_vector_variables: self.__parse_list_vectors
}
def read(self):
lines = open(self.file_path).read().replace('\n', '').split(';')
return filter(None, lines)
def parse(self):
lines = self.read()
for i, line in enumerate(lines):
var_name, var_content = line.split(' = ')
for variables, extractor in self.parser_factory.items():
if var_name in variables:
self.data[var_name] = extractor(var_content)
def __parse_integers(self, var_content):
return int(var_content)
def __parse_lists(self, var_content):
return loadtxt(StringIO(var_content[1:-1]), delimiter=',')
def __parse_matrices(self, var_content):
content = var_content[1:-1].replace('][', '\n')[1:-1]
return loadtxt(StringIO(content), delimiter=',')
def __parse_list_vectors(self, var_content):
content = var_content[1:-1].replace('>,', '\n').replace('<', '')
return loadtxt(StringIO(content), delimiter=',')
def __getitem__(self, item):
return self.data.get(item)
def __str__(self):
return self.data.__str__()
def get_parsed_data(self):
return self.data
def main():
parser = Parser('../data/instance.txt')
parser.parse()
print(parser)
if __name__ == '__main__':
main()
| 29.985507 | 90 | 0.61914 | 246 | 2,069 | 4.865854 | 0.321138 | 0.083542 | 0.06015 | 0.030075 | 0.135338 | 0.135338 | 0.068505 | 0.068505 | 0.068505 | 0.068505 | 0 | 0.005096 | 0.241179 | 2,069 | 68 | 91 | 30.426471 | 0.757325 | 0 | 0 | 0.040816 | 0 | 0 | 0.073949 | 0 | 0 | 0 | 0 | 0 | 0.020408 | 1 | 0.22449 | false | 0 | 0.040816 | 0.102041 | 0.530612 | 0.020408 | 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 |
3d7f48c7aff1d1ff08deea25441aea8e26d42920 | 433 | py | Python | turtlesim/launch/multisim.launch.py | zhangrelay/ros2_tutorials | 907ba6d9f2d9c7a9c9c364dbec217f1465696884 | [
"Apache-2.0"
] | 1 | 2020-03-17T18:19:55.000Z | 2020-03-17T18:19:55.000Z | turtlesim/launch/multisim.launch.py | zhangrelay/ros2_tutorials | 907ba6d9f2d9c7a9c9c364dbec217f1465696884 | [
"Apache-2.0"
] | null | null | null | turtlesim/launch/multisim.launch.py | zhangrelay/ros2_tutorials | 907ba6d9f2d9c7a9c9c364dbec217f1465696884 | [
"Apache-2.0"
] | 1 | 2020-07-11T08:59:03.000Z | 2020-07-11T08:59:03.000Z | from launch import LaunchDescription
import launch_ros.actions
def generate_launch_description():
return LaunchDescription([
launch_ros.actions.Node(
node_namespace= "turtlesim1", package='turtlesim', node_executable='turtlesim_node', output='screen'),
launch_ros.actions.Node(
node_namespace= "turtlesim2", package='turtlesim', node_executable='turtlesim_node', output='screen'),
])
| 39.363636 | 114 | 0.722864 | 44 | 433 | 6.863636 | 0.431818 | 0.172185 | 0.15894 | 0.13245 | 0.582781 | 0.582781 | 0.364238 | 0.364238 | 0 | 0 | 0 | 0.00554 | 0.166282 | 433 | 10 | 115 | 43.3 | 0.831025 | 0 | 0 | 0.222222 | 1 | 0 | 0.180139 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | true | 0 | 0.222222 | 0.111111 | 0.444444 | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
3d8fe83a0f849ba840d54f6c4cd27b7b61ecbbb3 | 370 | py | Python | vcfexplorer/frontend/views.py | UMCUGenetics/vcf-explorer | 18b46b1f61181ce5cbd2a8065d272dd37081da8f | [
"MIT"
] | 5 | 2018-04-27T09:02:25.000Z | 2020-12-17T13:15:08.000Z | vcfexplorer/frontend/views.py | CuppenResearch/vcf-explorer | 18b46b1f61181ce5cbd2a8065d272dd37081da8f | [
"MIT"
] | 2 | 2015-05-26T11:57:52.000Z | 2016-05-25T08:43:40.000Z | vcfexplorer/frontend/views.py | UMCUGenetics/vcf-explorer | 18b46b1f61181ce5cbd2a8065d272dd37081da8f | [
"MIT"
] | null | null | null | """
vcfexplorer.frontend.views
VCF Explorer frontend views
"""
from flask import send_file
from . import bp
@bp.route('/', defaults={'path': ''})
@bp.route('<path:path>') ## For now redirect everything, probably should use hardcoded paths to generate valid 404, especialy for api calls.
def index(path):
return send_file('frontend/templates/index.html')
| 24.666667 | 140 | 0.713514 | 50 | 370 | 5.24 | 0.7 | 0.099237 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009585 | 0.154054 | 370 | 14 | 141 | 26.428571 | 0.827476 | 0.456757 | 0 | 0 | 0 | 0 | 0.244565 | 0.157609 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 0.166667 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
3da2d72f2510a7de7a95a84f1cbc2b0c41fe5744 | 124 | py | Python | tensorflow/graphdef.py | habichta/redisAI_tutorial | 414cc1491439ffd79fae880f2f63aa7f9de69ccb | [
"Apache-2.0"
] | 1 | 2020-07-11T12:00:40.000Z | 2020-07-11T12:00:40.000Z | tensorflow/graphdef.py | habichta/redisAI_tutorial | 414cc1491439ffd79fae880f2f63aa7f9de69ccb | [
"Apache-2.0"
] | null | null | null | tensorflow/graphdef.py | habichta/redisAI_tutorial | 414cc1491439ffd79fae880f2f63aa7f9de69ccb | [
"Apache-2.0"
] | null | null | null | import tensorflow.compat.v1 as tf
gf = tf.GraphDef()
gf.ParseFromString(open('reference_model/saved_model.pb','rb').read())
| 31 | 70 | 0.766129 | 19 | 124 | 4.894737 | 0.842105 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008621 | 0.064516 | 124 | 3 | 71 | 41.333333 | 0.793103 | 0 | 0 | 0 | 0 | 0 | 0.258065 | 0.241935 | 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 |
3dad7c30bb36e24261659593f34c1d2aa59deeb4 | 297 | py | Python | wolverine-dns/wolverine-dns-server/manager.py | lihanhui/wolverine | 73e5e2d0b20e75e7e79fac0ff6d48c6724dee8f8 | [
"MIT"
] | 1 | 2021-01-29T09:24:11.000Z | 2021-01-29T09:24:11.000Z | wolverine-dns/wolverine-dns-server/manager.py | lihanhui/wolverine | 73e5e2d0b20e75e7e79fac0ff6d48c6724dee8f8 | [
"MIT"
] | null | null | null | wolverine-dns/wolverine-dns-server/manager.py | lihanhui/wolverine | 73e5e2d0b20e75e7e79fac0ff6d48c6724dee8f8 | [
"MIT"
] | null | null | null | import cache
import record
class Manager():
def __init__(self):
self.cache = cache.Cache()
self.cache.start()
def getRecord(self, hostname):
return self.cache.getRecord(hostname)
def getRecords(self, service):
return self.cache.getRecords(servicename)
| 22.846154 | 49 | 0.670034 | 34 | 297 | 5.735294 | 0.441176 | 0.184615 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.225589 | 297 | 12 | 50 | 24.75 | 0.847826 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0 | 0.2 | 0.2 | 0.8 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
3dbd5ae73f95358aa7b143e3051dd09db7718e52 | 1,697 | py | Python | tests/mocks/mock_view_transaction.py | ALonelyTower/BudgetApp | e040f763a5e621c4e997c7d051078ba960ba58ff | [
"MIT"
] | null | null | null | tests/mocks/mock_view_transaction.py | ALonelyTower/BudgetApp | e040f763a5e621c4e997c7d051078ba960ba58ff | [
"MIT"
] | null | null | null | tests/mocks/mock_view_transaction.py | ALonelyTower/BudgetApp | e040f763a5e621c4e997c7d051078ba960ba58ff | [
"MIT"
] | null | null | null | from views.view_transaction import TransactionView
class MockTransactionView(TransactionView):
def __init__(self, title):
super().__init__(title=title)
@property
def date_year_textctrl(self):
return self._date_year_textctrl.GetValue()
@date_year_textctrl.setter
def date_year_textctrl(self, value):
self._date_year_textctrl.SetValue(value)
@property
def date_month_textctrl(self):
return self._date_month_textctrl.GetValue()
@date_month_textctrl.setter
def date_month_textctrl(self, value):
self._date_month_textctrl.SetValue(value)
@property
def date_day_textctrl(self):
return self._date_day_textctrl.GetValue()
@date_day_textctrl.setter
def date_day_textctrl(self, value):
self._date_day_textctrl.SetValue(value)
@property
def category_textctrl(self):
return self._category_textctrl
@property
def payment_method_textctrl(self):
return self._payment_method_textctrl.GetValue()
@payment_method_textctrl.setter
def payment_method_textctrl(self, value):
self._payment_method_textctrl.SetValue(value)
@property
def total_expense_textctrl(self):
return self._total_expense_textctrl.GetValue()
@total_expense_textctrl.setter
def total_expense_textctrl(self, value):
self._total_expense_textctrl.SetValue(value)
@property
def description_textctrl(self):
return self._description_textctrl.GetValue()
@description_textctrl.setter
def description_textctrl(self, value):
self._description_textctrl.SetValue(value)
def ok_button(self):
return self._ok_button
| 27.370968 | 55 | 0.730112 | 197 | 1,697 | 5.873096 | 0.162437 | 0.134831 | 0.096802 | 0.133103 | 0.414866 | 0.06223 | 0 | 0 | 0 | 0 | 0 | 0 | 0.192693 | 1,697 | 61 | 56 | 27.819672 | 0.844526 | 0 | 0 | 0.155556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.022222 | 0.177778 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
3dc86255d8ac94a891213a46f6e4fbe5aaac52eb | 205 | py | Python | hard-gists/4131398/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 21 | 2019-07-08T08:26:45.000Z | 2022-01-24T23:53:25.000Z | hard-gists/4131398/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 5 | 2019-06-15T14:47:47.000Z | 2022-02-26T05:02:56.000Z | hard-gists/4131398/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 17 | 2019-05-16T03:50:34.000Z | 2021-01-14T14:35:12.000Z | from IPython.core.display import Image as image
from PIL import Image
def save_and_display(arr, fname):
pilimg = Image.fromarray(arr)
pilimg.save(fname)
return image(filename=fname, width=600) | 29.285714 | 47 | 0.756098 | 31 | 205 | 4.935484 | 0.612903 | 0.143791 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017341 | 0.156098 | 205 | 7 | 48 | 29.285714 | 0.867052 | 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 |
3de4eab50eb81abf525866021351b44ec677a171 | 138 | py | Python | smarttm/storage_backends.py | mseemab/smarttm | 4fbc4f2ae57b8555709fafce41528e7d8137ab82 | [
"MIT"
] | 1 | 2019-11-25T16:03:58.000Z | 2019-11-25T16:03:58.000Z | smarttm/storage_backends.py | mseemab/smarttm | 4fbc4f2ae57b8555709fafce41528e7d8137ab82 | [
"MIT"
] | 32 | 2019-12-08T13:53:49.000Z | 2022-03-12T00:05:23.000Z | smarttm/storage_backends.py | mseemab/smarttm | 4fbc4f2ae57b8555709fafce41528e7d8137ab82 | [
"MIT"
] | null | null | null | from storages.backends.s3boto3 import S3Boto3Storage
class MediaStorage(S3Boto3Storage):
location = 'media'
file_overwrite = False | 34.5 | 52 | 0.797101 | 14 | 138 | 7.785714 | 0.928571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05042 | 0.137681 | 138 | 4 | 53 | 34.5 | 0.865546 | 0 | 0 | 0 | 0 | 0 | 0.035971 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
9a801b22c00119d6054b604b80d4a693c320c467 | 549 | py | Python | Udemy/Secao4/aula106.py | rafaelgama/Curso_Python | 908231de9de4a17f5aa829f2671fd88de9261eda | [
"MIT"
] | 1 | 2020-05-07T20:21:15.000Z | 2020-05-07T20:21:15.000Z | Udemy/Secao4/aula106.py | rafaelgama/Curso_Python | 908231de9de4a17f5aa829f2671fd88de9261eda | [
"MIT"
] | null | null | null | Udemy/Secao4/aula106.py | rafaelgama/Curso_Python | 908231de9de4a17f5aa829f2671fd88de9261eda | [
"MIT"
] | null | null | null | """
Polimorfismo é o princípio que permite que classes derivadas de uma mesma
superclasse tenham métodos iguais (de mesma assinatura) mas comportamentos
diferentes.
Mesma assinatura = Mesma quantidade e tipo de parâmetros
"""
from abc import ABC, abstractmethod
class A(ABC):
@abstractmethod
def fala(self, msg): pass
class B(A):
def fala(self, msg):
print(f'B está falando {msg}')
class C(A):
def fala(self, msg):
print(f'C está falando {msg}')
b = B()
c = C()
b.fala('Um Assunto')
c.fala('Outro Assunto') | 20.333333 | 74 | 0.679417 | 82 | 549 | 4.54878 | 0.52439 | 0.0563 | 0.088472 | 0.112601 | 0.112601 | 0.112601 | 0.112601 | 0 | 0 | 0 | 0 | 0 | 0.209472 | 549 | 27 | 75 | 20.333333 | 0.859447 | 0.395264 | 0 | 0.142857 | 0 | 0 | 0.193846 | 0 | 0 | 0 | 0 | 0.037037 | 0 | 1 | 0.214286 | false | 0.071429 | 0.071429 | 0 | 0.5 | 0.142857 | 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 |
9a8e266cd5a9e25b35775b7954ec250d08b293ae | 286 | py | Python | python_backend/server.py | LiushaHe0317/python.recommender_system | 368fe427c8f63a6d8e4fdd5fbad71cde8d1d0424 | [
"Apache-2.0"
] | null | null | null | python_backend/server.py | LiushaHe0317/python.recommender_system | 368fe427c8f63a6d8e4fdd5fbad71cde8d1d0424 | [
"Apache-2.0"
] | 7 | 2021-03-10T11:31:43.000Z | 2022-03-02T07:48:29.000Z | python_backend/server.py | LiushaHe0317/python.recommender_system | 368fe427c8f63a6d8e4fdd5fbad71cde8d1d0424 | [
"Apache-2.0"
] | null | null | null | from flask import Flask
import json
from .recommender import getRecommendedItems
app = Flask(__name__)
@app.route("/predict/<int:uid>", strict_siashes=False)
def predict(uid):
return json.dumps(getRecommendedItems(uid), indent=2)
if __name__=='__main__':
app.run(debug=True) | 22 | 57 | 0.755245 | 38 | 286 | 5.342105 | 0.657895 | 0.108374 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003968 | 0.118881 | 286 | 13 | 58 | 22 | 0.801587 | 0 | 0 | 0 | 0 | 0 | 0.090592 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.333333 | 0.111111 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
9a956b35e88abc2c82744ab9123ba06cc108e6c3 | 1,226 | py | Python | conduit/util/comparable_interface.py | sleibman/python-conduit | f6002d45c4f25e4418591a72fdac9ac6fb422d80 | [
"MIT"
] | 1 | 2015-04-30T20:45:45.000Z | 2015-04-30T20:45:45.000Z | conduit/util/comparable_interface.py | sleibman/python-conduit | f6002d45c4f25e4418591a72fdac9ac6fb422d80 | [
"MIT"
] | 1 | 2019-04-23T12:54:47.000Z | 2019-04-23T13:48:21.000Z | conduit/util/comparable_interface.py | sleibman/python-conduit | f6002d45c4f25e4418591a72fdac9ac6fb422d80 | [
"MIT"
] | 2 | 2019-11-22T13:44:14.000Z | 2020-11-23T17:34:31.000Z | """
This class is an unmodified copy of one from a blog post written by Lennart Regebro at:
http://regebro.wordpress.com/2010/12/13/python-implementing-rich-comparison-the-correct-way/
No license terms were specified in the blog post.
It has been included as a minor convenience.
If we ever need to purge our code of external contributions, replacement should be fairly trivial.
"""
class Comparable(object):
def _compare(self, other, method):
try:
return method(self._cmpkey(), other._cmpkey())
except (AttributeError, TypeError):
# _cmpkey not implemented, or return different type,
# so I can't compare with "other".
return NotImplemented
def __lt__(self, other):
return self._compare(other, lambda s,o: s < o)
def __le__(self, other):
return self._compare(other, lambda s,o: s <= o)
def __eq__(self, other):
return self._compare(other, lambda s,o: s == o)
def __ge__(self, other):
return self._compare(other, lambda s,o: s >= o)
def __gt__(self, other):
return self._compare(other, lambda s,o: s > o)
def __ne__(self, other):
return self._compare(other, lambda s,o: s != o)
| 33.135135 | 98 | 0.659054 | 176 | 1,226 | 4.397727 | 0.517045 | 0.031008 | 0.116279 | 0.147287 | 0.337209 | 0.337209 | 0.337209 | 0.337209 | 0.337209 | 0.337209 | 0 | 0.008556 | 0.237357 | 1,226 | 36 | 99 | 34.055556 | 0.819251 | 0.375204 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.388889 | false | 0 | 0 | 0.333333 | 0.888889 | 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 |
9ab7edd5418fe233a829f972d4f9de4402a2082c | 89 | py | Python | icechart/common.py | Surfix/Icechart | 1c8c36b74faa2fc10a9a2353e9c204e17921ba39 | [
"MIT"
] | 3 | 2021-03-02T03:04:30.000Z | 2021-03-11T05:27:08.000Z | icechart/common.py | Surfix/Icechart | 1c8c36b74faa2fc10a9a2353e9c204e17921ba39 | [
"MIT"
] | 1 | 2021-04-02T07:21:14.000Z | 2021-04-02T07:21:14.000Z | icechart/common.py | Surfix/icechart | 1c8c36b74faa2fc10a9a2353e9c204e17921ba39 | [
"MIT"
] | 2 | 2021-05-31T09:20:21.000Z | 2021-07-28T13:59:19.000Z | """A module with some common functions to be used with ipyleaflet and folium.
""" | 44.5 | 81 | 0.685393 | 13 | 89 | 4.692308 | 0.923077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.235955 | 89 | 2 | 82 | 44.5 | 0.897059 | 0 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 0 | null | null | 0 | 0 | null | null | null | 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 |
9abbec3c4f55b1df6cbb0b93fe64dbd0839eac49 | 423 | py | Python | Mundo1/Desafio26.py | David-M-Dias/Exercicios-do-curso-de-Python | 14f818243f231738e9d47d452f778fb3bace93c0 | [
"MIT"
] | 1 | 2021-01-20T13:32:58.000Z | 2021-01-20T13:32:58.000Z | Mundo1/Desafio26.py | David-M-Dias/Exercicios-do-curso-de-Python | 14f818243f231738e9d47d452f778fb3bace93c0 | [
"MIT"
] | null | null | null | Mundo1/Desafio26.py | David-M-Dias/Exercicios-do-curso-de-Python | 14f818243f231738e9d47d452f778fb3bace93c0 | [
"MIT"
] | null | null | null | frase = str(input("Digite uma frase: ")).lower().strip()
print("A quantidade de letras A na frase é {}.".format(frase.count("a")))
print("A primeira letra a aparece na posição de número {}.".format(frase.find("a")+1))#para procurar a primeira posicao da letra a dentro da frase
print("A ultima letra a aparece na posição de número {}.".format(frase.rfind("a")+1))#usado para encontrar a posicao da ultima letra a da frase.
| 84.6 | 146 | 0.718676 | 73 | 423 | 4.164384 | 0.438356 | 0.078947 | 0.085526 | 0.098684 | 0.269737 | 0.269737 | 0.269737 | 0.269737 | 0.269737 | 0 | 0 | 0.005435 | 0.130024 | 423 | 4 | 147 | 105.75 | 0.820652 | 0.276596 | 0 | 0 | 0 | 0 | 0.526316 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.75 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
9ac4d1ea4f1de6dfcfa90fa131b2a746e310ae3f | 971 | py | Python | pydsalg/datastruct/hashset.py | lopezpdvn/pydsalg | 31bab8577ff026b8400b57b845496d89bffad376 | [
"MIT"
] | null | null | null | pydsalg/datastruct/hashset.py | lopezpdvn/pydsalg | 31bab8577ff026b8400b57b845496d89bffad376 | [
"MIT"
] | null | null | null | pydsalg/datastruct/hashset.py | lopezpdvn/pydsalg | 31bab8577ff026b8400b57b845496d89bffad376 | [
"MIT"
] | null | null | null | class HashSetString:
_ARR_DEFAULT_LENGTH = 211
def __init__(self, arr_len=_ARR_DEFAULT_LENGTH):
self._arr = [None,] * arr_len
self._count = 0
def _hash_str_00(self, value):
hashv = 0
for c in value:
hashv = (hashv * 27 + ord(c)) % len(self._arr)
return hashv
hashf = _hash_str_00
def __contains__(self, value):
return self._arr[self.hashf(value)]
def __iter__(self):
return self._iterator()
def __len__(self):
return self._count
def _iterator(self):
return (val for val in self._arr if val)
def add(self, value):
index = self.hashf(value)
if not self._arr[index]:
self._arr[index] = value
self._count += 1
def remove(self, value):
index = self.hashf(value)
if self._arr[index]:
self._arr[index] = None
self._count -= 1
else:
raise KeyError
| 24.897436 | 58 | 0.563337 | 124 | 971 | 4.056452 | 0.306452 | 0.125249 | 0.095427 | 0.071571 | 0.214712 | 0.214712 | 0.119284 | 0 | 0 | 0 | 0 | 0.020155 | 0.335736 | 971 | 38 | 59 | 25.552632 | 0.75969 | 0 | 0 | 0.064516 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.258065 | false | 0 | 0 | 0.129032 | 0.516129 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
b10163da7970c5225e6973e5bba1a74373454a5a | 71 | py | Python | T26-08/program.py | tiagomendes7/SSof-Project1920 | 9b026763a492683ab982aa769f2a381ed02930aa | [
"MIT"
] | 2 | 2019-11-20T19:26:07.000Z | 2019-11-22T00:42:23.000Z | T26-08/program.py | tiagomendes7/SSof-Project1920 | 9b026763a492683ab982aa769f2a381ed02930aa | [
"MIT"
] | 2 | 2019-11-28T05:21:24.000Z | 2019-11-28T05:21:58.000Z | T26-08/program.py | tiagomendes7/SSof-Project1920 | 9b026763a492683ab982aa769f2a381ed02930aa | [
"MIT"
] | 25 | 2019-11-27T01:40:56.000Z | 2019-12-04T23:38:59.000Z | a = source()
b = k
if(a == w):
b = c
elif(a==y):
b = d
sink(b)
| 8.875 | 12 | 0.394366 | 16 | 71 | 1.75 | 0.6875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.352113 | 71 | 7 | 13 | 10.142857 | 0.608696 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 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 |
b1093630027dc5e5313ccbf3cf479cd9f636e8b5 | 1,483 | py | Python | test_python_toolbox/test_math_tools/test_convert_to_base_in_tuple.py | hboshnak/python_toolbox | cb9ef64b48f1d03275484d707dc5079b6701ad0c | [
"MIT"
] | 119 | 2015-02-05T17:59:47.000Z | 2022-02-21T22:43:40.000Z | test_python_toolbox/test_math_tools/test_convert_to_base_in_tuple.py | hboshnak/python_toolbox | cb9ef64b48f1d03275484d707dc5079b6701ad0c | [
"MIT"
] | 4 | 2019-04-24T14:01:14.000Z | 2020-05-21T12:03:29.000Z | test_python_toolbox/test_math_tools/test_convert_to_base_in_tuple.py | hboshnak/python_toolbox | cb9ef64b48f1d03275484d707dc5079b6701ad0c | [
"MIT"
] | 14 | 2015-03-30T06:30:42.000Z | 2021-12-24T23:45:11.000Z | # Copyright 2009-2017 Ram Rachum.
# This program is distributed under the MIT license.
'''Testing module for `python_toolbox.math_tools.convert_to_base_in_tuple`.'''
import sys
from python_toolbox.math_tools import convert_to_base_in_tuple
from python_toolbox import cute_testing
def test():
assert convert_to_base_in_tuple(51346616, 16) == (3, 0, 15, 7, 12, 11, 8)
assert convert_to_base_in_tuple(2341263462323, 2) == (
1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1,
1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1
)
def test_trivial():
assert convert_to_base_in_tuple(0, 2) == \
convert_to_base_in_tuple(0, 10) == \
convert_to_base_in_tuple(0, 16) == \
convert_to_base_in_tuple(0, 23423) == (0,)
assert convert_to_base_in_tuple(1, 2) == \
convert_to_base_in_tuple(1, 10) == \
convert_to_base_in_tuple(1, 16) == \
convert_to_base_in_tuple(1, 23423) == (1,)
assert convert_to_base_in_tuple(7, 10) == \
convert_to_base_in_tuple(7, 16) == \
convert_to_base_in_tuple(7, 23423) == (7,)
def test_negative():
with cute_testing.RaiseAssertor(NotImplementedError):
convert_to_base_in_tuple(-1, 7)
with cute_testing.RaiseAssertor(NotImplementedError):
convert_to_base_in_tuple(-13462, 4)
with cute_testing.RaiseAssertor(NotImplementedError):
convert_to_base_in_tuple(-23451759010224, 11)
| 35.309524 | 78 | 0.656777 | 236 | 1,483 | 3.775424 | 0.228814 | 0.181818 | 0.262626 | 0.30303 | 0.670034 | 0.611672 | 0.239057 | 0.225589 | 0.225589 | 0.225589 | 0 | 0.13051 | 0.219825 | 1,483 | 41 | 79 | 36.170732 | 0.639585 | 0.105192 | 0 | 0.107143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.285714 | 1 | 0.107143 | true | 0 | 0.107143 | 0 | 0.214286 | 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 |
b111ba8e9af8cd3aff11f9925744f46abc479aa3 | 38 | py | Python | src/memscrimper_parser/consts.py | deeso/memscrimper-parser | 6eb0b84a977b19ba16ae9216bde0544f38202bb1 | [
"BSD-2-Clause"
] | 1 | 2019-12-13T13:07:55.000Z | 2019-12-13T13:07:55.000Z | src/memscrimper_parser/consts.py | deeso/memscrimper-parser | 6eb0b84a977b19ba16ae9216bde0544f38202bb1 | [
"BSD-2-Clause"
] | null | null | null | src/memscrimper_parser/consts.py | deeso/memscrimper-parser | 6eb0b84a977b19ba16ae9216bde0544f38202bb1 | [
"BSD-2-Clause"
] | null | null | null | QWORD = 8
DWORD = 4
WORD = 2
BYTE = 1
| 7.6 | 9 | 0.578947 | 8 | 38 | 2.75 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 0.315789 | 38 | 4 | 10 | 9.5 | 0.692308 | 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 |
b12f8ddcde9a10f1de21b13a8128d3ca7fee2739 | 794 | py | Python | gonzo/connectors/twitter/models.py | paulcwatts/1hph | 407337955121c3f59b4621acb392e6c23b57ae8e | [
"BSD-3-Clause"
] | 1 | 2016-10-03T05:29:12.000Z | 2016-10-03T05:29:12.000Z | gonzo/connectors/twitter/models.py | paulcwatts/1hph | 407337955121c3f59b4621acb392e6c23b57ae8e | [
"BSD-3-Clause"
] | null | null | null | gonzo/connectors/twitter/models.py | paulcwatts/1hph | 407337955121c3f59b4621acb392e6c23b57ae8e | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
class TwitterProfile(models.Model):
user = models.OneToOneField(User, primary_key=True)
# Twitter authentication
profile = models.URLField()
screen_name = models.CharField(max_length=128)
oauth_token = models.CharField(max_length=200)
oauth_secret = models.CharField(max_length=200)
# Whether or not we should post to twitter for these events
notify_on_submit = models.BooleanField(default=False)
notify_on_award = models.BooleanField(default=False)
notify_on_comment = models.BooleanField(default=False)
notify_on_rank = models.BooleanField(default=False)
notify_on_vote = models.BooleanField(default=False)
def __unicode__(self):
return unicode(self.user)
| 37.809524 | 63 | 0.761965 | 102 | 794 | 5.72549 | 0.519608 | 0.068493 | 0.214041 | 0.256849 | 0.35274 | 0.260274 | 0 | 0 | 0 | 0 | 0 | 0.013413 | 0.154912 | 794 | 20 | 64 | 39.7 | 0.85693 | 0.100756 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.066667 | false | 0 | 0.133333 | 0.066667 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
b152a52df3d5769f160f257ed56313cf3cae47cc | 72,926 | py | Python | pysnmp_mibs/FDDI-SMT73-MIB.py | jackjack821/pysnmp-mibs | 9835ea0bb2420715caf4ee9aaa07d59bb263acd6 | [
"BSD-2-Clause"
] | 6 | 2017-04-21T13:48:08.000Z | 2022-01-06T19:42:52.000Z | pysnmp_mibs/FDDI-SMT73-MIB.py | jackjack821/pysnmp-mibs | 9835ea0bb2420715caf4ee9aaa07d59bb263acd6 | [
"BSD-2-Clause"
] | 1 | 2020-05-05T16:42:25.000Z | 2020-05-05T16:42:25.000Z | pysnmp_mibs/FDDI-SMT73-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 FDDI-SMT73-MIB (http://pysnmp.sf.net)
# ASN.1 source http://mibs.snmplabs.com:80/asn1/FDDI-SMT73-MIB
# Produced by pysmi-0.0.7 at Sun Feb 14 00:12:32 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)
#
( OctetString, Integer, ObjectIdentifier, ) = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
( ValueSizeConstraint, ConstraintsIntersection, ValueRangeConstraint, SingleValueConstraint, ConstraintsUnion, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsIntersection", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsUnion")
( NotificationGroup, ModuleCompliance, ) = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
( MibScalar, MibTable, MibTableRow, MibTableColumn, Integer32, Gauge32, Bits, Unsigned32, Counter64, TimeTicks, NotificationType, ModuleIdentity, ObjectIdentity, mib_2, MibIdentifier, iso, Counter32, IpAddress, ) = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Integer32", "Gauge32", "Bits", "Unsigned32", "Counter64", "TimeTicks", "NotificationType", "ModuleIdentity", "ObjectIdentity", "mib-2", "MibIdentifier", "iso", "Counter32", "IpAddress")
( DisplayString, TextualConvention, ) = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
transmission = MibIdentifier((1, 3, 6, 1, 2, 1, 10))
fddi = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15))
fddimib = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 73))
class FddiTimeNano(Integer32):
subtypeSpec = Integer32.subtypeSpec+ValueRangeConstraint(0,2147483647)
class FddiTimeMilli(Integer32):
subtypeSpec = Integer32.subtypeSpec+ValueRangeConstraint(0,2147483647)
class FddiResourceId(Integer32):
subtypeSpec = Integer32.subtypeSpec+ValueRangeConstraint(0,65535)
class FddiSMTStationIdType(OctetString):
subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(8,8)
fixedLength = 8
class FddiMACLongAddressType(OctetString):
subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(6,6)
fixedLength = 6
fddimibSMT = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 1))
fddimibMAC = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 2))
fddimibMACCounters = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 3))
fddimibPATH = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 4))
fddimibPORT = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 5))
fddimibSMTNumber = MibScalar((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTNumber.setDescription("The number of SMT implementations (regardless of \n their current state) on this network management \n application entity. The value for this variable \n must remain constant at least from one re- \n initialization of the entity's network management \n system to the next re-initialization.")
fddimibSMTTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2), )
if mibBuilder.loadTexts: fddimibSMTTable.setDescription('A list of SMT entries. The number of entries \n shall not exceed the value of fddimibSMTNumber.')
fddimibSMTEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1), ).setIndexNames((0, "FDDI-SMT73-MIB", "fddimibSMTIndex"))
if mibBuilder.loadTexts: fddimibSMTEntry.setDescription('An SMT entry containing information common to a \n given SMT.')
fddimibSMTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTIndex.setDescription("A unique value for each SMT. The value for each \n SMT must remain constant at least from one re- \n initialization of the entity's network management \n system to the next re-initialization.")
fddimibSMTStationId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 2), FddiSMTStationIdType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTStationId.setDescription('Used to uniquely identify an FDDI station.')
fddimibSMTOpVersionId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTOpVersionId.setDescription('The version that this station is using for its \n operation (refer to ANSI 7.1.2.2). The value of \n this variable is 2 for this SMT revision.')
fddimibSMTHiVersionId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTHiVersionId.setDescription('The highest version of SMT that this station \n supports (refer to ANSI 7.1.2.2).')
fddimibSMTLoVersionId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTLoVersionId.setDescription('The lowest version of SMT that this station \n supports (refer to ANSI 7.1.2.2).')
fddimibSMTUserData = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(32,32)).setFixedLength(32)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibSMTUserData.setDescription('This variable contains 32 octets of user defined \n information. The information shall be an ASCII \n string.')
fddimibSMTMIBVersionId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTMIBVersionId.setDescription('The version of the FDDI MIB of this station. The \n value of this variable is 1 for this SMT \n revision.')
fddimibSMTMACCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTMACCts.setDescription('The number of MACs in this station or \n concentrator.')
fddimibSMTNonMasterCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,2))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTNonMasterCts.setDescription('The value of this variable is the number of A, B, \n and S ports in this station or concentrator.')
fddimibSMTMasterCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTMasterCts.setDescription('The number of M Ports in a node. If the node is \n not a concentrator, the value of the variable is \n zero.')
fddimibSMTAvailablePaths = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,7))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTAvailablePaths.setDescription('A value that indicates the PATH types available \n in the station. \n \n The value is a sum. This value initially takes \n the value zero, then for each type of PATH that \n this node has available, 2 raised to a power is \n added to the sum. The powers are according to the \n following table: \n \n Path Power \n Primary 0 \n Secondary 1 \n Local 2 \n \n For example, a station having Primary and Local \n PATHs available would have a value of 5 (2**0 + \n 2**2).')
fddimibSMTConfigCapabilities = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,3))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTConfigCapabilities.setDescription("A value that indicates the configuration \n capabilities of a node. The 'Hold Available' bit \n indicates the support of the optional Hold \n Function, which is controlled by \n fddiSMTConfigPolicy. The 'CF-Wrap-AB' bit \n indicates that the station has the capability of \n performing a wrap_ab (refer to ANSI SMT 9.7.2.2). \n \n The value is a sum. This value initially takes \n the value zero, then for each of the configuration \n policies currently enforced on the node, 2 raised \n to a power is added to the sum. The powers are \n according to the following table: \n \n Policy Power \n holdAvailable 0 \n CF-Wrap-AB 1 ")
fddimibSMTConfigPolicy = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,1))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibSMTConfigPolicy.setDescription("A value that indicates the configuration policies \n currently desired in a node. 'Hold' is one of the \n terms used for the Hold Flag, an optional ECM flag \n used to enable the optional Hold policy. \n \n The value is a sum. This value initially takes \n the value zero, then for each of the configuration \n policies currently enforced on the node, 2 raised \n to a power is added to the sum. The powers are \n according to the following table: \n \n Policy Power \n configurationhold 0 ")
fddimibSMTConnectionPolicy = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(32768,65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibSMTConnectionPolicy.setDescription("A value representing the connection policies in \n effect in a node. A station sets the corresponding \n bit for each of the connection types that it \n rejects. The letter designations, X and Y, in the \n 'rejectX-Y' names have the following significance: \n X represents the PC-Type of the local PORT and Y \n represents the PC_Type of the adjacent PORT \n (PC_Neighbor). The evaluation of Connection- \n Policy (PC-Type, PC-Neighbor) is done to determine \n the setting of T- Val(3) in the PC-Signalling \n sequence (refer to ANSI 9.6.3). Note that Bit 15, \n (rejectM-M), is always set and cannot be cleared. \n \n The value is a sum. This value initially takes \n the value zero, then for each of the connection \n policies currently enforced on the node, 2 raised \n to a power is added to the sum. The powers are \n according to the following table: \n \n Policy Power \n rejectA-A 0 \n rejectA-B 1 \n rejectA-S 2 \n rejectA-M 3 \n rejectB-A 4 \n rejectB-B 5 \n rejectB-S 6 \n rejectB-M 7 \n rejectS-A 8 \n rejectS-B 9 \n rejectS-S 10 \n rejectS-M 11 \n rejectM-A 12 \n rejectM-B 13 \n rejectM-S 14 \n rejectM-M 15 ")
fddimibSMTTNotify = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2,30))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibSMTTNotify.setDescription('The timer, expressed in seconds, used in the \n Neighbor Notification protocol. It has a range of \n 2 seconds to 30 seconds, and its default value is \n 30 seconds (refer to ANSI SMT 8.2).')
fddimibSMTStatRptPolicy = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibSMTStatRptPolicy.setDescription('If true, indicates that the node will generate \n Status Reporting Frames for its implemented events \n and conditions. It has an initial value of true. \n This variable determines the value of the \n SR_Enable Flag (refer to ANSI SMT 8.3.2.1).')
fddimibSMTTraceMaxExpiration = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 17), FddiTimeMilli()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibSMTTraceMaxExpiration.setDescription('Reference Trace_Max (refer to ANSI SMT \n 9.4.4.2.2).')
fddimibSMTBypassPresent = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTBypassPresent.setDescription('A flag indicating if the station has a bypass on \n its AB port pair.')
fddimibSMTECMState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8,))).clone(namedValues=NamedValues(("ec0", 1), ("ec1", 2), ("ec2", 3), ("ec3", 4), ("ec4", 5), ("ec5", 6), ("ec6", 7), ("ec7", 8),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTECMState.setDescription('Indicates the current state of the ECM state \n machine (refer to ANSI SMT 9.5.2).')
fddimibSMTCFState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,))).clone(namedValues=NamedValues(("cf0", 1), ("cf1", 2), ("cf2", 3), ("cf3", 4), ("cf4", 5), ("cf5", 6), ("cf6", 7), ("cf7", 8), ("cf8", 9), ("cf9", 10), ("cf10", 11), ("cf11", 12), ("cf12", 13),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTCFState.setDescription('The attachment configuration for the station or \n concentrator (refer to ANSI SMT 9.7.2.2).')
fddimibSMTRemoteDisconnectFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTRemoteDisconnectFlag.setDescription('A flag indicating that the station was remotely \n disconnected from the network as a result of \n receiving an fddiSMTAction, disconnect (refer to \n ANSI SMT 6.4.5.3) in a Parameter Management Frame. \n A station requires a Connect Action to rejoin and \n clear the flag (refer to ANSI SMT 6.4.5.2).')
fddimibSMTStationStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3,))).clone(namedValues=NamedValues(("concatenated", 1), ("separated", 2), ("thru", 3),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTStationStatus.setDescription('The current status of the primary and secondary \n paths within this station.')
fddimibSMTPeerWrapFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTPeerWrapFlag.setDescription('This variable assumes the value of the \n PeerWrapFlag in CFM (refer to ANSI SMT \n 9.7.2.4.4).')
fddimibSMTTimeStamp = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 24), FddiTimeMilli()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTTimeStamp.setDescription('This variable assumes the value of TimeStamp \n (refer to ANSI SMT 8.3.2.1).')
fddimibSMTTransitionTimeStamp = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 25), FddiTimeMilli()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibSMTTransitionTimeStamp.setDescription('This variable assumes the value of \n TransitionTimeStamp (refer to ANSI SMT 8.3.2.1).')
fddimibSMTStationAction = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 26), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8,))).clone(namedValues=NamedValues(("other", 1), ("connect", 2), ("disconnect", 3), ("path-Test", 4), ("self-Test", 5), ("disable-a", 6), ("disable-b", 7), ("disable-m", 8),))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibSMTStationAction.setDescription("This object, when read, always returns a value of \n other(1). The behavior of setting this variable \n to each of the acceptable values is as follows: \n \n other(1): Results in an appropriate error. \n connect(2): Generates a Connect signal to ECM \n to begin a connection sequence. See ANSI \n Ref 9.4.2. \n disconnect(3): Generates a Disconnect signal \n to ECM. see ANSI Ref 9.4.2. \n path-Test(4): Initiates a station Path_Test. \n The Path_Test variable (see ANSI Ref \n 9.4.1) is set to 'Testing'. The results \n of this action are not specified in this \n standard. \n self-Test(5): Initiates a station Self_Test. \n The results of this action are not \n specified in this standard. \n disable-a(6): Causes a PC_Disable on the A \n port if the A port mode is peer. \n disable-b(7): Causes a PC_Disable on the B \n port if the B port mode is peer. \n disable-m(8): Causes a PC_Disable on all M \n ports. \n \n Attempts to set this object to all other values \n results in an appropriate error. The result of \n setting this variable to path-Test(4) or self- \n Test(5) is implementation-specific.")
fddimibMACNumber = MibScalar((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACNumber.setDescription("The total number of MAC implementations (across \n all SMTs) on this network management application \n entity. The value for this variable must remain \n constant at least from one re-initialization of \n the entity's network management system to the next \n re-initialization.")
fddimibMACTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2), )
if mibBuilder.loadTexts: fddimibMACTable.setDescription('A list of MAC entries. The number of entries \n shall not exceed the value of fddimibMACNumber.')
fddimibMACEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1), ).setIndexNames((0, "FDDI-SMT73-MIB", "fddimibMACSMTIndex"), (0, "FDDI-SMT73-MIB", "fddimibMACIndex"))
if mibBuilder.loadTexts: fddimibMACEntry.setDescription('A MAC entry containing information common to a \n given MAC.')
fddimibMACSMTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACSMTIndex.setDescription('The value of the SMT index associated with this \n MAC.')
fddimibMACIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACIndex.setDescription('Index variable for uniquely identifying the MAC \n object instances, which is the same as the \n corresponding resource index in SMT.')
fddimibMACIfIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACIfIndex.setDescription('The value of the MIB-II ifIndex corresponding to \n this MAC. If none is applicable, 0 is returned.')
fddimibMACFrameStatusFunctions = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,7))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACFrameStatusFunctions.setDescription("Indicates the MAC's optional Frame Status \n processing functions. \n \n The value is a sum. This value initially takes \n the value zero, then for each function present, 2 \n raised to a power is added to the sum. The powers \n are according to the following table: \n \n function Power \n fs-repeating 0 \n fs-setting 1 \n fs-clearing 2 ")
fddimibMACTMaxCapability = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 5), FddiTimeNano()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACTMaxCapability.setDescription('Indicates the maximum time value of fddiMACTMax \n that this MAC can support.')
fddimibMACTVXCapability = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 6), FddiTimeNano()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACTVXCapability.setDescription('Indicates the maximum time value of \n fddiMACTvxValue that this MAC can support.')
fddimibMACAvailablePaths = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,7))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACAvailablePaths.setDescription('Indicates the paths available for this MAC (refer \n to ANSI SMT 9.7.7). \n \n The value is a sum. This value initially takes \n the value zero, then for each type of PATH that \n this MAC has available, 2 raised to a power is \n added to the sum. The powers are according to the \n following table: \n \n Path Power \n Primary 0 \n Secondary 1 \n Local 2 ')
fddimibMACCurrentPath = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6,))).clone(namedValues=NamedValues(("isolated", 1), ("local", 2), ("secondary", 3), ("primary", 4), ("concatenated", 5), ("thru", 6),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACCurrentPath.setDescription('Indicates the Path into which this MAC is \n currently inserted (refer to ANSI 9.7.7).')
fddimibMACUpstreamNbr = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 9), FddiMACLongAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACUpstreamNbr.setDescription("The MAC's upstream neighbor's long individual MAC \n address. It has an initial value of the SMT- \n Unknown-MAC Address and is only modified as \n specified by the Neighbor Information Frame \n protocol (refer to ANSI SMT 7.2.1 and 8.2).")
fddimibMACDownstreamNbr = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 10), FddiMACLongAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACDownstreamNbr.setDescription("The MAC's downstream neighbor's long individual \n MAC address. It has an initial value of the SMT- \n Unknown-MAC Address and is only modified as \n specified by the Neighbor Information Frame \n protocol (refer to ANSI SMT 7.2.1 and 8.2).")
fddimibMACOldUpstreamNbr = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 11), FddiMACLongAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACOldUpstreamNbr.setDescription("The previous value of the MAC's upstream \n neighbor's long individual MAC address. It has an \n initial value of the SMT-Unknown- MAC Address and \n is only modified as specified by the Neighbor \n Information Frame protocol (refer to ANSI SMT \n 7.2.1 and 8.2).")
fddimibMACOldDownstreamNbr = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 12), FddiMACLongAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACOldDownstreamNbr.setDescription("The previous value of the MAC's downstream \n neighbor's long individual MAC address. It has an \n initial value of the SMT- Unknown-MAC Address and \n is only modified as specified by the Neighbor \n Information Frame protocol (refer to ANSI SMT \n 7.2.1 and 8.2).")
fddimibMACDupAddressTest = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3,))).clone(namedValues=NamedValues(("none", 1), ("pass", 2), ("fail", 3),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACDupAddressTest.setDescription('The Duplicate Address Test flag, Dup_Addr_Test \n (refer to ANSI 8.2).')
fddimibMACRequestedPaths = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibMACRequestedPaths.setDescription('List of permitted Paths which specifies the \n Path(s) into which the MAC may be inserted (refer \n to ansi SMT 9.7). \n \n The value is a sum which represents the individual \n paths that are desired. This value initially \n takes the value zero, then for each type of PATH \n that this node is, 2 raised to a power is added to \n the sum. The powers are according to the \n following table: \n \n Path Power \n local 0 \n secondary-alternate 1 \n primary-alternate 2 \n concatenated-alternate 3 \n secondary-preferred 4 \n primary-preferred 5 \n concatenated-preferred 6 \n thru 7 ')
fddimibMACDownstreamPORTType = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5,))).clone(namedValues=NamedValues(("a", 1), ("b", 2), ("s", 3), ("m", 4), ("none", 5),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACDownstreamPORTType.setDescription('Indicates the PC-Type of the first port that is \n downstream of this MAC (the exit port).')
fddimibMACSMTAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 16), FddiMACLongAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACSMTAddress.setDescription('The 48-bit individual address of the MAC used for \n SMT frames.')
fddimibMACTReq = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 17), FddiTimeNano()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACTReq.setDescription('This variable is the T_Req_value passed to the \n MAC. Without having detected a duplicate, the \n time value of this variable shall assume the \n maximum supported time value which is less than or \n equal to the time value of fddiPATHMaxT-Req. When \n a MAC has an address detected as a duplicate, it \n may use a time value for this variable greater \n than the time value of fddiPATHTMaxLowerBound. A \n station shall cause claim when the new T_Req may \n cause the value of T_Neg to change in the claim \n process, (i.e., time value new T_Req < T_Neg, or \n old T_Req = T_Neg).')
fddimibMACTNeg = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 18), FddiTimeNano()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACTNeg.setDescription('It is reported as a FddiTimeNano number.')
fddimibMACTMax = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 19), FddiTimeNano()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACTMax.setDescription('This variable is the T_Max_value passed to the \n MAC. The time value of this variable shall assume \n the minimum suported time value which is greater \n than or equal to the time value of fddiPATHT- \n MaxLowerBound')
fddimibMACTvxValue = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 20), FddiTimeNano()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACTvxValue.setDescription('This variable is the TVX_value passed to the MAC. \n The time value of this variable shall assume the \n minimum suported time value which is greater than \n or equal to the time value of \n fddiPATHTVXLowerBound.')
fddimibMACFrameCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 21), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACFrameCts.setDescription('A count of the number of frames received by this \n MAC (refer to ANSI MAC 7.5.1).')
fddimibMACCopiedCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 22), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACCopiedCts.setDescription("A count that should as closely as possible match \n the number of frames addressed to (A bit set) and \n successfully copied into the station's receive \n buffers (C bit set) by this MAC (refer to ANSI MAC \n 7.5). Note that this count does not include MAC \n frames.")
fddimibMACTransmitCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 23), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACTransmitCts.setDescription('A count that should as closely as possible match \n the number of frames transmitted by this MAC \n (refer to ANSI MAC 7.5). Note that this count \n does not include MAC frames.')
fddimibMACErrorCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 24), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACErrorCts.setDescription('A count of the number of frames that were \n detected in error by this MAC that had not been \n detected in error by another MAC (refer to ANSI \n MAC 7.5.2).')
fddimibMACLostCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 25), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACLostCts.setDescription('A count of the number of instances that this MAC \n detected a format error during frame reception \n such that the frame was stripped (refer to ANSI \n MAC 7.5.3).')
fddimibMACFrameErrorThreshold = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 26), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibMACFrameErrorThreshold.setDescription('A threshold for determining when a MAC Condition \n report (see ANSI 8.3.1.1) shall be generated. \n Stations not supporting variable thresholds shall \n have a value of 0 and a range of (0..0).')
fddimibMACFrameErrorRatio = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 27), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACFrameErrorRatio.setDescription('This variable is the value of the ratio, \n \n ((delta fddiMACLostCts + delta fddiMACErrorCts) / \n (delta fddiMACFrameCts + delta fddiMACLostCts )) \n * 2**16 ')
fddimibMACRMTState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 28), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8,))).clone(namedValues=NamedValues(("rm0", 1), ("rm1", 2), ("rm2", 3), ("rm3", 4), ("rm4", 5), ("rm5", 6), ("rm6", 7), ("rm7", 8),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACRMTState.setDescription('Indicates the current state of the RMT State \n Machine (refer to ANSI 10.3.2).')
fddimibMACDaFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 29), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACDaFlag.setDescription('The RMT flag Duplicate Address Flag, DA_Flag \n (refer to ANSI 10.2.1.2).')
fddimibMACUnaDaFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 30), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACUnaDaFlag.setDescription('A flag, UNDA_Flag (refer to ANSI 8.2.2.1), set \n when the upstream neighbor reports a duplicate \n address condition. Cleared when the condition \n clears.')
fddimibMACFrameErrorFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 31), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACFrameErrorFlag.setDescription('Indicates the MAC Frame Error Condition is \n present when set. Cleared when the condition \n clears and on station initialization.')
fddimibMACMAUnitdataAvailable = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACMAUnitdataAvailable.setDescription('This variable shall take on the value of the \n MAC_Avail flag defined in RMT.')
fddimibMACHardwarePresent = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 33), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACHardwarePresent.setDescription('This variable indicates the presence of \n underlying hardware support for this MAC object. \n If the value of this object is false(2), the \n reporting of the objects in this entry may be \n handled in an implementation-specific manner.')
fddimibMACMAUnitdataEnable = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 34), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibMACMAUnitdataEnable.setDescription('This variable determines the value of the \n MA_UNITDATA_Enable flag in RMT. The default and \n initial value of this flag is true(1).')
fddimibMACCountersTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1), )
if mibBuilder.loadTexts: fddimibMACCountersTable.setDescription('A list of MAC Counters entries. The number of \n entries shall not exceed the value of \n fddimibMACNumber.')
fddimibMACCountersEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1), ).setIndexNames((0, "FDDI-SMT73-MIB", "fddimibMACSMTIndex"), (0, "FDDI-SMT73-MIB", "fddimibMACIndex"))
if mibBuilder.loadTexts: fddimibMACCountersEntry.setDescription('A MAC Counters entry containing information \n common to a given MAC.')
fddimibMACTokenCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACTokenCts.setDescription('A count that should as closely as possible match \n the number of times the station has received a \n token (total of non-restricted and restricted) on \n this MAC (see ANSI MAC 7.4). This count is \n valuable for determination of network load.')
fddimibMACTvxExpiredCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACTvxExpiredCts.setDescription('A count that should as closely as possible match \n the number of times that TVX has expired.')
fddimibMACNotCopiedCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACNotCopiedCts.setDescription('A count that should as closely as possible match \n the number of frames that were addressed to this \n MAC but were not copied into its receive buffers \n (see ANSI MAC 7.5). For example, this might occur \n due to local buffer congestion. Because of \n implementation considerations, this count may not \n match the actual number of frames not copied. It \n is not a requirement that this count be exact. \n Note that this count does not include MAC frames.')
fddimibMACLateCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACLateCts.setDescription('A count that should as closely as possible match \n the number of TRT expirations since this MAC was \n reset or a token was received (refer to ANSI MAC \n 7.4.5).')
fddimibMACRingOpCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACRingOpCts.setDescription("The count of the number of times the ring has \n entered the 'Ring_Operational' state from the \n 'Ring Not Operational' state. This count is \n updated when a SM_MA_STATUS.Indication of a change \n in the Ring_Operational status occurs (refer to \n ANSI 6.1.4). Because of implementation \n considerations, this count may be less than the \n actual RingOp_Ct. It is not a requirement that \n this count be exact.")
fddimibMACNotCopiedRatio = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACNotCopiedRatio.setDescription('This variable is the value of the ratio: \n \n (delta fddiMACNotCopiedCts / \n (delta fddiMACCopiedCts + \n delta fddiMACNotCopiedCts )) * 2**16 ')
fddimibMACNotCopiedFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibMACNotCopiedFlag.setDescription('Indicates that the Not Copied condition is \n present when read as true(1). Set to false(2) \n when the condition clears and on station \n initialization.')
fddimibMACNotCopiedThreshold = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibMACNotCopiedThreshold.setDescription('A threshold for determining when a MAC condition \n report shall be generated. Stations not \n supporting variable thresholds shall have a value \n of 0 and a range of (0..0).')
fddimibPATHNumber = MibScalar((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPATHNumber.setDescription("The total number of PATHs possible (across all \n SMTs) on this network management application \n entity. The value for this variable must remain \n constant at least from one re-initialization of \n the entity's network management system to the next \n re-initialization.")
fddimibPATHTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2), )
if mibBuilder.loadTexts: fddimibPATHTable.setDescription('A list of PATH entries. The number of entries \n shall not exceed the value of fddimibPATHNumber.')
fddimibPATHEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1), ).setIndexNames((0, "FDDI-SMT73-MIB", "fddimibPATHSMTIndex"), (0, "FDDI-SMT73-MIB", "fddimibPATHIndex"))
if mibBuilder.loadTexts: fddimibPATHEntry.setDescription('A PATH entry containing information common to a \n given PATH.')
fddimibPATHSMTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPATHSMTIndex.setDescription('The value of the SMT index associated with this \n PATH.')
fddimibPATHIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPATHIndex.setDescription('Index variable for uniquely identifying the \n primary, secondary and local PATH object \n instances. Local PATH object instances are \n represented with integer values 3 to 255.')
fddimibPATHTVXLowerBound = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 3), FddiTimeNano()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibPATHTVXLowerBound.setDescription('Specifies the minimum time value of \n fddiMACTvxValue that shall be used by any MAC that \n is configured in this path. The operational value \n of fddiMACTvxValue is managed by settting this \n variable. This variable has the time value range \n of: \n \n 0 < fddimibPATHTVXLowerBound < fddimibPATHMaxTReq \n Changes to this variable shall either satisfy the \n time value relationship: \n \n fddimibPATHTVXLowerBound <= \n fddimibMACTVXCapability \n \n of each of the MACs currently on the path, or be \n considered out of range. The initial value of \n fddimibPATHTVXLowerBound shall be 2500 nsec (2.5 \n ms).')
fddimibPATHTMaxLowerBound = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 4), FddiTimeNano()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibPATHTMaxLowerBound.setDescription('Specifies the minimum time value of fddiMACTMax \n that shall be used by any MAC that is configured \n in this path. The operational value of \n fddiMACTMax is managed by setting this variable. \n This variable has the time value range of: \n \n fddimibPATHMaxTReq <= fddimibPATHTMaxLowerBound \n \n and an absolute time value range of: \n \n 10000nsec (10 msec) <= fddimibPATHTMaxLowerBound \n \n Changes to this variable shall either satisfy the \n time value relationship: \n \n fddimibPATHTMaxLowerBound < \n fddimibMACTMaxCapability \n \n of each of the MACs currently on the path, or be \n considered out of range. The initial value of \n fddimibPATHTMaxLowerBound shall be 165000 nsec \n (165 msec).')
fddimibPATHMaxTReq = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 5), FddiTimeNano()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibPATHMaxTReq.setDescription('Specifies the maximum time value of fddiMACT-Req \n that shall be used by any MAC that is configured \n in this path. The operational value of fddiMACT- \n Req is managed by setting this variable. This \n variable has the time value range of: \n \n fddimibPATHTVXLowerBound < fddimibPATHMaxTReq <= \n fddimibPATHTMaxLowerBound. \n \n The default value of fddimibPATHMaxTReq is 165000 \n nsec (165 msec).')
fddimibPATHConfigTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3), )
if mibBuilder.loadTexts: fddimibPATHConfigTable.setDescription('A table of Path configuration entries. This \n table lists all the resources that may be in this \n Path.')
fddimibPATHConfigEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1), ).setIndexNames((0, "FDDI-SMT73-MIB", "fddimibPATHConfigSMTIndex"), (0, "FDDI-SMT73-MIB", "fddimibPATHConfigPATHIndex"), (0, "FDDI-SMT73-MIB", "fddimibPATHConfigTokenOrder"))
if mibBuilder.loadTexts: fddimibPATHConfigEntry.setDescription('A collection of objects containing information \n for a given PATH Configuration entry.')
fddimibPATHConfigSMTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPATHConfigSMTIndex.setDescription('The value of the SMT index associated with this \n configuration entry.')
fddimibPATHConfigPATHIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPATHConfigPATHIndex.setDescription('The value of the PATH resource index associated \n with this configuration entry.')
fddimibPATHConfigTokenOrder = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPATHConfigTokenOrder.setDescription('An object associated with Token order for this \n entry. Thus if the token passes resources a, b, c \n and d, in that order, then the value of this \n object for these resources would be 1, 2, 3 and 4 \n respectively.')
fddimibPATHConfigResourceType = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 4,))).clone(namedValues=NamedValues(("mac", 2), ("port", 4),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPATHConfigResourceType.setDescription('The type of resource associated with this \n configuration entry.')
fddimibPATHConfigResourceIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPATHConfigResourceIndex.setDescription('The value of the SMT resource index used to refer \n to the instance of this MAC or Port resource.')
fddimibPATHConfigCurrentPath = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6,))).clone(namedValues=NamedValues(("isolated", 1), ("local", 2), ("secondary", 3), ("primary", 4), ("concatenated", 5), ("thru", 6),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPATHConfigCurrentPath.setDescription('The current insertion status for this resource on \n this Path.')
fddimibPORTNumber = MibScalar((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTNumber.setDescription("The total number of PORT implementations (across \n all SMTs) on this network management application \n entity. The value for this variable must remain \n constant at least from one re-initialization of \n the entity's network management system to the next \n re-initialization.")
fddimibPORTTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2), )
if mibBuilder.loadTexts: fddimibPORTTable.setDescription('A list of PORT entries. The number of entries \n shall not exceed the value of fddimibPORTNumber.')
fddimibPORTEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1), ).setIndexNames((0, "FDDI-SMT73-MIB", "fddimibPORTSMTIndex"), (0, "FDDI-SMT73-MIB", "fddimibPORTIndex"))
if mibBuilder.loadTexts: fddimibPORTEntry.setDescription('A PORT entry containing information common to a \n given PORT.')
fddimibPORTSMTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTSMTIndex.setDescription('The value of the SMT index associated with this \n PORT.')
fddimibPORTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTIndex.setDescription("A unique value for each PORT within a given SMT, \n which is the same as the corresponding resource \n index in SMT. The value for each PORT must remain \n constant at least from one re-initialization of \n the entity's network management system to the next \n re-initialization.")
fddimibPORTMyType = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5,))).clone(namedValues=NamedValues(("a", 1), ("b", 2), ("s", 3), ("m", 4), ("none", 5),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTMyType.setDescription("The value of the PORT's PC_Type (refer to ANSI \n 9.4.1, and 9.6.3.2).")
fddimibPORTNeighborType = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5,))).clone(namedValues=NamedValues(("a", 1), ("b", 2), ("s", 3), ("m", 4), ("none", 5),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTNeighborType.setDescription('The type of the remote PORT as determined in PCM. \n This variable has an initial value of none, and is \n only modified in PC_RCode(3)_Actions (refer to \n ANSI SMT 9.6.3.2).')
fddimibPORTConnectionPolicies = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,3))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibPORTConnectionPolicies.setDescription("A value representing the PORT's connection \n policies desired in the node. The value of pc- \n mac-lct is a term used in the PC_MAC_LCT Flag (see \n 9.4.3.2). The value of pc-mac-loop is a term used \n in the PC_MAC_Loop Flag. \n \n The value is a sum. This value initially takes \n the value zero, then for each PORT policy, 2 \n raised to a power is added to the sum. The powers \n are according to the following table: \n \n Policy Power \n pc-mac-lct 0 \n pc-mac-loop 1 ")
fddimibPORTMACIndicated = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4,))).clone(namedValues=NamedValues(("tVal9FalseRVal9False", 1), ("tVal9FalseRVal9True", 2), ("tVal9TrueRVal9False", 3), ("tVal9TrueRVal9True", 4),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTMACIndicated.setDescription('The indications (T_Val(9), R_Val(9)) in PC- \n Signalling, of the intent to place a MAC in the \n output token path to a PORT (refer to ANSI SMT \n 9.6.3.2.).')
fddimibPORTCurrentPath = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6,))).clone(namedValues=NamedValues(("ce0", 1), ("ce1", 2), ("ce2", 3), ("ce3", 4), ("ce4", 5), ("ce5", 6),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTCurrentPath.setDescription('Indicates the Path(s) into which this PORT is \n currently inserted.')
fddimibPORTRequestedPaths = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(3,3)).setFixedLength(3)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibPORTRequestedPaths.setDescription("This variable is a list of permitted Paths where \n each list element defines the Port's permitted \n Paths. The first octet corresponds to 'none', the \n second octet to 'tree', and the third octet to \n 'peer'.")
fddimibPORTMACPlacement = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 9), FddiResourceId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTMACPlacement.setDescription('Indicates the MAC, if any, whose transmit path \n exits the station via this PORT. The value shall \n be zero if there is no MAC associated with the \n PORT. Otherwise, the MACIndex of the MAC will be \n the value of the variable.')
fddimibPORTAvailablePaths = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,7))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTAvailablePaths.setDescription('Indicates the Paths which are available to this \n Port. In the absence of faults, the A and B Ports \n will always have both the Primary and Secondary \n Paths available. \n \n The value is a sum. This value initially takes \n the value zero, then for each type of PATH that \n this port has available, 2 raised to a power is \n added to the sum. The powers are according to the \n following table: \n \n Path Power \n Primary 0 \n Secondary 1 \n Local 2 ')
fddimibPORTPMDClass = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8,))).clone(namedValues=NamedValues(("multimode", 1), ("single-mode1", 2), ("single-mode2", 3), ("sonet", 4), ("low-cost-fiber", 5), ("twisted-pair", 6), ("unknown", 7), ("unspecified", 8),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTPMDClass.setDescription('This variable indicates the type of PMD entity \n associated with this port.')
fddimibPORTConnectionCapabilities = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,3))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTConnectionCapabilities.setDescription('A value that indicates the connection \n capabilities of the port. The pc-mac-lct bit \n indicates that the station has the capability of \n setting the PC_MAC_LCT Flag. The pc-mac-loop bit \n indicates that the station has the capability of \n setting the PC_MAC_Loop Flag (refer to ANSI \n 9.4.3.2). \n \n The value is a sum. This value initially takes \n the value zero, then for each capability that this \n port has, 2 raised to a power is added to the sum. \n The powers are according to the following table: \n \n capability Power \n pc-mac-lct 0 \n pc-mac-loop 1 ')
fddimibPORTBSFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTBSFlag.setDescription('This variable assumes the value of the BS_Flag \n (refer to ANSI SMT 9.4.3.3).')
fddimibPORTLCTFailCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 14), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTLCTFailCts.setDescription('The count of the consecutive times the link \n confidence test (LCT) has failed during connection \n management (refer to ANSI 9.4.1).')
fddimibPORTLerEstimate = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(4,15))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTLerEstimate.setDescription('A long term average link error rate. It ranges \n from 10**-4 to 10**-15 and is reported as the \n absolute value of the base 10 logarithm (refer to \n ANSI SMT 9.4.7.5.).')
fddimibPORTLemRejectCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 16), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTLemRejectCts.setDescription('A link error monitoring count of the times that a \n link has been rejected.')
fddimibPORTLemCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 17), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTLemCts.setDescription('The aggregate link error monitor error count, set \n to zero only on station initialization.')
fddimibPORTLerCutoff = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(4,15))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibPORTLerCutoff.setDescription('The link error rate estimate at which a link \n connection will be broken. It ranges from 10**-4 \n to 10**-15 and is reported as the absolute value \n of the base 10 logarithm (default of 7).')
fddimibPORTLerAlarm = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(4,15))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibPORTLerAlarm.setDescription('The link error rate estimate at which a link \n connection will generate an alarm. It ranges from \n 10**-4 to 10**-15 and is reported as the absolute \n value of the base 10 logarithm of the estimate \n (default of 8).')
fddimibPORTConnectState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4,))).clone(namedValues=NamedValues(("disabled", 1), ("connecting", 2), ("standby", 3), ("active", 4),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTConnectState.setDescription('An indication of the connect state of this PORT \n and is equal to the value of Connect_State (refer \n to ANSI 9.4.1)')
fddimibPORTPCMState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10,))).clone(namedValues=NamedValues(("pc0", 1), ("pc1", 2), ("pc2", 3), ("pc3", 4), ("pc4", 5), ("pc5", 6), ("pc6", 7), ("pc7", 8), ("pc8", 9), ("pc9", 10),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTPCMState.setDescription("The state of this Port's PCM state machine refer \n to ANSI SMT 9.6.2).")
fddimibPORTPCWithhold = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4,))).clone(namedValues=NamedValues(("none", 1), ("m-m", 2), ("otherincompatible", 3), ("pathnotavailable", 4),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTPCWithhold.setDescription('The value of PC_Withhold (refer to ANSI SMT \n 9.4.1).')
fddimibPORTLerFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTLerFlag.setDescription('The condition becomes active when the value of \n fddiPORTLerEstimate is less than or equal to \n fddiPORTLerAlarm. This will be reported with the \n Status Report Frames (SRF) (refer to ANSI SMT \n 7.2.7 and 8.3).')
fddimibPORTHardwarePresent = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 24), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("true", 1), ("false", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: fddimibPORTHardwarePresent.setDescription('This variable indicates the presence of \n underlying hardware support for this Port object. \n If the value of this object is false(2), the \n reporting of the objects in this entry may be \n handled in an implementation-specific manner.')
fddimibPORTAction = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6,))).clone(namedValues=NamedValues(("other", 1), ("maintPORT", 2), ("enablePORT", 3), ("disablePORT", 4), ("startPORT", 5), ("stopPORT", 6),))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: fddimibPORTAction.setDescription("Causes a Control signal to be generated with a \n control_action of 'Signal' and the 'variable' \n parameter set with the appropriate value (i.e., \n PC_Maint, PC_Enable, PC_Disable, PC_Start, or \n PC_Stop) (refer to ANSI 9.4.2).")
mibBuilder.exportSymbols("FDDI-SMT73-MIB", fddimibPATHConfigSMTIndex=fddimibPATHConfigSMTIndex, fddimibMACAvailablePaths=fddimibMACAvailablePaths, fddimibSMTTransitionTimeStamp=fddimibSMTTransitionTimeStamp, fddimibPORTHardwarePresent=fddimibPORTHardwarePresent, fddimibMACRequestedPaths=fddimibMACRequestedPaths, fddimibPATHConfigTable=fddimibPATHConfigTable, fddimibMACMAUnitdataAvailable=fddimibMACMAUnitdataAvailable, fddimibMACFrameStatusFunctions=fddimibMACFrameStatusFunctions, fddimibSMTConfigCapabilities=fddimibSMTConfigCapabilities, fddimibMACNumber=fddimibMACNumber, fddimibMACSMTIndex=fddimibMACSMTIndex, fddimibSMTECMState=fddimibSMTECMState, FddiResourceId=FddiResourceId, fddimibPATHSMTIndex=fddimibPATHSMTIndex, fddimibMACTMaxCapability=fddimibMACTMaxCapability, fddimibMAC=fddimibMAC, fddimibPORTLemRejectCts=fddimibPORTLemRejectCts, fddimibMACSMTAddress=fddimibMACSMTAddress, fddimibMACRMTState=fddimibMACRMTState, fddimibPORTEntry=fddimibPORTEntry, fddimibSMTTNotify=fddimibSMTTNotify, fddimibPORTLerAlarm=fddimibPORTLerAlarm, FddiTimeNano=FddiTimeNano, fddimibMACFrameErrorRatio=fddimibMACFrameErrorRatio, fddimibPORTSMTIndex=fddimibPORTSMTIndex, fddimibSMTStationAction=fddimibSMTStationAction, fddimibMACCopiedCts=fddimibMACCopiedCts, fddimibSMTNumber=fddimibSMTNumber, fddimib=fddimib, FddiMACLongAddressType=FddiMACLongAddressType, fddimibSMTLoVersionId=fddimibSMTLoVersionId, fddimibMACTransmitCts=fddimibMACTransmitCts, fddimibMACHardwarePresent=fddimibMACHardwarePresent, fddimibSMTBypassPresent=fddimibSMTBypassPresent, fddimibPORTIndex=fddimibPORTIndex, fddimibSMTTable=fddimibSMTTable, fddimibMACDownstreamNbr=fddimibMACDownstreamNbr, fddimibSMTOpVersionId=fddimibSMTOpVersionId, fddimibPORTConnectionCapabilities=fddimibPORTConnectionCapabilities, fddimibPATHConfigResourceIndex=fddimibPATHConfigResourceIndex, fddimibPORTCurrentPath=fddimibPORTCurrentPath, fddimibMACIndex=fddimibMACIndex, fddimibMACOldDownstreamNbr=fddimibMACOldDownstreamNbr, fddimibSMTTraceMaxExpiration=fddimibSMTTraceMaxExpiration, fddimibPORTPCWithhold=fddimibPORTPCWithhold, fddimibPORTTable=fddimibPORTTable, fddimibMACNotCopiedFlag=fddimibMACNotCopiedFlag, FddiSMTStationIdType=FddiSMTStationIdType, fddimibMACTvxValue=fddimibMACTvxValue, fddimibSMTRemoteDisconnectFlag=fddimibSMTRemoteDisconnectFlag, fddimibMACTokenCts=fddimibMACTokenCts, fddimibMACCountersTable=fddimibMACCountersTable, fddimibPORTNumber=fddimibPORTNumber, fddimibMACNotCopiedCts=fddimibMACNotCopiedCts, fddimibPORTConnectState=fddimibPORTConnectState, fddimibPORTAction=fddimibPORTAction, fddimibSMTStationStatus=fddimibSMTStationStatus, fddimibPORTNeighborType=fddimibPORTNeighborType, fddimibPORTLerEstimate=fddimibPORTLerEstimate, fddimibPORTPMDClass=fddimibPORTPMDClass, fddimibMACTVXCapability=fddimibMACTVXCapability, FddiTimeMilli=FddiTimeMilli, fddimibPATHTVXLowerBound=fddimibPATHTVXLowerBound, fddimibSMTHiVersionId=fddimibSMTHiVersionId, fddimibMACTReq=fddimibMACTReq, fddimibPATHNumber=fddimibPATHNumber, fddimibSMTUserData=fddimibSMTUserData, fddimibMACFrameCts=fddimibMACFrameCts, fddimibPATHConfigTokenOrder=fddimibPATHConfigTokenOrder, transmission=transmission, fddimibMACLostCts=fddimibMACLostCts, fddimibMACFrameErrorThreshold=fddimibMACFrameErrorThreshold, fddimibSMTConnectionPolicy=fddimibSMTConnectionPolicy, fddimibMACErrorCts=fddimibMACErrorCts, fddimibPORT=fddimibPORT, fddimibPORTLCTFailCts=fddimibPORTLCTFailCts, fddi=fddi, fddimibPORTMACPlacement=fddimibPORTMACPlacement, fddimibSMTEntry=fddimibSMTEntry, fddimibPORTLerFlag=fddimibPORTLerFlag, fddimibPORTLemCts=fddimibPORTLemCts, fddimibMACIfIndex=fddimibMACIfIndex, fddimibSMTCFState=fddimibSMTCFState, fddimibPATHConfigEntry=fddimibPATHConfigEntry, fddimibPORTAvailablePaths=fddimibPORTAvailablePaths, fddimibPATHTMaxLowerBound=fddimibPATHTMaxLowerBound, fddimibPORTMyType=fddimibPORTMyType, fddimibMACTvxExpiredCts=fddimibMACTvxExpiredCts, fddimibPATHConfigCurrentPath=fddimibPATHConfigCurrentPath, fddimibSMTIndex=fddimibSMTIndex, fddimibPATHConfigResourceType=fddimibPATHConfigResourceType, fddimibSMTPeerWrapFlag=fddimibSMTPeerWrapFlag, fddimibSMTStationId=fddimibSMTStationId, fddimibPATH=fddimibPATH, fddimibMACDownstreamPORTType=fddimibMACDownstreamPORTType, fddimibMACOldUpstreamNbr=fddimibMACOldUpstreamNbr, fddimibPORTRequestedPaths=fddimibPORTRequestedPaths, fddimibSMT=fddimibSMT, fddimibMACFrameErrorFlag=fddimibMACFrameErrorFlag, fddimibPATHConfigPATHIndex=fddimibPATHConfigPATHIndex, fddimibPATHMaxTReq=fddimibPATHMaxTReq, fddimibMACUnaDaFlag=fddimibMACUnaDaFlag, fddimibPORTBSFlag=fddimibPORTBSFlag, fddimibPORTConnectionPolicies=fddimibPORTConnectionPolicies, fddimibMACCurrentPath=fddimibMACCurrentPath, fddimibMACRingOpCts=fddimibMACRingOpCts, fddimibSMTMACCts=fddimibSMTMACCts, fddimibSMTTimeStamp=fddimibSMTTimeStamp, fddimibMACNotCopiedRatio=fddimibMACNotCopiedRatio, fddimibMACDupAddressTest=fddimibMACDupAddressTest, fddimibPORTLerCutoff=fddimibPORTLerCutoff, fddimibSMTConfigPolicy=fddimibSMTConfigPolicy, fddimibMACTMax=fddimibMACTMax, fddimibPATHIndex=fddimibPATHIndex, fddimibMACLateCts=fddimibMACLateCts, fddimibSMTNonMasterCts=fddimibSMTNonMasterCts, fddimibMACCountersEntry=fddimibMACCountersEntry, fddimibMACUpstreamNbr=fddimibMACUpstreamNbr, fddimibPATHEntry=fddimibPATHEntry, fddimibPATHTable=fddimibPATHTable, fddimibMACMAUnitdataEnable=fddimibMACMAUnitdataEnable, fddimibPORTPCMState=fddimibPORTPCMState, fddimibMACTNeg=fddimibMACTNeg, fddimibSMTMIBVersionId=fddimibSMTMIBVersionId, fddimibSMTMasterCts=fddimibSMTMasterCts, fddimibSMTStatRptPolicy=fddimibSMTStatRptPolicy, fddimibPORTMACIndicated=fddimibPORTMACIndicated, fddimibMACNotCopiedThreshold=fddimibMACNotCopiedThreshold, fddimibMACCounters=fddimibMACCounters, fddimibSMTAvailablePaths=fddimibSMTAvailablePaths, fddimibMACEntry=fddimibMACEntry, fddimibMACDaFlag=fddimibMACDaFlag, fddimibMACTable=fddimibMACTable)
| 260.45 | 5,869 | 0.654664 | 8,727 | 72,926 | 5.463962 | 0.09568 | 0.009731 | 0.009752 | 0.013527 | 0.525837 | 0.481335 | 0.408691 | 0.381176 | 0.36031 | 0.35471 | 0 | 0.059695 | 0.240353 | 72,926 | 279 | 5,870 | 261.383513 | 0.801058 | 0.004169 | 0 | 0.007491 | 0 | 0.322097 | 0.502045 | 0.007891 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.029963 | 0.022472 | 0 | 0.067416 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b16332db9cbb7c287c4f4814173308bd2c9efea5 | 284 | py | Python | scripts/factory-install/tests/installed/conftest.py | jraygauthier/nixos_secure_factory | 67adb93b153902226301d4a68e7b6e3a0af660c2 | [
"Apache-2.0"
] | 1 | 2021-04-17T10:13:42.000Z | 2021-04-17T10:13:42.000Z | scripts/factory-install/tests/installed/conftest.py | jraygauthier/nixos_secure_factory | 67adb93b153902226301d4a68e7b6e3a0af660c2 | [
"Apache-2.0"
] | 4 | 2019-10-21T17:40:17.000Z | 2021-11-11T13:46:20.000Z | scripts/factory-install/tests/installed/conftest.py | jraygauthier/nixos_secure_factory | 67adb93b153902226301d4a68e7b6e3a0af660c2 | [
"Apache-2.0"
] | 2 | 2019-10-10T18:32:01.000Z | 2021-08-24T16:02:09.000Z | # import os
# import pytest
def pytest_runtest_setup(item):
pass
"""
if "1" != os.environ.get("PKG_NSF_FACTORY_INSTALL_IN_ENV"):
pytest.skip(
"Should be run only from build environement. "
"See `PKG_NSF_FACTORY_INSTALL_IN_ENV`.")
"""
| 21.846154 | 63 | 0.616197 | 37 | 284 | 4.405405 | 0.72973 | 0.07362 | 0.159509 | 0.245399 | 0.306748 | 0.306748 | 0 | 0 | 0 | 0 | 0 | 0.004808 | 0.267606 | 284 | 12 | 64 | 23.666667 | 0.778846 | 0.080986 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0.5 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
b18697741b7b1eb90750aedf693bb22ba0da549c | 244 | py | Python | todo_app/urls.py | ptyadana/django-WEB-simple-todo | 52b06042748293e0ddaa614f319be267533ad820 | [
"MIT"
] | null | null | null | todo_app/urls.py | ptyadana/django-WEB-simple-todo | 52b06042748293e0ddaa614f319be267533ad820 | [
"MIT"
] | 4 | 2021-04-08T19:50:31.000Z | 2021-09-22T18:47:16.000Z | todo_app/urls.py | ptyadana/django-WEB-simple-todo | 52b06042748293e0ddaa614f319be267533ad820 | [
"MIT"
] | null | null | null | from django.urls import path
from todo_app import views
urlpatterns = [
path('',views.home,name='home'),
path('home',views.home,name='home'),
path('add',views.add_task,name='addtask'),
path('home/<id>',views.home,name='home')
] | 27.111111 | 46 | 0.663934 | 36 | 244 | 4.444444 | 0.416667 | 0.16875 | 0.24375 | 0.31875 | 0.2625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.131148 | 244 | 9 | 47 | 27.111111 | 0.754717 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 0 | 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 |
b190e64d4516263d14713277133281b8dc9ed011 | 63 | py | Python | AtCoder/BeginnerContest134/myans/e.py | scnsh/CompetitiveProgramming | 3f08b4719ffe9511cba6d1ba7909f1899def702b | [
"MIT"
] | 1 | 2019-08-04T23:40:18.000Z | 2019-08-04T23:40:18.000Z | AtCoder/BeginnerContest134/myans/e.py | scnsh/CompetitiveProgramming | 3f08b4719ffe9511cba6d1ba7909f1899def702b | [
"MIT"
] | null | null | null | AtCoder/BeginnerContest134/myans/e.py | scnsh/CompetitiveProgramming | 3f08b4719ffe9511cba6d1ba7909f1899def702b | [
"MIT"
] | null | null | null | N = int(input())
A = [0]*N
for i in N:
A[i] = int(input())
| 12.6 | 23 | 0.460317 | 14 | 63 | 2.071429 | 0.571429 | 0.551724 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.021739 | 0.269841 | 63 | 4 | 24 | 15.75 | 0.608696 | 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 |
b192339ac0bcf9a5d0b02f5a77fa3a70963bf6cd | 230 | py | Python | tests/testapp/urls.py | hotwire-django/django-turbo-allauth | ce45ae042d7a5e8915aae35fd812d886b584c9ff | [
"MIT"
] | 6 | 2021-01-04T16:27:51.000Z | 2022-03-04T02:50:14.000Z | src/turbo_allauth/tests/testapp/urls.py | danjac/django-turbo-allauth | dde7b5a9aede029198f7feef41fad1160ddf9aed | [
"MIT"
] | 1 | 2021-01-25T20:35:40.000Z | 2021-02-02T19:40:44.000Z | tests/testapp/urls.py | hotwire-django/django-turbo-allauth | ce45ae042d7a5e8915aae35fd812d886b584c9ff | [
"MIT"
] | null | null | null | # Django
from django.urls import include, path
from django.views.generic import TemplateView
urlpatterns = [
path("/", TemplateView.as_view(template_name="index.html")),
path("account/", include("turbo_allauth.urls")),
]
| 25.555556 | 64 | 0.730435 | 28 | 230 | 5.892857 | 0.678571 | 0.121212 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121739 | 230 | 8 | 65 | 28.75 | 0.816832 | 0.026087 | 0 | 0 | 0 | 0 | 0.166667 | 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 |
b19f329f2eec3926605b62d5aedee61360912ac1 | 278 | py | Python | httpie_lambda.py | IlyaSukhanov/httpie-lambda | 5b4c04f4b4a64253279ef7505d78f5818f9048f7 | [
"MIT"
] | 8 | 2021-09-30T18:40:39.000Z | 2022-02-04T04:14:37.000Z | httpie_lambda.py | IlyaSukhanov/httpie-lambda | 5b4c04f4b4a64253279ef7505d78f5818f9048f7 | [
"MIT"
] | null | null | null | httpie_lambda.py | IlyaSukhanov/httpie-lambda | 5b4c04f4b4a64253279ef7505d78f5818f9048f7 | [
"MIT"
] | null | null | null | from httpie.plugins import TransportPlugin
from lambda_requests import DEFAULT_SCHEME, LambdaAdapter
class LambdaTransportPlugin(TransportPlugin):
name = "AWS Lambda invoke transport"
prefix = DEFAULT_SCHEME
def get_adapter(self):
return LambdaAdapter()
| 23.166667 | 57 | 0.776978 | 29 | 278 | 7.310345 | 0.758621 | 0.122642 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.172662 | 278 | 11 | 58 | 25.272727 | 0.921739 | 0 | 0 | 0 | 0 | 0 | 0.097122 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.285714 | 0.142857 | 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 | 0 | 1 | 1 | 0 | 0 | 3 |
b1a3b6ffb81a2f108c175c6718d941815bd9cea8 | 1,367 | py | Python | devind_helpers/files/utils.py | devind-team/devind-django-helpers | 5c64d46a12802bbe0b70e44aa9d19bf975511b6e | [
"MIT"
] | null | null | null | devind_helpers/files/utils.py | devind-team/devind-django-helpers | 5c64d46a12802bbe0b70e44aa9d19bf975511b6e | [
"MIT"
] | 4 | 2022-02-18T09:24:05.000Z | 2022-03-31T16:46:29.000Z | devind_helpers/files/utils.py | devind-team/devind-django-helpers | 5c64d46a12802bbe0b70e44aa9d19bf975511b6e | [
"MIT"
] | null | null | null | """Модуль со вспомогательными функциями."""
import pathlib
from os import path, walk
from typing import cast
from django.conf import settings
from django.db.models import FileField
__all__ = ('get_upload_to', 'get_existing_paths',)
def get_upload_to(file_field: FileField) -> str:
"""Получение значения upload_to поля файла.
:param file_field: поле файла
:return: значение upload_to поля файла
"""
return file_field.upload_to(_Stub(), '').rstrip('/') if callable(file_field.upload_to) else file_field.upload_to
def get_existing_paths(file_field: FileField) -> set[str]:
"""Получение существующих путей относительно storage.
:param file_field: поле файла
:return: существующие пути относительно storage
"""
existing_paths: set[str] = set()
for dirpath, _, filenames in walk(path.join(settings.BASE_DIR, get_upload_to(file_field))):
existing_paths.update(
pathlib.PurePath(
path.relpath(path.join(cast(str, dirpath), cast(str, fn)), settings.BASE_DIR)
).as_posix() for fn in filenames
)
return existing_paths
class _Stub:
"""Заглушка для получения пути, если upload_to является методом."""
def __getattr__(self, item):
return self
def __call__(self, *args, **kwargs):
return self
def __str__(self):
return ''
| 26.803922 | 116 | 0.687637 | 175 | 1,367 | 5.091429 | 0.422857 | 0.080808 | 0.037037 | 0.057239 | 0.109989 | 0.065095 | 0 | 0 | 0 | 0 | 0 | 0 | 0.208486 | 1,367 | 50 | 117 | 27.34 | 0.823475 | 0.24872 | 0 | 0.083333 | 0 | 0 | 0.032653 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.208333 | false | 0 | 0.208333 | 0.125 | 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 |
490df48895d25bb5714dc98e161fa1aef0a939cb | 992 | py | Python | tests/tests.py | sethlivingston/django-amptags | c1af033a2d6607466b67fd16b2d2f87b7a7fc50f | [
"0BSD"
] | null | null | null | tests/tests.py | sethlivingston/django-amptags | c1af033a2d6607466b67fd16b2d2f87b7a7fc50f | [
"0BSD"
] | 3 | 2020-02-12T01:14:48.000Z | 2021-06-10T20:36:30.000Z | tests/tests.py | sethlivingston/django-amptags | c1af033a2d6607466b67fd16b2d2f87b7a7fc50f | [
"0BSD"
] | null | null | null | from django.template import Template, Context
from django.test import TestCase
class IncludeStaticTestCase(TestCase):
""" Test the {% include_static %} template tag. """
def setUp(self):
pass
def test_resulting_file_includes_static_file(self):
# Arrange
template = Template("abc {% load amptags %}{% include_static 'tests/static_file.txt' %} xyz")
# Act
rendered = template.render(Context({}))
# Assert
self.assertIn("The quick brown fox jumped over the lazy dog.", rendered)
def test_resulting_file_includes_unescaped_static_file(self):
# Arrange
template = Template("abc {% load amptags %}{% include_static 'tests/static_file_with_escapables.txt' %} xyz")
# Act
rendered = template.render(Context({}))
# Assert
self.assertIn("The \"quick\" brown fox 'jumped' over the <lazy> dog.", rendered)
# TODO: Tests for include_css
# TODO: Tests for AMPPostMiddleware
| 28.342857 | 117 | 0.660282 | 114 | 992 | 5.578947 | 0.403509 | 0.062893 | 0.050314 | 0.062893 | 0.650943 | 0.562893 | 0.562893 | 0.562893 | 0.562893 | 0.562893 | 0 | 0 | 0.230847 | 992 | 34 | 118 | 29.176471 | 0.833552 | 0.146169 | 0 | 0.153846 | 0 | 0 | 0.296029 | 0.074609 | 0 | 0 | 0 | 0.029412 | 0.153846 | 1 | 0.230769 | false | 0.076923 | 0.153846 | 0 | 0.461538 | 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 |
490dfe66aa9da414281c514d47d1e20ee338cc08 | 3,369 | py | Python | biliob_spider/items.py | qjhqqqqq/biliob-spider | aa47addacaf0e9ea15f004765de2f0c38a6b27ec | [
"MIT"
] | 9 | 2020-06-18T15:36:45.000Z | 2021-12-10T02:27:41.000Z | biliob_spider/items.py | qjhqqqqq/biliob-spider | aa47addacaf0e9ea15f004765de2f0c38a6b27ec | [
"MIT"
] | null | null | null | biliob_spider/items.py | qjhqqqqq/biliob-spider | aa47addacaf0e9ea15f004765de2f0c38a6b27ec | [
"MIT"
] | 28 | 2020-09-25T10:36:55.000Z | 2022-01-22T02:33:01.000Z | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html
import scrapy
from mail import mailer
class SiteItem(scrapy.Item):
region_count = scrapy.Field()
all_count = scrapy.Field()
web_online = scrapy.Field()
play_online = scrapy.Field()
class TagItem(scrapy.Item):
tag_id = scrapy.Field()
tag_name = scrapy.Field()
use = scrapy.Field()
atten = scrapy.Field()
ctime = scrapy.Field()
class BangumiItem(scrapy.Item):
title = scrapy.Field()
tag = scrapy.Field()
cover = scrapy.Field()
square_cover = scrapy.Field()
is_finish = scrapy.Field()
is_started = scrapy.Field()
newest_ep_index = scrapy.Field()
data = scrapy.Field()
class VideoAndAuthorItem(scrapy.Item):
mid = scrapy.Field()
name = scrapy.Field()
face = scrapy.Field()
official = scrapy.Field()
sex = scrapy.Field()
data_video = scrapy.Field()
data_author = scrapy.Field()
level = scrapy.Field()
focus = scrapy.Field()
pts = scrapy.Field()
c_fans = scrapy.Field()
c_attention = scrapy.Field()
c_archive = scrapy.Field()
c_article = scrapy.Field()
c_archive_view = scrapy.Field()
c_article_view = scrapy.Field()
c_datetime = scrapy.Field()
channel = scrapy.Field()
aid = scrapy.Field()
datetime = scrapy.Field()
author = scrapy.Field()
data = scrapy.Field()
subChannel = scrapy.Field()
title = scrapy.Field()
mid = scrapy.Field()
pic = scrapy.Field()
current_view = scrapy.Field()
current_favorite = scrapy.Field()
current_danmaku = scrapy.Field()
current_coin = scrapy.Field()
current_share = scrapy.Field()
current_like = scrapy.Field()
current_datetime = scrapy.Field()
class VideoItem(scrapy.Item):
channel = scrapy.Field()
aid = scrapy.Field()
datetime = scrapy.Field()
author = scrapy.Field()
data = scrapy.Field()
subChannel = scrapy.Field()
title = scrapy.Field()
mid = scrapy.Field()
pic = scrapy.Field()
current_view = scrapy.Field()
current_favorite = scrapy.Field()
current_danmaku = scrapy.Field()
current_coin = scrapy.Field()
current_share = scrapy.Field()
current_like = scrapy.Field()
current_datetime = scrapy.Field()
class AuthorItem(scrapy.Item):
mid = scrapy.Field()
name = scrapy.Field()
face = scrapy.Field()
official = scrapy.Field()
sex = scrapy.Field()
data = scrapy.Field()
level = scrapy.Field()
focus = scrapy.Field()
pts = scrapy.Field()
c_fans = scrapy.Field()
c_attention = scrapy.Field()
c_archive = scrapy.Field()
c_article = scrapy.Field()
c_archive_view = scrapy.Field()
c_article_view = scrapy.Field()
c_datetime = scrapy.Field()
class RankItem(scrapy.Item):
title = scrapy.Field()
author = scrapy.Field()
aid = scrapy.Field()
pts = scrapy.Field()
mid = scrapy.Field()
channel = scrapy.Field()
class VideoOnline(scrapy.Item):
title = scrapy.Field()
author = scrapy.Field()
data = scrapy.Field()
aid = scrapy.Field()
subChannel = scrapy.Field()
channel = scrapy.Field()
class VideoWatcherItem(scrapy.Item):
mid = scrapy.Field()
aid = scrapy.Field()
channels = scrapy.Field()
| 25.141791 | 52 | 0.646186 | 401 | 3,369 | 5.316708 | 0.216958 | 0.500469 | 0.078799 | 0.04925 | 0.717636 | 0.649625 | 0.61773 | 0.61773 | 0.570356 | 0.570356 | 0 | 0.000381 | 0.220837 | 3,369 | 133 | 53 | 25.330827 | 0.81181 | 0.041555 | 0 | 0.731481 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.018519 | 0 | 1 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
4910f5e2fda66f9cb3108f5d15a83dd5df0f170b | 377 | py | Python | HE_RE/controllers/controller_connection.py | karniv0re-cyber/HiddenEyeReborn | 68920836179011f53523e3656d07eade73b8b834 | [
"Unlicense"
] | 2 | 2020-12-16T08:38:24.000Z | 2021-03-15T06:10:06.000Z | HE_RE/controllers/controller_connection.py | karniv0re-cyber/HiddenEyeReborn | 68920836179011f53523e3656d07eade73b8b834 | [
"Unlicense"
] | null | null | null | HE_RE/controllers/controller_connection.py | karniv0re-cyber/HiddenEyeReborn | 68920836179011f53523e3656d07eade73b8b834 | [
"Unlicense"
] | 2 | 2020-11-22T12:45:44.000Z | 2021-03-15T06:10:07.000Z | from HE_RE.models.model_connection import ConnectionModel
import urllib.request
class ConnectionController:
def __init__(self, host, model=ConnectionModel()):
self._model = model
self._host = host if not None else self._model.host
def verify_connection(self):
return True if urllib.request.urlopen(url=self._host).getcode() == 200 else False
| 31.416667 | 89 | 0.734748 | 49 | 377 | 5.428571 | 0.571429 | 0.090226 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009709 | 0.180371 | 377 | 11 | 90 | 34.272727 | 0.851133 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 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 |
492deb95983b6f3881d1fea740b3f3ea57a57b60 | 2,624 | py | Python | src/emuvim/api/osm/pre_configured_osm.py | RafaelSche/vim-emu | 6503ba9fcbe13ca73c94d318157a1ba78ef26b5b | [
"Apache-2.0"
] | 34 | 2016-09-05T06:11:12.000Z | 2021-12-24T08:45:24.000Z | src/emuvim/api/osm/pre_configured_osm.py | RafaelSche/vim-emu | 6503ba9fcbe13ca73c94d318157a1ba78ef26b5b | [
"Apache-2.0"
] | 89 | 2016-07-19T14:14:27.000Z | 2020-01-09T07:19:45.000Z | src/emuvim/api/osm/pre_configured_osm.py | RafaelSche/vim-emu | 6503ba9fcbe13ca73c94d318157a1ba78ef26b5b | [
"Apache-2.0"
] | 32 | 2016-07-19T14:58:06.000Z | 2020-05-05T13:30:01.000Z | #!/usr/bin/env python2
# Copyright (c) 2019 Erik Schilling
# ALL RIGHTS RESERVED.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
from emuvim.api.openstack.openstack_api_endpoint import OpenstackApiEndpoint
from emuvim.api.osm.osm import OSM
from emuvim.dcemulator.net import DCNetwork
class PreConfiguredOSM:
def __init__(self,
vca_host=os.environ.get('VCA_HOST'),
vca_secret=os.environ.get('VCA_SECRET'),
osm_version='releasefive-daily'):
self.net = DCNetwork(monitor=False, enable_learning=True)
dc1 = self.net.addDatacenter("dc1")
self.api = OpenstackApiEndpoint("0.0.0.0", 6001)
self.api.connect_datacenter(dc1)
self.api.connect_dc_network(self.net)
s1 = self.net.addSwitch('s1')
self.osm = OSM(self.net, s1, vca_host=vca_host, vca_secret=vca_secret, osm_version=osm_version)
self.vim_emu_id = None
def __enter__(self):
self.start()
return self
def __exit__(self, exc_type, exc_val, exc_tb):
self.stop()
def start(self):
self.net.start()
self.api.start()
self.osm.start()
self.vim_emu_id = self.osm.register_emulated_api('emu-vim1', self.api)
def stop(self):
self.api.stop()
self.net.stop()
def ns_create(self, ns_name, nsd_id):
return self.osm.ns_create(ns_name, nsd_id, self.vim_emu_id)
# forward api related calls
def onboard_vnfd(self, *args, **kwargs):
return self.osm.onboard_vnfd(*args, **kwargs)
def onboard_nsd(self, *args, **kwargs):
return self.osm.onboard_nsd(*args, **kwargs)
def ns_list(self):
return self.osm.ns_list()
def ns_delete(self, *args, **kwargs):
return self.osm.ns_delete(*args, **kwargs)
def ns_get(self, *args, **kwargs):
return self.osm.ns_get(*args, **kwargs)
def ns_action(self, *args, **kwargs):
return self.osm.ns_action(*args, **kwargs)
def ns_wait_until_all_in_status(self, *args, **kwargs):
return self.osm.ns_wait_until_all_in_status(*args, **kwargs)
| 32.8 | 103 | 0.672256 | 378 | 2,624 | 4.486772 | 0.375661 | 0.070755 | 0.061321 | 0.053066 | 0.133255 | 0.133255 | 0.108491 | 0 | 0 | 0 | 0 | 0.011622 | 0.213034 | 2,624 | 79 | 104 | 33.21519 | 0.809685 | 0.237424 | 0 | 0 | 0 | 0 | 0.027708 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.282609 | false | 0 | 0.086957 | 0.173913 | 0.586957 | 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 |
493dc59641a0a0f274685bae420fb2990bafd1fa | 2,503 | py | Python | deepself/models/model_managers/base_model_manager.py | Tomoya-K-0504/deepSELF | 0e5a7d0169b3e9edcb5c8d9802140a84ce5cb69a | [
"MIT"
] | 1 | 2021-08-17T09:56:47.000Z | 2021-08-17T09:56:47.000Z | deepself/models/model_managers/base_model_manager.py | JIangjiang1108/deepSELF | 0e5a7d0169b3e9edcb5c8d9802140a84ce5cb69a | [
"MIT"
] | null | null | null | deepself/models/model_managers/base_model_manager.py | JIangjiang1108/deepSELF | 0e5a7d0169b3e9edcb5c8d9802140a84ce5cb69a | [
"MIT"
] | 1 | 2021-08-17T09:56:41.000Z | 2021-08-17T09:56:41.000Z | import logging
from abc import ABCMeta, abstractmethod
logger = logging.getLogger(__name__)
import numpy as np
from deepself.models.loss import set_criterion
from dataclasses import dataclass, field
from deepself.models.loss import LossConfig
from typing import List, Any
from omegaconf import MISSING
from deepself.utils.enums import TaskType, ModelType
@dataclass
class ModelConfig: # ML/DL model arguments
model_name: str = ''
model_path: str = '../output/models/sth.pth' # Path to save model
early_stopping: bool = False # Early stopping with validation data
return_prob: bool = False # Returns probability, not predicted labels
loss_config: LossConfig = LossConfig()
checkpoint_path: str = '' # Model weight file to load model
amp: bool = False # Mixed precision training
input_size: List[int] = field(default_factory=lambda: [])
# TODO train_managerと共有したままなのか、継承によって消すのか
class_names: List[str] = field(default_factory=lambda: ['0', '1'])
task_type: TaskType = TaskType.classify
cuda: bool = True # Use cuda to train a model
transfer: bool = False # TODO modify this or remove this feature # Transfer learning from model_path
model_type: ModelType = ModelType.cnn
optim: Any = MISSING
@dataclass
class ExtendedModelConfig(ModelConfig):
mixup_alpha: float = 0.0 # Beta distirbution alpha for mixup
class BaseModelManager(metaclass=ABCMeta):
def __init__(self, class_labels, cfg):
self.class_labels = class_labels
self.cfg = cfg
self.criterion = set_criterion(self.cfg.loss_config, self.cfg.task_type.value, self.cfg.class_names)
self.fitted = False
def anneal_lr(self, learning_anneal):
pass
@abstractmethod
def fit(self, inputs, labels, phase):
pass
def save_model(self):
logger.info(f"Best model is saved to {self.cfg['model_path']}")
self.model.save_model(self.cfg['model_path'])
def load_model(self):
# MLModelは各Modelがfittedを管理しているため、エラーハンドリングの必要がない
try:
self.model.load_model(self.cfg['model_path'])
print('Saved model loaded.')
except FileNotFoundError as e:
print(e)
print(f"trained model file doesn't exist at {self.cfg['model_path']}")
exit(1)
self.fitted = self.model.fitted
@abstractmethod
def predict(self, inputs) -> np.array:
pass
def update_by_epoch(self, phase):
pass
| 30.901235 | 108 | 0.688374 | 317 | 2,503 | 5.299685 | 0.44164 | 0.033333 | 0.028571 | 0.038095 | 0.058333 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002576 | 0.224531 | 2,503 | 80 | 109 | 31.2875 | 0.862957 | 0.15861 | 0 | 0.140351 | 0 | 0 | 0.082179 | 0.0344 | 0 | 0 | 0 | 0.0125 | 0 | 1 | 0.122807 | false | 0.070175 | 0.157895 | 0 | 0.596491 | 0.052632 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
4953c7ce1da0dd21e42b954f78cffcc6678f12b4 | 453 | py | Python | nonbonded/tests/library/utilities/test_molecules.py | SimonBoothroyd/nonbonded | 3efbb7d943d936b47248975f9ad0d8a006ea8684 | [
"MIT"
] | 5 | 2020-05-11T18:25:00.000Z | 2022-01-27T10:55:09.000Z | nonbonded/tests/library/utilities/test_molecules.py | SimonBoothroyd/nonbonded | 3efbb7d943d936b47248975f9ad0d8a006ea8684 | [
"MIT"
] | 88 | 2020-06-02T14:40:05.000Z | 2022-03-02T09:20:39.000Z | nonbonded/tests/library/utilities/test_molecules.py | SimonBoothroyd/nonbonded | 3efbb7d943d936b47248975f9ad0d8a006ea8684 | [
"MIT"
] | null | null | null | from nonbonded.library.utilities.molecules import (
smiles_to_url_string,
url_string_to_smiles,
)
def test_smiles_to_url_string():
"""A simple test that a smiles pattern with a forbidden url
character is correctly encoded."""
assert smiles_to_url_string("N#N") == "N%23N"
def test_url_string_to_smiles():
"""A simple test that a url encoded smiles pattern can be decoded."""
assert url_string_to_smiles("N%23N") == "N#N"
| 28.3125 | 73 | 0.724062 | 71 | 453 | 4.338028 | 0.394366 | 0.175325 | 0.107143 | 0.165584 | 0.103896 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010667 | 0.172185 | 453 | 15 | 74 | 30.2 | 0.810667 | 0.335541 | 0 | 0 | 0 | 0 | 0.055944 | 0 | 0 | 0 | 0 | 0 | 0.25 | 1 | 0.25 | true | 0 | 0.125 | 0 | 0.375 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4954bdd8f0f9c2c7478c0bce2893917ad3840042 | 81 | py | Python | Src/StdLib/Lib/test/crashers/compiler_recursion.py | cwensley/ironpython2 | f854444e1e08afc8850cb7c1a739a7dd2d10d32a | [
"Apache-2.0"
] | 2,557 | 2016-07-19T22:20:45.000Z | 2022-01-25T10:53:35.000Z | build/cmd/win32/Python27/Lib/test/crashers/compiler_recursion.py | IamBaoMouMou/AliOS-Things | 195a9160b871b3d78de6f8cf6c2ab09a71977527 | [
"Apache-2.0"
] | 1,360 | 2016-07-20T02:06:42.000Z | 2021-07-27T12:46:40.000Z | build/cmd/win32/Python27/Lib/test/crashers/compiler_recursion.py | IamBaoMouMou/AliOS-Things | 195a9160b871b3d78de6f8cf6c2ab09a71977527 | [
"Apache-2.0"
] | 607 | 2016-07-20T03:34:04.000Z | 2022-01-05T14:57:09.000Z | """
The compiler (>= 2.5) recurses happily.
"""
compile('()'*9**5, '?', 'exec')
| 13.5 | 39 | 0.506173 | 10 | 81 | 4.1 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.057971 | 0.148148 | 81 | 5 | 40 | 16.2 | 0.536232 | 0.481481 | 0 | 0 | 0 | 0 | 0.205882 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
495e3870592b41bb8f808a81e4942ce05625afd2 | 85 | py | Python | client_django/makes/apps.py | kaparis/spa101 | 0c225d0676a13a33950aca5954c02b443237149d | [
"MIT"
] | null | null | null | client_django/makes/apps.py | kaparis/spa101 | 0c225d0676a13a33950aca5954c02b443237149d | [
"MIT"
] | null | null | null | client_django/makes/apps.py | kaparis/spa101 | 0c225d0676a13a33950aca5954c02b443237149d | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class MakesConfig(AppConfig):
name = 'makes'
| 14.166667 | 33 | 0.741176 | 10 | 85 | 6.3 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.176471 | 85 | 5 | 34 | 17 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0.058824 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
62057eebe5c5f48d787c17ee3501025ebe975b4f | 90 | py | Python | text/_elisp/face/font/shape/height.py | jedhsu/text | 8525b602d304ac571a629104c48703443244545c | [
"Apache-2.0"
] | null | null | null | text/_elisp/face/font/shape/height.py | jedhsu/text | 8525b602d304ac571a629104c48703443244545c | [
"Apache-2.0"
] | null | null | null | text/_elisp/face/font/shape/height.py | jedhsu/text | 8525b602d304ac571a629104c48703443244545c | [
"Apache-2.0"
] | null | null | null | from enum import Enum
__all__ = [
"FontHeight",
]
class FontHeight(Enum):
pass
| 9 | 23 | 0.644444 | 10 | 90 | 5.4 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.255556 | 90 | 9 | 24 | 10 | 0.80597 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.166667 | 0.166667 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
6253ade39a1700889d158f53d9b0fd965ec67be8 | 34 | py | Python | __init__.py | Iamshankhadeep/pyBoost | bcd2f277461e52c8742918057ca27369fee7fd54 | [
"MIT"
] | null | null | null | __init__.py | Iamshankhadeep/pyBoost | bcd2f277461e52c8742918057ca27369fee7fd54 | [
"MIT"
] | null | null | null | __init__.py | Iamshankhadeep/pyBoost | bcd2f277461e52c8742918057ca27369fee7fd54 | [
"MIT"
] | null | null | null | __title__ = 'pyBoost'
name="hello" | 17 | 21 | 0.735294 | 4 | 34 | 5.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.088235 | 34 | 2 | 22 | 17 | 0.677419 | 0 | 0 | 0 | 0 | 0 | 0.342857 | 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 |
6272e1488872dd4ec144c258b8a1c294bc346ebe | 174 | py | Python | Question 1 - 10/Q2.py | debdutgoswami/python-semester-practical | 9abdc9091d825a2425b36437f6f8fe6806ac84f2 | [
"MIT"
] | null | null | null | Question 1 - 10/Q2.py | debdutgoswami/python-semester-practical | 9abdc9091d825a2425b36437f6f8fe6806ac84f2 | [
"MIT"
] | null | null | null | Question 1 - 10/Q2.py | debdutgoswami/python-semester-practical | 9abdc9091d825a2425b36437f6f8fe6806ac84f2 | [
"MIT"
] | null | null | null | l = [int(i) for i in input().split()]
print("largest - ", max(l))
print('smallest - ', min(l))
print('2nd largest - ', sorted(l)[-2])
print('2nd smallest - ', sorted(l)[1]) | 24.857143 | 38 | 0.58046 | 28 | 174 | 3.607143 | 0.571429 | 0.118812 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.027027 | 0.149425 | 174 | 7 | 39 | 24.857143 | 0.655405 | 0 | 0 | 0 | 0 | 0 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.8 | 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 |
6277734578e9c94f7192887363344b2a839309a1 | 1,177 | py | Python | models.py | lmptfy/homework | 7d756e4199aa614b74c63910d5e8b5675e37ce2b | [
"CECILL-B"
] | null | null | null | models.py | lmptfy/homework | 7d756e4199aa614b74c63910d5e8b5675e37ce2b | [
"CECILL-B"
] | null | null | null | models.py | lmptfy/homework | 7d756e4199aa614b74c63910d5e8b5675e37ce2b | [
"CECILL-B"
] | null | null | null | # Import external dependencies
from sqlalchemy import Column, Integer, Float
from typing import Optional
# Import local dependency
from db import Base
# Define class
class Experience(Base):
__tablename__ = "experiences"
__table_args__ = {'sqlite_autoincrement': True}
# Mandatory fields
id = Column(Integer,primary_key=True, index=True, nullable=False)
Machine_N_cycles = Column(Integer)
Machine_Load = Column(Float)
Machine_Displacement = Column(Float)
# Optional fields, set by default to None
# index: Optional[Column(Integer)] = None
# Camera_N_cycles: Optional[Column(Float)] = None
# exx: Optional[Column(Float)] = None
# eyy: Optional[Column(Float)] = None
# exy: Optional[Column(Float)] = None
# crack_length: Optional[Column(Float)] = None
# Th_time: Optional[Column(Time)] = None
# Th_N_cycles: Optional[Column(Float)] = None
# Th_specimen_max: Optional[Column(Float)] = None
# Th_specimen_mean: Optional[Column(Float)] = None
# Th_chamber: Optional[Column(Float)] = None
# Th_uppergrips: Optional[Column(Float)] = None
# Th_lowergrips: Optional[Column(Float)] = None
| 33.628571 | 69 | 0.700935 | 142 | 1,177 | 5.612676 | 0.394366 | 0.179423 | 0.262233 | 0.31744 | 0.254705 | 0.129235 | 0 | 0 | 0 | 0 | 0 | 0 | 0.189465 | 1,177 | 35 | 70 | 33.628571 | 0.83543 | 0.57689 | 0 | 0 | 0 | 0 | 0.064583 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.3 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
627b4d38542eb87cca249e80fdc665dcbbde1334 | 284 | py | Python | ecosystem/models/tier.py | ryanfmandelbaum/ecosystem | ca78ffe6dc4fd5589286d796a90655866a13b02a | [
"Apache-2.0"
] | null | null | null | ecosystem/models/tier.py | ryanfmandelbaum/ecosystem | ca78ffe6dc4fd5589286d796a90655866a13b02a | [
"Apache-2.0"
] | null | null | null | ecosystem/models/tier.py | ryanfmandelbaum/ecosystem | ca78ffe6dc4fd5589286d796a90655866a13b02a | [
"Apache-2.0"
] | null | null | null | """Tier of ecosystem membership."""
# pylint: disable=too-few-public-methods
class Tier:
"""Tiers of ecosystem membership."""
MAIN: str = "MAIN"
MEMBER: str = "MEMBER"
CANDIDATE: str = "CANDIDATE"
COMMUNITY: str = "COMMUNITY"
PROTOTYPES: str = "PROTOTYPES"
| 21.846154 | 40 | 0.644366 | 31 | 284 | 5.903226 | 0.580645 | 0.120219 | 0.229508 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.211268 | 284 | 12 | 41 | 23.666667 | 0.816964 | 0.352113 | 0 | 0 | 0 | 0 | 0.219653 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
655b42cade171558f16522b2eb3bd97781d27abe | 3,170 | py | Python | pysnmp/ELTEX-IP-OSPF-IF-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/ELTEX-IP-OSPF-IF-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/ELTEX-IP-OSPF-IF-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module ELTEX-IP-OSPF-IF-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ELTEX-IP-OSPF-IF-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:45:50 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueRangeConstraint", "ValueSizeConstraint")
eltMes, = mibBuilder.importSymbols("ELTEX-MES", "eltMes")
eltMesOspf, = mibBuilder.importSymbols("ELTEX-MES-IP", "eltMesOspf")
PortList, = mibBuilder.importSymbols("Q-BRIDGE-MIB", "PortList")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
TimeTicks, Gauge32, ObjectIdentity, Counter32, Unsigned32, MibIdentifier, Counter64, NotificationType, ModuleIdentity, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, iso, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "Gauge32", "ObjectIdentity", "Counter32", "Unsigned32", "MibIdentifier", "Counter64", "NotificationType", "ModuleIdentity", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "iso", "IpAddress")
TextualConvention, DisplayString, RowStatus, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "RowStatus", "TruthValue")
eltIpOspfIfTable = MibTable((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2), )
if mibBuilder.loadTexts: eltIpOspfIfTable.setStatus('current')
eltIpOspfIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1), ).setIndexNames((0, "ELTEX-IP-OSPF-IF-MIB", "eltOspfIfAddress"))
if mibBuilder.loadTexts: eltIpOspfIfEntry.setStatus('current')
eltOspfIfAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1, 1), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: eltOspfIfAddress.setStatus('current')
eltOspfIfPassiveDefault = MibTableColumn((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1, 2), TruthValue().clone('false')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: eltOspfIfPassiveDefault.setStatus('current')
eltOspfIfPassiveList = MibTableColumn((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1, 3), PortList()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: eltOspfIfPassiveList.setStatus('current')
eltOspfIfStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 35265, 1, 23, 91, 1, 2, 1, 4), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: eltOspfIfStatus.setStatus('current')
mibBuilder.exportSymbols("ELTEX-IP-OSPF-IF-MIB", eltOspfIfAddress=eltOspfIfAddress, eltOspfIfPassiveDefault=eltOspfIfPassiveDefault, eltIpOspfIfTable=eltIpOspfIfTable, eltOspfIfStatus=eltOspfIfStatus, eltIpOspfIfEntry=eltIpOspfIfEntry, eltOspfIfPassiveList=eltOspfIfPassiveList)
| 105.666667 | 477 | 0.769716 | 346 | 3,170 | 7.052023 | 0.33815 | 0.084836 | 0.007377 | 0.009836 | 0.379098 | 0.233197 | 0.206967 | 0.206967 | 0.206967 | 0.206967 | 0 | 0.064217 | 0.081388 | 3,170 | 29 | 478 | 109.310345 | 0.773695 | 0.105363 | 0 | 0 | 0 | 0 | 0.232048 | 0.015564 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.227273 | 0.409091 | 0 | 0.409091 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 3 |
6568c51521af4616a5ed9aaaedb889b7e95af209 | 1,430 | py | Python | prefix_list_item.py | jokerxs/pyez_resources | 22dc9d341b38fdccdb6832cc46746cc0f48913aa | [
"Apache-2.0"
] | null | null | null | prefix_list_item.py | jokerxs/pyez_resources | 22dc9d341b38fdccdb6832cc46746cc0f48913aa | [
"Apache-2.0"
] | null | null | null | prefix_list_item.py | jokerxs/pyez_resources | 22dc9d341b38fdccdb6832cc46746cc0f48913aa | [
"Apache-2.0"
] | null | null | null | # 3rd-party modules
from lxml.builder import E
# local module
from jnpr.junos.cfg import Resource
from jnpr.junos import jxml as JXML
class PrefixListItem(Resource):
"""
[edit policy-options prefix-list <name> prefix-list-item <item> ]
Resource name: str
<name> is the prefix-list name
"""
# there are no properties, since the name is the actual data
PROPERTIES = []
# -----------------------------------------------------------------------
# XML readers
# -----------------------------------------------------------------------
def _xml_at_top(self):
return E('policy-options', E('prefix-list',
E.name(self.P.name),
E('prefix-list-item', E.name(self._name))
))
def _xml_at_res(self, xml):
return xml.find('.//prefix-list-item')
def _xml_to_py(self, has_xml, has_py):
Resource._r_has_xml_status(has_xml, has_py)
# -----------------------------------------------------------------------
# Manager List, Catalog
# -----------------------------------------------------------------------
def _r_list(self):
# the key list comes from the parent object.
self._rlist = self.P['$prefix_list_items']
def _r_catalog(self):
# no catalog but the keys
self._rcatalog = dict((k, None) for k in self.list)
| 28.6 | 78 | 0.465734 | 155 | 1,430 | 4.129032 | 0.425806 | 0.109375 | 0.065625 | 0.034375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000933 | 0.25035 | 1,430 | 49 | 79 | 29.183673 | 0.596082 | 0.418182 | 0 | 0 | 0 | 0 | 0.104278 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.277778 | false | 0 | 0.166667 | 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 |
657553638013785ae327eec969ea634cd704a6f0 | 304 | py | Python | examples/docs_snippets/docs_snippets/deploying/dask_hello_world.py | bitdotioinc/dagster | 4fe395a37b206b1a48b956fa5dd72bf698104cca | [
"Apache-2.0"
] | 1 | 2021-04-27T19:49:59.000Z | 2021-04-27T19:49:59.000Z | examples/docs_snippets/docs_snippets/deploying/dask_hello_world.py | bitdotioinc/dagster | 4fe395a37b206b1a48b956fa5dd72bf698104cca | [
"Apache-2.0"
] | 7 | 2022-03-16T06:55:04.000Z | 2022-03-18T07:03:25.000Z | examples/docs_snippets/docs_snippets/deploying/dask_hello_world.py | bitdotioinc/dagster | 4fe395a37b206b1a48b956fa5dd72bf698104cca | [
"Apache-2.0"
] | null | null | null | from dagster_dask import dask_executor
from dagster import ModeDefinition, default_executors, pipeline, solid
@solid
def hello_world(_):
return "Hello, World!"
@pipeline(mode_defs=[ModeDefinition(executor_defs=default_executors + [dask_executor])])
def dask_pipeline():
return hello_world()
| 21.714286 | 88 | 0.786184 | 37 | 304 | 6.162162 | 0.432432 | 0.131579 | 0.140351 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121711 | 304 | 13 | 89 | 23.384615 | 0.853933 | 0 | 0 | 0 | 0 | 0 | 0.042763 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0.25 | 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 |
658550c3abc050dde80f8473853c65e4725d8d43 | 360 | py | Python | LNMarketBot/Data.py | DivyanshuBagga/LNMarketBot | 7f3d63651fd8636c83b13675d505a53b62da31d3 | [
"MIT"
] | 2 | 2021-07-23T16:26:50.000Z | 2022-03-08T18:19:14.000Z | LNMarketBot/Data.py | DivyanshuBagga/LNMarketBot | 7f3d63651fd8636c83b13675d505a53b62da31d3 | [
"MIT"
] | 2 | 2021-02-07T16:08:16.000Z | 2021-02-12T12:40:15.000Z | LNMarketBot/Data.py | DivyanshuBagga/LNMarketBot | 7f3d63651fd8636c83b13675d505a53b62da31d3 | [
"MIT"
] | null | null | null | from abc import ABCMeta, abstractmethod
class Data(metaclass=ABCMeta):
def __init__(self):
pass
@abstractmethod
def dataGenerator(self):
"""
Genrtator which yields datetime index dataframe containing
open, high, low, and close prices with volume
for each new price bar recieved.
"""
pass
| 21.176471 | 66 | 0.636111 | 39 | 360 | 5.769231 | 0.871795 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.302778 | 360 | 16 | 67 | 22.5 | 0.896414 | 0.380556 | 0 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0.285714 | 0.142857 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
65c00e7e791b0867d451df61e9952f54d731cd11 | 326 | py | Python | quickstart.py | socialbotspy/TwitPy | c0e3499bf1988421a268a924f1779d1c58f7a3c1 | [
"MIT"
] | 3 | 2019-08-12T02:15:12.000Z | 2020-07-23T15:12:05.000Z | quickstart.py | socialbotspy/TwitPy | c0e3499bf1988421a268a924f1779d1c58f7a3c1 | [
"MIT"
] | null | null | null | quickstart.py | socialbotspy/TwitPy | c0e3499bf1988421a268a924f1779d1c58f7a3c1 | [
"MIT"
] | null | null | null | from twitpy import TwitPy
try:
import config
except ImportError:
raise ImportError("Missing config.py. Did you copy it from config.py.dist?")
TwitPy(username=config.USERNAME, password=config.PASSWORD,
chrome_path=config.CHROME_PATH) \
.login() \
.follow_from_recom(amount=5) \
.unfollow_users(amount=5) \
.end() | 27.166667 | 78 | 0.748466 | 45 | 326 | 5.311111 | 0.6 | 0.066946 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007067 | 0.131902 | 326 | 12 | 79 | 27.166667 | 0.837456 | 0 | 0 | 0 | 0 | 0 | 0.168196 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.090909 | 0.363636 | 0 | 0.363636 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 3 |
65c34dd8e68922a408adfc32fa780a41a9fe7cac | 94 | py | Python | maya/app/renderSetup/views/propertyEditor/overridePropertyEditorStrings.py | arjun-namdeo/py_stubs | 605bb167e239978f5417f3f1fc1f5c12e2a243cc | [
"MIT"
] | null | null | null | maya/app/renderSetup/views/propertyEditor/overridePropertyEditorStrings.py | arjun-namdeo/py_stubs | 605bb167e239978f5417f3f1fc1f5c12e2a243cc | [
"MIT"
] | null | null | null | maya/app/renderSetup/views/propertyEditor/overridePropertyEditorStrings.py | arjun-namdeo/py_stubs | 605bb167e239978f5417f3f1fc1f5c12e2a243cc | [
"MIT"
] | null | null | null | kDragAttributeFromAE = []
kIncompatibleAttribute = []
kInvalidAttribute = []
kLayer = []
| 9.4 | 27 | 0.691489 | 4 | 94 | 16.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.180851 | 94 | 9 | 28 | 10.444444 | 0.844156 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 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 |
65dc9b52b1f2481a5083dca6893099a4499124c6 | 170 | py | Python | tests/context.py | yunleopard/data_py | c98fc075569732bac67a8f60719a39b1e1cc6eeb | [
"Apache-2.0"
] | null | null | null | tests/context.py | yunleopard/data_py | c98fc075569732bac67a8f60719a39b1e1cc6eeb | [
"Apache-2.0"
] | null | null | null | tests/context.py | yunleopard/data_py | c98fc075569732bac67a8f60719a39b1e1cc6eeb | [
"Apache-2.0"
] | null | null | null | '''
Created on Nov 12, 2018
@author: yangzh
'''
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import OS_Script | 17 | 82 | 0.705882 | 28 | 170 | 4.107143 | 0.642857 | 0.156522 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.046358 | 0.111765 | 170 | 10 | 83 | 17 | 0.715232 | 0.235294 | 0 | 0 | 0 | 0 | 0.01626 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.75 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
65e5ac31b7eac4be4eb4a250085f56a424aff7bc | 1,245 | py | Python | core/logging/logger.py | droidsec-cn/lobotomy-1 | e801a89b98a67722383e2597b388778c536c8cd3 | [
"Apache-2.0"
] | 4 | 2018-09-29T08:55:23.000Z | 2021-06-01T04:54:49.000Z | core/logging/logger.py | droidsec-cn/lobotomy-1 | e801a89b98a67722383e2597b388778c536c8cd3 | [
"Apache-2.0"
] | null | null | null | core/logging/logger.py | droidsec-cn/lobotomy-1 | e801a89b98a67722383e2597b388778c536c8cd3 | [
"Apache-2.0"
] | 2 | 2020-03-22T02:16:46.000Z | 2021-05-31T14:04:44.000Z | from blessings import Terminal
from datetime import datetime
class Logger(object):
def __init__(self):
self.t = Terminal()
def log(self, t, m):
"""
Log a message to the console.
Args:
param1: Type of log {info, warn, critical}
param2: Log message
Returns:
None
"""
if t == "info":
print(self.t.green("[{}] ".format(datetime.now())) +
"{}".format(m))
if t == "warn":
print(self.t.yellow("[{}] ".format(datetime.now())) +
self.t.white("{}".format(m)))
elif t == "critical":
print(self.t.red("[{}] ".format(datetime.now())) +
self.t.white("{}".format(m)))
def surgical_log(self, t, m):
"""
Log a message to the console.
Args:
param1: Type of log {info, warn, critical}
param2: Log message
Returns:
None
"""
if t == "info":
print(self.t.yellow("[{}] ".format(datetime.now())) + "{}".format(m))
elif t == "critical":
print(self.t.red("[{}] ".format(datetime.now())) +
self.t.white("{}".format(m)))
| 27.065217 | 81 | 0.458635 | 135 | 1,245 | 4.192593 | 0.288889 | 0.097173 | 0.088339 | 0.111307 | 0.787986 | 0.745583 | 0.745583 | 0.676678 | 0.628975 | 0.628975 | 0 | 0.005076 | 0.367068 | 1,245 | 45 | 82 | 27.666667 | 0.713198 | 0.203213 | 0 | 0.428571 | 0 | 0 | 0.072832 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.095238 | 0 | 0.285714 | 0.238095 | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.