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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c74bcfc2ced347db268162f7092cf78c85a91da | 2,571 | py | Python | consul/tests/test_e2e.py | tanner-bruce/integrations-core | 36337b84fefb73e94d4f1ee28aaeb669dc12fb59 | [
"BSD-3-Clause"
] | null | null | null | consul/tests/test_e2e.py | tanner-bruce/integrations-core | 36337b84fefb73e94d4f1ee28aaeb669dc12fb59 | [
"BSD-3-Clause"
] | null | null | null | consul/tests/test_e2e.py | tanner-bruce/integrations-core | 36337b84fefb73e94d4f1ee28aaeb669dc12fb59 | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2019-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import pytest
from datadog_checks.consul import ConsulCheck
from . import common
pytestmark = pytest.mark.e2e
def test_e2e(dd_agent_check, instance_single_node_install):
aggregator = dd_agent_check(instance_single_node_install, rate=True)
aggregator.assert_metric('consul.peers', count=2)
aggregator.assert_metric('consul.catalog.nodes_critical', count=2)
aggregator.assert_metric('consul.catalog.services_passing', count=6)
aggregator.assert_metric('consul.catalog.nodes_warning', count=2)
aggregator.assert_metric('consul.catalog.services_warning', count=6)
aggregator.assert_metric('consul.catalog.services_critical', count=6)
aggregator.assert_metric('consul.catalog.services_up', count=6)
aggregator.assert_metric('consul.catalog.nodes_passing', count=2)
aggregator.assert_metric('consul.catalog.nodes_up', count=2)
aggregator.assert_metric('consul.catalog.total_nodes', count=2)
aggregator.assert_service_check(
'consul.up', ConsulCheck.OK, tags=['consul_datacenter:dc1', 'consul_url:http://{}:8500'.format(common.HOST)]
)
aggregator.assert_service_check('consul.check', ConsulCheck.OK, tags=['check:serfHealth', 'consul_datacenter:dc1'])
aggregator.assert_service_check(
'consul.can_connect', ConsulCheck.OK, tags=['url:http://{}:8500/v1/status/leader'.format(common.HOST)]
)
aggregator.assert_service_check(
'consul.can_connect', ConsulCheck.OK, tags=['url:http://{}:8500/v1/status/peers'.format(common.HOST)]
)
aggregator.assert_service_check(
'consul.can_connect', ConsulCheck.OK, tags=['url:http://{}:8500/v1/agent/self'.format(common.HOST)]
)
aggregator.assert_service_check(
'consul.can_connect', ConsulCheck.OK, tags=['url:http://{}:8500/v1/health/state/any'.format(common.HOST)]
)
aggregator.assert_service_check(
'consul.can_connect', ConsulCheck.OK, tags=['url:http://{}:8500/v1/catalog/services'.format(common.HOST)]
)
aggregator.assert_service_check(
'consul.can_connect', ConsulCheck.OK, tags=['url:http://{}:8500/v1/catalog/nodes'.format(common.HOST)]
)
aggregator.assert_service_check(
'consul.can_connect', ConsulCheck.OK, tags=['url:http://{}:8500/v1/coordinate/datacenters'.format(common.HOST)]
)
aggregator.assert_service_check(
'consul.can_connect', ConsulCheck.OK, tags=['url:http://{}:8500/v1/coordinate/nodes'.format(common.HOST)]
)
| 46.745455 | 119 | 0.730844 | 324 | 2,571 | 5.608025 | 0.222222 | 0.176114 | 0.121079 | 0.1541 | 0.731425 | 0.712713 | 0.712713 | 0.649422 | 0.412768 | 0.412768 | 0 | 0.027373 | 0.11902 | 2,571 | 54 | 120 | 47.611111 | 0.774834 | 0.039673 | 0 | 0.204545 | 0 | 0 | 0.327789 | 0.120081 | 0 | 0 | 0 | 0 | 0.454545 | 1 | 0.022727 | false | 0.045455 | 0.068182 | 0 | 0.090909 | 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 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1c81db8fdb3114c38f3296b315146b2c8945f11a | 9,815 | py | Python | tf_encrypted/tensor/int64.py | bendecoste/tf-encrypted | 00c9b80435411299a518f777de644c61d64cceea | [
"Apache-2.0"
] | null | null | null | tf_encrypted/tensor/int64.py | bendecoste/tf-encrypted | 00c9b80435411299a518f777de644c61d64cceea | [
"Apache-2.0"
] | null | null | null | tf_encrypted/tensor/int64.py | bendecoste/tf-encrypted | 00c9b80435411299a518f777de644c61d64cceea | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from typing import Union, List, Dict, Any, Tuple, Optional
import numpy as np
import tensorflow as tf
from .factory import AbstractFactory, AbstractTensor, AbstractVariable, AbstractConstant, AbstractPlaceholder
from .helpers import inverse
from .shared import binarize, conv2d, im2col
from ..types import Slice, Ellipse
class Int64Factory(AbstractFactory):
def tensor(self, value) -> 'Int64Tensor':
if isinstance(value, tf.Tensor):
if value.dtype is not tf.int64:
value = tf.cast(value, dtype=tf.int64)
return Int64Tensor(value)
if isinstance(value, np.ndarray):
return Int64Tensor(value)
if isinstance(value, Int64Tensor):
return Int64Tensor(value.value)
raise TypeError("Don't know how to handle {}".format(type(value)))
def constant(self, value) -> 'Int64Constant':
if isinstance(value, (tf.Tensor, np.ndarray)):
return Int64Constant(value)
if isinstance(value, Int64Tensor):
return Int64Constant(value.value)
raise TypeError("Don't know how to handle {}".format(type(value)))
def variable(self, initial_value) -> 'Int64Variable':
if isinstance(initial_value, (tf.Tensor, np.ndarray)):
return Int64Variable(initial_value)
if isinstance(initial_value, Int64Tensor):
return Int64Variable(initial_value.value)
raise TypeError("Don't know how to handle {}".format(type(initial_value)))
def placeholder(self, shape: List[int]) -> 'Int64Placeholder':
return Int64Placeholder(shape)
@property
def modulus(self) -> int:
return 2**64
@property
def native_type(self):
return tf.int64
def sample_uniform(self, shape: List[int]) -> 'Int64Tensor':
value = tf.random_uniform(shape=shape, dtype=self.native_type, minval=tf.int64.min, maxval=tf.int64.max)
return Int64Tensor(value)
def sample_bounded(self, shape: List[int], bitlength: int) -> 'Int64Tensor':
# TODO[Morten] verify that uses of this work for signed integers
value = tf.random_uniform(shape=shape, dtype=self.native_type, minval=0, maxval=2**bitlength)
return Int64Tensor(value)
def stack(self, xs: List['Int64Tensor'], axis: int = 0) -> 'Int64Tensor':
assert all(isinstance(x, Int64Tensor) for x in xs)
value = tf.stack([x.value for x in xs], axis=axis)
return Int64Tensor(value)
def concat(self, xs: List['Int64Tensor'], axis: int) -> 'Int64Tensor':
assert all(isinstance(x, Int64Tensor) for x in xs)
value = tf.concat([x.value for x in xs], axis=axis)
return Int64Tensor(value)
int64factory = Int64Factory()
def _lift(x, y) -> Tuple['Int64Tensor', 'Int64Tensor']:
if isinstance(x, Int64Tensor) and isinstance(y, Int64Tensor):
return x, y
if isinstance(x, Int64Tensor) and isinstance(y, int):
return x, x.factory.tensor(np.array([y]))
if isinstance(x, int) and isinstance(y, Int64Tensor):
return y.factory.tensor(np.array([x])), y
raise TypeError("Don't know how to lift {} {}".format(type(x), type(y)))
class Int64Tensor(AbstractTensor):
def __init__(self, value: Union[np.ndarray, tf.Tensor]) -> None:
self.value = value
def to_native(self) -> Union[tf.Tensor, np.ndarray]:
return self.value
def to_bits(self, factory: Optional[AbstractFactory] = None) -> AbstractTensor:
factory = factory or int64factory
return factory.tensor(binarize(self.value))
def __repr__(self) -> str:
return 'Int64Tensor(shape={})'.format(self.shape)
@property
def shape(self) -> Union[Tuple[int, ...], tf.TensorShape]:
return self.value.shape
@property
def factory(self) -> AbstractFactory:
return int64factory
def __add__(self, other) -> 'Int64Tensor':
x, y = _lift(self, other)
return x.add(y)
def __radd__(self, other) -> 'Int64Tensor':
x, y = _lift(self, other)
return x.add(y)
def __sub__(self, other) -> 'Int64Tensor':
x, y = _lift(self, other)
return x.sub(y)
def __rsub__(self, other) -> 'Int64Tensor':
x, y = _lift(self, other)
return x.sub(y)
def __mul__(self, other) -> 'Int64Tensor':
x, y = _lift(self, other)
return x.mul(y)
def __rmul__(self, other) -> 'Int64Tensor':
x, y = _lift(self, other)
return x.mul(y)
def __mod__(self, k: int) -> 'Int64Tensor':
return self.mod(k)
def __neg__(self) -> 'Int64Tensor':
return self.mul(-1)
def __getitem__(self, slice: Union[Slice, Ellipse]) -> 'Int64Tensor':
return int64factory.tensor(self.value[slice])
def add(self, other: Any) -> 'Int64Tensor':
x, y = _lift(self, other)
return int64factory.tensor(x.value + y.value)
def sub(self, other: Any) -> 'Int64Tensor':
x, y = _lift(self, other)
return int64factory.tensor(x.value - y.value)
def mul(self, other: Any) -> 'Int64Tensor':
x, y = _lift(self, other)
return int64factory.tensor(x.value * y.value)
def matmul(self, other: Any) -> 'Int64Tensor':
x, y = _lift(self, other)
return int64factory.tensor(tf.matmul(x.value, y.value))
def im2col(self, h_filter: int, w_filter: int, padding: str, strides: int) -> 'Int64Tensor':
return int64factory.tensor(im2col(self.value, h_filter, w_filter, padding, strides))
def conv2d(self, other: Any, strides: int, padding: str='SAME') -> 'Int64Tensor':
x, y = _lift(self, other)
return conv2d(x, y, strides, padding) # type: ignore
def mod(self, k: int) -> 'Int64Tensor':
return int64factory.tensor(self.value % k)
def transpose(self, perm: Union[List[int], Tuple[int]]) -> 'Int64Tensor':
return int64factory.tensor(tf.transpose(self.value, perm))
def strided_slice(self, args: Any, kwargs: Any) -> 'Int64Tensor':
return int64factory.tensor(tf.strided_slice(self.value, *args, **kwargs))
def split(self, num_split: int, axis: int=0) -> List['Int64Tensor']:
values = tf.split(self.value, num_split, axis=axis)
return [int64factory.tensor(value) for value in values]
def reshape(self, axes: Union[tf.Tensor, List[int]]) -> 'Int64Tensor':
return Int64Tensor(tf.reshape(self.value, axes))
def reduce_sum(self, axis, keepdims=None) -> 'Int64Tensor':
return Int64Tensor(tf.reduce_sum(self.value, axis, keepdims))
def cumsum(self, axis, exclusive, reverse) -> 'Int64Tensor':
return Int64Tensor(tf.cumsum(self.value, axis=axis, exclusive=exclusive, reverse=reverse))
def equal_zero(self, factory: AbstractFactory=int64factory) -> 'AbstractTensor':
return factory.tensor(tf.cast(tf.equal(self.value, 0), dtype=factory.native_type))
def equal(self, other, factory: AbstractFactory=int64factory) -> 'AbstractTensor':
x, y = _lift(self, other)
return factory.tensor(tf.cast(tf.equal(x.value, y.value), dtype=factory.native_type))
def truncate(self, amount, base=2) -> 'Int64Tensor':
if base == 2:
return self.right_shift(amount)
else:
factor = base**amount
factor_inverse = inverse(factor, self.factory.modulus)
return (self - (self % factor)) * factor_inverse
def right_shift(self, bitlength) -> 'Int64Tensor':
return Int64Tensor(tf.bitwise.right_shift(self.value, bitlength))
def expand_dims(self, axis: Optional[int]=None) -> 'Int64Tensor':
return Int64Tensor(tf.expand_dims(self.value, axis))
def squeeze(self, axis: Optional[List[int]]=None) -> 'Int64Tensor':
return Int64Tensor(tf.squeeze(self.value, axis=axis))
def negative(self) -> 'Int64Tensor':
return Int64Tensor(tf.negative(self.value))
class Int64Constant(Int64Tensor, AbstractConstant):
def __init__(self, value: Union[tf.Tensor, np.ndarray]) -> None:
super(Int64Constant, self).__init__(tf.constant(value, dtype=tf.int64))
def __repr__(self) -> str:
return 'int64.Constant(shape={})'.format(self.shape)
class Int64Placeholder(Int64Tensor, AbstractPlaceholder):
def __init__(self, shape: List[int]) -> None:
self.placeholder = tf.placeholder(tf.int64, shape=shape)
super(Int64Placeholder, self).__init__(self.placeholder)
def __repr__(self) -> str:
return 'Int64Placeholder(shape={})'.format(self.shape)
def feed_from_native(self, value: np.ndarray) -> Dict[tf.Tensor, np.ndarray]:
assert type(value) in [np.ndarray], type(value)
return self.feed_from_same(int64factory.tensor(value))
def feed_from_same(self, value: Int64Tensor) -> Dict[tf.Tensor, np.ndarray]:
assert isinstance(value, Int64Tensor), type(value)
return {
self.placeholder: value.value
}
class Int64Variable(Int64Tensor, AbstractVariable):
def __init__(self, initial_value: Union[tf.Tensor, np.ndarray]) -> None:
self.variable = tf.Variable(initial_value, dtype=tf.int64, trainable=False)
self.initializer = self.variable.initializer
super(Int64Variable, self).__init__(self.variable.read_value())
def __repr__(self) -> str:
return 'Int64Variable(shape={})'.format(self.shape)
def assign_from_native(self, value: np.ndarray) -> tf.Operation:
assert type(value) in [np.ndarray], type(value)
return self.assign_from_same(int64factory.tensor(value))
def assign_from_same(self, value: Int64Tensor) -> tf.Operation:
assert isinstance(value, Int64Tensor), type(value)
return tf.assign(self.variable, value.value).op
| 35.952381 | 112 | 0.656139 | 1,208 | 9,815 | 5.208609 | 0.140728 | 0.03719 | 0.011443 | 0.019072 | 0.429275 | 0.34965 | 0.250795 | 0.184997 | 0.184997 | 0.184997 | 0 | 0.03123 | 0.213754 | 9,815 | 272 | 113 | 36.084559 | 0.784113 | 0.007641 | 0 | 0.225806 | 0 | 0 | 0.069118 | 0.009654 | 0 | 0 | 0 | 0.003676 | 0.032258 | 1 | 0.301075 | false | 0 | 0.043011 | 0.134409 | 0.688172 | 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 |
1c82c1cbcce046aee601c29da72d71b2412f23f0 | 459 | py | Python | indra/tests/test_obo_clients/test_efo_client.py | zebulon2/indra | 7727ddcab52ad8012eb6592635bfa114e904bd48 | [
"BSD-2-Clause"
] | 136 | 2016-02-11T22:06:37.000Z | 2022-03-31T17:26:20.000Z | indra/tests/test_obo_clients/test_efo_client.py | zebulon2/indra | 7727ddcab52ad8012eb6592635bfa114e904bd48 | [
"BSD-2-Clause"
] | 748 | 2016-02-03T16:27:56.000Z | 2022-03-09T14:27:54.000Z | indra/tests/test_obo_clients/test_efo_client.py | zebulon2/indra | 7727ddcab52ad8012eb6592635bfa114e904bd48 | [
"BSD-2-Clause"
] | 56 | 2015-08-28T14:03:44.000Z | 2022-02-04T06:15:55.000Z | from indra.databases import efo_client
from indra.databases.efo_client import _client as client
def test_efo_client_loaded():
assert 'efo' == client.prefix
assert client.entries
assert client.name_to_id
def test_efo_id_to_name():
assert 'muscle measurement' == \
efo_client.get_efo_name_from_efo_id('0004515')
def test_efo_name_to_id():
assert '0004515' == \
efo_client.get_efo_id_from_efo_name('muscle measurement')
| 24.157895 | 65 | 0.745098 | 68 | 459 | 4.617647 | 0.294118 | 0.171975 | 0.095541 | 0.095541 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.036745 | 0.169935 | 459 | 18 | 66 | 25.5 | 0.787402 | 0 | 0 | 0 | 0 | 0 | 0.115468 | 0 | 0 | 0 | 0 | 0 | 0.416667 | 1 | 0.25 | true | 0 | 0.166667 | 0 | 0.416667 | 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 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
98c6d6daf87d8adaf32148556efd4aaa3d270230 | 103 | py | Python | sphero-project/src/drive_mode.py | wangandr/robot-api | f0f7ea84e13c86011eb8f40e9cdd99c46ba1bb63 | [
"MIT"
] | null | null | null | sphero-project/src/drive_mode.py | wangandr/robot-api | f0f7ea84e13c86011eb8f40e9cdd99c46ba1bb63 | [
"MIT"
] | 2 | 2020-03-11T19:33:33.000Z | 2021-11-03T22:39:05.000Z | sphero-project/src/drive_mode.py | wangandr/robot-api | f0f7ea84e13c86011eb8f40e9cdd99c46ba1bb63 | [
"MIT"
] | 1 | 2020-02-21T01:59:14.000Z | 2020-02-21T01:59:14.000Z | from client import DroidClient
r2 = DroidClient()
r2.connect_to_R2Q5()
r2.enter_drive_mode()
r2.exit()
| 17.166667 | 30 | 0.786408 | 16 | 103 | 4.8125 | 0.75 | 0.337662 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.064516 | 0.097087 | 103 | 5 | 31 | 20.6 | 0.763441 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 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 |
98d72b7db6b7b5c09893660f134dc821e10e0706 | 309 | py | Python | NetDetect/datasets/iscx/download_raw.py | joaoceron/NetDetect | 6bf608d61722d86e8fab4087b2e725df1cd236ab | [
"MIT"
] | null | null | null | NetDetect/datasets/iscx/download_raw.py | joaoceron/NetDetect | 6bf608d61722d86e8fab4087b2e725df1cd236ab | [
"MIT"
] | null | null | null | NetDetect/datasets/iscx/download_raw.py | joaoceron/NetDetect | 6bf608d61722d86e8fab4087b2e725df1cd236ab | [
"MIT"
] | null | null | null | from ..utils.network_utils import download_file
from . import config
if __name__ == "__main__":
# Download training set
download_file("datasets", "iscx_train_raw", config.RAW_TRAINING_DATASET_PATH)
# Download testing set
download_file("datasets", "iscx_test_raw", config.RAW_TESTING_DATASET_PATH)
| 25.75 | 79 | 0.783172 | 41 | 309 | 5.365854 | 0.487805 | 0.163636 | 0.136364 | 0.209091 | 0.245455 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.122977 | 309 | 11 | 80 | 28.090909 | 0.811808 | 0.135922 | 0 | 0 | 0 | 0 | 0.193916 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.4 | 0 | 0.4 | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
98d83a5b8b965f2190c84f577b087dd0d7e19f8c | 17 | py | Python | wurst/version.py | kais-siala/wurst | 448dd4e9e0bfbde956c2913222222509ff2b14e1 | [
"BSD-2-Clause"
] | 4 | 2020-12-07T11:37:15.000Z | 2022-03-15T14:29:41.000Z | wurst/version.py | kais-siala/wurst | 448dd4e9e0bfbde956c2913222222509ff2b14e1 | [
"BSD-2-Clause"
] | 8 | 2020-06-02T14:13:35.000Z | 2022-03-11T14:33:58.000Z | wurst/version.py | kais-siala/wurst | 448dd4e9e0bfbde956c2913222222509ff2b14e1 | [
"BSD-2-Clause"
] | 3 | 2021-05-19T09:51:24.000Z | 2022-03-11T13:51:16.000Z | version = (0, 3)
| 8.5 | 16 | 0.529412 | 3 | 17 | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 0.235294 | 17 | 1 | 17 | 17 | 0.538462 | 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 |
98e6e540ecccd83a6c7fd6a41861d5182928d69e | 98 | py | Python | Programming basics/Exercises PROVERKI/lab/invalid_number.py | antonarnaudov/SoftUniProjects | 01cbdce2b350b57240045d1bc3e21d34f9d0351d | [
"MIT"
] | null | null | null | Programming basics/Exercises PROVERKI/lab/invalid_number.py | antonarnaudov/SoftUniProjects | 01cbdce2b350b57240045d1bc3e21d34f9d0351d | [
"MIT"
] | null | null | null | Programming basics/Exercises PROVERKI/lab/invalid_number.py | antonarnaudov/SoftUniProjects | 01cbdce2b350b57240045d1bc3e21d34f9d0351d | [
"MIT"
] | null | null | null | number = int(input())
if 100 <= number <= 200 or number == 0:
pass
else:
print('invalid') | 16.333333 | 39 | 0.581633 | 14 | 98 | 4.071429 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.094595 | 0.244898 | 98 | 6 | 40 | 16.333333 | 0.675676 | 0 | 0 | 0 | 0 | 0 | 0.070707 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.2 | 0 | 0 | 0 | 0.2 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
98ff12a63818af327233db18ec6a018e4bffdcaf | 1,331 | py | Python | jupyterlab_pullrequests/__init__.py | meihkv/pull-requests | fe2fdf37bf340f789b7d39f76a38f40474f395da | [
"BSD-3-Clause"
] | 32 | 2019-07-29T23:20:47.000Z | 2022-03-01T06:16:30.000Z | jupyterlab_pullrequests/__init__.py | meihkv/pull-requests | fe2fdf37bf340f789b7d39f76a38f40474f395da | [
"BSD-3-Clause"
] | 58 | 2019-07-31T16:08:06.000Z | 2022-02-28T04:34:25.000Z | jupyterlab_pullrequests/__init__.py | meihkv/pull-requests | fe2fdf37bf340f789b7d39f76a38f40474f395da | [
"BSD-3-Clause"
] | 16 | 2019-07-30T21:07:05.000Z | 2022-02-24T00:32:04.000Z | from ._version import __version__, __js__
def _jupyter_labextension_paths():
return [{"src": "labextension", "dest": __js__["name"]}]
def _jupyter_server_extension_points():
return [{"module": "jupyterlab_pullrequests"}]
def _load_jupyter_server_extension(server_app):
"""Registers the API handler to receive HTTP requests from the frontend extension.
Args:
server_app (jupyterlab.labapp.LabApp): JupyterLab application instance
"""
from .base import PRConfig
from .handlers import setup_handlers
setup_handlers(server_app.web_app, server_app.config)
server_app.log.info("Registered jupyterlab_pullrequests extension")
# for legacy launching with notebok (e.g. Binder)
_jupyter_server_extension_paths = _jupyter_server_extension_points
load_jupyter_server_extension = _load_jupyter_server_extension
# Entry points
def get_github_manager(config: "traitlets.config.Config") -> "jupyterlab_pullrequests.managers.PullRequestsManager":
"""GitHub Manager factory"""
from .managers.github import GitHubManager
return GitHubManager(config)
def get_gitlab_manager(config: "traitlets.config.Config") -> "jupyterlab_pullrequests.managers.PullRequestsManager":
"""GitLab Manager factory"""
from .managers.gitlab import GitLabManager
return GitLabManager(config)
| 33.275 | 116 | 0.777611 | 150 | 1,331 | 6.533333 | 0.406667 | 0.079592 | 0.134694 | 0.079592 | 0.169388 | 0.169388 | 0.169388 | 0.169388 | 0.169388 | 0 | 0 | 0 | 0.132983 | 1,331 | 39 | 117 | 34.128205 | 0.84922 | 0.202104 | 0 | 0 | 0 | 0 | 0.238372 | 0.189922 | 0 | 0 | 0 | 0 | 0 | 1 | 0.277778 | false | 0 | 0.277778 | 0.111111 | 0.777778 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
c7170f1211494fa44709a519b3237ef2ead19de0 | 182 | py | Python | pycatia/workbenches.py | z86961027/pycatia | 5dd9b7eb5d21f2261198d6a2af489abafb2f5f32 | [
"MIT"
] | null | null | null | pycatia/workbenches.py | z86961027/pycatia | 5dd9b7eb5d21f2261198d6a2af489abafb2f5f32 | [
"MIT"
] | null | null | null | pycatia/workbenches.py | z86961027/pycatia | 5dd9b7eb5d21f2261198d6a2af489abafb2f5f32 | [
"MIT"
] | null | null | null | #! /usr/bin/python3.6
def create_spa_workbench(document):
"""
:param document:
:return: workbench com object
"""
return document.GetWorkbench("SPAWorkbench")
| 15.166667 | 48 | 0.659341 | 19 | 182 | 6.210526 | 0.789474 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013889 | 0.208791 | 182 | 11 | 49 | 16.545455 | 0.805556 | 0.368132 | 0 | 0 | 0 | 0 | 0.12766 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
c71f02e077e5b97f2db28678e697fceaaf462df9 | 25,666 | py | Python | tests/test_req_vars.py | fast01/falcon-python | a8154de497b3ec5d6e5579026e74e9073e353819 | [
"Apache-2.0"
] | 1 | 2019-03-14T08:54:04.000Z | 2019-03-14T08:54:04.000Z | tests/test_req_vars.py | fast01/falcon-python | a8154de497b3ec5d6e5579026e74e9073e353819 | [
"Apache-2.0"
] | null | null | null | tests/test_req_vars.py | fast01/falcon-python | a8154de497b3ec5d6e5579026e74e9073e353819 | [
"Apache-2.0"
] | null | null | null | import datetime
import six
import testtools
import ddt
import falcon
from falcon.request import Request
import falcon.testing as testing
@ddt.ddt
class TestReqVars(testing.TestBase):
def before(self):
self.qs = 'marker=deadbeef&limit=10'
self.headers = {
'Content-Type': 'text/plain',
'Content-Length': '4829',
'Authorization': ''
}
self.app = '/test'
self.path = '/hello'
self.relative_uri = self.path + '?' + self.qs
self.req = Request(testing.create_environ(
app=self.app,
port=8080,
path='/hello',
query_string=self.qs,
headers=self.headers))
self.req_noqs = Request(testing.create_environ(
app=self.app,
path='/hello',
headers=self.headers))
def test_missing_qs(self):
env = testing.create_environ()
if 'QUERY_STRING' in env:
del env['QUERY_STRING']
# Should not cause an exception when Request is instantiated
Request(env)
def test_empty(self):
self.assertIs(self.req.auth, None)
def test_host(self):
self.assertEqual(self.req.host, testing.DEFAULT_HOST)
def test_subdomain(self):
req = Request(testing.create_environ(
host='com',
path='/hello',
headers=self.headers))
self.assertIs(req.subdomain, None)
req = Request(testing.create_environ(
host='example.com',
path='/hello',
headers=self.headers))
self.assertEqual(req.subdomain, 'example')
req = Request(testing.create_environ(
host='highwire.example.com',
path='/hello',
headers=self.headers))
self.assertEqual(req.subdomain, 'highwire')
req = Request(testing.create_environ(
host='lb01.dfw01.example.com',
port=8080,
path='/hello',
headers=self.headers))
self.assertEqual(req.subdomain, 'lb01')
# NOTE(kgriffs): Behavior for IP addresses is undefined,
# so just make sure it doesn't blow up.
req = Request(testing.create_environ(
host='127.0.0.1',
path='/hello',
headers=self.headers))
self.assertEqual(type(req.subdomain), str)
# NOTE(kgriffs): Test fallback to SERVER_NAME by using
# HTTP 1.0, which will cause .create_environ to not set
# HTTP_HOST.
req = Request(testing.create_environ(
protocol='HTTP/1.0',
host='example.com',
path='/hello',
headers=self.headers))
self.assertEqual(req.subdomain, 'example')
def test_reconstruct_url(self):
req = self.req
scheme = req.protocol
host = req.get_header('host')
app = req.app
path = req.path
query_string = req.query_string
expected_uri = ''.join([scheme, '://', host, app, path,
'?', query_string])
self.assertEqual(expected_uri, req.uri)
@testtools.skipUnless(six.PY3, 'Test only applies to Python 3')
def test_nonlatin_path(self):
cyrillic_path = u'/hello_\u043f\u0440\u0438\u0432\u0435\u0442'
cyrillic_path_decoded = cyrillic_path.encode('utf-8').decode('latin1')
req = Request(testing.create_environ(
host='com',
path=cyrillic_path_decoded,
headers=self.headers))
self.assertEqual(req.path, cyrillic_path)
def test_uri(self):
uri = ('http://' + testing.DEFAULT_HOST + ':8080' +
self.app + self.relative_uri)
self.assertEqual(self.req.url, uri)
# NOTE(kgriffs): Call twice to check caching works
self.assertEqual(self.req.uri, uri)
self.assertEqual(self.req.uri, uri)
uri_noqs = ('http://' + testing.DEFAULT_HOST + self.app + self.path)
self.assertEqual(self.req_noqs.uri, uri_noqs)
def test_uri_https(self):
# =======================================================
# Default port, implicit
# =======================================================
req = Request(testing.create_environ(
path='/hello', scheme='https'))
uri = ('https://' + testing.DEFAULT_HOST + '/hello')
self.assertEqual(req.uri, uri)
# =======================================================
# Default port, explicit
# =======================================================
req = Request(testing.create_environ(
path='/hello', scheme='https', port=443))
uri = ('https://' + testing.DEFAULT_HOST + '/hello')
self.assertEqual(req.uri, uri)
# =======================================================
# Non-default port
# =======================================================
req = Request(testing.create_environ(
path='/hello', scheme='https', port=22))
uri = ('https://' + testing.DEFAULT_HOST + ':22/hello')
self.assertEqual(req.uri, uri)
def test_uri_http_1_0(self):
# =======================================================
# HTTP, 80
# =======================================================
req = Request(testing.create_environ(
protocol='HTTP/1.0',
app=self.app,
port=80,
path='/hello',
query_string=self.qs,
headers=self.headers))
uri = ('http://' + testing.DEFAULT_HOST +
self.app + self.relative_uri)
self.assertEqual(req.uri, uri)
# =======================================================
# HTTP, 80
# =======================================================
req = Request(testing.create_environ(
protocol='HTTP/1.0',
app=self.app,
port=8080,
path='/hello',
query_string=self.qs,
headers=self.headers))
uri = ('http://' + testing.DEFAULT_HOST + ':8080' +
self.app + self.relative_uri)
self.assertEqual(req.uri, uri)
# =======================================================
# HTTP, 80
# =======================================================
req = Request(testing.create_environ(
protocol='HTTP/1.0',
scheme='https',
app=self.app,
port=443,
path='/hello',
query_string=self.qs,
headers=self.headers))
uri = ('https://' + testing.DEFAULT_HOST +
self.app + self.relative_uri)
self.assertEqual(req.uri, uri)
# =======================================================
# HTTP, 80
# =======================================================
req = Request(testing.create_environ(
protocol='HTTP/1.0',
scheme='https',
app=self.app,
port=22,
path='/hello',
query_string=self.qs,
headers=self.headers))
uri = ('https://' + testing.DEFAULT_HOST + ':22' +
self.app + self.relative_uri)
self.assertEqual(req.uri, uri)
def test_relative_uri(self):
self.assertEqual(self.req.relative_uri, self.app + self.relative_uri)
self.assertEqual(
self.req_noqs.relative_uri, self.app + self.path)
req_noapp = Request(testing.create_environ(
path='/hello',
query_string=self.qs,
headers=self.headers))
self.assertEqual(req_noapp.relative_uri, self.relative_uri)
req_noapp = Request(testing.create_environ(
path='/hello/',
query_string=self.qs,
headers=self.headers))
# NOTE(kgriffs): Call twice to check caching works
self.assertEqual(req_noapp.relative_uri, self.relative_uri)
self.assertEqual(req_noapp.relative_uri, self.relative_uri)
def test_client_accepts(self):
headers = {'Accept': 'application/xml'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts('application/xml'))
headers = {'Accept': '*/*'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts('application/xml'))
self.assertTrue(req.client_accepts('application/json'))
self.assertTrue(req.client_accepts('application/x-msgpack'))
headers = {'Accept': 'application/x-msgpack'}
req = Request(testing.create_environ(headers=headers))
self.assertFalse(req.client_accepts('application/xml'))
self.assertFalse(req.client_accepts('application/json'))
self.assertTrue(req.client_accepts('application/x-msgpack'))
headers = {} # NOTE(kgriffs): Equivalent to '*/*' per RFC
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts('application/xml'))
headers = {'Accept': 'application/json'}
req = Request(testing.create_environ(headers=headers))
self.assertFalse(req.client_accepts('application/xml'))
headers = {'Accept': 'application/x-msgpack'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts('application/x-msgpack'))
headers = {'Accept': 'application/xm'}
req = Request(testing.create_environ(headers=headers))
self.assertFalse(req.client_accepts('application/xml'))
headers = {'Accept': 'application/*'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts('application/json'))
self.assertTrue(req.client_accepts('application/xml'))
self.assertTrue(req.client_accepts('application/x-msgpack'))
headers = {'Accept': 'text/*'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts('text/plain'))
self.assertTrue(req.client_accepts('text/csv'))
self.assertFalse(req.client_accepts('application/xhtml+xml'))
headers = {'Accept': 'text/*, application/xhtml+xml; q=0.0'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts('text/plain'))
self.assertTrue(req.client_accepts('text/csv'))
self.assertTrue(req.client_accepts('application/xhtml+xml'))
headers = {'Accept': 'text/*; q=0.1, application/xhtml+xml; q=0.5'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts('text/plain'))
headers = {'Accept': 'text/*, application/*'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts('text/plain'))
self.assertTrue(req.client_accepts('application/xml'))
self.assertTrue(req.client_accepts('application/json'))
self.assertTrue(req.client_accepts('application/x-msgpack'))
headers = {'Accept': 'text/*,application/*'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts('text/plain'))
self.assertTrue(req.client_accepts('application/xml'))
self.assertTrue(req.client_accepts('application/json'))
self.assertTrue(req.client_accepts('application/x-msgpack'))
def test_client_accepts_bogus(self):
headers = {'Accept': '~'}
req = Request(testing.create_environ(headers=headers))
self.assertFalse(req.client_accepts('text/plain'))
self.assertFalse(req.client_accepts('application/json'))
def test_client_accepts_props(self):
headers = {'Accept': 'application/xml'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts_xml)
self.assertFalse(req.client_accepts_json)
self.assertFalse(req.client_accepts_msgpack)
headers = {'Accept': 'application/*'}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts_xml)
self.assertTrue(req.client_accepts_json)
self.assertTrue(req.client_accepts_msgpack)
headers = {'Accept': 'application/json'}
req = Request(testing.create_environ(headers=headers))
self.assertFalse(req.client_accepts_xml)
self.assertTrue(req.client_accepts_json)
self.assertFalse(req.client_accepts_msgpack)
headers = {'Accept': 'application/x-msgpack'}
req = Request(testing.create_environ(headers=headers))
self.assertFalse(req.client_accepts_xml)
self.assertFalse(req.client_accepts_json)
self.assertTrue(req.client_accepts_msgpack)
headers = {'Accept': 'application/msgpack'}
req = Request(testing.create_environ(headers=headers))
self.assertFalse(req.client_accepts_xml)
self.assertFalse(req.client_accepts_json)
self.assertTrue(req.client_accepts_msgpack)
headers = {
'Accept': 'application/json,application/xml,application/x-msgpack'
}
req = Request(testing.create_environ(headers=headers))
self.assertTrue(req.client_accepts_xml)
self.assertTrue(req.client_accepts_json)
self.assertTrue(req.client_accepts_msgpack)
def test_client_prefers(self):
headers = {'Accept': 'application/xml'}
req = Request(testing.create_environ(headers=headers))
preferred_type = req.client_prefers(['application/xml'])
self.assertEqual(preferred_type, 'application/xml')
headers = {'Accept': '*/*'}
preferred_type = req.client_prefers(('application/xml',
'application/json'))
# NOTE(kgriffs): If client doesn't care, "preferr" the first one
self.assertEqual(preferred_type, 'application/xml')
headers = {'Accept': 'text/*; q=0.1, application/xhtml+xml; q=0.5'}
req = Request(testing.create_environ(headers=headers))
preferred_type = req.client_prefers(['application/xhtml+xml'])
self.assertEqual(preferred_type, 'application/xhtml+xml')
headers = {'Accept': '3p12845j;;;asfd;'}
req = Request(testing.create_environ(headers=headers))
preferred_type = req.client_prefers(['application/xhtml+xml'])
self.assertEqual(preferred_type, None)
def test_range(self):
headers = {'Range': 'bytes=10-'}
req = Request(testing.create_environ(headers=headers))
self.assertEqual(req.range, (10, -1))
headers = {'Range': 'bytes=10-20'}
req = Request(testing.create_environ(headers=headers))
self.assertEqual(req.range, (10, 20))
headers = {'Range': 'bytes=-10240'}
req = Request(testing.create_environ(headers=headers))
self.assertEqual(req.range, (-10240, -1))
headers = {'Range': 'bytes=0-2'}
req = Request(testing.create_environ(headers=headers))
self.assertEqual(req.range, (0, 2))
headers = {'Range': ''}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPInvalidHeader, lambda: req.range)
req = Request(testing.create_environ())
self.assertIs(req.range, None)
def test_range_unit(self):
headers = {'Range': 'bytes=10-'}
req = Request(testing.create_environ(headers=headers))
self.assertEqual(req.range, (10, -1))
self.assertEqual(req.range_unit, 'bytes')
headers = {'Range': 'items=10-'}
req = Request(testing.create_environ(headers=headers))
self.assertEqual(req.range, (10, -1))
self.assertEqual(req.range_unit, 'items')
headers = {'Range': ''}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPInvalidHeader, lambda: req.range_unit)
req = Request(testing.create_environ())
self.assertIs(req.range_unit, None)
def test_range_invalid(self):
headers = {'Range': 'bytes=10240'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=-'}
expected_desc = ('The value provided for the Range header is '
'invalid. The range offsets are missing.')
self._test_error_details(headers, 'range',
falcon.HTTPInvalidHeader,
'Invalid header value', expected_desc)
headers = {'Range': 'bytes=--'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=-3-'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=-3-4'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=3-3-4'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=3-3-'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=3-3- '}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=fizbit'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=a-'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=a-3'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=-b'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=3-b'}
req = Request(testing.create_environ(headers=headers))
self.assertRaises(falcon.HTTPBadRequest, lambda: req.range)
headers = {'Range': 'bytes=x-y'}
expected_desc = ('The value provided for the Range header is '
'invalid. It must be a range formatted '
'according to RFC 7233.')
self._test_error_details(headers, 'range',
falcon.HTTPInvalidHeader,
'Invalid header value', expected_desc)
headers = {'Range': 'bytes=0-0,-1'}
expected_desc = ('The value provided for the Range '
'header is invalid. The value must be a '
'continuous range.')
self._test_error_details(headers, 'range',
falcon.HTTPInvalidHeader,
'Invalid header value', expected_desc)
headers = {'Range': '10-'}
expected_desc = ("The value provided for the Range "
"header is invalid. The value must be "
"prefixed with a range unit, e.g. 'bytes='")
self._test_error_details(headers, 'range',
falcon.HTTPInvalidHeader,
'Invalid header value', expected_desc)
def test_missing_attribute_header(self):
req = Request(testing.create_environ())
self.assertEqual(req.range, None)
req = Request(testing.create_environ())
self.assertEqual(req.content_length, None)
def test_content_length(self):
headers = {'content-length': '5656'}
req = Request(testing.create_environ(headers=headers))
self.assertEqual(req.content_length, 5656)
headers = {'content-length': ''}
req = Request(testing.create_environ(headers=headers))
self.assertEqual(req.content_length, None)
def test_bogus_content_length_nan(self):
headers = {'content-length': 'fuzzy-bunnies'}
expected_desc = ('The value provided for the '
'Content-Length header is invalid. The value '
'of the header must be a number.')
self._test_error_details(headers, 'content_length',
falcon.HTTPInvalidHeader,
'Invalid header value', expected_desc)
def test_bogus_content_length_neg(self):
headers = {'content-length': '-1'}
expected_desc = ('The value provided for the Content-Length '
'header is invalid. The value of the header '
'must be a positive number.')
self._test_error_details(headers, 'content_length',
falcon.HTTPInvalidHeader,
'Invalid header value', expected_desc)
@ddt.data(('Date', 'date'),
('If-Modified-since', 'if_modified_since'),
('If-Unmodified-since', 'if_unmodified_since'),
)
@ddt.unpack
def test_date(self, header, attr):
date = datetime.datetime(2013, 4, 4, 5, 19, 18)
date_str = 'Thu, 04 Apr 2013 05:19:18 GMT'
self._test_header_expected_value(header, date_str, attr, date)
@ddt.data(('Date', 'date'),
('If-Modified-Since', 'if_modified_since'),
('If-Unmodified-Since', 'if_unmodified_since'),
)
@ddt.unpack
def test_date_invalid(self, header, attr):
# Date formats don't conform to RFC 1123
headers = {header: 'Thu, 04 Apr 2013'}
expected_desc = ('The value provided for the {0} '
'header is invalid. It must be formatted '
'according to RFC 7231, Section 7.1.1.1')
self._test_error_details(headers, attr,
falcon.HTTPInvalidHeader,
'Invalid header value',
expected_desc.format(header))
headers = {header: ''}
self._test_error_details(headers, attr,
falcon.HTTPInvalidHeader,
'Invalid header value',
expected_desc.format(header))
@ddt.data('date', 'if_modified_since', 'if_unmodified_since')
def test_date_missing(self, attr):
req = Request(testing.create_environ())
self.assertIs(getattr(req, attr), None)
def test_attribute_headers(self):
hash = 'fa0d1a60ef6616bb28038515c8ea4cb2'
auth = 'HMAC_SHA1 c590afa9bb59191ffab30f223791e82d3fd3e3af'
agent = 'testing/1.0.1'
default_agent = 'curl/7.24.0 (x86_64-apple-darwin12.0)'
self._test_attribute_header('Accept', 'x-falcon', 'accept',
default='*/*')
self._test_attribute_header('Authorization', auth, 'auth')
self._test_attribute_header('Content-Type', 'text/plain',
'content_type')
self._test_attribute_header('Expect', '100-continue', 'expect')
self._test_attribute_header('If-Match', hash, 'if_match')
self._test_attribute_header('If-None-Match', hash, 'if_none_match')
self._test_attribute_header('If-Range', hash, 'if_range')
self._test_attribute_header('User-Agent', agent, 'user_agent',
default=default_agent)
def test_method(self):
self.assertEqual(self.req.method, 'GET')
self.req = Request(testing.create_environ(path='', method='HEAD'))
self.assertEqual(self.req.method, 'HEAD')
def test_empty_path(self):
self.req = Request(testing.create_environ(path=''))
self.assertEqual(self.req.path, '/')
def test_content_type_method(self):
self.assertEqual(self.req.get_header('content-type'), 'text/plain')
def test_content_length_method(self):
self.assertEqual(self.req.get_header('content-length'), '4829')
# -------------------------------------------------------------------------
# Helpers
# -------------------------------------------------------------------------
def _test_attribute_header(self, name, value, attr, default=None):
headers = {name: value}
req = Request(testing.create_environ(headers=headers))
self.assertEqual(getattr(req, attr), value)
req = Request(testing.create_environ())
self.assertEqual(getattr(req, attr), default)
def _test_header_expected_value(self, name, value, attr, expected_value):
headers = {name: value}
req = Request(testing.create_environ(headers=headers))
self.assertEqual(getattr(req, attr), expected_value)
def _test_error_details(self, headers, attr_name,
error_type, title, description):
req = Request(testing.create_environ(headers=headers))
try:
getattr(req, attr_name)
self.fail('{0} not raised'.format(error_type.__name__))
except error_type as ex:
self.assertEqual(ex.title, title)
self.assertEqual(ex.description, description)
| 39.546995 | 79 | 0.582639 | 2,683 | 25,666 | 5.424525 | 0.098397 | 0.067885 | 0.103064 | 0.137282 | 0.784458 | 0.757249 | 0.725093 | 0.687165 | 0.665934 | 0.623265 | 0 | 0.015716 | 0.261241 | 25,666 | 648 | 80 | 39.608025 | 0.751859 | 0.06043 | 0 | 0.562241 | 0 | 0 | 0.154865 | 0.024918 | 0 | 0 | 0 | 0 | 0.244813 | 1 | 0.068465 | false | 0 | 0.014523 | 0 | 0.085062 | 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 |
c757387f43fcdc8eca2179e045c54f9a0d7d2927 | 155 | py | Python | bot/commands/ResumeCommand.py | ciaracdb/ACMusic | 2a5aa81887db20098aa6bf1f9a2c3349ad0ee300 | [
"Apache-2.0"
] | null | null | null | bot/commands/ResumeCommand.py | ciaracdb/ACMusic | 2a5aa81887db20098aa6bf1f9a2c3349ad0ee300 | [
"Apache-2.0"
] | null | null | null | bot/commands/ResumeCommand.py | ciaracdb/ACMusic | 2a5aa81887db20098aa6bf1f9a2c3349ad0ee300 | [
"Apache-2.0"
] | null | null | null | from bot.commands.Command import Command
class ResumeCommand(Command):
async def execute(self, message):
self.client.voiceUser.player.resume() | 31 | 45 | 0.754839 | 19 | 155 | 6.157895 | 0.842105 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.148387 | 155 | 5 | 45 | 31 | 0.886364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.25 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
c75ee1585076c4b312dab707f005a7be895250bf | 146 | py | Python | clientes/api.py | rrgaya-zz/client-manager | 777b800596fbee67ba902308d4896566efce873f | [
"MIT"
] | 1 | 2019-08-04T04:03:03.000Z | 2019-08-04T04:03:03.000Z | clientes/api.py | rrgaya/gestao-clientes-django | 777b800596fbee67ba902308d4896566efce873f | [
"MIT"
] | 8 | 2019-06-17T22:14:19.000Z | 2019-09-26T03:17:19.000Z | clientes/api.py | rrgaya-zz/client-manager | 777b800596fbee67ba902308d4896566efce873f | [
"MIT"
] | 1 | 2019-08-03T05:08:47.000Z | 2019-08-03T05:08:47.000Z | from rest_framework import routers
from .views import PersonViewSet
router = routers.DefaultRouter()
router.register(r"clientes", PersonViewSet)
| 24.333333 | 43 | 0.828767 | 17 | 146 | 7.058824 | 0.705882 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.09589 | 146 | 5 | 44 | 29.2 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0.054795 | 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 |
c76715025fd91762e09b96d2091e645002d9a6c3 | 1,137 | py | Python | chat/indico_chat/controllers/event.py | aristofanischionis/indico-plugins | abd67d8f5173aa0e2d80613cf8bef415e332d773 | [
"MIT"
] | null | null | null | chat/indico_chat/controllers/event.py | aristofanischionis/indico-plugins | abd67d8f5173aa0e2d80613cf8bef415e332d773 | [
"MIT"
] | null | null | null | chat/indico_chat/controllers/event.py | aristofanischionis/indico-plugins | abd67d8f5173aa0e2d80613cf8bef415e332d773 | [
"MIT"
] | null | null | null | # This file is part of the Indico plugins.
# Copyright (C) 2002 - 2019 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.
from __future__ import unicode_literals
from flask_pluginengine import current_plugin
from indico.modules.events.controllers.base import RHDisplayEventBase
from indico_chat.models.chatrooms import ChatroomEventAssociation
from indico_chat.views import WPChatEventPage
class RHChatEventPage(RHDisplayEventBase):
"""Lists the public chatrooms in a conference"""
def _process(self):
chatrooms = ChatroomEventAssociation.find_for_event(self.event).all()
cols = set()
if any(c.chatroom.description for c in chatrooms):
cols.add('description')
if any(c.chatroom.password for c in chatrooms):
cols.add('password')
return WPChatEventPage.render_template('event_page.html', self.event, event_chatrooms=chatrooms, cols=cols,
chat_links=current_plugin.settings.get('chat_links'))
| 37.9 | 115 | 0.723835 | 142 | 1,137 | 5.669014 | 0.56338 | 0.037267 | 0.039752 | 0.034783 | 0.054658 | 0.054658 | 0 | 0 | 0 | 0 | 0 | 0.00882 | 0.202287 | 1,137 | 29 | 116 | 39.206897 | 0.878721 | 0.240106 | 0 | 0 | 0 | 0 | 0.051583 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.066667 | false | 0.133333 | 0.333333 | 0 | 0.533333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
c77e966a9157ae814729147ddd6de47425df39e7 | 160 | py | Python | gdmodloader/sdk/main.py | spookybear0/gdmodloader | 7990f31fb2a5b50f29e58704190e28c842beadb6 | [
"MIT"
] | 4 | 2020-11-17T11:51:44.000Z | 2022-01-15T19:15:53.000Z | gdmodloader/sdk/main.py | spookybear0/gdmodloader | 7990f31fb2a5b50f29e58704190e28c842beadb6 | [
"MIT"
] | 8 | 2020-06-13T21:49:06.000Z | 2020-06-13T21:55:43.000Z | gdmodloader/sdk/main.py | SpookyBear0/gdmodloader | 7990f31fb2a5b50f29e58704190e28c842beadb6 | [
"MIT"
] | null | null | null | import gd.memory
try:
memory = gd.memory.get_memory()
except RuntimeError:
pass
def main(code):
exec(code)
def reload_memory():
memory.reload() | 16 | 35 | 0.6875 | 22 | 160 | 4.909091 | 0.590909 | 0.148148 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.19375 | 160 | 10 | 36 | 16 | 0.837209 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0.111111 | 0.111111 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
c79f9bb595dbb8f5fe74fff6fbdb927431cf3a47 | 1,313 | py | Python | problem_set_1/src/p01b_logreg.py | genkiyui/cs229-solutions-fall2018 | e0e1f8152165848b755f2a1e9e954beaa27f485a | [
"MIT"
] | 13 | 2021-02-23T07:43:35.000Z | 2022-02-23T04:08:27.000Z | problem_set_1/src/p01b_logreg.py | genkiyui/cs229-solutions-fall2018 | e0e1f8152165848b755f2a1e9e954beaa27f485a | [
"MIT"
] | null | null | null | problem_set_1/src/p01b_logreg.py | genkiyui/cs229-solutions-fall2018 | e0e1f8152165848b755f2a1e9e954beaa27f485a | [
"MIT"
] | 11 | 2021-02-24T17:50:57.000Z | 2021-12-14T02:49:23.000Z | import numpy as np
import util
from linear_model import LinearModel
def main(train_path, eval_path, pred_path):
"""Problem 1(b): Logistic regression with Newton's Method.
Args:
train_path: Path to CSV file containing dataset for training.
eval_path: Path to CSV file containing dataset for evaluation.
pred_path: Path to save predictions.
"""
x_train, y_train = util.load_dataset(train_path, add_intercept=True)
# *** START CODE HERE ***
# *** END CODE HERE ***
class LogisticRegression(LinearModel):
"""Logistic regression with Newton's Method as the solver.
Example usage:
> clf = LogisticRegression()
> clf.fit(x_train, y_train)
> clf.predict(x_eval)
"""
def fit(self, x, y):
"""Run Newton's Method to minimize J(theta) for logistic regression.
Args:
x: Training example inputs. Shape (m, n).
y: Training example labels. Shape (m,).
"""
# *** START CODE HERE ***
# *** END CODE HERE ***
def predict(self, x):
"""Make a prediction given new inputs x.
Args:
x: Inputs of shape (m, n).
Returns:
Outputs of shape (m,).
"""
# *** START CODE HERE ***
# *** END CODE HERE ***
| 25.745098 | 76 | 0.582635 | 164 | 1,313 | 4.573171 | 0.439024 | 0.064 | 0.052 | 0.064 | 0.304 | 0.304 | 0.178667 | 0.178667 | 0 | 0 | 0 | 0.001096 | 0.305407 | 1,313 | 50 | 77 | 26.26 | 0.821272 | 0.619954 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.375 | false | 0 | 0.375 | 0 | 0.875 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
c7af35f300d8853813898e67c252596aa8c282e1 | 138 | py | Python | domain/db.py | Ladsgroup/db-analyzor-tools | 229a4d080097f60d0e63cbbbe7019c64efa3ee62 | [
"Apache-2.0"
] | 3 | 2021-02-01T18:00:22.000Z | 2021-06-14T20:25:02.000Z | domain/db.py | Ladsgroup/db-analyzor-tools | 229a4d080097f60d0e63cbbbe7019c64efa3ee62 | [
"Apache-2.0"
] | null | null | null | domain/db.py | Ladsgroup/db-analyzor-tools | 229a4d080097f60d0e63cbbbe7019c64efa3ee62 | [
"Apache-2.0"
] | 2 | 2020-11-24T04:32:38.000Z | 2021-01-01T13:16:37.000Z | class Db():
def __init__(self, section, host, wiki):
self.section = section
self.host = host
self.wiki = wiki
| 23 | 44 | 0.572464 | 17 | 138 | 4.411765 | 0.470588 | 0.293333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.318841 | 138 | 5 | 45 | 27.6 | 0.797872 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c7b699d495b0b67e412023fd0faeedb794914622 | 204 | py | Python | app.py | amanpuranik/amanpuranik | 9130b1c679e38351ffcf93fea6cca8070a978b40 | [
"Apache-2.0"
] | null | null | null | app.py | amanpuranik/amanpuranik | 9130b1c679e38351ffcf93fea6cca8070a978b40 | [
"Apache-2.0"
] | null | null | null | app.py | amanpuranik/amanpuranik | 9130b1c679e38351ffcf93fea6cca8070a978b40 | [
"Apache-2.0"
] | null | null | null |
from flask import Flask, render_template
from flask_bootstrap import Bootstrap
app = Flask(__name__)
Bootstrap(app)
@app.route('/')
def math():
#return(y)
return render_template('index.html') | 15.692308 | 40 | 0.730392 | 27 | 204 | 5.259259 | 0.555556 | 0.126761 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.151961 | 204 | 13 | 41 | 15.692308 | 0.820809 | 0.044118 | 0 | 0 | 0 | 0 | 0.056701 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.285714 | 0.142857 | 0.571429 | 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 |
c7cdd9249654fde551b0a22dc9f5a5265ee7e5c3 | 57 | py | Python | prueba9.py | elviscruz45/Estadistica-Computacional | 0f1eefc69a43c73631bfca26c7cbd0b6754caa06 | [
"MIT"
] | null | null | null | prueba9.py | elviscruz45/Estadistica-Computacional | 0f1eefc69a43c73631bfca26c7cbd0b6754caa06 | [
"MIT"
] | null | null | null | prueba9.py | elviscruz45/Estadistica-Computacional | 0f1eefc69a43c73631bfca26c7cbd0b6754caa06 | [
"MIT"
] | null | null | null | otra_coordenada=(0, 1)
new=otra_coordenada.x
print(new) | 11.4 | 22 | 0.77193 | 10 | 57 | 4.2 | 0.7 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.038462 | 0.087719 | 57 | 5 | 23 | 11.4 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 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 |
c7df5351cb0f21037229929e786aa7999e841eab | 125 | py | Python | TestMnist/Test.py | Cesar456/tensorflowTest | f5c9026f9bcd75997e6d7ff5182bfdbebcbb1dbb | [
"MIT"
] | null | null | null | TestMnist/Test.py | Cesar456/tensorflowTest | f5c9026f9bcd75997e6d7ff5182bfdbebcbb1dbb | [
"MIT"
] | null | null | null | TestMnist/Test.py | Cesar456/tensorflowTest | f5c9026f9bcd75997e6d7ff5182bfdbebcbb1dbb | [
"MIT"
] | null | null | null | from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data", one_hot=True)
| 17.857143 | 61 | 0.816 | 19 | 125 | 5.052632 | 0.684211 | 0.1875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.096 | 125 | 6 | 62 | 20.833333 | 0.849558 | 0 | 0 | 0 | 0 | 0 | 0.081967 | 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 |
1be54580bb94de0e532217b8149e38bdf4f8deaa | 1,373 | py | Python | stub/py/v2s/scene.py | isabella232/sosp21-artifact | 1b4a11c648e456c9ff9d74f16b09f4238d6694a0 | [
"BSD-3-Clause"
] | 1 | 2021-09-20T07:57:50.000Z | 2021-09-20T07:57:50.000Z | stub/py/v2s/scene.py | digi-project/sosp21-artifact | 1b4a11c648e456c9ff9d74f16b09f4238d6694a0 | [
"BSD-3-Clause"
] | 1 | 2022-03-21T11:33:33.000Z | 2022-03-21T11:33:33.000Z | stub/py/v2s/scene.py | isabella232/sosp21-artifact | 1b4a11c648e456c9ff9d74f16b09f4238d6694a0 | [
"BSD-3-Clause"
] | 2 | 2021-12-09T12:54:52.000Z | 2022-03-21T08:43:31.000Z | import json
import redis
from util import timed
from k8s import update_status
# singleton redis client
_r = redis.StrictRedis(host="localhost")
class SceneStatus:
""" Schema and client to scene status.
Attributes:
self.put(): commit the scene object to state store
self.get(): retrieve the scene object from state store
self.__init__(id_): id_ is a required field to discourage
unnamed scene pollute the state store.
"""
def __init__(self, id_, status=None):
# id of the scene; should be unique
self.id = id_
# status; loose schema; should include to_dict()
self.status = status
# redis client
self.r = _r
def __str__(self):
return self.__repr__()
def __repr__(self):
return str(self.to_dict())
def key(self):
return self.id
@timed
def put(self):
self.r.set(self.key(), json.dumps(self.to_dict()))
@timed
def get(self, raw=False):
v = self.r.get(self.key())
if not raw:
v = json.loads(v)
return v
@timed
def upload(self, gvr):
# translate status
status = self.status
print(status)
update_status(gvr, status)
def to_dict(self):
return {
"id": self.id,
"status": self.status,
}
| 21.123077 | 65 | 0.581209 | 177 | 1,373 | 4.327684 | 0.367232 | 0.031332 | 0.036554 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001074 | 0.321923 | 1,373 | 64 | 66 | 21.453125 | 0.821697 | 0.296431 | 0 | 0.085714 | 0 | 0 | 0.01828 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.228571 | false | 0 | 0.114286 | 0.114286 | 0.514286 | 0.028571 | 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 |
1bf831ac74f2af9186a94819d576757b2c442070 | 4,785 | py | Python | backend/initDatabases_test.py | DinoSubbu/SmartEnergyManagementSystem | 7e80b4f3af17959e75a61ac5a5f9c31805ce46dd | [
"MIT"
] | null | null | null | backend/initDatabases_test.py | DinoSubbu/SmartEnergyManagementSystem | 7e80b4f3af17959e75a61ac5a5f9c31805ce46dd | [
"MIT"
] | null | null | null | backend/initDatabases_test.py | DinoSubbu/SmartEnergyManagementSystem | 7e80b4f3af17959e75a61ac5a5f9c31805ce46dd | [
"MIT"
] | 1 | 2020-12-03T22:18:37.000Z | 2020-12-03T22:18:37.000Z | import requests
import json
headers = {'content-type': 'application/json'}
# solar panel
payload = """
{
"name": "solar_1",
"lat": "47.745837",
"long": "8.105398",
"powerCoefficient": 0.6,
"area": 25,
"angleOfModule": 45
}
"""
r = requests.post("http://127.0.0.1:5000/solarpanel/create", data=payload, headers=headers)
print(r)
payload = """
{
"name": "solar_2",
"lat": "47.745837",
"long": "8.105398",
"powerCoefficient": 0.6,
"area": 20,
"angleOfModule": 45
}
"""
r = requests.post("http://127.0.0.1:5000/solarpanel/create", data=payload, headers=headers)
print(r)
# wind turbine
payload = """
{
"name": "wind_1",
"lat": "48.745837",
"long": "10.105398",
"powerCoefficient": 0.6,
"radius": 7
}
"""
r = requests.post("http://127.0.0.1:5000/windturbine/create", data=payload, headers=headers)
print(r)
payload = """
{
"name": "wind_2",
"lat": "48.745837",
"long": "10.105398",
"powerCoefficient": 0.6,
"radius": 6
}
"""
r = requests.post("http://127.0.0.1:5000/windturbine/create", data=payload, headers=headers)
print(r)
payload = """{
"name": "battery_1",
"lat": "48.745837",
"long": "9.105398",
"batteryEfficiency": 0.95,
"chargeUpperBound": 20000,
"dischargeUpperBound": 20000,
"energyUpperBound": 100000,
"selfDischargingRate": 10
}
"""
r = requests.post("http://127.0.0.1:5000/battery/create", data=payload, headers=headers)
payload = """{
"name": "battery_2",
"lat": "48.745837",
"long": "9.105398",
"batteryEfficiency": 0.95,
"chargeUpperBound": 10000,
"dischargeUpperBound": 10000,
"energyUpperBound": 50000,
"selfDischargingRate": 10
}
"""
r = requests.post("http://127.0.0.1:5000/battery/create", data=payload, headers=headers)
print(r)
payload = """
{
"name": "office_1",
"lat": "48.745837",
"long": "9.105398",
"mathematicalModel": {
"thermalResistance" : 0.055,
"heatCapacityAirIndoor" : 525
},
"historicalData": [
3295.45431,
3230.50214,
3088.39031,
3066.93376,
3029.34311,
3013.018,
2898.94943,
2892.45014,
3028.16952,
3606.25,
4247.32906,
6434.29533,
5214.87252,
5814.52432,
5659.70644,
5093.25284,
5255.44979,
5019.69489,
4628.43443,
4269.22425,
4071.98214,
3855.55357,
3606.15708,
3414.28935
],
"components": [
{
"name": "dish_washer_1",
"est": 9,
"let": 18,
"e": 1800,
"lot": 2
},
{
"name": "dish_washer_2",
"est": 9,
"let": 12,
"e": 1800,
"lot": 2
},
{
"name": "dish_washer_3",
"est": 9,
"let": 12,
"e": 1800,
"lot": 2
},
{
"name": "dish_washer_4",
"est": 9,
"let": 12,
"e": 1800,
"lot": 2
},
{
"name": "vacuum_cleaner_1",
"est": 7,
"let": 10,
"e": 1200,
"lot": 1
},
{
"name": "vacuum_cleaner_2",
"est": 7,
"let": 9,
"e": 1200,
"lot": 1
},
{
"name": "vacuum_cleaner_3",
"est": 19,
"let": 21,
"e": 1200,
"lot": 1
},
{
"name": "vacuum_cleaner_4",
"est": 19,
"let": 23,
"e": 1200,
"lot": 1
},
{
"name": "electrical_vehicle_1",
"est": 8,
"let": 18,
"e": 3500,
"lot": 3
},
{
"name": "electrical_vehicle_2",
"est": 18,
"let": 24,
"e": 3500,
"lot": 3
}
]
}
"""
r = requests.post("http://127.0.0.1:5000/building/create", data=payload, headers=headers)
print(r)
payload = """
{
"name": "home_1",
"lat": "48.745837",
"long": "9.105398",
"mathematicalModel": {
"thermalResistance" : 0.018,
"heatCapacityAirIndoor" : 525
},
"historicalData": [
332.1709,
262.819,
234.3779,
229.2816,
235.4617,
255.1405,
283.4671,
432.1225,
534.3769,
559.6205,
608.4645,
585.9718,
648.3234,
668.8364,
557.5756,
526.7263,
550.5535,
529.8151,
641.3157,
754.156,
782.5452,
740.9206,
597.4084,
475.6613
],
"components": [
{
"name": "washing_machine",
"est": 9,
"let": 17,
"e": 2000,
"lot": 2
},
{
"name": "dish_washer",
"est": 9,
"let": 12,
"e": 1800,
"lot": 2
},
{
"name": "spin_dryer",
"est": 13,
"let": 18,
"e": 2500,
"lot": 1
},
{
"name": "electrical_vehicle",
"est": 18,
"let": 24,
"e": 3500,
"lot": 3
},
{
"name": "vacuum_cleaner",
"est": 9,
"let": 17,
"e": 1.2,
"lot": 1
}
]
}
"""
r = requests.post("http://127.0.0.1:5000/building/create", data=payload, headers=headers)
print(r)
r = requests.post("http://127.0.0.1:5001/updateWeather")
print(r)
r = requests.post("http://127.0.0.1:5003/updateprices")
print(r)
r = requests.post("http://127.0.0.1:5002/simulation/init")
print(r)
r = requests.post("http://127.0.0.1:5002/simulation/forecast")
print(r)
r = requests.post("http://127.0.0.1:5004/optimizer/generateSchedule")
print(r)
for i in range(40):
r = requests.post("http://127.0.0.1:5002/simulation/nextHour")
print(r)
| 16.331058 | 92 | 0.572414 | 642 | 4,785 | 4.214953 | 0.319315 | 0.046563 | 0.067258 | 0.087953 | 0.622321 | 0.580562 | 0.580562 | 0.542868 | 0.528825 | 0.498152 | 0 | 0.222686 | 0.198537 | 4,785 | 292 | 93 | 16.386986 | 0.48292 | 0.005016 | 0 | 0.452555 | 0 | 0 | 0.811686 | 0.042245 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.007299 | 0 | 0.007299 | 0.047445 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4001fca70ec707f3b35d6586e22d35b25cfa342b | 501 | py | Python | test/tests/cmp_test.py | aisk/pyston | ac69cfef0621dbc8901175e84fa2b5cb5781a646 | [
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2020-02-06T14:28:45.000Z | 2020-02-06T14:28:45.000Z | test/tests/cmp_test.py | aisk/pyston | ac69cfef0621dbc8901175e84fa2b5cb5781a646 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | test/tests/cmp_test.py | aisk/pyston | ac69cfef0621dbc8901175e84fa2b5cb5781a646 | [
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2020-02-06T14:29:00.000Z | 2020-02-06T14:29:00.000Z | class C(object):
def __eq__(self, rhs):
print "eq", type(self), type(rhs)
return False
def __lt__(self, rhs):
print "lt", type(self), type(rhs)
return False
def __gt__(self, rhs):
print "gt", type(self), type(rhs)
return True
class D(C):
def __cmp__(self, rhs):
print "cmp", type(self), type(rhs)
return 0
l = [C(), D()]
for lhs in l:
for rhs in l:
r = cmp(lhs, rhs)
print type(lhs), type(rhs), r
| 20.875 | 42 | 0.52495 | 75 | 501 | 3.293333 | 0.293333 | 0.161943 | 0.194332 | 0.242915 | 0.404858 | 0.234818 | 0.234818 | 0 | 0 | 0 | 0 | 0.002967 | 0.327345 | 501 | 23 | 43 | 21.782609 | 0.72997 | 0 | 0 | 0.105263 | 0 | 0 | 0.017964 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.263158 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4008ff6fda2b024b1cb854796756da84350aea1d | 102 | py | Python | Numpy/01_Numpy_Sample.py | ajeyln/W3_School_Python_Coding | cfc598d5d0e96072303846b07b5c2b6f11d72690 | [
"MIT"
] | null | null | null | Numpy/01_Numpy_Sample.py | ajeyln/W3_School_Python_Coding | cfc598d5d0e96072303846b07b5c2b6f11d72690 | [
"MIT"
] | null | null | null | Numpy/01_Numpy_Sample.py | ajeyln/W3_School_Python_Coding | cfc598d5d0e96072303846b07b5c2b6f11d72690 | [
"MIT"
] | null | null | null | import numpy as np
arr = np.array([1, 2, 3, 4, 5])
print(arr)
print("The Type is:")
print(type(arr)) | 14.571429 | 31 | 0.627451 | 21 | 102 | 3.047619 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.058824 | 0.166667 | 102 | 7 | 32 | 14.571429 | 0.694118 | 0 | 0 | 0 | 0 | 0 | 0.116505 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 0.6 | 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 |
4013ccdd39414e8a8e5314fbb19321e3e4d2ed1f | 174 | py | Python | tests/data/write_all_consumer.py | lumatijev/mitogen | b610b0c93bbab1bc0fbe86cfcc4f3a56fd2b2c14 | [
"BSD-3-Clause"
] | null | null | null | tests/data/write_all_consumer.py | lumatijev/mitogen | b610b0c93bbab1bc0fbe86cfcc4f3a56fd2b2c14 | [
"BSD-3-Clause"
] | null | null | null | tests/data/write_all_consumer.py | lumatijev/mitogen | b610b0c93bbab1bc0fbe86cfcc4f3a56fd2b2c14 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# I consume 65535 bytes every 10ms, for testing mitogen.core.write_all()
import os
import time
while True:
os.read(0, 65535)
time.sleep(0.01)
| 17.4 | 72 | 0.706897 | 30 | 174 | 4.066667 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111888 | 0.178161 | 174 | 9 | 73 | 19.333333 | 0.741259 | 0.522989 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.4 | 0 | 0.4 | 0 | 0 | 0 | 0 | null | 0 | 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 |
40180ed5f3fe46aaca40908fbcdf956538ca57d8 | 80 | py | Python | test_the_warden.py | CorgiTosh/the-warden | 86f9926a3971e0bd7e967ab1e2e988fbb8c9ddda | [
"MIT"
] | null | null | null | test_the_warden.py | CorgiTosh/the-warden | 86f9926a3971e0bd7e967ab1e2e988fbb8c9ddda | [
"MIT"
] | null | null | null | test_the_warden.py | CorgiTosh/the-warden | 86f9926a3971e0bd7e967ab1e2e988fbb8c9ddda | [
"MIT"
] | null | null | null | import the_warden
class TestBot:
def test_bonk(self):
assert(True) | 13.333333 | 24 | 0.675 | 11 | 80 | 4.727273 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 80 | 6 | 25 | 13.333333 | 0.866667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4023e1446d444eeeb48eee873d751abd58a88c8a | 208 | py | Python | practice0/print_tuple.py | DeercoderPractice/python | 4a32cc8922f47baea390e8167e34f185f67ae0fd | [
"MIT"
] | null | null | null | practice0/print_tuple.py | DeercoderPractice/python | 4a32cc8922f47baea390e8167e34f185f67ae0fd | [
"MIT"
] | null | null | null | practice0/print_tuple.py | DeercoderPractice/python | 4a32cc8922f47baea390e8167e34f185f67ae0fd | [
"MIT"
] | null | null | null | #! /usr/bin/python
# Filename: print_tuple.py
# Description: this script is used to print tuple with %
age = 22
name = "deercoder"
print '%s is %d years old' %(name, age)
print 'why %s is doing that' %name
| 20.8 | 56 | 0.682692 | 35 | 208 | 4.028571 | 0.714286 | 0.141844 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011834 | 0.1875 | 208 | 9 | 57 | 23.111111 | 0.822485 | 0.466346 | 0 | 0 | 0 | 0 | 0.435185 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.5 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
403e6711020452ee54bddb1a5db21f0774780014 | 838 | py | Python | fastapi_admin/utils.py | Dudude-bit/fastapi-admin | a9dd28e7929ff1d8f30fa196662b129659b41560 | [
"Apache-2.0"
] | null | null | null | fastapi_admin/utils.py | Dudude-bit/fastapi-admin | a9dd28e7929ff1d8f30fa196662b129659b41560 | [
"Apache-2.0"
] | null | null | null | fastapi_admin/utils.py | Dudude-bit/fastapi-admin | a9dd28e7929ff1d8f30fa196662b129659b41560 | [
"Apache-2.0"
] | null | null | null | import datetime
import random
import string
import bcrypt
from bson import ObjectId
from mongoengine import QuerySet
def generate_random_str(
length: int,
is_digit: bool = True,
):
if is_digit:
all_char = string.digits
else:
all_char = string.ascii_letters + string.digits
return "".join(random.sample(all_char, length))
def check_password(password: str, password_hash: str):
return bcrypt.checkpw(password.encode(), password_hash.encode())
def hash_password(password: str):
return bcrypt.hashpw(password.encode(), bcrypt.gensalt()).decode()
def default_json(obj):
if isinstance(obj, QuerySet):
return list(obj)
elif isinstance(obj, ObjectId):
return str(obj)
elif isinstance(obj, (datetime.datetime, datetime.date)):
return obj.isoformat()
| 23.277778 | 70 | 0.698091 | 105 | 838 | 5.447619 | 0.428571 | 0.036713 | 0.045455 | 0.06993 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.200477 | 838 | 35 | 71 | 23.942857 | 0.853731 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.153846 | false | 0.153846 | 0.230769 | 0.076923 | 0.615385 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
4041100c06a69f7b615c0f4ae0ac990e99c7c50f | 106 | py | Python | lambdata_ianforrest11/df_utils.py | ianforrest11/lambdata | f494b4e9ce55be82a81ab61b3bf6957c86a2a0d2 | [
"MIT"
] | null | null | null | lambdata_ianforrest11/df_utils.py | ianforrest11/lambdata | f494b4e9ce55be82a81ab61b3bf6957c86a2a0d2 | [
"MIT"
] | null | null | null | lambdata_ianforrest11/df_utils.py | ianforrest11/lambdata | f494b4e9ce55be82a81ab61b3bf6957c86a2a0d2 | [
"MIT"
] | null | null | null | """
Utility functions for working with dataframes
"""
import pandas
TEST_DF = pandas.DataFrame([1,2,3])
| 13.25 | 45 | 0.726415 | 15 | 106 | 5.066667 | 0.933333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.032967 | 0.141509 | 106 | 7 | 46 | 15.142857 | 0.802198 | 0.424528 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
404e980009f79b0f9c9e5c0d812a467028a3dc99 | 13,359 | py | Python | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/models/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/models/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/models/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from ._models_py3 import AccessPolicy
from ._models_py3 import AccountImmutabilityPolicyProperties
from ._models_py3 import AccountSasParameters
from ._models_py3 import ActiveDirectoryProperties
from ._models_py3 import AzureEntityResource
from ._models_py3 import AzureFilesIdentityBasedAuthentication
from ._models_py3 import BlobContainer
from ._models_py3 import BlobInventoryPolicy
from ._models_py3 import BlobInventoryPolicyDefinition
from ._models_py3 import BlobInventoryPolicyFilter
from ._models_py3 import BlobInventoryPolicyRule
from ._models_py3 import BlobInventoryPolicySchema
from ._models_py3 import BlobRestoreParameters
from ._models_py3 import BlobRestoreRange
from ._models_py3 import BlobRestoreStatus
from ._models_py3 import BlobServiceItems
from ._models_py3 import BlobServiceProperties
from ._models_py3 import ChangeFeed
from ._models_py3 import CheckNameAvailabilityResult
from ._models_py3 import CloudErrorAutoGenerated
from ._models_py3 import CloudErrorBody
from ._models_py3 import CloudErrorBodyAutoGenerated
from ._models_py3 import CorsRule
from ._models_py3 import CorsRules
from ._models_py3 import CustomDomain
from ._models_py3 import DateAfterCreation
from ._models_py3 import DateAfterModification
from ._models_py3 import DeleteRetentionPolicy
from ._models_py3 import DeletedAccount
from ._models_py3 import DeletedAccountListResult
from ._models_py3 import DeletedShare
from ._models_py3 import Dimension
from ._models_py3 import Encryption
from ._models_py3 import EncryptionIdentity
from ._models_py3 import EncryptionScope
from ._models_py3 import EncryptionScopeKeyVaultProperties
from ._models_py3 import EncryptionScopeListResult
from ._models_py3 import EncryptionService
from ._models_py3 import EncryptionServices
from ._models_py3 import Endpoints
from ._models_py3 import ErrorResponse
from ._models_py3 import ErrorResponseBody
from ._models_py3 import ExtendedLocation
from ._models_py3 import FileServiceItems
from ._models_py3 import FileServiceProperties
from ._models_py3 import FileShare
from ._models_py3 import FileShareItem
from ._models_py3 import FileShareItems
from ._models_py3 import GeoReplicationStats
from ._models_py3 import IPRule
from ._models_py3 import Identity
from ._models_py3 import ImmutabilityPolicy
from ._models_py3 import ImmutabilityPolicyProperties
from ._models_py3 import ImmutableStorageAccount
from ._models_py3 import ImmutableStorageWithVersioning
from ._models_py3 import KeyCreationTime
from ._models_py3 import KeyPolicy
from ._models_py3 import KeyVaultProperties
from ._models_py3 import LastAccessTimeTrackingPolicy
from ._models_py3 import LeaseContainerRequest
from ._models_py3 import LeaseContainerResponse
from ._models_py3 import LeaseShareRequest
from ._models_py3 import LeaseShareResponse
from ._models_py3 import LegalHold
from ._models_py3 import LegalHoldProperties
from ._models_py3 import ListAccountSasResponse
from ._models_py3 import ListBlobInventoryPolicy
from ._models_py3 import ListContainerItem
from ._models_py3 import ListContainerItems
from ._models_py3 import ListQueue
from ._models_py3 import ListQueueResource
from ._models_py3 import ListQueueServices
from ._models_py3 import ListServiceSasResponse
from ._models_py3 import ListTableResource
from ._models_py3 import ListTableServices
from ._models_py3 import ManagementPolicy
from ._models_py3 import ManagementPolicyAction
from ._models_py3 import ManagementPolicyBaseBlob
from ._models_py3 import ManagementPolicyDefinition
from ._models_py3 import ManagementPolicyFilter
from ._models_py3 import ManagementPolicyRule
from ._models_py3 import ManagementPolicySchema
from ._models_py3 import ManagementPolicySnapShot
from ._models_py3 import ManagementPolicyVersion
from ._models_py3 import MetricSpecification
from ._models_py3 import Multichannel
from ._models_py3 import NetworkRuleSet
from ._models_py3 import ObjectReplicationPolicies
from ._models_py3 import ObjectReplicationPolicy
from ._models_py3 import ObjectReplicationPolicyFilter
from ._models_py3 import ObjectReplicationPolicyRule
from ._models_py3 import Operation
from ._models_py3 import OperationDisplay
from ._models_py3 import OperationListResult
from ._models_py3 import PrivateEndpoint
from ._models_py3 import PrivateEndpointConnection
from ._models_py3 import PrivateEndpointConnectionListResult
from ._models_py3 import PrivateLinkResource
from ._models_py3 import PrivateLinkResourceListResult
from ._models_py3 import PrivateLinkServiceConnectionState
from ._models_py3 import ProtectedAppendWritesHistory
from ._models_py3 import ProtocolSettings
from ._models_py3 import ProxyResource
from ._models_py3 import QueueServiceProperties
from ._models_py3 import Resource
from ._models_py3 import ResourceAccessRule
from ._models_py3 import RestorePolicyProperties
from ._models_py3 import Restriction
from ._models_py3 import RoutingPreference
from ._models_py3 import SKUCapability
from ._models_py3 import SasPolicy
from ._models_py3 import ServiceSasParameters
from ._models_py3 import ServiceSpecification
from ._models_py3 import SignedIdentifier
from ._models_py3 import Sku
from ._models_py3 import SkuInformation
from ._models_py3 import SmbSetting
from ._models_py3 import StorageAccount
from ._models_py3 import StorageAccountCheckNameAvailabilityParameters
from ._models_py3 import StorageAccountCreateParameters
from ._models_py3 import StorageAccountInternetEndpoints
from ._models_py3 import StorageAccountKey
from ._models_py3 import StorageAccountListKeysResult
from ._models_py3 import StorageAccountListResult
from ._models_py3 import StorageAccountMicrosoftEndpoints
from ._models_py3 import StorageAccountRegenerateKeyParameters
from ._models_py3 import StorageAccountUpdateParameters
from ._models_py3 import StorageQueue
from ._models_py3 import StorageSkuListResult
from ._models_py3 import SystemData
from ._models_py3 import Table
from ._models_py3 import TableServiceProperties
from ._models_py3 import TagFilter
from ._models_py3 import TagProperty
from ._models_py3 import TrackedResource
from ._models_py3 import UpdateHistoryProperty
from ._models_py3 import Usage
from ._models_py3 import UsageListResult
from ._models_py3 import UsageName
from ._models_py3 import UserAssignedIdentity
from ._models_py3 import VirtualNetworkRule
from ._storage_management_client_enums import (
AccessTier,
AccountImmutabilityPolicyState,
AccountStatus,
BlobInventoryPolicyName,
BlobRestoreProgressStatus,
Bypass,
CorsRuleAllowedMethodsItem,
CreatedByType,
DefaultAction,
DefaultSharePermission,
DirectoryServiceOptions,
EnabledProtocols,
EncryptionScopeSource,
EncryptionScopeState,
ExpirationAction,
ExtendedLocationTypes,
Format,
GeoReplicationStatus,
HttpProtocol,
IdentityType,
ImmutabilityPolicyState,
ImmutabilityPolicyUpdateType,
InventoryRuleType,
KeyPermission,
KeySource,
KeyType,
Kind,
LargeFileSharesState,
LeaseContainerRequestAction,
LeaseDuration,
LeaseShareAction,
LeaseState,
LeaseStatus,
ListContainersInclude,
ManagementPolicyName,
MigrationState,
MinimumTlsVersion,
Name,
ObjectType,
Permissions,
PrivateEndpointConnectionProvisioningState,
PrivateEndpointServiceConnectionStatus,
ProvisioningState,
PublicAccess,
PublicNetworkAccess,
Reason,
ReasonCode,
RootSquashType,
RoutingChoice,
RuleType,
Schedule,
Services,
ShareAccessTier,
SignedResource,
SignedResourceTypes,
SkuName,
SkuTier,
State,
StorageAccountExpand,
UsageUnit,
)
__all__ = [
'AccessPolicy',
'AccountImmutabilityPolicyProperties',
'AccountSasParameters',
'ActiveDirectoryProperties',
'AzureEntityResource',
'AzureFilesIdentityBasedAuthentication',
'BlobContainer',
'BlobInventoryPolicy',
'BlobInventoryPolicyDefinition',
'BlobInventoryPolicyFilter',
'BlobInventoryPolicyRule',
'BlobInventoryPolicySchema',
'BlobRestoreParameters',
'BlobRestoreRange',
'BlobRestoreStatus',
'BlobServiceItems',
'BlobServiceProperties',
'ChangeFeed',
'CheckNameAvailabilityResult',
'CloudErrorAutoGenerated',
'CloudErrorBody',
'CloudErrorBodyAutoGenerated',
'CorsRule',
'CorsRules',
'CustomDomain',
'DateAfterCreation',
'DateAfterModification',
'DeleteRetentionPolicy',
'DeletedAccount',
'DeletedAccountListResult',
'DeletedShare',
'Dimension',
'Encryption',
'EncryptionIdentity',
'EncryptionScope',
'EncryptionScopeKeyVaultProperties',
'EncryptionScopeListResult',
'EncryptionService',
'EncryptionServices',
'Endpoints',
'ErrorResponse',
'ErrorResponseBody',
'ExtendedLocation',
'FileServiceItems',
'FileServiceProperties',
'FileShare',
'FileShareItem',
'FileShareItems',
'GeoReplicationStats',
'IPRule',
'Identity',
'ImmutabilityPolicy',
'ImmutabilityPolicyProperties',
'ImmutableStorageAccount',
'ImmutableStorageWithVersioning',
'KeyCreationTime',
'KeyPolicy',
'KeyVaultProperties',
'LastAccessTimeTrackingPolicy',
'LeaseContainerRequest',
'LeaseContainerResponse',
'LeaseShareRequest',
'LeaseShareResponse',
'LegalHold',
'LegalHoldProperties',
'ListAccountSasResponse',
'ListBlobInventoryPolicy',
'ListContainerItem',
'ListContainerItems',
'ListQueue',
'ListQueueResource',
'ListQueueServices',
'ListServiceSasResponse',
'ListTableResource',
'ListTableServices',
'ManagementPolicy',
'ManagementPolicyAction',
'ManagementPolicyBaseBlob',
'ManagementPolicyDefinition',
'ManagementPolicyFilter',
'ManagementPolicyRule',
'ManagementPolicySchema',
'ManagementPolicySnapShot',
'ManagementPolicyVersion',
'MetricSpecification',
'Multichannel',
'NetworkRuleSet',
'ObjectReplicationPolicies',
'ObjectReplicationPolicy',
'ObjectReplicationPolicyFilter',
'ObjectReplicationPolicyRule',
'Operation',
'OperationDisplay',
'OperationListResult',
'PrivateEndpoint',
'PrivateEndpointConnection',
'PrivateEndpointConnectionListResult',
'PrivateLinkResource',
'PrivateLinkResourceListResult',
'PrivateLinkServiceConnectionState',
'ProtectedAppendWritesHistory',
'ProtocolSettings',
'ProxyResource',
'QueueServiceProperties',
'Resource',
'ResourceAccessRule',
'RestorePolicyProperties',
'Restriction',
'RoutingPreference',
'SKUCapability',
'SasPolicy',
'ServiceSasParameters',
'ServiceSpecification',
'SignedIdentifier',
'Sku',
'SkuInformation',
'SmbSetting',
'StorageAccount',
'StorageAccountCheckNameAvailabilityParameters',
'StorageAccountCreateParameters',
'StorageAccountInternetEndpoints',
'StorageAccountKey',
'StorageAccountListKeysResult',
'StorageAccountListResult',
'StorageAccountMicrosoftEndpoints',
'StorageAccountRegenerateKeyParameters',
'StorageAccountUpdateParameters',
'StorageQueue',
'StorageSkuListResult',
'SystemData',
'Table',
'TableServiceProperties',
'TagFilter',
'TagProperty',
'TrackedResource',
'UpdateHistoryProperty',
'Usage',
'UsageListResult',
'UsageName',
'UserAssignedIdentity',
'VirtualNetworkRule',
'AccessTier',
'AccountImmutabilityPolicyState',
'AccountStatus',
'BlobInventoryPolicyName',
'BlobRestoreProgressStatus',
'Bypass',
'CorsRuleAllowedMethodsItem',
'CreatedByType',
'DefaultAction',
'DefaultSharePermission',
'DirectoryServiceOptions',
'EnabledProtocols',
'EncryptionScopeSource',
'EncryptionScopeState',
'ExpirationAction',
'ExtendedLocationTypes',
'Format',
'GeoReplicationStatus',
'HttpProtocol',
'IdentityType',
'ImmutabilityPolicyState',
'ImmutabilityPolicyUpdateType',
'InventoryRuleType',
'KeyPermission',
'KeySource',
'KeyType',
'Kind',
'LargeFileSharesState',
'LeaseContainerRequestAction',
'LeaseDuration',
'LeaseShareAction',
'LeaseState',
'LeaseStatus',
'ListContainersInclude',
'ManagementPolicyName',
'MigrationState',
'MinimumTlsVersion',
'Name',
'ObjectType',
'Permissions',
'PrivateEndpointConnectionProvisioningState',
'PrivateEndpointServiceConnectionStatus',
'ProvisioningState',
'PublicAccess',
'PublicNetworkAccess',
'Reason',
'ReasonCode',
'RootSquashType',
'RoutingChoice',
'RuleType',
'Schedule',
'Services',
'ShareAccessTier',
'SignedResource',
'SignedResourceTypes',
'SkuName',
'SkuTier',
'State',
'StorageAccountExpand',
'UsageUnit',
]
| 31.95933 | 94 | 0.781945 | 1,020 | 13,359 | 9.956863 | 0.244118 | 0.138834 | 0.180484 | 0.263785 | 0.183931 | 0.183931 | 0.183931 | 0.183931 | 0.183931 | 0.183931 | 0 | 0.01243 | 0.144846 | 13,359 | 417 | 95 | 32.035971 | 0.876576 | 0.033835 | 0 | 0 | 0 | 0 | 0.278704 | 0.140631 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.004926 | 0.349754 | 0 | 0.349754 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
4053b017e65985029dd964ac7a38191c4949b6e6 | 167 | py | Python | adapters/moes/__init__.py | vladi1234/domoticz-zigbee2mqtt-plugin | 198fe7c5148e77495c936a3acb3b50217acb0562 | [
"MIT"
] | null | null | null | adapters/moes/__init__.py | vladi1234/domoticz-zigbee2mqtt-plugin | 198fe7c5148e77495c936a3acb3b50217acb0562 | [
"MIT"
] | null | null | null | adapters/moes/__init__.py | vladi1234/domoticz-zigbee2mqtt-plugin | 198fe7c5148e77495c936a3acb3b50217acb0562 | [
"MIT"
] | null | null | null | from adapters.moes.BRT100TRV import BRT100TRV
moes_adapters = {
'BRT-100-TRV': BRT100TRV, # Moes BRT-100-TRV Radiator valve with thermostat
}
| 23.857143 | 98 | 0.664671 | 20 | 167 | 5.5 | 0.6 | 0.236364 | 0.163636 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.12 | 0.251497 | 167 | 6 | 99 | 27.833333 | 0.76 | 0.281437 | 0 | 0 | 0 | 0 | 0.09322 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4065489eccdd9b886057a49d52e641939cf148e4 | 151 | py | Python | Zip_key and value.py | zysundar/Python_programming | 51384ecd2dfdb2cfe94b67605ca49bbd7edf49b6 | [
"bzip2-1.0.6"
] | null | null | null | Zip_key and value.py | zysundar/Python_programming | 51384ecd2dfdb2cfe94b67605ca49bbd7edf49b6 | [
"bzip2-1.0.6"
] | null | null | null | Zip_key and value.py | zysundar/Python_programming | 51384ecd2dfdb2cfe94b67605ca49bbd7edf49b6 | [
"bzip2-1.0.6"
] | null | null | null | keys = ['red', 'green', 'blue']
values = ['#FF0000','#008000', '#0000FF']
color_dictionary = dict(zip(keys, values))
print(color_dictionary)
| 30.2 | 45 | 0.622517 | 17 | 151 | 5.411765 | 0.764706 | 0.326087 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.110236 | 0.15894 | 151 | 4 | 46 | 37.75 | 0.614173 | 0 | 0 | 0 | 0 | 0 | 0.22449 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
40795681affec3fdc946f706158f4f765cc0ce2b | 329 | py | Python | python-re/list.py | OpenEDF/practices-test | a0c81dbd295cb9017f32f55987dac6ab4d8ab3d3 | [
"Apache-2.0"
] | 4 | 2021-08-13T15:59:17.000Z | 2022-03-19T23:54:14.000Z | python-re/list.py | OpenEDF/practices-test | a0c81dbd295cb9017f32f55987dac6ab4d8ab3d3 | [
"Apache-2.0"
] | null | null | null | python-re/list.py | OpenEDF/practices-test | a0c81dbd295cb9017f32f55987dac6ab4d8ab3d3 | [
"Apache-2.0"
] | null | null | null | #!/bin/python
# list
lauguage = 'Python'
lst = list(lauguage)
print(type(lst))
print(lst)
print("-------------------------------")
# [i for i in iterable if expression]
lst = [i for i in lauguage]
print(type(lst))
print(lst)
print("-------------------------------")
add_two_nums = lambda a, b: a + b
print(add_two_nums(2, 3))
| 18.277778 | 40 | 0.541033 | 47 | 329 | 3.702128 | 0.446809 | 0.183908 | 0.195402 | 0.229885 | 0.37931 | 0.37931 | 0.37931 | 0 | 0 | 0 | 0 | 0.006993 | 0.130699 | 329 | 17 | 41 | 19.352941 | 0.601399 | 0.161094 | 0 | 0.545455 | 0 | 0 | 0.249084 | 0.227106 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.636364 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
408638f98f0831a0a5a10089db98d07681bd944a | 289 | py | Python | stubs/loboris-esp32_lobo-3_2_24/json.py | RonaldHiemstra/micropython-stubs | d97f879b01f6687baaebef1c7e26a80909c3cff3 | [
"MIT"
] | 38 | 2020-10-18T21:59:44.000Z | 2022-03-17T03:03:28.000Z | stubs/loboris-esp32_lobo-3_2_24/json.py | RonaldHiemstra/micropython-stubs | d97f879b01f6687baaebef1c7e26a80909c3cff3 | [
"MIT"
] | 176 | 2020-10-18T14:31:03.000Z | 2022-03-30T23:22:39.000Z | stubs/loboris-esp32_lobo-3_2_24/json.py | RonaldHiemstra/micropython-stubs | d97f879b01f6687baaebef1c7e26a80909c3cff3 | [
"MIT"
] | 6 | 2020-12-28T21:11:12.000Z | 2022-02-06T04:07:50.000Z | """
Module: 'json' on esp32_LoBo
MCU: (sysname='esp32_LoBo', nodename='esp32_LoBo', release='3.2.24', version='ESP32_LoBo_v3.2.24 on 2018-09-06', machine='ESP32 board with ESP32')
Stubber: 1.0.0
"""
def dump():
pass
def dumps():
pass
def load():
pass
def loads():
pass
| 16.055556 | 146 | 0.643599 | 47 | 289 | 3.851064 | 0.617021 | 0.198895 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130252 | 0.176471 | 289 | 17 | 147 | 17 | 0.630252 | 0.657439 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | true | 0.5 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
408a6c54f6a06b3450e73e1567046e9e677539cb | 269 | py | Python | robob/__init__.py | wavesoft/robo-benchmark | 1191b86bb161d88fdd5c165750e10ad2330661dc | [
"Apache-2.0"
] | 3 | 2016-05-10T12:01:44.000Z | 2020-09-28T10:23:34.000Z | robob/__init__.py | wavesoft/robob | 1191b86bb161d88fdd5c165750e10ad2330661dc | [
"Apache-2.0"
] | null | null | null | robob/__init__.py | wavesoft/robob | 1191b86bb161d88fdd5c165750e10ad2330661dc | [
"Apache-2.0"
] | null | null | null |
def time2sec(timestr):
"""
Conver time specs to seconds
"""
if timestr[-1] == "s":
return int(timestr[0:-1])
elif timestr[-1] == "m":
return int(timestr[0:-1]) * 60
elif timestr[-1] == "h":
return int(timestr[0:-1]) * 60 * 60
else:
return int(timestr)
| 17.933333 | 37 | 0.591078 | 42 | 269 | 3.785714 | 0.452381 | 0.226415 | 0.402516 | 0.320755 | 0.36478 | 0.251572 | 0 | 0 | 0 | 0 | 0 | 0.074074 | 0.197026 | 269 | 14 | 38 | 19.214286 | 0.662037 | 0.104089 | 0 | 0 | 0 | 0 | 0.013043 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
408c97d84733f5ace42d8644cfbdd8d68e9054f0 | 419 | py | Python | terrascript/data/cloudsmith_io/cloudsmith.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/data/cloudsmith_io/cloudsmith.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/data/cloudsmith_io/cloudsmith.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/data/cloudsmith-io/cloudsmith.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:14:19 UTC)
import terrascript
class cloudsmith_namespace(terrascript.Data):
pass
class cloudsmith_package_list(terrascript.Data):
pass
class cloudsmith_repository(terrascript.Data):
pass
__all__ = [
"cloudsmith_namespace",
"cloudsmith_package_list",
"cloudsmith_repository",
]
| 18.217391 | 73 | 0.763723 | 48 | 419 | 6.416667 | 0.520833 | 0.194805 | 0.185065 | 0.155844 | 0.220779 | 0 | 0 | 0 | 0 | 0 | 0 | 0.033426 | 0.143198 | 419 | 22 | 74 | 19.045455 | 0.824513 | 0.27685 | 0 | 0.25 | 1 | 0 | 0.213333 | 0.146667 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.25 | 0.083333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
409b5d6e46a1419fb1ba21482061d1035510512b | 200 | py | Python | data_collection/gazette/spiders/sc_curitibanos.py | kaiocp/querido-diario | 86004049c6eee305e13066cf3607d30849bb099a | [
"MIT"
] | 454 | 2018-04-07T03:32:57.000Z | 2020-08-17T19:56:22.000Z | data_collection/gazette/spiders/sc_curitibanos.py | kaiocp/querido-diario | 86004049c6eee305e13066cf3607d30849bb099a | [
"MIT"
] | 254 | 2020-08-18T14:09:43.000Z | 2022-03-28T11:30:51.000Z | data_collection/gazette/spiders/sc_curitibanos.py | kaiocp/querido-diario | 86004049c6eee305e13066cf3607d30849bb099a | [
"MIT"
] | 183 | 2018-04-11T15:09:37.000Z | 2020-08-15T18:55:11.000Z | from gazette.spiders.base.fecam import FecamGazetteSpider
class ScCuritibanosSpider(FecamGazetteSpider):
name = "sc_curitibanos"
FECAM_QUERY = "cod_entidade:82"
TERRITORY_ID = "4204806"
| 25 | 57 | 0.775 | 21 | 200 | 7.190476 | 0.904762 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.052632 | 0.145 | 200 | 7 | 58 | 28.571429 | 0.830409 | 0 | 0 | 0 | 0 | 0 | 0.18 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
40a1520302b0f0e4d85e8f3d6b9efd7b8442a7be | 2,588 | py | Python | openrave/docs/breathe/finder/doxygen/__init__.py | jdsika/TUM_HOly | a2ac55fa1751a3a8038cf61d29b95005f36d6264 | [
"MIT"
] | 2 | 2015-11-13T16:40:57.000Z | 2017-09-15T15:37:19.000Z | openrave/docs/breathe/finder/doxygen/__init__.py | jdsika/holy | a2ac55fa1751a3a8038cf61d29b95005f36d6264 | [
"MIT"
] | 1 | 2016-06-13T01:29:51.000Z | 2016-06-14T00:38:27.000Z | openrave/docs/breathe/finder/doxygen/__init__.py | jdsika/holy | a2ac55fa1751a3a8038cf61d29b95005f36d6264 | [
"MIT"
] | 2 | 2015-10-03T06:24:07.000Z | 2016-01-21T11:36:20.000Z |
from breathe.finder.doxygen import index as indexfinder
from breathe.finder.doxygen import compound as compoundfinder
from breathe.parser.doxygen import index, compound
from breathe.finder import Matcher
class ItemMatcher(Matcher):
def __init__(self, name, type_):
self.name = name
self.type_ = type_
def match(self, data_object):
return self.name == data_object.name and self.type_ == data_object.kind
def __repr__(self):
return "<ItemMatcher - name:%s, type_:%s>" % (self.name, self.type_)
class RefMatcher(Matcher):
def __init__(self, refid):
self.refid = refid
def match(self, data_object):
return self.refid == data_object.refid
class ItemMatcherFactory(Matcher):
def create_name_type_matcher(self, name, type_):
return ItemMatcher(name, type_)
def create_ref_matcher(self, ref):
return RefMatcher(ref)
class CreateCompoundTypeSubFinder(object):
def __init__(self, parser_factory, matcher_factory):
self.parser_factory = parser_factory
self.matcher_factory = matcher_factory
def __call__(self, project_info, *args):
compound_parser = self.parser_factory.create_compound_parser(project_info)
return indexfinder.CompoundTypeSubItemFinder(self.matcher_factory, compound_parser, project_info, *args)
class DoxygenItemFinderFactory(object):
def __init__(self, finders, project_info):
self.finders = finders
self.project_info = project_info
def create_finder(self, data_object):
return self.finders[data_object.__class__](self.project_info, data_object, self)
class DoxygenItemFinderFactoryCreator(object):
def __init__(self, parser_factory, matcher_factory):
self.parser_factory = parser_factory
self.matcher_factory = matcher_factory
def create_factory(self, project_info):
finders = {
index.DoxygenTypeSub : indexfinder.DoxygenTypeSubItemFinder,
index.CompoundTypeSub : CreateCompoundTypeSubFinder(self.parser_factory, self.matcher_factory),
index.MemberTypeSub : indexfinder.MemberTypeSubItemFinder,
compound.DoxygenTypeSub : compoundfinder.DoxygenTypeSubItemFinder,
compound.compounddefTypeSub : compoundfinder.CompoundDefTypeSubItemFinder,
compound.sectiondefTypeSub : compoundfinder.SectionDefTypeSubItemFinder,
compound.memberdefTypeSub : compoundfinder.MemberDefTypeSubItemFinder,
}
return DoxygenItemFinderFactory(finders, project_info)
| 27.827957 | 112 | 0.726816 | 264 | 2,588 | 6.806818 | 0.200758 | 0.055092 | 0.056761 | 0.033389 | 0.220924 | 0.156928 | 0.156928 | 0.121313 | 0.121313 | 0.121313 | 0 | 0 | 0.197836 | 2,588 | 92 | 113 | 28.130435 | 0.865607 | 0 | 0 | 0.16 | 0 | 0 | 0.012771 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.26 | false | 0 | 0.08 | 0.12 | 0.62 | 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 |
40afdd9a6a661d9435b9f250c0456ece41964203 | 678 | py | Python | core/app/alarm/business/alarm_status.py | EmixMaxime/mx-home-security | ec6d329a09bb2e0afbbd7e481937893311f02634 | [
"MIT"
] | null | null | null | core/app/alarm/business/alarm_status.py | EmixMaxime/mx-home-security | ec6d329a09bb2e0afbbd7e481937893311f02634 | [
"MIT"
] | null | null | null | core/app/alarm/business/alarm_status.py | EmixMaxime/mx-home-security | ec6d329a09bb2e0afbbd7e481937893311f02634 | [
"MIT"
] | null | null | null | from devices.models import Device
from alarm.business.alarm_motions import current_motions_device
def can_turn_off(device: Device) -> bool:
"""
If a motion is being detected you cannot turn off the alarm on the device.
Otherwise, it would be a huge flaw: a schedule could turn off the alarm even if somebody is being detected.
Note: the system allows the the resident to force the turn off.
Parameters
----------
device : Device
The device that host the alarm service.
Returns
-------
bool
Whether or not the alarm can be turned off for the given device.
"""
return not current_motions_device(device).exists()
| 30.818182 | 111 | 0.69469 | 100 | 678 | 4.64 | 0.53 | 0.060345 | 0.086207 | 0.064655 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.237463 | 678 | 21 | 112 | 32.285714 | 0.897485 | 0.619469 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.5 | 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 |
40d121a3f1dc9f12e54314507d2748e6da54231c | 3,698 | py | Python | src/aria_rest/controllers.py | openov2/common-tosca-aria | 334cbd6ce7f763cf9430c4db0b40b7ec0847f0ab | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/aria_rest/controllers.py | openov2/common-tosca-aria | 334cbd6ce7f763cf9430c4db0b40b7ec0847f0ab | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/aria_rest/controllers.py | openov2/common-tosca-aria | 334cbd6ce7f763cf9430c4db0b40b7ec0847f0ab | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2017 GigaSpaces Technologies Ltd. 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 json
from aria.parser.consumption import ConsumerChain, Read, Validate, Model, Inputs, Instance
from aria.utils.formatting import json_dumps
from .aria_customisation import ConsumptionContextBuilder
def json_response(function):
return lambda instance, **kwargs: json.loads(json_dumps(function(instance, **kwargs)))
def dump_issues(function):
def render_issues(data, *args):
try:
return function(data, *args)
except ControllerOperationError as e:
return {'issues': e.issues}
return render_issues
class ControllerOperationError(Exception):
def __init__(self, issues):
super(ControllerOperationError, self).__init__()
self.issues = issues
# TODO in future if needed
class Controller(object):
pass
class ParseController(Controller):
@staticmethod
def _execute_command(command_data, consumers, *args):
context = ConsumptionContextBuilder(*args, **command_data).build()
ConsumerChain(context, consumers).consume()
if context.validation.has_issues:
raise ControllerOperationError(context.validation.issues_as_raw)
return context
@classmethod
@dump_issues
def _validate(cls, data, *args):
cls._execute_command(data, (Read, Validate), *args)
return {}
@classmethod
@dump_issues
def _model(cls, data, *args):
context = cls._execute_command(data, (Read, Validate, Model), *args)
return {
'types': context.modeling.types_as_raw,
'model': context.modeling.model_as_raw
}
@classmethod
@dump_issues
def _instance(cls, data, *args):
context = cls._execute_command(data, (Read, Validate, Model, Inputs, Instance), *args)
return {
'types': context.modeling.types_as_raw,
'model': context.modeling.model_as_raw,
'instance': context.modeling.instance_as_raw
}
@json_response
def validate_file(self, path):
return self._validate({'uri': path})
@json_response
def validate_indirect(self, indirect_data):
return self._validate(indirect_data)
@json_response
def validate_upload(self, upload_content, inputs=''):
return self._validate({'literal_location': upload_content})
@json_response
def model_file(self, path):
return self._model({'uri': path})
@json_response
def model_indirect(self, indirect_data):
return self._model(indirect_data)
@json_response
def model_upload(self, upload_content, inputs=''):
return self._model({'literal_location': upload_content})
@json_response
def instance_file(self, path, inputs=''):
return self._instance({'uri': path, 'inputs': inputs})
@json_response
def instance_indirect(self, indirect_data):
return self._instance(indirect_data, '--json')
@json_response
def instance_upload(self, upload_content, inputs=''):
return self._instance({'literal_location': upload_content, 'inputs': inputs})
| 29.349206 | 94 | 0.690373 | 431 | 3,698 | 5.723898 | 0.313225 | 0.048642 | 0.054722 | 0.029185 | 0.314957 | 0.239157 | 0.184435 | 0.102148 | 0.102148 | 0.102148 | 0 | 0.002743 | 0.211195 | 3,698 | 125 | 95 | 29.584 | 0.842989 | 0.166577 | 0 | 0.25 | 0 | 0 | 0.035563 | 0 | 0 | 0 | 0 | 0.008 | 0 | 1 | 0.223684 | false | 0.013158 | 0.052632 | 0.131579 | 0.539474 | 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 |
40d65ae3d9a535bb7b8d32538ff709d83482fe89 | 322 | py | Python | exercises/pt/test_03_14_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/pt/test_03_14_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/pt/test_03_14_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
"patterns = list(nlp.pipe(people))" in __solution__
), "Você está usando nlp.pipe envolvido em uma lista (list)?"
__msg__.good(
"Bom trabalho! Vamos seguir agora com um exemplo prático que "
"usa nlp.pipe para processar documentos com metadados adicionais."
)
| 32.2 | 74 | 0.65528 | 41 | 322 | 4.95122 | 0.853659 | 0.103448 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.251553 | 322 | 9 | 75 | 35.777778 | 0.842324 | 0 | 0 | 0 | 0 | 0 | 0.661491 | 0.068323 | 0 | 0 | 0 | 0 | 0.125 | 1 | 0.125 | true | 0 | 0 | 0 | 0.125 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
40dc7704ee2e54980e4ef01b619ce88b8181c46b | 14 | py | Python | src/util/__init__.py | Newms226/project_creator | 4fda1fd92e3b1e85a3b2f5ba2a78fe3f697213f5 | [
"MIT"
] | null | null | null | src/util/__init__.py | Newms226/project_creator | 4fda1fd92e3b1e85a3b2f5ba2a78fe3f697213f5 | [
"MIT"
] | null | null | null | src/util/__init__.py | Newms226/project_creator | 4fda1fd92e3b1e85a3b2f5ba2a78fe3f697213f5 | [
"MIT"
] | null | null | null |
URL_Root = '' | 7 | 13 | 0.571429 | 2 | 14 | 3.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.214286 | 14 | 2 | 13 | 7 | 0.636364 | 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 |
40e71fc3f3fc6416b0dc5eea5bb5777ed5311212 | 225 | py | Python | currency/urls.py | Sebasssiu/CurrencyApi | 709333417e9c132656f53bce4f82957b5c6be53b | [
"MIT"
] | null | null | null | currency/urls.py | Sebasssiu/CurrencyApi | 709333417e9c132656f53bce4f82957b5c6be53b | [
"MIT"
] | null | null | null | currency/urls.py | Sebasssiu/CurrencyApi | 709333417e9c132656f53bce4f82957b5c6be53b | [
"MIT"
] | null | null | null | from django.urls import path
from .views import *
urlpatterns = [
path('exchangeRate/', rate_exchange, name='exchangeRate'),
path('exchangeRateComparison/', rate_exchange_comparison, name='exchangeRateComparison')
]
| 28.125 | 92 | 0.76 | 22 | 225 | 7.636364 | 0.590909 | 0.142857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.12 | 225 | 7 | 93 | 32.142857 | 0.848485 | 0 | 0 | 0 | 0 | 0 | 0.311111 | 0.2 | 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 |
40eb388f57d6868cb1cb4642f143095ceefca48d | 536 | py | Python | explorations/generateEAF/pythonDemos/daylight1/getTable.py | paul-shannon/slexil | cba47d70d7301d1cc74d387e51d93b683b1109de | [
"MIT"
] | null | null | null | explorations/generateEAF/pythonDemos/daylight1/getTable.py | paul-shannon/slexil | cba47d70d7301d1cc74d387e51d93b683b1109de | [
"MIT"
] | 53 | 2019-02-14T15:12:21.000Z | 2019-12-04T14:26:13.000Z | explorations/generateEAF/pythonDemos/daylight1/getTable.py | paul-shannon/slexil | cba47d70d7301d1cc74d387e51d93b683b1109de | [
"MIT"
] | 1 | 2020-02-08T23:47:47.000Z | 2020-02-08T23:47:47.000Z | import re
import sys
sys.path.append("../../../..")
from text import *
#import importlib
#import os
#import pdb
#----------------------------------------------------------------------------------------------------
text = Text("../../../../testData/harryMosesDaylight/daylight_1_4.eaf",
"../../../../testData/harryMosesDaylight/audioPhrases",
grammaticalTermsFile="../../../../testData/harryMosesDaylight/grammaticalTerms.txt",
tierGuideFile="../../../../testData/harryMosesDaylight/tierGuide.yaml")
| 38.285714 | 101 | 0.522388 | 37 | 536 | 7.513514 | 0.621622 | 0.374101 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004193 | 0.110075 | 536 | 13 | 102 | 41.230769 | 0.578616 | 0.251866 | 0 | 0 | 0 | 0 | 0.588384 | 0.560606 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.375 | 0 | 0.375 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
40f27e6ae637bb627ac304fae806130849a09c14 | 33,794 | py | Python | pylearn2/expr/probabilistic_max_pooling.py | jacobpeplinskiV2/pylearn2 | 478903d84bfa2b317e78be4e0d78588c2f58496e | [
"BSD-3-Clause"
] | null | null | null | pylearn2/expr/probabilistic_max_pooling.py | jacobpeplinskiV2/pylearn2 | 478903d84bfa2b317e78be4e0d78588c2f58496e | [
"BSD-3-Clause"
] | null | null | null | pylearn2/expr/probabilistic_max_pooling.py | jacobpeplinskiV2/pylearn2 | 478903d84bfa2b317e78be4e0d78588c2f58496e | [
"BSD-3-Clause"
] | null | null | null | """
An implementation of probabilistic max-pooling, based on
"Convolutional Deep Belief Networks for Scalable
Unsupervised Learning of Hierarchical Representations"
Honglak Lee, Roger Grosse, Rajesh Ranganath, and Andrew Y. Ng
ICML 2009
This paper defines probabilistic max-pooling in the context
of a Convolutional Deep Belief Network (its energy function is
more like a DBM than a DBN but it is trained like a DBN). Here
we define probabilistic max pooling as a general layer for
use in an energy-based model regardless of how the rest of the
model is assembled.
"""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
import logging
import theano.tensor as T
import numpy as np
from six.moves import xrange
from theano import config
from theano import function
import time
from pylearn2.utils import sharedX
from theano.sandbox.rng_mrg import MRG_RandomStreams
from theano.gof.op import get_debug_values
logger = logging.getLogger(__name__)
def max_pool(z, pool_shape, top_down=None, theano_rng=None):
"""
Probabilistic max-pooling
Parameters
----------
z : theano 4-tensor
a theano 4-tensor representing input from below
pool_shape : tuple
tuple of ints. the shape of regions to be pooled
top_down : theano 4-tensor, optional
a theano 4-tensor representing input from above
if None, assumes top-down input is 0
theano_rng : MRG_RandomStreams, optional
Used for random numbers for sampling
Returns
-------
p : theano 4-tensor
the expected value of the pooling layer p
h : theano 4-tensor
the expected value of the detector layer h
p_samples : theano 4-tensor, only returned if theano_rng is not None
samples of the pooling layer
h_samples : theano 4-tensor, only returned if theano_rng is not None
samples of the detector layer
Notes
------
all 4-tensors are formatted with axes ('b', 'c', 0, 1).
This is for maximum speed when using theano's conv2d
to generate z and top_down, or when using it to infer conditionals of
other layers using the return values.
Detailed description:
Suppose you have a variable h that lives in a Conv2DSpace h_space and
you want to pool it down to a variable p that lives in a smaller
Conv2DSpace p.
This function does that, using non-overlapping pools.
Specifically, consider one channel of h. h must have a height that is a
multiple of pool_shape[0] and a width that is a multiple of pool_shape[1].
A channel of h can thus be broken down into non-overlapping rectangles
of shape pool_shape.
Now consider one rectangular pooled region within one channel of h.
I now use 'h' to refer just to this rectangle, and 'p' to refer to
just the one pooling unit associated with that rectangle.
We assume that the space that h and p live in is constrained such
that h and p are both binary and p = max(h). To reduce the state-space
in order to make probabilistic computations cheaper we also
constrain sum(h) <= 1.
Suppose h contains k different units. Suppose that the only term
in the model's energy function involving h is -(z*h).sum()
(elemwise multiplication) and the only term in
the model's energy function involving p is -(top_down*p).sum().
Then P(h[i] = 1) = softmax( [ z[1], z[2], ..., z[k], -top_down] )[i]
and P(p = 1) = 1-softmax( [z[1], z[2], ..., z[k], -top_down])[k]
This variation of the function assumes that z, top_down, and all
return values use Conv2D axes ('b', 'c', 0, 1).
This variation of the function implements the softmax using a
theano graph of exp, maximum, sub, and div operations.
Performance notes:
It might be possible to make a faster implementation with different
theano ops. rather than using set_subtensor, it might be possible
to use the stuff in theano.sandbox.neighbours. Probably not possible,
or at least nasty, because that code isn't written with multiple
channels in mind, and I don't think just a reshape can fix it.
Some work on this in galatea.cond.neighbs.py
At some point images2neighbs' gradient was broken so check that
it has been fixed before sinking too much time into this.
Stabilizing the softmax is also another source of slowness.
Here it is stabilized with several calls to maximum and sub.
It might also be possible to stabilize it with
T.maximum(-top_down,T.signal.downsample.max_pool(z)).
Don't know if that would be faster or slower.
Elsewhere in this file I implemented the softmax with a reshape
and call to Softmax / SoftmaxWithBias.
This is slower, even though Softmax is faster on the GPU than the
equivalent max/sub/exp/div graph. Maybe the reshape is too expensive.
Benchmarks show that most of the time is spent in GpuIncSubtensor
when running on gpu. So it is mostly that which needs a faster
implementation. One other way to implement this would be with
a linear.Conv2D.lmul_T, where the convolution stride is equal to
the pool width, and the thing to multiply with is the hparts stacked
along the channel axis. Unfortunately, conv2D doesn't work right
with stride > 2 and is pretty slow for stride 2. Conv3D is used to
mitigate some of this, but only has CPU code.
"""
z_name = z.name
if z_name is None:
z_name = 'anon_z'
batch_size, ch, zr, zc = z.shape
r, c = pool_shape
zpart = []
mx = None
if top_down is None:
t = 0.
else:
t = - top_down
t.name = 'neg_top_down'
for i in xrange(r):
zpart.append([])
for j in xrange(c):
cur_part = z[:, :, i:zr:r, j:zc:c]
if z_name is not None:
cur_part.name = z_name + '[%d,%d]' % (i, j)
zpart[i].append(cur_part)
if mx is None:
mx = T.maximum(t, cur_part)
if cur_part.name is not None:
mx.name = 'max(-top_down,' + cur_part.name + ')'
else:
max_name = None
if cur_part.name is not None:
mx_name = 'max(' + cur_part.name + ',' + mx.name + ')'
mx = T.maximum(mx, cur_part)
mx.name = mx_name
mx.name = 'local_max(' + z_name + ')'
pt = []
for i in xrange(r):
pt.append([])
for j in xrange(c):
z_ij = zpart[i][j]
safe = z_ij - mx
safe.name = 'safe_z(%s)' % z_ij.name
cur_pt = T.exp(safe)
cur_pt.name = 'pt(%s)' % z_ij.name
pt[-1].append(cur_pt)
off_pt = T.exp(t - mx)
off_pt.name = 'p_tilde_off(%s)' % z_name
denom = off_pt
for i in xrange(r):
for j in xrange(c):
denom = denom + pt[i][j]
denom.name = 'denom(%s)' % z_name
off_prob = off_pt / denom
p = 1. - off_prob
p.name = 'p(%s)' % z_name
hpart = []
for i in xrange(r):
hpart.append([pt_ij / denom for pt_ij in pt[i]])
h = T.alloc(0., batch_size, ch, zr, zc)
for i in xrange(r):
for j in xrange(c):
h.name = 'h_interm'
h = T.set_subtensor(h[:, :, i:zr:r, j:zc:c], hpart[i][j])
h.name = 'h(%s)' % z_name
if theano_rng is None:
return p, h
else:
events = []
for i in xrange(r):
for j in xrange(c):
events.append(hpart[i][j])
events.append(off_prob)
events = [event.dimshuffle(0, 1, 2, 3, 'x') for event in events]
events = tuple(events)
stacked_events = T.concatenate(events, axis=4)
rows = zr // pool_shape[0]
cols = zc // pool_shape[1]
outcomes = pool_shape[0] * pool_shape[1] + 1
assert stacked_events.ndim == 5
for se, bs, r, c, chv in get_debug_values(stacked_events, batch_size,
rows, cols, ch):
assert se.shape[0] == bs
assert se.shape[1] == r
assert se.shape[2] == c
assert se.shape[3] == chv
assert se.shape[4] == outcomes
reshaped_events = stacked_events.reshape((
batch_size * rows * cols * ch, outcomes))
multinomial = theano_rng.multinomial(pvals=reshaped_events,
dtype=p.dtype)
reshaped_multinomial = multinomial.reshape((batch_size, ch, rows,
cols, outcomes))
h_sample = T.alloc(0., batch_size, ch, zr, zc)
idx = 0
for i in xrange(r):
for j in xrange(c):
h_sample = T.set_subtensor(h_sample[:, :, i:zr:r, j:zc:c],
reshaped_multinomial[:, :, :, :,
idx])
idx += 1
p_sample = 1 - reshaped_multinomial[:, :, :, :, -1]
return p, h, p_sample, h_sample
def max_pool_c01b(z, pool_shape, top_down=None, theano_rng=None):
"""
.. todo::
WRITEME properly
Like max_pool but with all 4-tensors formatted with axes ('c', 0, 1, 'b').
This is for maximum speed when using-cuda convnet.
Notes
-----
Performance notes:
Stabilizing the softmax is one source of slowness. Here it is stabilized
with several calls to maximum and sub. It might also be possible to
stabilize it with T.maximum(-top_down,<cuda convnet max pooling>).
Don't know if that would be faster or slower.
Benchmarks show that most of the time is spent in GpuIncSubtensor
when running on gpu. So it is mostly that which needs a faster
implementation. One other way to implement this would be with cuda
convnet convolution, where the convolution stride is equal to the
pool width, and the thing to multiply with is the hparts stacked
along the channel axis. This isn't a feasible solution for max_pool
because of theano convolution's poor support for strides, but for cuda
convnet it could give a speedup.
"""
z_name = z.name
if z_name is None:
z_name = 'anon_z'
ch, zr, zc, batch_size = z.shape
r, c = pool_shape
zpart = []
mx = None
if top_down is None:
t = 0.
else:
t = - top_down
t.name = 'neg_top_down'
for i in xrange(r):
zpart.append([])
for j in xrange(c):
cur_part = z[:, i:zr:r, j:zc:c, :]
if z_name is not None:
cur_part.name = z_name + '[%d, %d]' % (i, j)
zpart[i].append(cur_part)
if mx is None:
mx = T.maximum(t, cur_part)
if cur_part.name is not None:
mx.name = 'max(-top_down,' + cur_part.name + ')'
else:
max_name = None
if cur_part.name is not None:
mx_name = 'max(' + cur_part.name + ',' + mx.name + ')'
mx = T.maximum(mx, cur_part)
mx.name = mx_name
mx.name = 'local_max(' + z_name + ')'
pt = []
for i in xrange(r):
pt.append([])
for j in xrange(c):
z_ij = zpart[i][j]
safe = z_ij - mx
safe.name = 'safe_z(%s)' % z_ij.name
cur_pt = T.exp(safe)
cur_pt.name = 'pt(%s)' % z_ij.name
pt[-1].append(cur_pt)
off_pt = T.exp(t - mx)
off_pt.name = 'p_tilde_off(%s)' % z_name
denom = off_pt
for i in xrange(r):
for j in xrange(c):
denom = denom + pt[i][j]
denom.name = 'denom(%s)' % z_name
off_prob = off_pt / denom
p = 1. - off_prob
p.name = 'p(%s)' % z_name
hpart = []
for i in xrange(r):
hpart.append([pt_ij / denom for pt_ij in pt[i]])
h = T.alloc(0., ch, zr, zc, batch_size)
for i in xrange(r):
for j in xrange(c):
h.name = 'h_interm'
h = T.set_subtensor(h[:, i:zr:r, j:zc:c, :], hpart[i][j])
h.name = 'h(%s)' % z_name
if theano_rng is None:
return p, h
else:
events = []
for i in xrange(r):
for j in xrange(c):
events.append(hpart[i][j])
events.append(off_prob)
events = [event.dimshuffle(0, 1, 2, 3, 'x') for event in events]
events = tuple(events)
stacked_events = T.concatenate(events, axis=4)
ch, rows, cols, batch_size, outcomes = stacked_events.shape
reshaped_events = stacked_events.reshape((ch * rows * cols *
batch_size, outcomes))
multinomial = theano_rng.multinomial(pvals=reshaped_events,
dtype=p.dtype)
reshaped_multinomial = multinomial.reshape((ch, rows, cols, batch_size,
outcomes))
h_sample = T.alloc(0., ch, zr, zc, batch_size)
idx = 0
for i in xrange(r):
for j in xrange(c):
h_sample = T.set_subtensor(h_sample[:, i:zr:r, j:zc:c, :],
reshaped_multinomial[:, :, :, :,
idx])
idx += 1
p_sample = 1 - reshaped_multinomial[:, :, :, :, -1]
return p, h, p_sample, h_sample
def max_pool_channels(z, pool_size, top_down=None, theano_rng=None):
"""
Unlike Honglak's convolutional max pooling, which pools over spatial
locations within each channels, this does max pooling in a densely
connected model. Here we pool groups of channels together.
Parameters
----------
z : theano matrix
representings a batch of input from below
pool_size : int
the number of features to combine into one pooled unit
top_down : theano matrix, optional
a theano matrix representing input from above
if None, assumes top-down input is 0
theano_rng : MRG_RandomStreams, optional
For random numbers for sampling
Returns
-------
h : theano matrix
a theano matrix for the expected value of the detector layer h
p : theano matrix
a theano matrix for the expected value of the pooling layer p
h_samples : theano matrix, only returned if theano_rng is not None
a theano matrix of samples of the detector layer
p_samples: theano matrix, only returned if theano_rng is not None
a theano matrix of samples of the pooling layer
Notes
-----
All matrices are formatted as (num_example, num_features)
"""
z_name = z.name
if z_name is None:
z_name = 'anon_z'
if pool_size == 1:
if top_down is None:
top_down = 0.
total_input = z + top_down
p = T.nnet.sigmoid(total_input)
h = p
if theano_rng is None:
return p, h
else:
p_samples = theano_rng.binomial(p=p, size=p.shape,
dtype=p.dtype, n=1)
h_samples = p_samples
return p_samples, h_samples, p_samples, h_samples
else:
batch_size, n = z.shape
mx = None
if top_down is None:
t = 0.
else:
t = - top_down
t.name = 'neg_top_down'
zpart = []
for i in xrange(pool_size):
cur_part = z[:, i:n:pool_size]
if z_name is not None:
cur_part.name = z_name + '[%d]' % (i)
zpart.append(cur_part)
if mx is None:
mx = T.maximum(t, cur_part)
if cur_part.name is not None:
mx.name = 'max(-top_down,' + cur_part.name + ')'
else:
max_name = None
if cur_part.name is not None:
mx_name = 'max(' + cur_part.name + ',' + mx.name + ')'
mx = T.maximum(mx, cur_part)
mx.name = mx_name
mx.name = 'local_max(' + z_name + ')'
pt = []
for i in xrange(pool_size):
z_i = zpart[i]
safe = z_i - mx
safe.name = 'safe_z(%s)' % z_i.name
cur_pt = T.exp(safe)
cur_pt.name = 'pt(%s)' % z_i.name
assert cur_pt.ndim == 2
pt.append(cur_pt)
off_pt = T.exp(t - mx)
assert off_pt.ndim == 2
off_pt.name = 'p_tilde_off(%s)' % z_name
denom = off_pt
for i in xrange(pool_size):
denom = denom + pt[i]
assert denom.ndim == 2
denom.name = 'denom(%s)' % z_name
off_prob = off_pt / denom
p = 1. - off_prob
assert p.dtype == z.dtype
hpart = [pt_i / denom for pt_i in pt]
h = T.alloc(0., batch_size, n)
for i in xrange(pool_size):
h.name = 'h_interm'
hp = hpart[i]
sub_h = h[:, i:n:pool_size]
assert sub_h.ndim == 2
assert hp.ndim == 2
for hv, hsv, hpartv in get_debug_values(h, sub_h, hp):
logger.info(hv.shape)
logger.info(hsv.shape)
logger.info(hpartv.shape)
h = T.set_subtensor(sub_h, hp)
p.name = 'p(%s)' % z_name
h.name = 'h(%s)' % z_name
if theano_rng is None:
return p, h
else:
events = []
for i in xrange(pool_size):
events.append(hpart[i])
events.append(off_prob)
events = [event.dimshuffle(0, 1, 'x') for event in events]
events = tuple(events)
stacked_events = T.concatenate(events, axis=2)
outcomes = pool_size + 1
reshaped_events = stacked_events.reshape((batch_size * n // pool_size,
outcomes))
multinomial = theano_rng.multinomial(pvals=reshaped_events,
dtype=p.dtype)
reshaped_multinomial = multinomial.reshape((batch_size,
n // pool_size,
outcomes))
h_sample = T.zeros_like(z)
idx = 0
for i in xrange(pool_size):
h_sample = T.set_subtensor(h_sample[:, i:n:pool_size],
reshaped_multinomial[:, :, idx])
idx += 1
p_sample = 1 - reshaped_multinomial[:, :, -1]
assert h_sample.dtype == z.dtype
return p, h, p_sample, h_sample
def max_pool_python(z, pool_shape, top_down=None):
"""
.. todo::
WRITEME properly
Slow python implementation of max_pool
for unit tests.
Also, this uses the ('b', 0, 1, 'c') format.
"""
batch_size, zr, zc, ch = z.shape
r, c = pool_shape
assert zr % r == 0
assert zc % c == 0
h = np.zeros(z.shape, dtype=z.dtype)
p = np.zeros((batch_size, zr / r, zc / c, ch), dtype=z.dtype)
if top_down is None:
top_down = p.copy()
for u in xrange(0, zr, r):
for l in xrange(0, zc, c):
pt = np.exp(z[:, u:u+r, l:l+c, :])
off_pt = np.exp(-top_down[:, u/r, l/c, :])
denom = pt.sum(axis=1).sum(axis=1) + off_pt
p[:, u/r, l/c, :] = 1. - off_pt / denom
for i in xrange(batch_size):
for j in xrange(ch):
pt[i, :, :, j] /= denom[i, j]
h[:, u:u+r, l:l+c, :] = pt
return p, h
def max_pool_channels_python(z, pool_size, top_down=None):
"""
.. todo::
WRITEME properly
Slow python implementation of max_pool_channels
for unit tests.
Also, this uses the ('b', 0, 1, 'c') format.
"""
batch_size, n = z.shape
assert n % pool_size == 0
h = np.zeros(z.shape, dtype=z.dtype)
p = np.zeros((batch_size, n / pool_size), dtype=z.dtype)
if top_down is None:
top_down = p.copy()
for i in xrange(0, n // pool_size):
pt = np.exp(z[:, i*pool_size:(i+1)*pool_size])
off_pt = np.exp(-top_down[:, i])
denom = pt.sum(axis=1) + off_pt
assert denom.ndim == 1
p[:, i] = 1. - off_pt / denom
for j in xrange(batch_size):
for k in xrange(pool_size):
h[j, i*pool_size+k] = pt[j, k] / denom[j]
return p, h
def max_pool_unstable(z, pool_shape):
"""
.. todo::
WRITEME properly
A version of max_pool that does not numerically stabilize the softmax.
This is faster, but prone to both overflow and underflow in the
intermediate computations.
Mostly useful for benchmarking, to determine how much speedup we
could hope to get by using a better stabilization method.
Also, this uses the ('b', 0, 1, 'c') format.
"""
batch_size, zr, zc, ch = z.shape
r, c = pool_shape
zpart = []
for i in xrange(r):
zpart.append([])
for j in xrange(c):
zpart[i].append(z[:, i:zr:r, j:zc:c, :])
pt = []
for i in xrange(r):
pt.append([T.exp(z_ij) for z_ij in zpart[i]])
denom = 1.
for i in xrange(r):
for j in xrange(c):
denom = denom + pt[i][j]
p = 1. - 1. / denom
hpart = []
for i in xrange(r):
hpart.append([pt_ij / denom for pt_ij in pt[i]])
h = T.alloc(0., batch_size, zr, zc, ch)
for i in xrange(r):
for j in xrange(c):
h = T.set_subtensor(h[:, i:zr:r, j:zc:c, :], hpart[i][j])
return p, h
def max_pool_b01c(z, pool_shape, top_down=None, theano_rng=None):
"""
.. todo::
WRITEME properly
An implementation of max_pool but where all 4-tensors use the
('b', 0, 1, 'c') format.
"""
z_name = z.name
if z_name is None:
z_name = 'anon_z'
batch_size, zr, zc, ch = z.shape
r, c = pool_shape
zpart = []
mx = None
if top_down is None:
t = 0.
else:
t = - top_down
for i in xrange(r):
zpart.append([])
for j in xrange(c):
cur_part = z[:, i:zr:r, j:zc:c, :]
if z_name is not None:
cur_part.name = z_name + '[%d, %d]' % (i, j)
zpart[i].append(cur_part)
if mx is None:
mx = T.maximum(t, cur_part)
if cur_part.name is not None:
mx.name = 'max(-top_down,' + cur_part.name + ')'
else:
max_name = None
if cur_part.name is not None:
mx_name = 'max(' + cur_part.name + ','+mx.name + ')'
mx = T.maximum(mx, cur_part)
mx.name = mx_name
mx.name = 'local_max('+z_name+')'
pt = []
for i in xrange(r):
pt.append([])
for j in xrange(c):
z_ij = zpart[i][j]
safe = z_ij - mx
safe.name = 'safe_z(%s)' % z_ij.name
cur_pt = T.exp(safe)
cur_pt.name = 'pt(%s)' % z_ij.name
pt[-1].append(cur_pt)
off_pt = T.exp(t - mx)
off_pt.name = 'p_tilde_off(%s)' % z_name
denom = off_pt
for i in xrange(r):
for j in xrange(c):
denom = denom + pt[i][j]
denom.name = 'denom(%s)' % z_name
off_prob = off_pt / denom
p = 1. - off_prob
p.name = 'p(%s)' % z_name
hpart = []
for i in xrange(r):
hpart.append([pt_ij / denom for pt_ij in pt[i]])
h = T.alloc(0., batch_size, zr, zc, ch)
for i in xrange(r):
for j in xrange(c):
h = T.set_subtensor(h[:, i:zr:r, j:zc:c, :], hpart[i][j])
h.name = 'h(%s)' % z_name
if theano_rng is None:
return p, h
else:
events = []
for i in xrange(r):
for j in xrange(c):
events.append(hpart[i][j])
events.append(off_prob)
events = [event.dimshuffle(0, 1, 2, 3, 'x') for event in events]
events = tuple(events)
stacked_events = T.concatenate(events, axis=4)
batch_size, rows, cols, channels, outcomes = stacked_events.shape
reshaped_events = stacked_events.reshape((batch_size * rows * cols *
channels, outcomes))
multinomial = theano_rng.multinomial(pvals=reshaped_events,
dtype=p.dtype)
reshaped_multinomial = multinomial.reshape((batch_size, rows, cols,
channels, outcomes))
h_sample = T.alloc(0., batch_size, zr, zc, ch)
idx = 0
for i in xrange(r):
for j in xrange(c):
h_sample = T.set_subtensor(h_sample[:, i:zr:r, j:zc:c, :],
reshaped_multinomial[:, :, :, :,
idx])
idx += 1
p_sample = 1 - reshaped_multinomial[:, :, :, :, -1]
return p, h, p_sample, h_sample
def max_pool_softmax_with_bias_op(z, pool_shape):
"""
.. todo::
WRITEME properly
An implementation of max_pool that uses the SoftmaxWithBias op.
Mostly kept around for comparison benchmarking purposes.
Also, this uses the ('b', 0, 1, 'c') format.
"""
z_name = z.name
if z_name is None:
z_name = 'anon_z'
batch_size, zr, zc, ch = z.shape
r, c = pool_shape
flat_z = []
for i in xrange(r):
for j in xrange(c):
cur_part = z[:, i:zr:r, j:zc:c, :]
assert cur_part.ndim == 4
if z_name is not None:
cur_part.name = z_name + '[%d,%d]' % (i, j)
flat_z.append(cur_part.dimshuffle(0, 1, 2, 3, 'x'))
flat_z.append(T.zeros_like(flat_z[-1]))
stacked_z = T.concatenate(flat_z, axis=4)
batch_size, rows, cols, channels, outcomes = stacked_z.shape
reshaped_z = stacked_z.reshape((batch_size * rows * cols * channels,
outcomes))
dist = T.nnet.softmax_with_bias(reshaped_z, T.zeros_like(reshaped_z[0, :]))
dist = dist.reshape((batch_size, rows, cols, channels, outcomes))
p = 1. - dist[:, :, :, :, -1]
p.name = 'p(%s)' % z_name
h = T.alloc(0., batch_size, zr, zc, ch)
idx = 0
for i in xrange(r):
for j in xrange(c):
h = T.set_subtensor(h[:, i:zr:r, j:zc:c, :],
dist[:, :, :, :, idx])
idx += 1
h.name = 'h(%s)' % z_name
return p, h
def max_pool_softmax_op(z, pool_shape):
"""
.. todo::
WRITEME properly
An implementation of max_pool that uses the SoftmaxWithBias op.
Mostly kept around for comparison benchmarking purposes.
Also, this uses the ('b', 0, 1, 'c') format.
"""
z_name = z.name
if z_name is None:
z_name = 'anon_z'
batch_size, zr, zc, ch = z.shape
r, c = pool_shape
flat_z = []
for i in xrange(r):
for j in xrange(c):
cur_part = z[:, i:zr:r, j:zc:c, :]
assert cur_part.ndim == 4
if z_name is not None:
cur_part.name = z_name + '[%d,%d]' % (i, j)
flat_z.append(cur_part.dimshuffle(0, 1, 2, 3, 'x'))
flat_z.append(T.zeros_like(flat_z[-1]))
stacked_z = T.concatenate(flat_z, axis=4)
batch_size, rows, cols, channels, outcomes = stacked_z.shape
reshaped_z = stacked_z.reshape((batch_size * rows * cols * channels,
outcomes))
dist = T.nnet.softmax(reshaped_z)
dist = dist.reshape((batch_size, rows, cols, channels, outcomes))
p = 1. - dist[:, :, :, :, len(flat_z)-1]
p.name = 'p(%s)' % z_name
h = T.alloc(0., batch_size, zr, zc, ch)
idx = 0
for i in xrange(r):
for j in xrange(c):
h = T.set_subtensor(h[:, i:zr:r, j:zc:c, :],
dist[:, :, :, :, idx])
idx += 1
h.name = 'h(%s)' % z_name
return p, h
def profile(f):
"""
.. todo::
WRITEME
"""
logger.info('profiling {0}'.format(f))
rng = np.random.RandomState([2012, 7, 19])
batch_size = 80
rows = 26
cols = 27
channels = 30
pool_rows = 2
pool_cols = 3
zv = rng.randn(batch_size, rows, cols, channels).astype(config.floatX)
#put the inputs + outputs in shared variables so we don't pay GPU
# transfer during test
p_shared = sharedX(zv[:, 0:rows:pool_rows, 0:cols:pool_cols, :])
h_shared = sharedX(zv)
z_shared = sharedX(zv)
p_th, h_th = f(z_shared, (pool_rows, pool_cols))
func = function([], updates={p_shared: p_th, h_shared: h_th})
logger.info('warming up')
for i in xrange(10):
func()
trials = 10
results = []
for i in xrange(trials):
t1 = time.time()
for j in xrange(10):
func()
t2 = time.time()
logger.info(t2 - t1)
results.append(t2-t1)
logger.info('final: {0}'.format(sum(results)/float(trials)))
def profile_bc01(f):
"""
.. todo::
WRITEME
"""
logger.info('profiling {0}'.format(f))
rng = np.random.RandomState([2012, 7, 19])
batch_size = 80
rows = 26
cols = 27
channels = 30
pool_rows = 2
pool_cols = 3
zv = rng.randn(batch_size, channels, rows, cols).astype(config.floatX)
# put the inputs + outputs in shared variables so we don't pay GPU
# transfer during test
p_shared = sharedX(zv[:, :, 0:rows:pool_rows, 0:cols:pool_cols])
h_shared = sharedX(zv)
z_shared = sharedX(zv)
p_th, h_th = f(z_shared, (pool_rows, pool_cols))
func = function([], updates={p_shared: p_th, h_shared: h_th})
logger.info('warming up')
for i in xrange(10):
func()
trials = 10
results = []
for i in xrange(trials):
t1 = time.time()
for j in xrange(10):
func()
t2 = time.time()
logger.info(t2 - t1)
results.append(t2-t1)
logger.info('final: {0}'.format(sum(results)/float(trials)))
def profile_samples(f):
"""
.. todo::
WRITEME
"""
logger.info('profiling samples {0}'.format(f))
rng = np.random.RandomState([2012, 7, 19])
theano_rng = MRG_RandomStreams(rng.randint(2147462579))
batch_size = 80
rows = 26
cols = 27
channels = 30
pool_rows = 2
pool_cols = 3
zv = rng.randn(batch_size, rows, cols, channels).astype(config.floatX)
#put the inputs + outputs in shared variables so we don't pay GPU
# transfer during test
p_shared = sharedX(zv[:, 0:rows:pool_rows, 0:cols:pool_cols, :])
h_shared = sharedX(zv)
z_shared = sharedX(zv)
p_th, h_th, ps_th, hs_th = f(z_shared, (pool_rows, pool_cols), theano_rng)
func = function([], updates={p_shared: ps_th, h_shared: hs_th})
logger.info('warming up')
for i in xrange(10):
func()
trials = 10
results = []
for i in xrange(trials):
t1 = time.time()
for j in xrange(10):
func()
t2 = time.time()
logger.info(t2 - t1)
results.append(t2-t1)
logger.info('final: {0}'.format(sum(results)/float(trials)))
def profile_grad(f):
"""
.. todo::
WRITEME
"""
logger.info('profiling gradient of {0}'.format(f))
rng = np.random.RandomState([2012, 7, 19])
batch_size = 80
rows = 26
cols = 27
channels = 30
pool_rows = 2
pool_cols = 3
zv = rng.randn(batch_size, rows, cols, channels).astype(config.floatX)
#put the inputs + outputs in shared variables so we don't pay GPU
# transfer during test
grad_shared = sharedX(zv)
z_shared = sharedX(zv)
p_th, h_th = f(z_shared, (pool_rows, pool_cols))
func = function([], updates={grad_shared: T.grad(p_th.sum() + h_th.sum(),
z_shared)})
logger.info('warming up')
for i in xrange(10):
func()
trials = 10
results = []
for i in xrange(trials):
t1 = time.time()
for j in xrange(10):
func()
t2 = time.time()
logger.info(t2 - t1)
results.append(t2-t1)
logger.info('final: {0}'.format(sum(results)/float(trials)))
def profile_grad_bc01(f):
"""
.. todo::
WRITEME
"""
logger.info('profiling gradient of {0}'.format(f))
rng = np.random.RandomState([2012, 7, 19])
batch_size = 80
rows = 26
cols = 27
channels = 30
pool_rows = 2
pool_cols = 3
zv = rng.randn(batch_size, channels, rows, cols).astype(config.floatX)
# put the inputs + outputs in shared variables so we don't pay GPU
# transfer during test
grad_shared = sharedX(zv)
z_shared = sharedX(zv)
p_th, h_th = f(z_shared, (pool_rows, pool_cols))
func = function([], updates={grad_shared: T.grad(p_th.sum() + h_th.sum(),
z_shared)})
logger.info('warming up')
for i in xrange(10):
func()
trials = 10
results = []
for i in xrange(trials):
t1 = time.time()
for j in xrange(10):
func()
t2 = time.time()
logger.info(t2 - t1)
results.append(t2-t1)
logger.info('final: {0}'.format(sum(results)/float(trials)))
if __name__ == '__main__':
profile_bc01(max_pool)
profile_grad_bc01(max_pool)
"""
profile(max_pool_unstable)
profile_samples(max_pool_b01c)
profile(max_pool_softmax_op)
profile(max_pool_softmax_with_bias_op)
profile_grad(max_pool_unstable)
profile_grad(max_pool_b01c)
profile_grad(max_pool_softmax_op)
profile_grad(max_pool_softmax_with_bias_op)
"""
| 29.157895 | 79 | 0.556992 | 4,943 | 33,794 | 3.670038 | 0.101962 | 0.036602 | 0.015876 | 0.031751 | 0.722231 | 0.696819 | 0.674274 | 0.649248 | 0.636955 | 0.612645 | 0 | 0.01618 | 0.33065 | 33,794 | 1,158 | 80 | 29.183074 | 0.785809 | 0.244718 | 0 | 0.776435 | 0 | 0 | 0.033273 | 0.000985 | 0 | 0 | 0 | 0.010363 | 0.028701 | 1 | 0.021148 | false | 0 | 0.015106 | 0 | 0.058912 | 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 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
dc00d6034e74a9888a5c411651982770876ea8ad | 853 | py | Python | Statistics/Statistics.py | payalbhalala/IS601850_Project2_StatisticsCalculator | 7ef4b52ee2f59ef9718afc2188bfec436e5130d7 | [
"MIT"
] | null | null | null | Statistics/Statistics.py | payalbhalala/IS601850_Project2_StatisticsCalculator | 7ef4b52ee2f59ef9718afc2188bfec436e5130d7 | [
"MIT"
] | null | null | null | Statistics/Statistics.py | payalbhalala/IS601850_Project2_StatisticsCalculator | 7ef4b52ee2f59ef9718afc2188bfec436e5130d7 | [
"MIT"
] | null | null | null | from Calculator.Calculator import Calculator
from Statistics.Mean import mean
from Statistics.Median import median
from Statistics.Mode import mode
from Statistics.Variance import variance
from Statistics.Standard_Deviation import stddev
from Statistics.Zscore import zscore
class Statistics(Calculator):
def mean(self, data):
self.result = mean(data)
return self.result
def median(self, data):
self.result = median(data)
return self.result
def mode(self, data):
self.result = mode(data)
return self.result
def variance(self, data):
self.result = variance(data)
return self.result
def stddev(self, data):
self.result = stddev(data)
return self.result
def zscore(self, data, x):
self.result = zscore(data, x)
return self.result
| 25.848485 | 48 | 0.681125 | 107 | 853 | 5.420561 | 0.17757 | 0.206897 | 0.165517 | 0.155172 | 0.198276 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.241501 | 853 | 32 | 49 | 26.65625 | 0.896445 | 0 | 0 | 0.230769 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0 | 0.269231 | 0 | 0.769231 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
dc035ad2a2af0c0e597c8c799d3c81a6baa86045 | 5,641 | py | Python | typedb/connection/cluster/client.py | rpatil524/client-python | e8daba79842a81669f4f4c2799bcc8610e610551 | [
"Apache-2.0"
] | 47 | 2019-01-22T19:17:13.000Z | 2021-02-06T15:39:59.000Z | typedb/connection/cluster/client.py | rpatil524/client-python | e8daba79842a81669f4f4c2799bcc8610e610551 | [
"Apache-2.0"
] | 85 | 2019-01-22T14:51:34.000Z | 2021-04-08T15:41:43.000Z | typedb/connection/cluster/client.py | rpatil524/client-python | e8daba79842a81669f4f4c2799bcc8610e610551 | [
"Apache-2.0"
] | 24 | 2019-01-22T13:21:42.000Z | 2021-03-02T18:06:03.000Z | #
# Copyright (C) 2021 Vaticle
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
from typing import Iterable, Dict, Set
from typedb.api.connection.client import TypeDBClusterClient
from typedb.api.connection.credential import TypeDBCredential
from typedb.api.connection.options import TypeDBOptions, TypeDBClusterOptions
from typedb.api.connection.session import SessionType
from typedb.api.connection.user import UserManager
from typedb.connection.cluster.database import _ClusterDatabase, _FailsafeTask
from typedb.connection.cluster.database_manager import _ClusterDatabaseManager
from typedb.connection.cluster.server_client import _ClusterServerClient
from typedb.connection.cluster.session import _ClusterSession
from typedb.connection.cluster.stub import _ClusterServerStub
from typedb.connection.cluster.user_manager import _ClusterUserManager
from typedb.common.rpc.request_builder import cluster_server_manager_all_req
from typedb.common.exception import TypeDBClientException, UNABLE_TO_CONNECT, CLUSTER_UNABLE_TO_CONNECT
class _ClusterClient(TypeDBClusterClient):
def __init__(self, addresses: Iterable[str], credential: TypeDBCredential, parallelisation: int = None):
self._credential = credential
self._server_clients: Dict[str, _ClusterServerClient] = {addr: _ClusterServerClient(addr, credential, parallelisation) for addr in self._fetch_server_addresses(addresses)}
self._database_managers = _ClusterDatabaseManager(self)
self._cluster_databases: Dict[str, _ClusterDatabase] = {}
self._user_manager = _ClusterUserManager(self)
self._is_open = True
def _fetch_server_addresses(self, addresses: Iterable[str]) -> Set[str]:
for address in addresses:
try:
print("Fetching list of cluster servers from %s..." % address)
with _ClusterServerClient(address, self._credential) as client:
res = client.stub().servers_all(cluster_server_manager_all_req())
members = {srv.address for srv in res.servers}
print("The cluster servers are %s" % [str(member) for member in members])
return members
except TypeDBClientException as e:
if e.error_message is UNABLE_TO_CONNECT:
print("Fetching cluster servers from %s failed. %s" % (address, str(e)))
else:
raise e
raise TypeDBClientException.of(CLUSTER_UNABLE_TO_CONNECT, ",".join(addresses))
def session(self, database: str, session_type: SessionType, options=None) -> _ClusterSession:
if not options:
options = TypeDBOptions.cluster()
return self._session_any_replica(database, session_type, options) if getattr(options, "read_any_replica", False) else self._session_primary_replica(database, session_type, options)
def _session_primary_replica(self, database: str, session_type: SessionType, options=None) -> _ClusterSession:
return _OpenSessionFailsafeTask(database, session_type, options, self).run_primary_replica()
def _session_any_replica(self, database: str, session_type: SessionType, options=None) -> _ClusterSession:
return _OpenSessionFailsafeTask(database, session_type, options, self).run_any_replica()
def is_open(self) -> bool:
return self._is_open
def users(self) -> UserManager:
return self._user_manager
def databases(self) -> _ClusterDatabaseManager:
return self._database_managers
def database_by_name(self) -> Dict[str, _ClusterDatabase]:
return self._cluster_databases
def server_addresses(self) -> Set[str]:
return set(self._server_clients.keys())
def _cluster_server_clients(self) -> Dict[str, _ClusterServerClient]:
return self._server_clients
def _cluster_server_client(self, address: str) -> _ClusterServerClient:
return self._server_clients.get(address)
def _stub(self, address: str) -> _ClusterServerStub:
return self._server_clients.get(address).stub()
def is_cluster(self) -> bool:
return True
def __enter__(self):
return self
def __exit__(self, exc_type, exc_val, exc_tb):
self.close()
if exc_tb is not None:
return False
def close(self) -> None:
for client in self._server_clients.values():
client.close()
self._is_open = False
class _OpenSessionFailsafeTask(_FailsafeTask):
def __init__(self, database: str, session_type: SessionType, options: TypeDBClusterOptions, client: _ClusterClient):
super().__init__(client, database)
self.session_type = session_type
self.options = options
def run(self, replica: _ClusterDatabase.Replica):
return _ClusterSession(self.client, replica.address(), self.database, self.session_type, self.options)
| 45.128 | 188 | 0.730899 | 661 | 5,641 | 6.001513 | 0.266263 | 0.03277 | 0.03025 | 0.040837 | 0.173683 | 0.126292 | 0.092765 | 0.081674 | 0.081674 | 0.066045 | 0 | 0.001752 | 0.190569 | 5,641 | 124 | 189 | 45.491935 | 0.867061 | 0.138096 | 0 | 0 | 0 | 0 | 0.026647 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2375 | false | 0 | 0.175 | 0.1625 | 0.6375 | 0.0375 | 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 |
9066037b2c5eeefffc26d96b295f2c957848647d | 273 | py | Python | app/__init__.py | miraculixx/pyrules | b10d1d5e74052fa1db93cc9b459ac9057a9eb502 | [
"MIT"
] | 17 | 2015-07-20T03:11:04.000Z | 2021-05-02T03:34:05.000Z | app/__init__.py | miraculixx/pyrules | b10d1d5e74052fa1db93cc9b459ac9057a9eb502 | [
"MIT"
] | 20 | 2015-04-10T10:11:44.000Z | 2020-09-10T03:51:47.000Z | app/__init__.py | miraculixx/pyrules | b10d1d5e74052fa1db93cc9b459ac9057a9eb502 | [
"MIT"
] | 8 | 2017-04-03T10:46:16.000Z | 2021-11-20T05:46:02.000Z | from __future__ import absolute_import
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
# see http://chriskief.com/2013/11/15/celery-3-1-with-django-django-celery-rabbitmq-and-macports/
from .celery import app
| 39 | 97 | 0.787546 | 46 | 273 | 4.543478 | 0.76087 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.042017 | 0.128205 | 273 | 6 | 98 | 45.5 | 0.836134 | 0.732601 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
907a4fde92736320f72f6e7a6ba8c81c7fb6dfc2 | 1,150 | py | Python | tests/NBodyAtmEsc/test_NBodyAtmEsc.py | alex-w/vplanet | e901ac08208f7fd5edb30677f32f36619eb8ca8c | [
"MIT"
] | null | null | null | tests/NBodyAtmEsc/test_NBodyAtmEsc.py | alex-w/vplanet | e901ac08208f7fd5edb30677f32f36619eb8ca8c | [
"MIT"
] | null | null | null | tests/NBodyAtmEsc/test_NBodyAtmEsc.py | alex-w/vplanet | e901ac08208f7fd5edb30677f32f36619eb8ca8c | [
"MIT"
] | null | null | null | from vplot import GetOutput
import subprocess
import numpy as np
import os
cwd = os.path.dirname(os.path.realpath(__file__))
def test_NBodyAtmEsc():
"""Test coupling between AtmEsc and SpiNBody."""
# Remove old log file
subprocess.run(['rm', 'PSR1257.log'], cwd=cwd)
# Run vplanet
subprocess.run(['vplanet', 'vpl.in', '-q'], cwd=cwd)
# Grab the output
output = GetOutput(path=cwd)
# Check
assert np.isclose(output.log.final.Pulsar.PositionXSpiNBody, 1.72523e+05)
assert np.isclose(output.log.final.Pulsar.VelZSpiNBody, 0.10003)
assert np.isclose(output.log.final.A.EnvelopeMass, 0.99913)
assert np.isclose(output.log.final.A.PlanetRadius, 59.80530)
assert np.isclose(output.log.final.A.ArgP, 2.52340)
assert np.isclose(output.log.final.A.PositionXSpiNBody, 2.61203e+10)
assert np.isclose(output.log.final.B.LongA, 6.27639)
assert np.isclose(output.log.final.B.VelXSpiNBody, 4.40398e+04)
assert np.isclose(output.log.final.C.SemiMajorAxis, 6.97244e+10)
assert np.isclose(output.log.final.C.PositionZSpiNBody, 4.87735e+10)
if __name__ == "__main__":
test_NBodyAtmEsc()
| 34.848485 | 77 | 0.718261 | 168 | 1,150 | 4.833333 | 0.440476 | 0.098522 | 0.184729 | 0.258621 | 0.3867 | 0.3867 | 0.3867 | 0 | 0 | 0 | 0 | 0.076142 | 0.143478 | 1,150 | 32 | 78 | 35.9375 | 0.748223 | 0.084348 | 0 | 0 | 0 | 0 | 0.034483 | 0 | 0 | 0 | 0 | 0 | 0.47619 | 1 | 0.047619 | false | 0 | 0.190476 | 0 | 0.238095 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
90953a111ea082ef903924c99fb31a7ed4c05d79 | 255 | py | Python | armitage/armitageApp/filters/repository/filtersRepository.py | sudoFerraz/armitage | 303a5aca64ace9bacd10acabb0ba1d9b99c678ac | [
"CC0-1.0"
] | null | null | null | armitage/armitageApp/filters/repository/filtersRepository.py | sudoFerraz/armitage | 303a5aca64ace9bacd10acabb0ba1d9b99c678ac | [
"CC0-1.0"
] | null | null | null | armitage/armitageApp/filters/repository/filtersRepository.py | sudoFerraz/armitage | 303a5aca64ace9bacd10acabb0ba1d9b99c678ac | [
"CC0-1.0"
] | null | null | null | import sqlalchemy
from sqlalchemy import Column, Integer, Float, String, Bool
from ..model import base
class Filters(Base):
__tablename__ = 'filters'
id = Column(Integer, primary_key=True)
words = Column(String(999))
active = Column(Bool) | 28.333333 | 59 | 0.72549 | 32 | 255 | 5.625 | 0.625 | 0.144444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014286 | 0.176471 | 255 | 9 | 60 | 28.333333 | 0.842857 | 0 | 0 | 0 | 0 | 0 | 0.027344 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.375 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
90c35cbe16f0174011c7a7d5c0959c0b0e56bcd0 | 150 | py | Python | server/edd/profile/apps.py | trussworks/edd | 1183c6bb1f04de31d8c4c6ed7b97b051228f3bb7 | [
"BSD-3-Clause-LBNL"
] | 13 | 2016-11-15T07:33:40.000Z | 2021-09-22T12:19:13.000Z | server/edd/profile/apps.py | trussworks/edd | 1183c6bb1f04de31d8c4c6ed7b97b051228f3bb7 | [
"BSD-3-Clause-LBNL"
] | 40 | 2017-04-04T15:20:14.000Z | 2022-03-31T04:34:37.000Z | server/edd/profile/apps.py | trussworks/edd | 1183c6bb1f04de31d8c4c6ed7b97b051228f3bb7 | [
"BSD-3-Clause-LBNL"
] | 10 | 2017-09-21T07:27:01.000Z | 2022-03-10T17:02:19.000Z | from django.apps import AppConfig
class ProfileConfig(AppConfig):
label = "profile"
name = "edd.profile"
verbose_name = "User Profiles"
| 18.75 | 34 | 0.706667 | 17 | 150 | 6.176471 | 0.823529 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | 150 | 7 | 35 | 21.428571 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0.206667 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
90ee2efd20c5737288b593b97f93336ffeacdfa0 | 125 | py | Python | servo/types/kubernetes.py | opsani/ServoX | 06c574e2c9cd15da819f8a81e928ac0e606f2298 | [
"Apache-2.0"
] | null | null | null | servo/types/kubernetes.py | opsani/ServoX | 06c574e2c9cd15da819f8a81e928ac0e606f2298 | [
"Apache-2.0"
] | null | null | null | servo/types/kubernetes.py | opsani/ServoX | 06c574e2c9cd15da819f8a81e928ac0e606f2298 | [
"Apache-2.0"
] | null | null | null | import enum
class ContainerLogOptions(str, enum.Enum):
previous = "previous"
current = "current"
both = "both"
| 15.625 | 42 | 0.664 | 13 | 125 | 6.384615 | 0.615385 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.224 | 125 | 7 | 43 | 17.857143 | 0.85567 | 0 | 0 | 0 | 0 | 0 | 0.152 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
2909792c4a2e046038a6585d1325fc22b7606189 | 2,569 | py | Python | gym_quickcheck/envs/random_walk_env.py | SwamyDev/gym-quickcheck | d271f509c11998c9f210c5d8131906f712553123 | [
"MIT"
] | null | null | null | gym_quickcheck/envs/random_walk_env.py | SwamyDev/gym-quickcheck | d271f509c11998c9f210c5d8131906f712553123 | [
"MIT"
] | null | null | null | gym_quickcheck/envs/random_walk_env.py | SwamyDev/gym-quickcheck | d271f509c11998c9f210c5d8131906f712553123 | [
"MIT"
] | null | null | null | import sys
import gym
import numpy as np
from gym import spaces, utils
class RandomWalkEnv(gym.Env):
metadata = {'render.modes': ['human']}
def __init__(self):
self.action_space = spaces.Discrete(2)
self._walk_len = 7
self.observation_space = spaces.Box(low=0, high=1, shape=(self._walk_len,), dtype=np.uint8)
self._position = self._center()
self._max_len = self._walk_len * 2
self._penalty = -1
self._reward = 1
self.reward_range = (self.penalty * self.max_len,
self.reward - (self._steps_to_edge() - 1))
self._step = 0
self._last_action = None
def _center(self):
return self._walk_len // 2
def _steps_to_edge(self):
return self._walk_len - self._center() - 1
@property
def max_len(self):
return self._max_len
@property
def penalty(self):
return self._penalty
@property
def reward(self):
return self._reward
def step(self, action):
assert action == 0 or action == 1, "the action range must be [0,1]"
self._last_action = action
# noinspection PyTypeChecker
self._update_position(action)
self._step += 1
return self._make_observation(), self._calc_reward(), self._is_done(), None
def _update_position(self, action):
self._position += action * 2 - 1
self._position = max(0, self._position)
def _calc_reward(self):
return self.reward if self._reached_right_edge() else self.penalty
def _reached_right_edge(self):
return self._position == self._walk_len - 1
def _is_done(self):
return self._reached_right_edge() or self._step == self.max_len
def _make_observation(self):
obs = np.zeros(shape=self.observation_space.shape)
obs[self._position] = 1
return obs
def reset(self):
self._position = self._center()
self._step = 0
return self._make_observation()
def render(self, mode='human'):
sys.stdout.write(f"{self._render_action()}\n{self._render_walk()}\n")
def _render_action(self):
if self._last_action is None:
return ""
return ["(Left)", "(Right)"][self._last_action]
def _render_walk(self):
chars = ['#'] * self._walk_len
c = 'green' if self._reached_right_edge() else 'red'
chars[self._position] = utils.colorize(chars[self._position], color=c, highlight=True)
return "".join(chars)
def close(self):
pass
| 28.865169 | 99 | 0.617361 | 333 | 2,569 | 4.456456 | 0.255255 | 0.067385 | 0.075472 | 0.040431 | 0.133423 | 0.03504 | 0 | 0 | 0 | 0 | 0 | 0.012215 | 0.26703 | 2,569 | 88 | 100 | 29.193182 | 0.77589 | 0.010121 | 0 | 0.104478 | 0 | 0 | 0.048013 | 0.01889 | 0 | 0 | 0 | 0 | 0.014925 | 1 | 0.253731 | false | 0.014925 | 0.059701 | 0.119403 | 0.552239 | 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 |
290ff9b3d57cfee80c6301599aa6b5ab6c9927a4 | 1,459 | py | Python | functions/multiplyDigits_test.py | JRJurman/persistent-number-generator | 4f531e88c94ae9ea1c6aa241e3ae9086c48fd80d | [
"MIT"
] | 1 | 2019-04-10T04:07:50.000Z | 2019-04-10T04:07:50.000Z | functions/multiplyDigits_test.py | JRJurman/persistent-number-generator | 4f531e88c94ae9ea1c6aa241e3ae9086c48fd80d | [
"MIT"
] | 1 | 2019-04-10T04:09:43.000Z | 2019-04-12T01:46:18.000Z | functions/multiplyDigits_test.py | JRJurman/persistent-number-generator | 4f531e88c94ae9ea1c6aa241e3ae9086c48fd80d | [
"MIT"
] | null | null | null | import numpy as np
from functions.multiplyDigits import multiplyDigits
import unittest
class multiplyDigits_spec(unittest.TestCase):
"""Test multiplyDigits"""
def test_single_digit(self):
result = multiplyDigits(np.array([4]))
self.assertEqual(result, 4)
result = multiplyDigits(np.array([1]))
self.assertEqual(result, 1)
result = multiplyDigits(np.array([0]))
self.assertEqual(result, 0)
def test_single_number(self):
result = multiplyDigits(np.array([20]))
self.assertEqual(result, 0)
result = multiplyDigits(np.array([300]))
self.assertEqual(result, 0)
result = multiplyDigits(np.array([4872]))
self.assertEqual(result, 448)
result = multiplyDigits(np.array([113]))
self.assertEqual(result, 3)
result = multiplyDigits(np.array([125]))
self.assertEqual(result, 10)
result = multiplyDigits(np.array([24]))
self.assertEqual(result, 8)
def test_even_single_dimension_list(self):
result = multiplyDigits(np.array([11,12,13,14,15]))
self.assertEqual(result.tolist(), [1, 2, 3, 4, 5])
def test_odd_single_dimension_list(self):
result = multiplyDigits(np.array([11,103,13,144,125, 40]))
self.assertEqual(result.tolist(), [1, 0, 3, 16, 10, 0])
def test_even_multi_dimension_list(self):
result = multiplyDigits(np.array([[10, 23], [45, 67]]))
self.assertEqual(result.tolist(), [[0, 6], [20, 42]])
if __name__ == '__main__':
unittest.main()
| 28.607843 | 62 | 0.687457 | 189 | 1,459 | 5.174603 | 0.306878 | 0.245399 | 0.269939 | 0.331288 | 0.372188 | 0.251534 | 0.251534 | 0.206544 | 0.106339 | 0 | 0 | 0.068404 | 0.158328 | 1,459 | 50 | 63 | 29.18 | 0.728013 | 0.013023 | 0 | 0.085714 | 0 | 0 | 0.005579 | 0 | 0 | 0 | 0 | 0 | 0.342857 | 1 | 0.142857 | false | 0 | 0.085714 | 0 | 0.257143 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2928b0ef1d0d6538f652898d2af9f5049cca3e8b | 492 | py | Python | torchember/fastai.py | raynardj/torchember | 635a6578760ede37c2b02b47be84e3bf773a18a4 | [
"Apache-2.0"
] | 2 | 2020-02-16T03:16:20.000Z | 2021-05-22T21:46:48.000Z | torchember/fastai.py | raynardj/torchember | 635a6578760ede37c2b02b47be84e3bf773a18a4 | [
"Apache-2.0"
] | 14 | 2020-02-24T15:44:09.000Z | 2021-09-28T00:41:16.000Z | torchember/fastai.py | raynardj/torchember | 635a6578760ede37c2b02b47be84e3bf773a18a4 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/50_extension_fastai.ipynb (unless otherwise specified).
__all__ = ['EmberCallback']
# Cell
from .core import torchEmber
from fastai.basic_train import Learner,LearnerCallback
# Cell
class EmberCallback(LearnerCallback):
"""
A call back for fastai learner
"""
def __init__(self,learn:Learner, te:torchEmber):
super().__init__(learn)
self.te = te
def on_step_end(self,**kwargs):
self.te.log_model() | 25.894737 | 103 | 0.703252 | 62 | 492 | 5.290323 | 0.677419 | 0.036585 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005025 | 0.191057 | 492 | 19 | 104 | 25.894737 | 0.819095 | 0.29065 | 0 | 0 | 1 | 0 | 0.039157 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.222222 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
2942cdeb1086bb5543a26812bca45cf3641dcfb3 | 80 | py | Python | libroderecetas1.py | FedeFossati/my-first-binder | d960aa7ddd689642af966af817447429452ec825 | [
"MIT"
] | 8 | 2020-06-11T21:59:40.000Z | 2022-03-24T16:48:16.000Z | libroderecetas1.py | RosyMH/pythonMoocCompanion | e0fe196804caf9a1dbd18ed2c045d3cb902c3c55 | [
"MIT"
] | null | null | null | libroderecetas1.py | RosyMH/pythonMoocCompanion | e0fe196804caf9a1dbd18ed2c045d3cb902c3c55 | [
"MIT"
] | 53 | 2020-06-14T12:01:27.000Z | 2022-03-24T16:45:37.000Z | CONST = "constante1 en modulo1 del paquete"
VAR_2 = ",datos adicionales en var"
| 26.666667 | 43 | 0.75 | 12 | 80 | 4.916667 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.044776 | 0.1625 | 80 | 2 | 44 | 40 | 0.835821 | 0 | 0 | 0 | 0 | 0 | 0.725 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2947cf8d236b0b1735aa3f66b65a36be396db557 | 97 | py | Python | awesome_django_timezones/__init__.py | onurmatik/awesome-django-timezones | b0d257c33ec681c3303692d0e13fc11e8b034d8e | [
"MIT"
] | 7 | 2019-02-05T19:18:44.000Z | 2020-09-30T12:50:31.000Z | awesome_django_timezones/__init__.py | onurmatik/awesome-django-timezones | b0d257c33ec681c3303692d0e13fc11e8b034d8e | [
"MIT"
] | 2 | 2019-12-03T16:35:55.000Z | 2020-08-31T10:01:05.000Z | awesome_django_timezones/__init__.py | onurmatik/awesome-django-timezones | b0d257c33ec681c3303692d0e13fc11e8b034d8e | [
"MIT"
] | 5 | 2019-04-10T09:48:09.000Z | 2022-02-05T05:08:13.000Z | __version__ = '0.3.0'
default_app_config = 'awesome_django_timezones.apps.DjangoTimezonesConfig'
| 32.333333 | 74 | 0.835052 | 12 | 97 | 6.083333 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.032967 | 0.061856 | 97 | 2 | 75 | 48.5 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0.57732 | 0.525773 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
296cfe768914b92dbb98c8c10d91a7b2ddddbc4c | 263 | py | Python | Templates/filters/custom/@register.filter/@register.filter(is_safe=True)/tests.py | looking-for-a-job/django-examples | dfafa450668cac5c0351f6c7238b8886511229bf | [
"Unlicense"
] | null | null | null | Templates/filters/custom/@register.filter/@register.filter(is_safe=True)/tests.py | looking-for-a-job/django-examples | dfafa450668cac5c0351f6c7238b8886511229bf | [
"Unlicense"
] | null | null | null | Templates/filters/custom/@register.filter/@register.filter(is_safe=True)/tests.py | looking-for-a-job/django-examples | dfafa450668cac5c0351f6c7238b8886511229bf | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
from django.template import Context, Template
out=Template("""
{% load my_filters %}
{{ "<script>alert('danger!')</script>" | my_not_save_filter }}
{{ "<script>alert('danger!')</script>" | my_save_filter }}""").render(Context())
print(out)
| 29.222222 | 80 | 0.676806 | 34 | 263 | 5.058824 | 0.617647 | 0.127907 | 0.197674 | 0.267442 | 0.290698 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.091255 | 263 | 8 | 81 | 32.875 | 0.719665 | 0.076046 | 0 | 0 | 0 | 0 | 0.595041 | 0.289256 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.166667 | 0.166667 | 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 |
296f7733f83141fb147f36764690e1a17b469d55 | 77 | py | Python | bwgpt2/workspace.py | daemon/bungeeweb-gpt2 | f2e0736d24a5d2b889c40831b58ed077ae41832f | [
"MIT"
] | null | null | null | bwgpt2/workspace.py | daemon/bungeeweb-gpt2 | f2e0736d24a5d2b889c40831b58ed077ae41832f | [
"MIT"
] | null | null | null | bwgpt2/workspace.py | daemon/bungeeweb-gpt2 | f2e0736d24a5d2b889c40831b58ed077ae41832f | [
"MIT"
] | null | null | null | UUID_RESOLVE_FILENAME = 'uuid-resolv.json'
CHAT_LOG_FILENAME = 'chat-log.tsv' | 38.5 | 42 | 0.805195 | 12 | 77 | 4.833333 | 0.666667 | 0.241379 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.064935 | 77 | 2 | 43 | 38.5 | 0.805556 | 0 | 0 | 0 | 0 | 0 | 0.358974 | 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 |
462a9b4c305462ad1704451b8fbde407577a4290 | 1,734 | py | Python | supports/pyload/src/pyload/core/utils/struct/base.py | LuckyNicky/pycrawler | 4b3fe2f6e8e51f236d95a64a89a44199e4e97743 | [
"Apache-2.0"
] | 1 | 2020-04-02T17:03:39.000Z | 2020-04-02T17:03:39.000Z | supports/pyload/src/pyload/core/utils/struct/base.py | LuckyNicky/pycrawler | 4b3fe2f6e8e51f236d95a64a89a44199e4e97743 | [
"Apache-2.0"
] | null | null | null | supports/pyload/src/pyload/core/utils/struct/base.py | LuckyNicky/pycrawler | 4b3fe2f6e8e51f236d95a64a89a44199e4e97743 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# AUTHOR: vuolter
from collections.abc import Mapping, MutableMapping
class Singleton(type):
"""A metaclass that creates a Singleton base class when called."""
_inst = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._inst:
cls._inst[cls] = super(Singleton, cls).__call__(*args, **kwargs)
return cls._inst[cls]
class InscDict(MutableMapping):
"""Improved version of the header dictionary from
`requests.structures.CaseInsensitiveDict`."""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def __getitem__(self, key):
return self.__dict__[key.lower()][-1]
def __setitem__(self, key, value):
# NOTE: Use the lowercased key for lookups, but store the actual key
# alongside the value
self.__dict__[key.lower()] = (key, value)
def __delitem__(self, key):
del self.__dict__[key.lower()]
def __len__(self):
return len(self.__dict__)
def __iter__(self):
return iter(key for key, val in self.__dict__.values())
def __str__(self):
return f"<InscDict {self.__dict__}>"
def __eq__(self, other):
if not isinstance(other, Mapping):
raise TypeError
# Compare insensitively
return self.loweritems() == InscDict(other).loweritems()
def lowerkeys(self):
"""Like `keys`, but with all lowercase keys."""
return self.__dict__.keys()
def loweritems(self):
"""Like `items`, but with all lowercase keys."""
return ((lowerkey, val) for lowerkey, (key, val) in self.__dict__.items())
def copy(self):
return InscDict(self.__dict__.values())
| 28.42623 | 82 | 0.624567 | 206 | 1,734 | 4.849515 | 0.412621 | 0.072072 | 0.03003 | 0.048048 | 0.09009 | 0.058058 | 0 | 0 | 0 | 0 | 0 | 0.001531 | 0.246828 | 1,734 | 61 | 83 | 28.42623 | 0.7634 | 0.220877 | 0 | 0 | 0 | 0 | 0.019652 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.375 | false | 0 | 0.03125 | 0.15625 | 0.78125 | 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 |
462c741a8309097b9d6980f8b51beb13bbb40706 | 222 | py | Python | appendix/numpy_2.py | skillup-ai/tettei-engineer | d3f8a36c068db44391afcf4727ccbb7c456852c2 | [
"MIT"
] | 16 | 2021-02-10T11:10:40.000Z | 2022-02-16T13:27:50.000Z | appendix/numpy_2.py | skillup-ai/tettei-engineer | d3f8a36c068db44391afcf4727ccbb7c456852c2 | [
"MIT"
] | null | null | null | appendix/numpy_2.py | skillup-ai/tettei-engineer | d3f8a36c068db44391afcf4727ccbb7c456852c2 | [
"MIT"
] | 5 | 2021-02-10T12:14:29.000Z | 2022-02-01T00:55:22.000Z | import numpy as np
x_1 = np.array([1, 2, 3])
x_2 = np.array([[1, 2, 3]])
print(x_1.ndim) #一次元 array
'''
1
'''
print(x_2.ndim) #二次元 array
'''
2
'''
print(x_1.T)
'''
[1 2 3]
'''
print(x_2.T)
'''
[[1]
[2]
[3]]
''' | 7.16129 | 27 | 0.481982 | 46 | 222 | 2.195652 | 0.304348 | 0.079208 | 0.118812 | 0.178218 | 0.346535 | 0 | 0 | 0 | 0 | 0 | 0 | 0.115607 | 0.220721 | 222 | 31 | 28 | 7.16129 | 0.468208 | 0.081081 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.142857 | 0 | 0.142857 | 0.571429 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
463075e57a9cf9b40ce761e6ff57825d867cec87 | 1,173 | py | Python | app/models/user.py | KindtAnton/Haldis | 6e3e5e7fb5a06640e48c7c6f91a13320ea760483 | [
"MIT"
] | null | null | null | app/models/user.py | KindtAnton/Haldis | 6e3e5e7fb5a06640e48c7c6f91a13320ea760483 | [
"MIT"
] | null | null | null | app/models/user.py | KindtAnton/Haldis | 6e3e5e7fb5a06640e48c7c6f91a13320ea760483 | [
"MIT"
] | null | null | null | "Script for everything User related in the database"
from models import db
class User(db.Model):
"Class used for configuring the User model in the database"
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(80), unique=True, nullable=False)
admin = db.Column(db.Boolean)
bias = db.Column(db.Integer)
runs = db.relation(
"Order",
backref="courrier",
primaryjoin="Order.courrier_id==User.id",
foreign_keys="Order.courrier_id",
)
orderItems = db.relationship("OrderItem", backref="user", lazy="dynamic")
def configure(self, username: str, admin: bool, bias: int) -> None:
"Configure the User"
self.username = username
self.admin = admin
self.bias = bias
# pylint: disable=C0111, R0201
def is_authenticated(self) -> bool:
return True
def is_active(self) -> bool:
return True
def is_admin(self) -> bool:
return self.admin
def is_anonymous(self) -> bool:
return False
def get_id(self) -> str:
return str(self.id)
def __repr__(self) -> str:
return "%s" % self.username
| 27.27907 | 77 | 0.627451 | 151 | 1,173 | 4.788079 | 0.417219 | 0.04426 | 0.055325 | 0.047026 | 0.063624 | 0.063624 | 0 | 0 | 0 | 0 | 0 | 0.011468 | 0.256607 | 1,173 | 42 | 78 | 27.928571 | 0.817661 | 0.133845 | 0 | 0.0625 | 0 | 0 | 0.177603 | 0.022747 | 0 | 0 | 0 | 0 | 0 | 1 | 0.21875 | false | 0 | 0.03125 | 0.1875 | 0.65625 | 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 |
465ea9323301d7a0ce698276beca21fb11d53833 | 150 | py | Python | macos_virt/constants.py | dmarkey/vmcli | 1de9d936a72213867ba8462f62068017b2ad8a55 | [
"BSD-2-Clause"
] | null | null | null | macos_virt/constants.py | dmarkey/vmcli | 1de9d936a72213867ba8462f62068017b2ad8a55 | [
"BSD-2-Clause"
] | null | null | null | macos_virt/constants.py | dmarkey/vmcli | 1de9d936a72213867ba8462f62068017b2ad8a55 | [
"BSD-2-Clause"
] | null | null | null | KERNAL_FILENAME = "kernel"
INITRD_FILENAME = "initrd"
DISK_FILENAME = "disk.img"
BOOT_DISK_FILENAME = "boot.img"
CLOUDINIT_ISO_NAME = "cloudinit.img"
| 25 | 36 | 0.78 | 20 | 150 | 5.5 | 0.5 | 0.218182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1 | 150 | 5 | 37 | 30 | 0.814815 | 0 | 0 | 0 | 0 | 0 | 0.273333 | 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 |
465fd55e7d188dd064a0ba574ad89312685d8f50 | 887 | py | Python | models/user.py | guoweikuang/sanic-demo | ecbeb185aa5110c4c35bd79b0de485e146e54235 | [
"Apache-2.0"
] | null | null | null | models/user.py | guoweikuang/sanic-demo | ecbeb185aa5110c4c35bd79b0de485e146e54235 | [
"Apache-2.0"
] | null | null | null | models/user.py | guoweikuang/sanic-demo | ecbeb185aa5110c4c35bd79b0de485e146e54235 | [
"Apache-2.0"
] | null | null | null | from tortoise import Model
from tortoise import fields
from werkzeug.security import generate_password_hash, check_password_hash
class User(Model):
class Meta:
table = 'users'
id = fields.IntField(pk=True)
username = fields.CharField(max_length=100, unique=True)
email = fields.CharField(max_length=100)
password_hash = fields.TextField()
def _get_password(self):
raise AttributeError("Password not allow to reading")
def _set_password(self, password):
self.password_hash = generate_password_hash(password)
password = property(_get_password, _set_password)
async def create_user(**kwargs):
"""create user
:param kwargs:
:return:
"""
kwargs['password_hash'] = generate_password_hash(kwargs.pop('password'))
kwargs['username'] = kwargs.pop('name')
user = await User.create(**kwargs)
return user | 26.878788 | 76 | 0.709132 | 108 | 887 | 5.62037 | 0.435185 | 0.138386 | 0.098847 | 0.079077 | 0.194399 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008322 | 0.187148 | 887 | 33 | 77 | 26.878788 | 0.833564 | 0 | 0 | 0 | 1 | 0 | 0.080432 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1 | false | 0.4 | 0.15 | 0 | 0.65 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
469b83fc5392a6e13d6212b6521c9cc50a4399aa | 2,880 | py | Python | python/maya/site-packages/pymel-1.0.3/maya/app/python.py | CountZer0/PipelineConstructionSet | 0aa73a8a63c72989b2d1c677efd78dad4388d335 | [
"BSD-3-Clause"
] | 21 | 2015-04-27T05:01:36.000Z | 2021-11-22T13:45:14.000Z | python/maya/site-packages/pymel-1.0.3/maya/app/python.py | 0xb1dd1e/PipelineConstructionSet | 621349da1b6d1437e95d0c9e48ee9f36d59f19fd | [
"BSD-3-Clause"
] | null | null | null | python/maya/site-packages/pymel-1.0.3/maya/app/python.py | 0xb1dd1e/PipelineConstructionSet | 621349da1b6d1437e95d0c9e48ee9f36d59f19fd | [
"BSD-3-Clause"
] | 7 | 2015-04-11T11:37:19.000Z | 2020-05-22T09:49:04.000Z |
"""
!!!!!!!!
As of 2011, this file is no longer part of the 'official' maya distribution -
it is included here only to override it in older maya versions
!!!!!!!!
The maya.app.python module contains utilites which Maya uses to communicate
with Python. These functions are not part of Maya's public API and may be
subject to change.
Simple test script to exercise these manually:
import maya.cmds as cmds
def e1():
cmds.error("DUH")
def e2():
e1()
def e3():
cmds.ls(duh=1)
def e4():
e3()
def e5():
cmds.xform( q=True )
def e6():
e5()
"""
import sys, traceback
import maya.utils
formatException = maya.utils._guiExceptHook
#
#def formatOtherException( exceptionType, exceptionObject, traceBack, detail ):
# baseMsg = unicode(exceptionObject)
# if detail > 0:
# result = formatTraceback( detail==2, baseMsg, traceBack )
# else:
# result = baseMsg
# return u'%s: %s' % ( exceptionType.__name__, result)
#
#def formatRuntimeException( exceptionType, exceptionObject ):
# """
# Return the exception information for RuntimeError exceptions only,
# formatted as a string suitable for user consumption. Traceback
# information for this exception, if requested, is appended through
# the formatTraceback() function.
# """
# # Format the exception into a string
# stringBuffer = StringIO.StringIO()
# traceback.print_exception( exceptionType, exceptionObject, None,
# 32, stringBuffer )
# result = stringBuffer.getvalue().decode('utf8')
# stringBuffer.close()
# print `result`
# return u'%s' % result.rstrip()
# Copyright (C) 1997-2006 Autodesk, Inc., and/or its licensors.
# All rights reserved.
#
# The coded instructions, statements, computer programs, and/or related
# material (collectively the "Data") in these files contain unpublished
# information proprietary to Autodesk, Inc. ("Autodesk") and/or its licensors,
# which is protected by U.S. and Canadian federal copyright law and by
# international treaties.
#
# The Data is provided for use exclusively by You. You have the right to use,
# modify, and incorporate this Data into other products for purposes authorized
# by the Autodesk software license agreement, without fee.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. AUTODESK
# DOES NOT MAKE AND HEREBY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTIES
# INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF NON-INFRINGEMENT,
# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, OR ARISING FROM A COURSE
# OF DEALING, USAGE, OR TRADE PRACTICE. IN NO EVENT WILL AUTODESK AND/OR ITS
# LICENSORS BE LIABLE FOR ANY LOST REVENUES, DATA, OR PROFITS, OR SPECIAL,
# DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES, EVEN IF AUTODESK AND/OR ITS
# LICENSORS HAS BEEN ADVISED OF THE POSSIBILITY OR PROBABILITY OF SUCH DAMAGES.
| 33.882353 | 80 | 0.716667 | 380 | 2,880 | 5.415789 | 0.539474 | 0.012148 | 0.015549 | 0.033042 | 0.036443 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011648 | 0.195139 | 2,880 | 84 | 81 | 34.285714 | 0.876186 | 0.932292 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
46a1b5c1b7155853d569d99d90c767d6b4a3cda0 | 104 | py | Python | Dictionaries/substring.py | petel3/Softuni_education | 4fd80f8c6ce6c3d6a838edecdb091dda2ed1084c | [
"MIT"
] | 2 | 2022-03-05T13:17:12.000Z | 2022-03-05T13:17:16.000Z | Dictionaries/substring.py | petel3/Softuni_education | 4fd80f8c6ce6c3d6a838edecdb091dda2ed1084c | [
"MIT"
] | null | null | null | Dictionaries/substring.py | petel3/Softuni_education | 4fd80f8c6ce6c3d6a838edecdb091dda2ed1084c | [
"MIT"
] | null | null | null | substring=input()
word=input()
while substring in word:
word=word.replace(substring,"")
print(word) | 17.333333 | 35 | 0.730769 | 14 | 104 | 5.428571 | 0.5 | 0.210526 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.115385 | 104 | 6 | 36 | 17.333333 | 0.826087 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 |
d3d97163e26ae49bce83c102cb3f499d545d4551 | 110 | py | Python | lists/join_list_to_string.py | ivanlmj/SnakeEggs | 540843dcf6fba4b3fe0d6d57dd19654f33cccb74 | [
"MIT"
] | 1 | 2019-05-20T18:19:45.000Z | 2019-05-20T18:19:45.000Z | lists/join_list_to_string.py | ivanlmj/SnakeEggs | 540843dcf6fba4b3fe0d6d57dd19654f33cccb74 | [
"MIT"
] | null | null | null | lists/join_list_to_string.py | ivanlmj/SnakeEggs | 540843dcf6fba4b3fe0d6d57dd19654f33cccb74 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
""" Transforms a list into a string. """
l = ["I", "am", "the", "law"]
print(" ".join(l))
| 18.333333 | 40 | 0.536364 | 17 | 110 | 3.470588 | 0.882353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01087 | 0.163636 | 110 | 5 | 41 | 22 | 0.630435 | 0.463636 | 0 | 0 | 0 | 0 | 0.192308 | 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 |
d3e02d40b5c75fd6680b7fc6885ccbf9b6450257 | 87 | py | Python | _build/jupyter_execute/chapters/learning/vb.py | ssm-jax/ssm-book | f3bfa29a1c474b7dc85792a563df0f29736a44c6 | [
"MIT"
] | 10 | 2022-03-22T21:28:03.000Z | 2022-03-29T17:42:06.000Z | _build/jupyter_execute/chapters/learning/vb.py | ssm-jax/ssm-book | f3bfa29a1c474b7dc85792a563df0f29736a44c6 | [
"MIT"
] | null | null | null | _build/jupyter_execute/chapters/learning/vb.py | ssm-jax/ssm-book | f3bfa29a1c474b7dc85792a563df0f29736a44c6 | [
"MIT"
] | 1 | 2022-03-23T02:15:23.000Z | 2022-03-23T02:15:23.000Z | #!/usr/bin/env python
# coding: utf-8
#
# (sec:VB)=
# # Variational Bayes (VB)
#
#
| 9.666667 | 26 | 0.551724 | 12 | 87 | 4 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014706 | 0.218391 | 87 | 8 | 27 | 10.875 | 0.691176 | 0.793103 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
d3fc15c753f3bddf5142650b5744a1cae71cf9ed | 93 | py | Python | pg_cpu/test.py | RayYoh/BasicRL | bb5c27731f89e98b7c71fa966918220fddb47d5a | [
"Apache-2.0"
] | 12 | 2021-10-08T12:57:20.000Z | 2022-03-23T09:23:24.000Z | pg_cpu/test.py | RayYoh/BasicRL | bb5c27731f89e98b7c71fa966918220fddb47d5a | [
"Apache-2.0"
] | null | null | null | pg_cpu/test.py | RayYoh/BasicRL | bb5c27731f89e98b7c71fa966918220fddb47d5a | [
"Apache-2.0"
] | null | null | null | import gym
env = gym.make('Pendulum-v0')
act_limit = env.action_space.low[0]
print(act_limit) | 23.25 | 35 | 0.763441 | 17 | 93 | 4 | 0.764706 | 0.235294 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.023529 | 0.086022 | 93 | 4 | 36 | 23.25 | 0.776471 | 0 | 0 | 0 | 0 | 0 | 0.117021 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0.25 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
d3fca3008155d9e43032d46c2b9791c9945a0cb3 | 533 | py | Python | examples/introduction.to.programming.with.turtle/windows_only/5-4-1.snowflake.curve.py | strakam/PyEasyGraphics | 57a586aa92385d26725d4ec3d61b2bbbe970195d | [
"BSD-3-Clause"
] | 5 | 2019-09-23T05:15:47.000Z | 2021-01-17T08:06:47.000Z | examples/introduction.to.programming.with.turtle/windows_only/5-4-1.snowflake.curve.py | strakam/PyEasyGraphics | 57a586aa92385d26725d4ec3d61b2bbbe970195d | [
"BSD-3-Clause"
] | 3 | 2019-05-03T05:25:17.000Z | 2021-04-15T04:53:16.000Z | examples/introduction.to.programming.with.turtle/windows_only/5-4-1.snowflake.curve.py | strakam/PyEasyGraphics | 57a586aa92385d26725d4ec3d61b2bbbe970195d | [
"BSD-3-Clause"
] | 4 | 2019-05-04T13:42:40.000Z | 2021-04-15T10:38:48.000Z | from easygraphics.turtle import *
def snowflake_side(size, level):
if level == 0:
fd(size)
return
snowflake_side(size / 3, level - 1)
lt(60)
snowflake_side(size / 3, level - 1)
rt(120)
snowflake_side(size / 3, level - 1)
lt(60)
snowflake_side(size / 3, level - 1)
def snowflake(size, level):
for i in range(3):
snowflake_side(size, level)
rt(120)
create_world(800, 600)
set_speed(100)
setxy(-250, 150)
rt(90)
snowflake(500, 4)
hide()
pause()
close_world()
| 15.676471 | 39 | 0.611632 | 79 | 533 | 4.012658 | 0.493671 | 0.246057 | 0.321767 | 0.227129 | 0.328076 | 0.328076 | 0.328076 | 0.328076 | 0.328076 | 0.328076 | 0 | 0.103797 | 0.258912 | 533 | 33 | 40 | 16.151515 | 0.698734 | 0 | 0 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.083333 | false | 0 | 0.041667 | 0 | 0.166667 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
310af2946b6ec66f2358cd1e5c1b4f53faae889d | 224 | py | Python | tokens/config.py | molkoback/Fab-Lab-Tokens | 07e9e250931cf344610561108fe199eed257d9b8 | [
"MIT"
] | null | null | null | tokens/config.py | molkoback/Fab-Lab-Tokens | 07e9e250931cf344610561108fe199eed257d9b8 | [
"MIT"
] | null | null | null | tokens/config.py | molkoback/Fab-Lab-Tokens | 07e9e250931cf344610561108fe199eed257d9b8 | [
"MIT"
] | 1 | 2018-10-17T07:05:12.000Z | 2018-10-17T07:05:12.000Z | from tokens import app
# Ethereum settings
app.config["ETH_PROVIDER_URL"] = ""
app.config["ETH_PRIV_KEY"] = ""
# Allowed API users
app.config["ALLOWED_APPS"] = {
"document-fetcher": "password",
"scheduler": "password"
}
| 18.666667 | 35 | 0.700893 | 28 | 224 | 5.428571 | 0.714286 | 0.177632 | 0.157895 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.129464 | 224 | 11 | 36 | 20.363636 | 0.779487 | 0.15625 | 0 | 0 | 0 | 0 | 0.435484 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.285714 | 0.142857 | 0 | 0.142857 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
310f426c6f3017827ef025338271dccfa72a1bff | 266 | py | Python | app/template/views.py | rwgeaston/django-template | d51a023aacb871ba76992e1958b2a4fb27e5dad6 | [
"MIT"
] | null | null | null | app/template/views.py | rwgeaston/django-template | d51a023aacb871ba76992e1958b2a4fb27e5dad6 | [
"MIT"
] | 2 | 2020-02-11T23:21:09.000Z | 2020-06-05T19:23:58.000Z | app/template/views.py | rwgeaston/django-postgres-template | d51a023aacb871ba76992e1958b2a4fb27e5dad6 | [
"MIT"
] | null | null | null | # pylint: disable=too-many-ancestors
from rest_framework import viewsets
from .models import Entity
from .serializers import EntitySerializer
class EntityViewSet(viewsets.ModelViewSet):
queryset = Entity.objects.all()
serializer_class = EntitySerializer
| 22.166667 | 43 | 0.804511 | 29 | 266 | 7.310345 | 0.724138 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.131579 | 266 | 11 | 44 | 24.181818 | 0.917749 | 0.12782 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
310ff18642a9d3a663141d576c5588b556004213 | 892 | py | Python | creel_portal/api/serializers/FN125Lamprey_serializers.py | AdamCottrill/CreelPortal | 5ec867c4f11b4231c112e8209116b6b96c2830ec | [
"MIT"
] | null | null | null | creel_portal/api/serializers/FN125Lamprey_serializers.py | AdamCottrill/CreelPortal | 5ec867c4f11b4231c112e8209116b6b96c2830ec | [
"MIT"
] | null | null | null | creel_portal/api/serializers/FN125Lamprey_serializers.py | AdamCottrill/CreelPortal | 5ec867c4f11b4231c112e8209116b6b96c2830ec | [
"MIT"
] | null | null | null | from rest_framework import serializers
from ...models.fishnet2 import FN125_Lamprey
class FN125LampreyListSerializer(serializers.ModelSerializer):
"""Class to serialize our lamprey wounding data - fast and flat, readonly, to
emulate FN-2 data structure.
"""
prj_cd = serializers.CharField(read_only=True)
sam = serializers.CharField(read_only=True)
spc = serializers.CharField(read_only=True)
grp = serializers.CharField(read_only=True)
fish = serializers.CharField(read_only=True, source="_fish")
class Meta:
model = FN125_Lamprey
fields = (
"prj_cd",
"sam",
"spc",
"grp",
"fish",
"lamid",
"xlam",
"lamijc",
"lamijc_type",
"lamijc_size",
"comment_lam",
"id",
"slug",
)
| 25.485714 | 81 | 0.573991 | 88 | 892 | 5.659091 | 0.545455 | 0.200803 | 0.240964 | 0.281125 | 0.321285 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018212 | 0.32287 | 892 | 34 | 82 | 26.235294 | 0.806291 | 0.115471 | 0 | 0 | 0 | 0 | 0.100906 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.08 | 0 | 0.36 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
311fb8cace1e531114d0a231558352aea58fe2b7 | 164 | py | Python | lib/training/train_factory.py | shachargluska/centerpose | 01c2c8bfa9d3ee91807f2ffdcc48728d104265bd | [
"MIT"
] | 245 | 2019-11-29T02:55:25.000Z | 2022-03-30T07:30:18.000Z | lib/training/train_factory.py | shachargluska/centerpose | 01c2c8bfa9d3ee91807f2ffdcc48728d104265bd | [
"MIT"
] | 24 | 2019-11-29T10:05:00.000Z | 2022-03-30T07:16:06.000Z | lib/trains/train_factory.py | FishLiuabc/centerpose | 555d753cd82693476f91f78c53aa4147f5a83015 | [
"MIT"
] | 45 | 2019-11-29T05:12:02.000Z | 2022-03-21T02:20:36.000Z | from __future__ import absolute_import, division, print_function
from .multi_pose import MultiPoseTrainer
train_factory = {
'multi_pose': MultiPoseTrainer,
}
| 18.222222 | 64 | 0.804878 | 18 | 164 | 6.833333 | 0.666667 | 0.146341 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.134146 | 164 | 8 | 65 | 20.5 | 0.866197 | 0 | 0 | 0 | 0 | 0 | 0.060976 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0.2 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
312945ef3cb027ba08a90723b90cb06c001babb7 | 675 | py | Python | ciphers/CaesarShiftCipher.py | Kushal-kothari/Cryptography-Network_Security | fd85ead3e2794d856de2072dc9d40d69c1b94f37 | [
"MIT"
] | 9 | 2020-08-24T22:07:44.000Z | 2022-01-15T12:27:23.000Z | ciphers/CaesarShiftCipher.py | Kushal-kothari/Cryptography-Network_Security | fd85ead3e2794d856de2072dc9d40d69c1b94f37 | [
"MIT"
] | null | null | null | ciphers/CaesarShiftCipher.py | Kushal-kothari/Cryptography-Network_Security | fd85ead3e2794d856de2072dc9d40d69c1b94f37 | [
"MIT"
] | 2 | 2020-11-01T00:28:30.000Z | 2021-02-16T17:21:36.000Z | class CaesarShiftCipher:
def __init__(self, shift=1):
self.shift = shift
def encrypt(self, plaintext):
return ''.join(
[self.num_2_char((self.char_2_num(letter) + self.shift) % 26) for letter in plaintext.lower()]
).upper()
def decrypt(self, ciphertext: str) -> str:
return ''.join(
[self.num_2_char((self.char_2_num(letter) - self.shift) % 26) for letter in ciphertext.lower()]
).lower()
@staticmethod
def char_2_num(character: str) -> int:
return ord(character.lower()) - ord('a')
@staticmethod
def num_2_char(number: int) -> str:
return chr(number + ord('a'))
| 30.681818 | 107 | 0.598519 | 87 | 675 | 4.45977 | 0.344828 | 0.092784 | 0.061856 | 0.087629 | 0.319588 | 0.319588 | 0.319588 | 0.319588 | 0.319588 | 0.319588 | 0 | 0.021912 | 0.256296 | 675 | 21 | 108 | 32.142857 | 0.750996 | 0 | 0 | 0.235294 | 0 | 0 | 0.002963 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.294118 | false | 0 | 0 | 0.235294 | 0.588235 | 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 |
312cc4daf131aabb9c5870dd54694541cb5ba393 | 2,986 | py | Python | wurstfabrik/settings.py | kcsry/wurst | ab9ce59ef6d7a8db30d38740aba44855fe5e87e7 | [
"MIT"
] | 2 | 2016-03-13T10:14:40.000Z | 2016-06-20T09:52:43.000Z | wurstfabrik/settings.py | wurstfabrik/wurst | ab9ce59ef6d7a8db30d38740aba44855fe5e87e7 | [
"MIT"
] | 3 | 2016-01-30T19:23:01.000Z | 2016-01-31T16:35:56.000Z | wurstfabrik/settings.py | kcsry/wurst | ab9ce59ef6d7a8db30d38740aba44855fe5e87e7 | [
"MIT"
] | 1 | 2016-02-18T21:57:13.000Z | 2016-02-18T21:57:13.000Z | import os
from environ import Env
env = Env()
HOME_DIR = env.str(
"HOME_DIR",
default=os.path.realpath(os.path.join(os.path.dirname(__file__), ".."))
)
env.read_env(os.path.join(HOME_DIR, ".env"))
DEBUG = env.bool("DEBUG", False)
SECRET_KEY = env.bool("SECRET_KEY", "Sehr lecker Wurst" if DEBUG else Env.NOTSET)
ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", default=["*"])
DATABASES = {
"default": env.db_url(default="sqlite:///%s" % os.path.join(HOME_DIR, "wurst.sqlite3"))
}
STATIC_ROOT = env.str("STATIC_ROOT", default=os.path.join(HOME_DIR, "static"))
MEDIA_ROOT = env.str("MEDIA_ROOT", default=os.path.join(HOME_DIR, "media"))
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'reversion',
'rest_framework',
'rest_framework.authtoken',
'wurst.core',
'wurst.api'
]
MIDDLEWARE_CLASSES = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'wurstfabrik.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'wurstfabrik.wsgi.application'
AUTH_PASSWORD_VALIDATORS = [] if DEBUG else [
{'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'},
{'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator'},
{'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator'},
{'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'},
]
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.BasicAuthentication',
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
),
'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.NamespaceVersioning',
'TEST_REQUEST_DEFAULT_FORMAT': 'json', # TODO: This shouldn't be necessary, but some tests fail w/ multipart!
}
| 33.177778 | 114 | 0.703617 | 311 | 2,986 | 6.572347 | 0.405145 | 0.101761 | 0.066536 | 0.027397 | 0.120352 | 0.103718 | 0.027397 | 0 | 0 | 0 | 0 | 0.001983 | 0.155727 | 2,986 | 89 | 115 | 33.550562 | 0.808806 | 0.022773 | 0 | 0 | 0 | 0 | 0.555556 | 0.449931 | 0 | 0 | 0 | 0.011236 | 0 | 1 | 0 | false | 0.064103 | 0.025641 | 0 | 0.025641 | 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 | 1 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
312d18acc74012e4cfd614c620d72d3d050edbec | 99 | py | Python | config.py | lyleshaw/FastAPI-WeWork-Robot | a61d5a8236d185227f582847c7aab96750811253 | [
"MIT"
] | 14 | 2020-09-28T06:03:42.000Z | 2022-03-21T12:47:09.000Z | config.py | lyleshaw/FastAPI-WeWork-Robot | a61d5a8236d185227f582847c7aab96750811253 | [
"MIT"
] | null | null | null | config.py | lyleshaw/FastAPI-WeWork-Robot | a61d5a8236d185227f582847c7aab96750811253 | [
"MIT"
] | 6 | 2020-09-28T06:41:20.000Z | 2021-12-06T03:29:00.000Z | # sToken和sEncodingAESKey来自于企业微信创建的应用
# sCorpID为企业微信号
sToken = ""
sEncodingAESKey = ""
sCorpID = "" | 16.5 | 36 | 0.757576 | 5 | 99 | 15 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.131313 | 99 | 6 | 37 | 16.5 | 0.872093 | 0.484848 | 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 |
3137798b1e12d422e1a17c41a965944a882e3d77 | 139 | pyw | Python | Python/Experimentos/Fatorial/Casos especiais/fatNTR-LeftOp.pyw | robertocsa/TCC_CComp_UERJ | 51e055da0b21f96669eaeda393de2a386c00ab3f | [
"MIT"
] | null | null | null | Python/Experimentos/Fatorial/Casos especiais/fatNTR-LeftOp.pyw | robertocsa/TCC_CComp_UERJ | 51e055da0b21f96669eaeda393de2a386c00ab3f | [
"MIT"
] | null | null | null | Python/Experimentos/Fatorial/Casos especiais/fatNTR-LeftOp.pyw | robertocsa/TCC_CComp_UERJ | 51e055da0b21f96669eaeda393de2a386c00ab3f | [
"MIT"
] | null | null | null | def factorial(n):
if n < 2:
return 1
return n * factorial(n - 1)
def main():
n=6
print(factorial(n))
main()
| 11.583333 | 31 | 0.503597 | 21 | 139 | 3.333333 | 0.47619 | 0.428571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.044944 | 0.359712 | 139 | 11 | 32 | 12.636364 | 0.741573 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.5 | 0.125 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
31393bb97ee13f75db5b6de8b7df6ab3a3371d31 | 270 | py | Python | Python-Fundamentals-June-2019/04_lists_exercises/07_sort_list_using_bubble_sort.py | marinakolova/Python-Courses | eb95c782307be561b5026c5adafaa001b04caf4f | [
"MIT"
] | null | null | null | Python-Fundamentals-June-2019/04_lists_exercises/07_sort_list_using_bubble_sort.py | marinakolova/Python-Courses | eb95c782307be561b5026c5adafaa001b04caf4f | [
"MIT"
] | null | null | null | Python-Fundamentals-June-2019/04_lists_exercises/07_sort_list_using_bubble_sort.py | marinakolova/Python-Courses | eb95c782307be561b5026c5adafaa001b04caf4f | [
"MIT"
] | null | null | null | numbers = [int(n) for n in input().split(' ')]
n = len(numbers)
for i in range(n):
for j in range(0, n - i - 1):
if numbers[j] > numbers[j + 1]:
numbers[j], numbers[j + 1] = numbers[j + 1], numbers[j]
print(' '.join([str(n) for n in numbers])) | 27 | 67 | 0.533333 | 48 | 270 | 3 | 0.354167 | 0.333333 | 0.1875 | 0.333333 | 0.354167 | 0.291667 | 0.291667 | 0 | 0 | 0 | 0 | 0.025126 | 0.262963 | 270 | 10 | 68 | 27 | 0.698492 | 0 | 0 | 0 | 0 | 0 | 0.00738 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.142857 | 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 |
31523ce754ab949256759977b63da28778c7db10 | 280 | py | Python | src/applications/task402/logic.py | Vlad-Ivchik/xxx1 | 747ede3ddb4f59dc83a7b8253074a3a1e00ccd59 | [
"MIT"
] | null | null | null | src/applications/task402/logic.py | Vlad-Ivchik/xxx1 | 747ede3ddb4f59dc83a7b8253074a3a1e00ccd59 | [
"MIT"
] | 5 | 2021-02-21T08:52:19.000Z | 2021-09-22T19:47:13.000Z | src/applications/task402/logic.py | Vlad-Ivchik/xxx1 | 747ede3ddb4f59dc83a7b8253074a3a1e00ccd59 | [
"MIT"
] | null | null | null | from typing import Dict
def get_accumulated(session: Dict) -> int:
result = session.get("task402", 0)
return result
def add_number(session: Dict, number: int) -> int:
acc = get_accumulated(session)
acc += number
session["task402"] = acc
return number | 18.666667 | 50 | 0.667857 | 36 | 280 | 5.111111 | 0.444444 | 0.152174 | 0.228261 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03211 | 0.221429 | 280 | 15 | 51 | 18.666667 | 0.811927 | 0 | 0 | 0 | 0 | 0 | 0.049822 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.111111 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
3163c07f584eb6daa61940878018206a6c3f06b1 | 55,669 | py | Python | pysnmp/Nortel-Magellan-Passport-PppMIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/Nortel-Magellan-Passport-PppMIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/Nortel-Magellan-Passport-PppMIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module Nortel-Magellan-Passport-PppMIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Nortel-Magellan-Passport-PppMIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:18:42 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion")
Integer32, RowStatus, Gauge32, StorageType, Counter32, Unsigned32, DisplayString, InterfaceIndex = mibBuilder.importSymbols("Nortel-Magellan-Passport-StandardTextualConventionsMIB", "Integer32", "RowStatus", "Gauge32", "StorageType", "Counter32", "Unsigned32", "DisplayString", "InterfaceIndex")
NonReplicated, Link = mibBuilder.importSymbols("Nortel-Magellan-Passport-TextualConventionsMIB", "NonReplicated", "Link")
components, passportMIBs = mibBuilder.importSymbols("Nortel-Magellan-Passport-UsefulDefinitionsMIB", "components", "passportMIBs")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
Integer32, iso, TimeTicks, MibIdentifier, NotificationType, Gauge32, Counter32, ModuleIdentity, Unsigned32, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter64, Bits, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "iso", "TimeTicks", "MibIdentifier", "NotificationType", "Gauge32", "Counter32", "ModuleIdentity", "Unsigned32", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter64", "Bits", "ObjectIdentity")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
pppMIB = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 33))
ppp = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102))
pppRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 1), )
if mibBuilder.loadTexts: pppRowStatusTable.setStatus('mandatory')
pppRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"))
if mibBuilder.loadTexts: pppRowStatusEntry.setStatus('mandatory')
pppRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 1, 1, 1), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppRowStatus.setStatus('mandatory')
pppComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppComponentName.setStatus('mandatory')
pppStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppStorageType.setStatus('mandatory')
pppIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)))
if mibBuilder.loadTexts: pppIndex.setStatus('mandatory')
pppCidDataTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 20), )
if mibBuilder.loadTexts: pppCidDataTable.setStatus('mandatory')
pppCidDataEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 20, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"))
if mibBuilder.loadTexts: pppCidDataEntry.setStatus('mandatory')
pppCustomerIdentifier = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 20, 1, 1), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 8191), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppCustomerIdentifier.setStatus('mandatory')
pppIfEntryTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 21), )
if mibBuilder.loadTexts: pppIfEntryTable.setStatus('mandatory')
pppIfEntryEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 21, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"))
if mibBuilder.loadTexts: pppIfEntryEntry.setStatus('mandatory')
pppIfAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 21, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("testing", 3))).clone('up')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppIfAdminStatus.setStatus('mandatory')
pppIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 21, 1, 2), InterfaceIndex().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppIfIndex.setStatus('mandatory')
pppMpTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 22), )
if mibBuilder.loadTexts: pppMpTable.setStatus('mandatory')
pppMpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 22, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"))
if mibBuilder.loadTexts: pppMpEntry.setStatus('mandatory')
pppLinkToProtocolPort = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 22, 1, 1), Link()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLinkToProtocolPort.setStatus('mandatory')
pppStateTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 23), )
if mibBuilder.loadTexts: pppStateTable.setStatus('mandatory')
pppStateEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 23, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"))
if mibBuilder.loadTexts: pppStateEntry.setStatus('mandatory')
pppAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 23, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("locked", 0), ("unlocked", 1), ("shuttingDown", 2))).clone('unlocked')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppAdminState.setStatus('mandatory')
pppOperationalState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 23, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1))).clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppOperationalState.setStatus('mandatory')
pppUsageState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 23, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("idle", 0), ("active", 1), ("busy", 2))).clone('idle')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppUsageState.setStatus('mandatory')
pppOperStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 24), )
if mibBuilder.loadTexts: pppOperStatusTable.setStatus('mandatory')
pppOperStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 24, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"))
if mibBuilder.loadTexts: pppOperStatusEntry.setStatus('mandatory')
pppSnmpOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 24, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("testing", 3))).clone('up')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppSnmpOperStatus.setStatus('mandatory')
pppLnk = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2))
pppLnkRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 1), )
if mibBuilder.loadTexts: pppLnkRowStatusTable.setStatus('mandatory')
pppLnkRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLnkIndex"))
if mibBuilder.loadTexts: pppLnkRowStatusEntry.setStatus('mandatory')
pppLnkRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 1, 1, 1), RowStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkRowStatus.setStatus('mandatory')
pppLnkComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkComponentName.setStatus('mandatory')
pppLnkStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkStorageType.setStatus('mandatory')
pppLnkIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: pppLnkIndex.setStatus('mandatory')
pppLnkProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10), )
if mibBuilder.loadTexts: pppLnkProvTable.setStatus('mandatory')
pppLnkProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLnkIndex"))
if mibBuilder.loadTexts: pppLnkProvEntry.setStatus('mandatory')
pppLnkConfigInitialMru = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(68, 18000)).clone(18000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLnkConfigInitialMru.setStatus('mandatory')
pppLnkConfigMagicNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('enabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLnkConfigMagicNumber.setStatus('mandatory')
pppLnkRestartTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1000, 10000)).clone(3000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLnkRestartTimer.setStatus('mandatory')
pppLnkContinuityMonitor = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('enabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLnkContinuityMonitor.setStatus('mandatory')
pppLnkNegativeAckTries = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10, 1, 8), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295)).clone(10)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLnkNegativeAckTries.setStatus('mandatory')
pppLnkQualityThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10, 1, 9), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(10, 99)).clone(90)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLnkQualityThreshold.setStatus('mandatory')
pppLnkQualityWindow = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10, 1, 10), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(10, 400)).clone(30)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLnkQualityWindow.setStatus('mandatory')
pppLnkTerminateRequestTries = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10, 1, 11), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295)).clone(10)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLnkTerminateRequestTries.setStatus('mandatory')
pppLnkConfigureRequestTries = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10, 1, 12), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295)).clone(1000000000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLnkConfigureRequestTries.setStatus('mandatory')
pppLnkOperTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11), )
if mibBuilder.loadTexts: pppLnkOperTable.setStatus('mandatory')
pppLnkOperEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLnkIndex"))
if mibBuilder.loadTexts: pppLnkOperEntry.setStatus('mandatory')
pppLnkOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("initial", 0), ("starting", 1), ("closed", 2), ("stopped", 3), ("closing", 4), ("stopping", 5), ("reqsent", 6), ("ackrcvd", 7), ("acksent", 8), ("opened", 9))).clone('initial')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkOperState.setStatus('mandatory')
pppLnkLineCondition = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 3, 4))).clone(namedValues=NamedValues(("ok", 0), ("looped", 1), ("noClock", 3), ("badLineCondition", 4))).clone('ok')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkLineCondition.setStatus('mandatory')
pppLnkBadAddresses = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkBadAddresses.setStatus('mandatory')
pppLnkBadControls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkBadControls.setStatus('mandatory')
pppLnkPacketTooLongs = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkPacketTooLongs.setStatus('mandatory')
pppLnkBadFcss = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkBadFcss.setStatus('mandatory')
pppLnkLocalMru = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1, 8), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483648)).clone(1)).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkLocalMru.setStatus('mandatory')
pppLnkRemoteMru = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1, 9), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483648))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkRemoteMru.setStatus('mandatory')
pppLnkTransmitFcsSize = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1, 16), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkTransmitFcsSize.setStatus('mandatory')
pppLnkReceiveFcsSize = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1, 17), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkReceiveFcsSize.setStatus('mandatory')
pppLqm = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3))
pppLqmRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 1), )
if mibBuilder.loadTexts: pppLqmRowStatusTable.setStatus('mandatory')
pppLqmRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLqmIndex"))
if mibBuilder.loadTexts: pppLqmRowStatusEntry.setStatus('mandatory')
pppLqmRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 1, 1, 1), RowStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLqmRowStatus.setStatus('mandatory')
pppLqmComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLqmComponentName.setStatus('mandatory')
pppLqmStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLqmStorageType.setStatus('mandatory')
pppLqmIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: pppLqmIndex.setStatus('mandatory')
pppLqmProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 10), )
if mibBuilder.loadTexts: pppLqmProvTable.setStatus('mandatory')
pppLqmProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLqmIndex"))
if mibBuilder.loadTexts: pppLqmProvEntry.setStatus('mandatory')
pppLqmConfigPeriod = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 10, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLqmConfigPeriod.setStatus('mandatory')
pppLqmConfigStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 10, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLqmConfigStatus.setStatus('mandatory')
pppLqmOperTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 11), )
if mibBuilder.loadTexts: pppLqmOperTable.setStatus('mandatory')
pppLqmOperEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 11, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLqmIndex"))
if mibBuilder.loadTexts: pppLqmOperEntry.setStatus('mandatory')
pppLqmQuality = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 11, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("good", 1), ("bad", 2), ("notDetermined", 3))).clone('notDetermined')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLqmQuality.setStatus('mandatory')
pppLqmInGoodOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 11, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLqmInGoodOctets.setStatus('mandatory')
pppLqmLocalPeriod = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 11, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295)).clone(1)).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLqmLocalPeriod.setStatus('mandatory')
pppLqmRemotePeriod = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 11, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295)).clone(1)).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLqmRemotePeriod.setStatus('mandatory')
pppLqmOutLqrs = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 11, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLqmOutLqrs.setStatus('mandatory')
pppLqmInLqrs = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 11, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLqmInLqrs.setStatus('mandatory')
pppNcp = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4))
pppNcpRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 1), )
if mibBuilder.loadTexts: pppNcpRowStatusTable.setStatus('mandatory')
pppNcpRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpIndex"))
if mibBuilder.loadTexts: pppNcpRowStatusEntry.setStatus('mandatory')
pppNcpRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 1, 1, 1), RowStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpRowStatus.setStatus('mandatory')
pppNcpComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpComponentName.setStatus('mandatory')
pppNcpStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpStorageType.setStatus('mandatory')
pppNcpIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: pppNcpIndex.setStatus('mandatory')
pppNcpBprovTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 11), )
if mibBuilder.loadTexts: pppNcpBprovTable.setStatus('mandatory')
pppNcpBprovEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 11, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpIndex"))
if mibBuilder.loadTexts: pppNcpBprovEntry.setStatus('mandatory')
pppNcpBConfigTinygram = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 11, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('enabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppNcpBConfigTinygram.setStatus('mandatory')
pppNcpBConfigLanId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 11, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('enabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppNcpBConfigLanId.setStatus('mandatory')
pppNcpIpOperTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 12), )
if mibBuilder.loadTexts: pppNcpIpOperTable.setStatus('mandatory')
pppNcpIpOperEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 12, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpIndex"))
if mibBuilder.loadTexts: pppNcpIpOperEntry.setStatus('mandatory')
pppNcpIpOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 12, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("initial", 0), ("starting", 1), ("closed", 2), ("stopped", 3), ("closing", 4), ("stopping", 5), ("reqsent", 6), ("ackrcvd", 7), ("acksent", 8), ("opened", 9))).clone('initial')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpIpOperState.setStatus('mandatory')
pppNcpBoperTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 14), )
if mibBuilder.loadTexts: pppNcpBoperTable.setStatus('mandatory')
pppNcpBoperEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 14, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpIndex"))
if mibBuilder.loadTexts: pppNcpBoperEntry.setStatus('mandatory')
pppNcpBOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 14, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("initial", 0), ("starting", 1), ("closed", 2), ("stopped", 3), ("closing", 4), ("stopping", 5), ("reqsent", 6), ("ackrcvd", 7), ("acksent", 8), ("opened", 9))).clone('initial')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBOperState.setStatus('mandatory')
pppNcpBLocalToRemoteTinygramComp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 14, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBLocalToRemoteTinygramComp.setStatus('mandatory')
pppNcpBRemoteToLocalTinygramComp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 14, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBRemoteToLocalTinygramComp.setStatus('mandatory')
pppNcpBLocalToRemoteLanId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 14, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBLocalToRemoteLanId.setStatus('mandatory')
pppNcpBRemoteToLocalLanId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 14, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBRemoteToLocalLanId.setStatus('mandatory')
pppNcpOperTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 16), )
if mibBuilder.loadTexts: pppNcpOperTable.setStatus('mandatory')
pppNcpOperEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 16, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpIndex"))
if mibBuilder.loadTexts: pppNcpOperEntry.setStatus('mandatory')
pppNcpAppletalkOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 16, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("initial", 0), ("starting", 1), ("closed", 2), ("stopped", 3), ("closing", 4), ("stopping", 5), ("reqsent", 6), ("ackrcvd", 7), ("acksent", 8), ("opened", 9))).clone('initial')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpAppletalkOperState.setStatus('mandatory')
pppNcpIpxOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 16, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("initial", 0), ("starting", 1), ("closed", 2), ("stopped", 3), ("closing", 4), ("stopping", 5), ("reqsent", 6), ("ackrcvd", 7), ("acksent", 8), ("opened", 9))).clone('initial')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpIpxOperState.setStatus('mandatory')
pppNcpXnsOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 16, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("initial", 0), ("starting", 1), ("closed", 2), ("stopped", 3), ("closing", 4), ("stopping", 5), ("reqsent", 6), ("ackrcvd", 7), ("acksent", 8), ("opened", 9))).clone('initial')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpXnsOperState.setStatus('mandatory')
pppNcpDecnetOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 16, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("initial", 0), ("starting", 1), ("closed", 2), ("stopped", 3), ("closing", 4), ("stopping", 5), ("reqsent", 6), ("ackrcvd", 7), ("acksent", 8), ("opened", 9))).clone('initial')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpDecnetOperState.setStatus('mandatory')
pppNcpBmcEntry = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 2))
pppNcpBmcEntryRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 2, 1), )
if mibBuilder.loadTexts: pppNcpBmcEntryRowStatusTable.setStatus('mandatory')
pppNcpBmcEntryRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 2, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpBmcEntryMacTypeIndex"))
if mibBuilder.loadTexts: pppNcpBmcEntryRowStatusEntry.setStatus('mandatory')
pppNcpBmcEntryRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 2, 1, 1, 1), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppNcpBmcEntryRowStatus.setStatus('mandatory')
pppNcpBmcEntryComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 2, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBmcEntryComponentName.setStatus('mandatory')
pppNcpBmcEntryStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 2, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBmcEntryStorageType.setStatus('mandatory')
pppNcpBmcEntryMacTypeIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 2, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("ethernet", 1), ("tokenBus", 2), ("tokenRing", 3), ("fddi", 4))))
if mibBuilder.loadTexts: pppNcpBmcEntryMacTypeIndex.setStatus('mandatory')
pppNcpBmcEntryProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 2, 10), )
if mibBuilder.loadTexts: pppNcpBmcEntryProvTable.setStatus('mandatory')
pppNcpBmcEntryProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 2, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpBmcEntryMacTypeIndex"))
if mibBuilder.loadTexts: pppNcpBmcEntryProvEntry.setStatus('mandatory')
pppNcpBmcEntryLocalStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 2, 10, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("accept", 1))).clone('accept')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppNcpBmcEntryLocalStatus.setStatus('mandatory')
pppNcpBmEntry = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3))
pppNcpBmEntryRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3, 1), )
if mibBuilder.loadTexts: pppNcpBmEntryRowStatusTable.setStatus('mandatory')
pppNcpBmEntryRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpBmEntryMacTypeIndex"))
if mibBuilder.loadTexts: pppNcpBmEntryRowStatusEntry.setStatus('mandatory')
pppNcpBmEntryRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3, 1, 1, 1), RowStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBmEntryRowStatus.setStatus('mandatory')
pppNcpBmEntryComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBmEntryComponentName.setStatus('mandatory')
pppNcpBmEntryStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBmEntryStorageType.setStatus('mandatory')
pppNcpBmEntryMacTypeIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("ethernet", 1), ("tokenBus", 2), ("tokenRing", 3), ("fddi", 4))))
if mibBuilder.loadTexts: pppNcpBmEntryMacTypeIndex.setStatus('mandatory')
pppNcpBmEntryOperTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3, 10), )
if mibBuilder.loadTexts: pppNcpBmEntryOperTable.setStatus('mandatory')
pppNcpBmEntryOperEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpBmEntryMacTypeIndex"))
if mibBuilder.loadTexts: pppNcpBmEntryOperEntry.setStatus('mandatory')
pppNcpBmEntryLocalStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3, 10, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("accept", 1), ("dontAccept", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBmEntryLocalStatus.setStatus('mandatory')
pppNcpBmEntryRemoteStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3, 10, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("accept", 1), ("dontAccept", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBmEntryRemoteStatus.setStatus('mandatory')
pppFramer = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5))
pppFramerRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 1), )
if mibBuilder.loadTexts: pppFramerRowStatusTable.setStatus('mandatory')
pppFramerRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppFramerIndex"))
if mibBuilder.loadTexts: pppFramerRowStatusEntry.setStatus('mandatory')
pppFramerRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 1, 1, 1), RowStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerRowStatus.setStatus('mandatory')
pppFramerComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerComponentName.setStatus('mandatory')
pppFramerStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerStorageType.setStatus('mandatory')
pppFramerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: pppFramerIndex.setStatus('mandatory')
pppFramerProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 10), )
if mibBuilder.loadTexts: pppFramerProvTable.setStatus('mandatory')
pppFramerProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppFramerIndex"))
if mibBuilder.loadTexts: pppFramerProvEntry.setStatus('mandatory')
pppFramerInterfaceName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 10, 1, 1), Link()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppFramerInterfaceName.setStatus('mandatory')
pppFramerStateTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 12), )
if mibBuilder.loadTexts: pppFramerStateTable.setStatus('mandatory')
pppFramerStateEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 12, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppFramerIndex"))
if mibBuilder.loadTexts: pppFramerStateEntry.setStatus('mandatory')
pppFramerAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 12, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("locked", 0), ("unlocked", 1), ("shuttingDown", 2))).clone('unlocked')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerAdminState.setStatus('mandatory')
pppFramerOperationalState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 12, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1))).clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerOperationalState.setStatus('mandatory')
pppFramerUsageState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 12, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("idle", 0), ("active", 1), ("busy", 2))).clone('idle')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerUsageState.setStatus('mandatory')
pppFramerStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13), )
if mibBuilder.loadTexts: pppFramerStatsTable.setStatus('mandatory')
pppFramerStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppFramerIndex"))
if mibBuilder.loadTexts: pppFramerStatsEntry.setStatus('mandatory')
pppFramerFrmToIf = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13, 1, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerFrmToIf.setStatus('mandatory')
pppFramerFrmFromIf = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerFrmFromIf.setStatus('mandatory')
pppFramerAborts = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerAborts.setStatus('mandatory')
pppFramerCrcErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerCrcErrors.setStatus('mandatory')
pppFramerLrcErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerLrcErrors.setStatus('mandatory')
pppFramerNonOctetErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerNonOctetErrors.setStatus('mandatory')
pppFramerOverruns = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerOverruns.setStatus('mandatory')
pppFramerUnderruns = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerUnderruns.setStatus('mandatory')
pppFramerLargeFrmErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerLargeFrmErrors.setStatus('mandatory')
pppFramerUtilTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 14), )
if mibBuilder.loadTexts: pppFramerUtilTable.setStatus('mandatory')
pppFramerUtilEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 14, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppFramerIndex"))
if mibBuilder.loadTexts: pppFramerUtilEntry.setStatus('mandatory')
pppFramerNormPrioLinkUtilToIf = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 14, 1, 1), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerNormPrioLinkUtilToIf.setStatus('mandatory')
pppFramerNormPrioLinkUtilFromIf = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 14, 1, 3), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerNormPrioLinkUtilFromIf.setStatus('mandatory')
pppLeq = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6))
pppLeqRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 1), )
if mibBuilder.loadTexts: pppLeqRowStatusTable.setStatus('mandatory')
pppLeqRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLeqIndex"))
if mibBuilder.loadTexts: pppLeqRowStatusEntry.setStatus('mandatory')
pppLeqRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 1, 1, 1), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLeqRowStatus.setStatus('mandatory')
pppLeqComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqComponentName.setStatus('mandatory')
pppLeqStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqStorageType.setStatus('mandatory')
pppLeqIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: pppLeqIndex.setStatus('mandatory')
pppLeqProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 10), )
if mibBuilder.loadTexts: pppLeqProvTable.setStatus('mandatory')
pppLeqProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLeqIndex"))
if mibBuilder.loadTexts: pppLeqProvEntry.setStatus('mandatory')
pppLeqMaxPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 10, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 2048))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLeqMaxPackets.setStatus('mandatory')
pppLeqMaxMsecData = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 10, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(100, 60000)).clone(10000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLeqMaxMsecData.setStatus('mandatory')
pppLeqMaxPercentMulticast = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 10, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 100)).clone(50)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLeqMaxPercentMulticast.setStatus('mandatory')
pppLeqTimeToLive = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 10, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(100, 60000)).clone(10000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLeqTimeToLive.setStatus('mandatory')
pppLeqStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 11), )
if mibBuilder.loadTexts: pppLeqStatsTable.setStatus('mandatory')
pppLeqStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 11, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLeqIndex"))
if mibBuilder.loadTexts: pppLeqStatsEntry.setStatus('mandatory')
pppLeqTimedOutPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 11, 1, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqTimedOutPkt.setStatus('mandatory')
pppLeqHardwareForcedPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 11, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqHardwareForcedPkt.setStatus('mandatory')
pppLeqForcedPktDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 11, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqForcedPktDiscards.setStatus('mandatory')
pppLeqQueuePurgeDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 11, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqQueuePurgeDiscards.setStatus('mandatory')
pppLeqTStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 12), )
if mibBuilder.loadTexts: pppLeqTStatsTable.setStatus('mandatory')
pppLeqTStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 12, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLeqIndex"))
if mibBuilder.loadTexts: pppLeqTStatsEntry.setStatus('mandatory')
pppLeqTotalPktHandled = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 12, 1, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqTotalPktHandled.setStatus('mandatory')
pppLeqTotalPktForwarded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 12, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqTotalPktForwarded.setStatus('mandatory')
pppLeqTotalPktQueued = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 12, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqTotalPktQueued.setStatus('mandatory')
pppLeqTotalMulticastPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 12, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqTotalMulticastPkt.setStatus('mandatory')
pppLeqTotalPktDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 12, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqTotalPktDiscards.setStatus('mandatory')
pppLeqCStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 13), )
if mibBuilder.loadTexts: pppLeqCStatsTable.setStatus('mandatory')
pppLeqCStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 13, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLeqIndex"))
if mibBuilder.loadTexts: pppLeqCStatsEntry.setStatus('mandatory')
pppLeqCurrentPktQueued = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 13, 1, 1), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqCurrentPktQueued.setStatus('mandatory')
pppLeqCurrentBytesQueued = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 13, 1, 2), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqCurrentBytesQueued.setStatus('mandatory')
pppLeqCurrentMulticastQueued = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 13, 1, 3), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqCurrentMulticastQueued.setStatus('mandatory')
pppLeqThrStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 14), )
if mibBuilder.loadTexts: pppLeqThrStatsTable.setStatus('mandatory')
pppLeqThrStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 14, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLeqIndex"))
if mibBuilder.loadTexts: pppLeqThrStatsEntry.setStatus('mandatory')
pppLeqQueuePktThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 14, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqQueuePktThreshold.setStatus('mandatory')
pppLeqPktThresholdExceeded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 14, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqPktThresholdExceeded.setStatus('mandatory')
pppLeqQueueByteThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 14, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqQueueByteThreshold.setStatus('mandatory')
pppLeqByteThresholdExceeded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 14, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqByteThresholdExceeded.setStatus('mandatory')
pppLeqQueueMulticastThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 14, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqQueueMulticastThreshold.setStatus('mandatory')
pppLeqMulThresholdExceeded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 14, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqMulThresholdExceeded.setStatus('mandatory')
pppLeqMemThresholdExceeded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 14, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqMemThresholdExceeded.setStatus('mandatory')
pppGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 33, 1))
pppGroupBC = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 33, 1, 3))
pppGroupBC02 = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 33, 1, 3, 3))
pppGroupBC02A = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 33, 1, 3, 3, 2))
pppCapabilities = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 33, 3))
pppCapabilitiesBC = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 33, 3, 3))
pppCapabilitiesBC02 = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 33, 3, 3, 3))
pppCapabilitiesBC02A = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 33, 3, 3, 3, 2))
mibBuilder.exportSymbols("Nortel-Magellan-Passport-PppMIB", pppLeqTimeToLive=pppLeqTimeToLive, pppLnkStorageType=pppLnkStorageType, pppLqmOutLqrs=pppLqmOutLqrs, pppLeqRowStatus=pppLeqRowStatus, pppFramerInterfaceName=pppFramerInterfaceName, pppNcpBConfigLanId=pppNcpBConfigLanId, pppFramerRowStatusEntry=pppFramerRowStatusEntry, pppLnkTransmitFcsSize=pppLnkTransmitFcsSize, pppLnkQualityWindow=pppLnkQualityWindow, pppNcpBmcEntryLocalStatus=pppNcpBmcEntryLocalStatus, pppLeqThrStatsTable=pppLeqThrStatsTable, pppNcpBmEntryOperEntry=pppNcpBmEntryOperEntry, pppCidDataTable=pppCidDataTable, pppLnkConfigInitialMru=pppLnkConfigInitialMru, pppNcpIndex=pppNcpIndex, pppLeqTotalPktQueued=pppLeqTotalPktQueued, pppGroupBC02A=pppGroupBC02A, pppMpTable=pppMpTable, pppNcp=pppNcp, pppNcpBprovEntry=pppNcpBprovEntry, pppNcpBmEntry=pppNcpBmEntry, pppNcpIpOperEntry=pppNcpIpOperEntry, pppLeqStorageType=pppLeqStorageType, pppLqmQuality=pppLqmQuality, pppNcpBprovTable=pppNcpBprovTable, pppNcpBLocalToRemoteLanId=pppNcpBLocalToRemoteLanId, pppIfAdminStatus=pppIfAdminStatus, pppCapabilitiesBC02A=pppCapabilitiesBC02A, pppFramerAdminState=pppFramerAdminState, pppLnkProvEntry=pppLnkProvEntry, pppNcpBmEntryRowStatusTable=pppNcpBmEntryRowStatusTable, pppLeqThrStatsEntry=pppLeqThrStatsEntry, pppLqmConfigStatus=pppLqmConfigStatus, pppNcpRowStatus=pppNcpRowStatus, pppFramerNormPrioLinkUtilFromIf=pppFramerNormPrioLinkUtilFromIf, pppFramerStateTable=pppFramerStateTable, pppLnk=pppLnk, pppGroupBC=pppGroupBC, pppLnkReceiveFcsSize=pppLnkReceiveFcsSize, pppNcpBmcEntryRowStatusTable=pppNcpBmcEntryRowStatusTable, pppLnkConfigMagicNumber=pppLnkConfigMagicNumber, ppp=ppp, pppLeqForcedPktDiscards=pppLeqForcedPktDiscards, pppNcpRowStatusEntry=pppNcpRowStatusEntry, pppLnkContinuityMonitor=pppLnkContinuityMonitor, pppLeqHardwareForcedPkt=pppLeqHardwareForcedPkt, pppNcpBmEntryRemoteStatus=pppNcpBmEntryRemoteStatus, pppNcpBmEntryLocalStatus=pppNcpBmEntryLocalStatus, pppFramerUnderruns=pppFramerUnderruns, pppFramerNormPrioLinkUtilToIf=pppFramerNormPrioLinkUtilToIf, pppLeqStatsEntry=pppLeqStatsEntry, pppLeqRowStatusTable=pppLeqRowStatusTable, pppNcpBmEntryMacTypeIndex=pppNcpBmEntryMacTypeIndex, pppLeqProvEntry=pppLeqProvEntry, pppLeqMulThresholdExceeded=pppLeqMulThresholdExceeded, pppLeqCurrentBytesQueued=pppLeqCurrentBytesQueued, pppGroup=pppGroup, pppFramerOperationalState=pppFramerOperationalState, pppLeq=pppLeq, pppNcpBOperState=pppNcpBOperState, pppFramer=pppFramer, pppLqmRowStatusEntry=pppLqmRowStatusEntry, pppNcpIpOperState=pppNcpIpOperState, pppNcpXnsOperState=pppNcpXnsOperState, pppLqmIndex=pppLqmIndex, pppNcpBmcEntryProvTable=pppNcpBmcEntryProvTable, pppLnkLineCondition=pppLnkLineCondition, pppLqmComponentName=pppLqmComponentName, pppLeqMaxPackets=pppLeqMaxPackets, pppLqmStorageType=pppLqmStorageType, pppLeqTimedOutPkt=pppLeqTimedOutPkt, pppLeqTotalPktHandled=pppLeqTotalPktHandled, pppNcpIpxOperState=pppNcpIpxOperState, pppLeqTotalPktForwarded=pppLeqTotalPktForwarded, pppRowStatusTable=pppRowStatusTable, pppLqmInLqrs=pppLqmInLqrs, pppLnkRemoteMru=pppLnkRemoteMru, pppLnkTerminateRequestTries=pppLnkTerminateRequestTries, pppLnkConfigureRequestTries=pppLnkConfigureRequestTries, pppLnkBadAddresses=pppLnkBadAddresses, pppNcpBmcEntryProvEntry=pppNcpBmcEntryProvEntry, pppStateTable=pppStateTable, pppCapabilities=pppCapabilities, pppFramerNonOctetErrors=pppFramerNonOctetErrors, pppIfEntryEntry=pppIfEntryEntry, pppLqm=pppLqm, pppNcpBRemoteToLocalLanId=pppNcpBRemoteToLocalLanId, pppIndex=pppIndex, pppUsageState=pppUsageState, pppLqmConfigPeriod=pppLqmConfigPeriod, pppLnkOperEntry=pppLnkOperEntry, pppLqmRemotePeriod=pppLqmRemotePeriod, pppLeqProvTable=pppLeqProvTable, pppLeqMaxMsecData=pppLeqMaxMsecData, pppGroupBC02=pppGroupBC02, pppFramerUtilTable=pppFramerUtilTable, pppCapabilitiesBC02=pppCapabilitiesBC02, pppCapabilitiesBC=pppCapabilitiesBC, pppFramerLargeFrmErrors=pppFramerLargeFrmErrors, pppLnkRowStatusTable=pppLnkRowStatusTable, pppLnkBadControls=pppLnkBadControls, pppLeqByteThresholdExceeded=pppLeqByteThresholdExceeded, pppLeqPktThresholdExceeded=pppLeqPktThresholdExceeded, pppStorageType=pppStorageType, pppFramerIndex=pppFramerIndex, pppFramerOverruns=pppFramerOverruns, pppLeqCStatsEntry=pppLeqCStatsEntry, pppNcpOperTable=pppNcpOperTable, pppLnkRowStatusEntry=pppLnkRowStatusEntry, pppLeqStatsTable=pppLeqStatsTable, pppOperStatusEntry=pppOperStatusEntry, pppLeqCurrentPktQueued=pppLeqCurrentPktQueued, pppLeqQueueMulticastThreshold=pppLeqQueueMulticastThreshold, pppLeqTStatsEntry=pppLeqTStatsEntry, pppLnkProvTable=pppLnkProvTable, pppRowStatus=pppRowStatus, pppNcpBLocalToRemoteTinygramComp=pppNcpBLocalToRemoteTinygramComp, pppNcpComponentName=pppNcpComponentName, pppLqmOperEntry=pppLqmOperEntry, pppLeqCStatsTable=pppLeqCStatsTable, pppLqmProvTable=pppLqmProvTable, pppNcpBmEntryRowStatus=pppNcpBmEntryRowStatus, pppLeqTStatsTable=pppLeqTStatsTable, pppFramerLrcErrors=pppFramerLrcErrors, pppLqmRowStatusTable=pppLqmRowStatusTable, pppNcpBmEntryComponentName=pppNcpBmEntryComponentName, pppFramerProvTable=pppFramerProvTable, pppNcpAppletalkOperState=pppNcpAppletalkOperState, pppNcpBConfigTinygram=pppNcpBConfigTinygram, pppFramerStorageType=pppFramerStorageType, pppCustomerIdentifier=pppCustomerIdentifier, pppLnkQualityThreshold=pppLnkQualityThreshold, pppNcpBmcEntryComponentName=pppNcpBmcEntryComponentName, pppNcpBmcEntryRowStatusEntry=pppNcpBmcEntryRowStatusEntry, pppLeqMaxPercentMulticast=pppLeqMaxPercentMulticast, pppNcpBoperTable=pppNcpBoperTable, pppLnkLocalMru=pppLnkLocalMru, pppFramerCrcErrors=pppFramerCrcErrors, pppNcpRowStatusTable=pppNcpRowStatusTable, pppLeqMemThresholdExceeded=pppLeqMemThresholdExceeded, pppLnkBadFcss=pppLnkBadFcss, pppNcpBoperEntry=pppNcpBoperEntry, pppCidDataEntry=pppCidDataEntry, pppNcpBRemoteToLocalTinygramComp=pppNcpBRemoteToLocalTinygramComp, pppIfEntryTable=pppIfEntryTable, pppFramerStatsTable=pppFramerStatsTable, pppNcpBmEntryRowStatusEntry=pppNcpBmEntryRowStatusEntry, pppLnkIndex=pppLnkIndex, pppStateEntry=pppStateEntry, pppLeqIndex=pppLeqIndex, pppFramerStateEntry=pppFramerStateEntry, pppComponentName=pppComponentName, pppLnkComponentName=pppLnkComponentName, pppNcpBmEntryStorageType=pppNcpBmEntryStorageType, pppLeqRowStatusEntry=pppLeqRowStatusEntry, pppLeqComponentName=pppLeqComponentName, pppLeqTotalMulticastPkt=pppLeqTotalMulticastPkt, pppAdminState=pppAdminState, pppSnmpOperStatus=pppSnmpOperStatus, pppRowStatusEntry=pppRowStatusEntry, pppNcpBmcEntry=pppNcpBmcEntry, pppNcpBmEntryOperTable=pppNcpBmEntryOperTable, pppLeqQueueByteThreshold=pppLeqQueueByteThreshold, pppMpEntry=pppMpEntry, pppLnkPacketTooLongs=pppLnkPacketTooLongs, pppFramerStatsEntry=pppFramerStatsEntry, pppLeqQueuePurgeDiscards=pppLeqQueuePurgeDiscards, pppLnkRestartTimer=pppLnkRestartTimer, pppIfIndex=pppIfIndex, pppFramerRowStatusTable=pppFramerRowStatusTable, pppFramerRowStatus=pppFramerRowStatus, pppNcpBmcEntryMacTypeIndex=pppNcpBmcEntryMacTypeIndex, pppLnkNegativeAckTries=pppLnkNegativeAckTries, pppFramerFrmToIf=pppFramerFrmToIf, pppOperationalState=pppOperationalState, pppLnkOperTable=pppLnkOperTable, pppLqmRowStatus=pppLqmRowStatus, pppFramerAborts=pppFramerAborts, pppNcpIpOperTable=pppNcpIpOperTable, pppNcpDecnetOperState=pppNcpDecnetOperState, pppMIB=pppMIB, pppLqmOperTable=pppLqmOperTable, pppLeqQueuePktThreshold=pppLeqQueuePktThreshold, pppLinkToProtocolPort=pppLinkToProtocolPort, pppNcpBmcEntryRowStatus=pppNcpBmcEntryRowStatus, pppLqmLocalPeriod=pppLqmLocalPeriod, pppLnkOperState=pppLnkOperState, pppNcpBmcEntryStorageType=pppNcpBmcEntryStorageType, pppNcpOperEntry=pppNcpOperEntry, pppFramerUsageState=pppFramerUsageState, pppFramerUtilEntry=pppFramerUtilEntry, pppOperStatusTable=pppOperStatusTable, pppLeqCurrentMulticastQueued=pppLeqCurrentMulticastQueued, pppLnkRowStatus=pppLnkRowStatus, pppLeqTotalPktDiscards=pppLeqTotalPktDiscards, pppFramerComponentName=pppFramerComponentName, pppLqmProvEntry=pppLqmProvEntry, pppNcpStorageType=pppNcpStorageType, pppFramerFrmFromIf=pppFramerFrmFromIf, pppFramerProvEntry=pppFramerProvEntry, pppLqmInGoodOctets=pppLqmInGoodOctets)
| 138.136476 | 8,078 | 0.748747 | 6,565 | 55,669 | 6.349124 | 0.058187 | 0.019145 | 0.014467 | 0.019289 | 0.526846 | 0.493546 | 0.487501 | 0.477976 | 0.443237 | 0.412816 | 0 | 0.092668 | 0.087571 | 55,669 | 402 | 8,079 | 138.4801 | 0.72794 | 0.006395 | 0 | 0 | 0 | 0 | 0.126302 | 0.040576 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.091139 | 0.022785 | 0 | 0.022785 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
3169f3fe698b04a0f394a06eb6329b2f4ccd0f31 | 204 | py | Python | 20_classes_lab/02.py | maornesimi/python-course-examples | f2e606f142a9d331075db73fd451c4418dba45ed | [
"MIT"
] | null | null | null | 20_classes_lab/02.py | maornesimi/python-course-examples | f2e606f142a9d331075db73fd451c4418dba45ed | [
"MIT"
] | 143 | 2016-10-14T07:33:55.000Z | 2018-11-06T19:13:52.000Z | 20_classes_lab/02.py | maornesimi/python-course-examples | f2e606f142a9d331075db73fd451c4418dba45ed | [
"MIT"
] | 43 | 2016-10-13T15:49:47.000Z | 2019-09-10T09:14:52.000Z | """
Write a class called MyCounter that counts
how many times it was initialised, so the
following code:
for _ in range(10):
c1 = MyCounter()
print MyCounter.count
should print 10
"""
| 14.571429 | 42 | 0.676471 | 29 | 204 | 4.724138 | 0.862069 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03268 | 0.25 | 204 | 13 | 43 | 15.692308 | 0.862745 | 0.95098 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
316ecdc9a2d0b1d72b05b54e9d8ce4a9f5956e2d | 825 | py | Python | alienspoilers/subs/forms.py | astonshane/Alien-Spoilers | a84c2eff921bc260f192085129c6891d38594926 | [
"MIT"
] | null | null | null | alienspoilers/subs/forms.py | astonshane/Alien-Spoilers | a84c2eff921bc260f192085129c6891d38594926 | [
"MIT"
] | 1 | 2015-04-12T20:17:46.000Z | 2015-04-12T20:17:46.000Z | alienspoilers/subs/forms.py | astonshane/Alien-Spoilers | a84c2eff921bc260f192085129c6891d38594926 | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth.models import User
from subs.models import UserProfile, Event
import datetime
from django.utils import timezone
from django.contrib.admin import widgets
class UserForm(forms.ModelForm):
password = forms.CharField(widget=forms.PasswordInput())
class Meta:
model = User
fields = ('username', 'email', 'password')
class UserProfileForm(forms.ModelForm):
class Meta:
model = UserProfile
fields = ()
class CreateEventForm(forms.ModelForm):
#start_date = forms.DateTimeField(widget=forms.DateTimeInput(), initial=timezone.now())
#end_date = forms.DateTimeField(widget=forms.DateTimeInput(), initial=timezone.now() + datetime.timedelta(days=1))
class Meta:
model = Event
fields = ['title', 'subreddit']
| 28.448276 | 118 | 0.712727 | 92 | 825 | 6.369565 | 0.456522 | 0.068259 | 0.071672 | 0.095563 | 0.21843 | 0.21843 | 0.21843 | 0.21843 | 0.21843 | 0 | 0 | 0.001477 | 0.179394 | 825 | 28 | 119 | 29.464286 | 0.864106 | 0.241212 | 0 | 0.157895 | 0 | 0 | 0.05609 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.105263 | 0.315789 | 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 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
3176adcd470be891e094cbc367001660f0ccb59a | 151 | py | Python | blimp_env/blimp_env/envs/__init__.py | robot-perception-group/AutonomousBlimpDRL | a10a88b2e9c9f9a83435cff2e4bc7e16e83cfeee | [
"MIT"
] | 8 | 2021-11-21T20:47:37.000Z | 2022-03-15T09:50:06.000Z | blimp_env/blimp_env/envs/__init__.py | robot-perception-group/AutonomousBlimpDRL | a10a88b2e9c9f9a83435cff2e4bc7e16e83cfeee | [
"MIT"
] | null | null | null | blimp_env/blimp_env/envs/__init__.py | robot-perception-group/AutonomousBlimpDRL | a10a88b2e9c9f9a83435cff2e4bc7e16e83cfeee | [
"MIT"
] | null | null | null | """ import environment """
from blimp_env.envs.planar_navigate_env import (
PlanarNavigateEnv,
ResidualPlanarNavigateEnv,
YawControlEnv,
)
| 21.571429 | 48 | 0.754967 | 13 | 151 | 8.538462 | 0.846154 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15894 | 151 | 6 | 49 | 25.166667 | 0.874016 | 0.119205 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.2 | 0 | 0.2 | 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 |
317f7cac2e79acde6bb1a077f1a801147e7d3d35 | 166 | py | Python | today_app/core/config.py | managemeapp/manageme-api | 4b5c60cbb893b43019c01b1293ebddca8d38b431 | [
"MIT"
] | null | null | null | today_app/core/config.py | managemeapp/manageme-api | 4b5c60cbb893b43019c01b1293ebddca8d38b431 | [
"MIT"
] | null | null | null | today_app/core/config.py | managemeapp/manageme-api | 4b5c60cbb893b43019c01b1293ebddca8d38b431 | [
"MIT"
] | null | null | null | from starlette.datastructures import CommaSeparatedStrings
import os
ALLOWED_HOSTS = CommaSeparatedStrings(os.getenv("ALLOWED_HOSTS", ""))
PROJECT_NAME = "TodayApp"
| 27.666667 | 69 | 0.825301 | 17 | 166 | 7.882353 | 0.705882 | 0.179104 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.084337 | 166 | 5 | 70 | 33.2 | 0.881579 | 0 | 0 | 0 | 0 | 0 | 0.126506 | 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 |
318494e964b1205f452ee8a4ed7878405e95f2b1 | 425 | py | Python | indoorair/homepage/views.py | ydang5/indoorair-webapp-A | 3f10b32e7ceac310d94d30543defcc085577b3b6 | [
"BSD-3-Clause"
] | null | null | null | indoorair/homepage/views.py | ydang5/indoorair-webapp-A | 3f10b32e7ceac310d94d30543defcc085577b3b6 | [
"BSD-3-Clause"
] | null | null | null | indoorair/homepage/views.py | ydang5/indoorair-webapp-A | 3f10b32e7ceac310d94d30543defcc085577b3b6 | [
"BSD-3-Clause"
] | null | null | null | from django.http import HttpResponse, JsonResponse
from django.shortcuts import render
from django.shortcuts import redirect
def index_page(request):
user = request.user
return render(request,'homepage/index.html',{})
def contact_page(request):
context = {}
return render(request,'homepage/contact.html',context)
def get_version_api(request):
return JsonResponse({'version': '0.1.0-beta'})
| 22.368421 | 62 | 0.729412 | 53 | 425 | 5.773585 | 0.471698 | 0.098039 | 0.124183 | 0.163399 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00838 | 0.157647 | 425 | 18 | 63 | 23.611111 | 0.846369 | 0 | 0 | 0 | 0 | 0 | 0.134118 | 0.049412 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0 | 0.272727 | 0.090909 | 0.818182 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
3191422e155a48545ef7473b99cec7be038f2e61 | 7,964 | py | Python | mayan/apps/user_management/tests/test_views.py | Fourdee/mayan-edms | 39a94f8b4fed519a3b20ab419e920ea53c11eb84 | [
"Apache-2.0"
] | null | null | null | mayan/apps/user_management/tests/test_views.py | Fourdee/mayan-edms | 39a94f8b4fed519a3b20ab419e920ea53c11eb84 | [
"Apache-2.0"
] | null | null | null | mayan/apps/user_management/tests/test_views.py | Fourdee/mayan-edms | 39a94f8b4fed519a3b20ab419e920ea53c11eb84 | [
"Apache-2.0"
] | 1 | 2020-02-05T18:07:08.000Z | 2020-02-05T18:07:08.000Z | from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from common.tests import GenericViewTestCase
from documents.tests import GenericDocumentViewTestCase
from metadata.models import MetadataType
from metadata.permissions import permission_metadata_document_edit
from metadata.tests.literals import (
TEST_METADATA_TYPE_LABEL, TEST_METADATA_TYPE_NAME,
)
from ..permissions import (
permission_user_create, permission_user_delete, permission_user_edit
)
from .literals import (
TEST_USER_PASSWORD_EDITED, TEST_USER_USERNAME, TEST_USER_2_USERNAME
)
TEST_USER_TO_DELETE_USERNAME = 'user_to_delete'
class UserManagementViewTestCase(GenericViewTestCase):
def setUp(self):
super(UserManagementViewTestCase, self).setUp()
self.login_user()
def _request_user_create_view(self):
return self.post(
viewname='user_management:user_add', data={
'username': TEST_USER_2_USERNAME
}
)
def test_user_create_view_no_permission(self):
response = self._request_user_create_view()
self.assertEqual(response.status_code, 403)
self.assertEqual(get_user_model().objects.count(), 2)
self.assertFalse(TEST_USER_2_USERNAME in get_user_model().objects.values_list('username', flat=True))
def test_user_create_view_with_permission(self):
self.grant_permission(permission=permission_user_create)
response = self._request_user_create_view()
self.assertEqual(response.status_code, 302)
self.assertEqual(get_user_model().objects.count(), 3)
self.assertTrue(TEST_USER_2_USERNAME in get_user_model().objects.values_list('username', flat=True))
def _request_set_password(self, password):
return self.post(
viewname='user_management:user_set_password', args=(self.user_2.pk,),
data={
'new_password1': password, 'new_password2': password
}
)
def _create_test_user_2(self):
self.user_2 = get_user_model().objects.create(
username=TEST_USER_2_USERNAME
)
def test_user_set_password_view_no_access(self):
self._create_test_user_2()
response = self._request_set_password(
password=TEST_USER_PASSWORD_EDITED
)
self.assertEqual(response.status_code, 403)
self.logout()
with self.assertRaises(AssertionError):
self.login(
username=TEST_USER_2_USERNAME, password=TEST_USER_PASSWORD_EDITED
)
response = self.get('common:current_user_details')
self.assertEqual(response.status_code, 302)
def test_user_set_password_view_with_access(self):
self._create_test_user_2()
self.grant_access(permission=permission_user_edit, obj=self.user_2)
response = self._request_set_password(
password=TEST_USER_PASSWORD_EDITED
)
self.assertEqual(response.status_code, 302)
self.logout()
self.login(
username=TEST_USER_2_USERNAME, password=TEST_USER_PASSWORD_EDITED
)
response = self.get('common:current_user_details')
self.assertEqual(response.status_code, 200)
def _request_multiple_user_set_password(self, password):
return self.post(
'user_management:user_multiple_set_password', data={
'id_list': self.user_2.pk,
'new_password1': password,
'new_password2': password
}
)
def test_user_multiple_set_password_view_no_access(self):
self._create_test_user_2()
response = self._request_multiple_user_set_password(
password=TEST_USER_PASSWORD_EDITED
)
self.assertEqual(response.status_code, 403)
self.logout()
with self.assertRaises(AssertionError):
self.login(
username=TEST_USER_2_USERNAME, password=TEST_USER_PASSWORD_EDITED
)
response = self.get('common:current_user_details')
self.assertEqual(response.status_code, 302)
def test_user_multiple_set_password_view_with_access(self):
self._create_test_user_2()
self.grant_access(permission=permission_user_edit, obj=self.user_2)
response = self._request_multiple_user_set_password(
password=TEST_USER_PASSWORD_EDITED
)
self.assertEqual(response.status_code, 302)
self.logout()
self.login(
username=TEST_USER_2_USERNAME, password=TEST_USER_PASSWORD_EDITED
)
response = self.get('common:current_user_details')
self.assertEqual(response.status_code, 200)
def _request_user_delete(self):
return self.post(
viewname='user_management:user_delete', args=(self.user_2.pk,)
)
def test_user_delete_view_no_access(self):
self._create_test_user_2()
response = self._request_user_delete()
self.assertEqual(response.status_code, 302)
self.assertEqual(get_user_model().objects.count(), 3)
def test_user_delete_view_with_access(self):
self._create_test_user_2()
self.grant_access(permission=permission_user_delete, obj=self.user_2)
response = self._request_user_delete()
self.assertEqual(response.status_code, 302)
self.assertEqual(get_user_model().objects.count(), 2)
def _request_user_multiple_delete_view(self):
return self.post(
viewname='user_management:user_multiple_delete', data={
'id_list': self.user_2.pk
}
)
def test_user_multiple_delete_view_no_access(self):
self._create_test_user_2()
response = self._request_user_multiple_delete_view()
self.assertEqual(response.status_code, 302)
self.assertEqual(get_user_model().objects.count(), 3)
def test_user_multiple_delete_view_with_access(self):
self._create_test_user_2()
self.grant_access(permission=permission_user_delete, obj=self.user_2)
response = self._request_user_multiple_delete_view()
self.assertEqual(response.status_code, 302)
self.assertEqual(get_user_model().objects.count(), 2)
class MetadataLookupIntegrationTestCase(GenericDocumentViewTestCase):
def setUp(self):
super(MetadataLookupIntegrationTestCase, self).setUp()
self.metadata_type = MetadataType.objects.create(
name=TEST_METADATA_TYPE_NAME, label=TEST_METADATA_TYPE_LABEL
)
self.document_type.metadata.create(metadata_type=self.metadata_type)
self.login_user()
def test_user_list_lookup_render(self):
self.metadata_type.lookup = '{{ users }}'
self.metadata_type.save()
self.document.metadata.create(metadata_type=self.metadata_type)
self.role.permissions.add(
permission_metadata_document_edit.stored_permission
)
response = self.get(
viewname='metadata:metadata_edit', args=(self.document.pk,)
)
self.assertContains(
response, text='<option value="{}">{}</option>'.format(
TEST_USER_USERNAME, TEST_USER_USERNAME
), status_code=200
)
def test_group_list_lookup_render(self):
self.metadata_type.lookup = '{{ groups }}'
self.metadata_type.save()
self.document.metadata.create(metadata_type=self.metadata_type)
self.role.permissions.add(
permission_metadata_document_edit.stored_permission
)
response = self.get(
viewname='metadata:metadata_edit', args=(self.document.pk,)
)
self.assertContains(
response, text='<option value="{}">{}</option>'.format(
Group.objects.first().name, Group.objects.first().name
), status_code=200
)
| 34.180258 | 109 | 0.683827 | 922 | 7,964 | 5.507592 | 0.107375 | 0.066168 | 0.031902 | 0.079953 | 0.756991 | 0.727058 | 0.718984 | 0.662269 | 0.605947 | 0.587042 | 0 | 0.013826 | 0.228026 | 7,964 | 232 | 110 | 34.327586 | 0.812134 | 0 | 0 | 0.50838 | 0 | 0 | 0.062908 | 0.044952 | 0 | 0 | 0 | 0 | 0.145251 | 1 | 0.111732 | false | 0.134078 | 0.055866 | 0.027933 | 0.206704 | 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 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
3194ded0ba8efd119f478474c3b49ba4a8a84472 | 157 | py | Python | fastapi/fastapi_path_parameters/main.py | taptorestart/python-backend-examples | 0817223f403570f5822511c240726c6108d3b9b7 | [
"MIT"
] | 7 | 2022-02-25T03:27:01.000Z | 2022-03-22T10:51:13.000Z | fastapi/fastapi_path_parameters/main.py | taptorestart/python-backend-examples | 0817223f403570f5822511c240726c6108d3b9b7 | [
"MIT"
] | null | null | null | fastapi/fastapi_path_parameters/main.py | taptorestart/python-backend-examples | 0817223f403570f5822511c240726c6108d3b9b7 | [
"MIT"
] | 1 | 2022-03-24T14:47:49.000Z | 2022-03-24T14:47:49.000Z | from fastapi import FastAPI
app = FastAPI()
@app.get("/items/{item_id}")
async def read_item(item_id):
print(item_id)
return {"item_id": item_id}
| 15.7 | 31 | 0.687898 | 25 | 157 | 4.08 | 0.52 | 0.294118 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.165605 | 157 | 9 | 32 | 17.444444 | 0.778626 | 0 | 0 | 0 | 0 | 0 | 0.146497 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.333333 | 0.166667 | 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 |
31a850cf77fc183ef0f1b2e2f5abb6e6b4bf558c | 435 | py | Python | trx/__init__.py | cmariette/trx | 389fe03cd65b91b0989402758e8f5468d702e366 | [
"MIT"
] | 1 | 2017-12-01T06:46:48.000Z | 2017-12-01T06:46:48.000Z | trx/__init__.py | cmariette/trx | 389fe03cd65b91b0989402758e8f5468d702e366 | [
"MIT"
] | null | null | null | trx/__init__.py | cmariette/trx | 389fe03cd65b91b0989402758e8f5468d702e366 | [
"MIT"
] | 6 | 2017-12-01T20:42:06.000Z | 2021-11-02T15:02:57.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function,division,absolute_import
from . import azav
from . import utils
from . import mask
from . import cell
from . import filters
from . import id9
from . import dataReduction
from . import center
from datastorage import DataStorage, read, save
try:
from . import peaks
except ImportError as err:
print("Can't import submodule peaks, reason was:",err)
__version__ = "0.6.6"
| 24.166667 | 62 | 0.754023 | 62 | 435 | 5.129032 | 0.564516 | 0.283019 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013699 | 0.16092 | 435 | 17 | 63 | 25.588235 | 0.857534 | 0.048276 | 0 | 0 | 0 | 0 | 0.11165 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.866667 | 0 | 0.866667 | 0.133333 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
31acbf0e8e5a4a395ea8952e416ffd145dc42550 | 1,046 | py | Python | Quiz Game/hint.py | Egwau-Godfrey/Data-Structures-and-Algorithm | c75f6dcb5c8975d7a636a686c912a5a5419f2c8f | [
"MIT"
] | null | null | null | Quiz Game/hint.py | Egwau-Godfrey/Data-Structures-and-Algorithm | c75f6dcb5c8975d7a636a686c912a5a5419f2c8f | [
"MIT"
] | null | null | null | Quiz Game/hint.py | Egwau-Godfrey/Data-Structures-and-Algorithm | c75f6dcb5c8975d7a636a686c912a5a5419f2c8f | [
"MIT"
] | 2 | 2022-02-20T21:37:16.000Z | 2022-03-08T11:46:58.000Z | """Quiz Game using Dictionary"""
"""
Stpes:
1. Create a dictionary containing questions and answers
2. Loop through diction
3.
"""
question_and_answer = {
"What is the capital of India?": "New Delhi",
"What is the capital of USA?": "Washington",
"What is the capital of UK?": "London",
"What is the capital of Germany?": "Berlin",
"What is the capital of France?": "Paris",
"What is the capital of Italy?": "Rome",
"What is the capital of Australia?": "Canberra",
"What is the capital of Canada?": "Ottawa",
"What is the capital of New Zealand?": "Wellington",
"What is the capital of South Africa?": "Pretoria",
"What is the capital of the Netherlands?": "Amsterdam",
"What is the capital of the United Kingdom?": "London",
"What is the capital of the United States?": "Washington",
"What is the capital of the United Arab Emirates?": "Abu Dhabi",
"What is the capital of the United Kingdom?": "London",
"What is the capital of the United States?": "Washington",
}
| 36.068966 | 68 | 0.652964 | 149 | 1,046 | 4.57047 | 0.369128 | 0.140969 | 0.211454 | 0.375918 | 0.602056 | 0.390602 | 0.283407 | 0.243759 | 0.243759 | 0.243759 | 0 | 0.003686 | 0.221797 | 1,046 | 28 | 69 | 37.357143 | 0.832924 | 0.024857 | 0 | 0.222222 | 0 | 0 | 0.754153 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
31ca9d73d2fecbde8db4a056bcfb72518b9b1189 | 887 | py | Python | kde/kdegraphics/kipi-plugins/kipi-plugins.py | wrobelda/craft-blueprints-kde | 366f460cecd5baebdf3a695696767c8c0e5e7c7e | [
"BSD-2-Clause"
] | 14 | 2017-09-04T09:01:03.000Z | 2022-01-04T20:09:00.000Z | kde/kdegraphics/kipi-plugins/kipi-plugins.py | wrobelda/craft-blueprints-kde | 366f460cecd5baebdf3a695696767c8c0e5e7c7e | [
"BSD-2-Clause"
] | 14 | 2017-12-15T08:11:22.000Z | 2020-12-29T19:11:13.000Z | kde/kdegraphics/kipi-plugins/kipi-plugins.py | wrobelda/craft-blueprints-kde | 366f460cecd5baebdf3a695696767c8c0e5e7c7e | [
"BSD-2-Clause"
] | 19 | 2017-09-05T19:16:21.000Z | 2020-10-18T12:46:06.000Z | # -*- coding: utf-8 -*-
import info
from Package.CMakePackageBase import *
class subinfo(info.infoclass):
def setTargets(self):
self.versionInfo.setDefaultValues()
self.description = "common KDE graphics application plugins"
def setDependencies(self):
self.runtimeDependencies["kde/frameworks/extra-cmake-modules"] = None
self.runtimeDependencies["kde/frameworks/tier1/kconfig"] = None
self.runtimeDependencies["kde/frameworks/tier1/kwindowsystem"] = None
self.runtimeDependencies["kde/frameworks/tier3/kxmlgui"] = None
self.runtimeDependencies["kde/frameworks/tier1/karchive"] = None
self.runtimeDependencies["kde/frameworks/tier3/kio"] = None
self.runtimeDependencies["kde/kdegraphics/libkipi"] = None
class Package(CMakePackageBase):
def __init__(self):
CMakePackageBase.__init__(self)
| 35.48 | 77 | 0.718151 | 87 | 887 | 7.229885 | 0.448276 | 0.255962 | 0.289348 | 0.343402 | 0.357711 | 0.357711 | 0 | 0 | 0 | 0 | 0 | 0.00813 | 0.167982 | 887 | 24 | 78 | 36.958333 | 0.844173 | 0.023675 | 0 | 0 | 0 | 0 | 0.27662 | 0.231481 | 0 | 0 | 0 | 0 | 0 | 1 | 0.176471 | false | 0 | 0.117647 | 0 | 0.411765 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
31ecabf8f218b507e5f90a6d73407b82a4266e4d | 2,322 | py | Python | Python/Buch_ATBS/Teil_1/Kapitel_06_Stringbearbeitung/12_kapitel_6_repetitionsfragen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_1/Kapitel_06_Stringbearbeitung/12_kapitel_6_repetitionsfragen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_1/Kapitel_06_Stringbearbeitung/12_kapitel_6_repetitionsfragen.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | print('1. Was sind Maskierungssequenzen?')
input()
print('Maskierungszeichen stehen für Zeichen die sonst nur\nschwer in einem Code wiedergeben lassen')
print(r'Beispiele: \n für newline \t für tabulator \\ für backslash ... ')
print('')
input()
print('2. Wofür stehen die Maskierungssequenzen \\t und \\n')
input()
print(r'\n steht für Newline und \t für Tabulator')
print('')
input()
print(r'3. Wie können sie einen Backslash (\) in einen String einfügen?')
input()
print('Es gibt zwei Möglichkeiten.')
print(r"Einmal mittels mittels '\\' und einmal mittels r'\'")
print('')
input()
print('4. "How\'s your day?" ist ein gültiger Stringwert. \nWarum führt das als Apostroph verwendete einfache\nAnführungszeichen in How\'s nicht zu einem Problem \nobwohl es nicht maskiert ist?')
input()
print('Da der String mit doppelten Anführungszeichen\ngeschrieben wurde werden die einfachen\nAnführungszeichen innerhalb des Strings nicht\nausgewertet.')
print('')
input()
print('5. Wie können sie einen String mit Zeilenumbruch schreiben ohne \\n zu verwenden?')
input()
print('Man kann die Zeilenumbrüche auch direkt in Strings verwenden ohne \\n nutzen zu müssen.')
print('')
input()
print('6. Wozu werden folgende Ausdrücke ausgewertet?\n\'Hello World\'[1]\n\'Hello World\'[0:5]\n\'Hello World\'[:5]\n\'Hello World\'[3:]')
input()
print('1. e - 2. Hello - 3. Hello - 4. lo World')
print('')
input()
print('7. Wozu werden folgende Ausdrücke ausgewertet?\n\'Hello\'.upper()\n\'Hello\'.upper().isupper()\n\'Hello\'.upper().lower()')
input()
print('1. HELLO - 2. True - 3. hello')
print('')
input()
print('8. Wozu werden folgende Ausdrücke ausgewertet?\n\'Remember, remember, the fifth of november.\'.split()\n\'-\'.join(\'There can be only one.\'.split())')
input()
print('1. [ \'Remember,\', \'remember,\', \'the\', \'fifth\', \'of\', \'november.\' ]')
print('2. There-can-be-only-one.')
input()
print('9. Mit welchen Stringmethoden können sie einen String\nRechtsbünding, Zentriert oder Linksbündig ausrichten?')
input()
print('Mit den Methoden string.center(n), string.rjust(n) und string.ljust(n)')
print('')
input()
print('10. Wie können Weissraumzeichen/Leerschläge am Ende\n und am Anfang eines Strings entfernt werden?')
input()
print('Mit string.strip(), string.lstrip() und string.rstrip()')
print('')
input()
| 36.28125 | 195 | 0.710594 | 331 | 2,322 | 4.984894 | 0.429003 | 0.115152 | 0.072727 | 0.049091 | 0.138788 | 0.118182 | 0.053333 | 0 | 0 | 0 | 0 | 0.012201 | 0.117571 | 2,322 | 63 | 196 | 36.857143 | 0.79307 | 0 | 0 | 0.557692 | 0 | 0.038462 | 0.644828 | 0.074138 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0.615385 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
9eca9d4c0591e8aa7455ff186c189fa0e8354ead | 42 | py | Python | web/__init__.py | Hack4Vilnius/getpet-web | b757a6101e70845fddeea88a385acc367a5a58a0 | [
"Apache-2.0"
] | 2 | 2018-11-16T21:45:17.000Z | 2019-02-03T19:55:46.000Z | web/__init__.py | Hack4Vilnius/getpet-web | b757a6101e70845fddeea88a385acc367a5a58a0 | [
"Apache-2.0"
] | 13 | 2018-08-17T19:12:11.000Z | 2022-03-11T23:27:41.000Z | web/__init__.py | zinaukarenku/zkr-platform | 8daf7d1206c482f1f8e0bcd54d4fde783e568774 | [
"Apache-2.0"
] | 1 | 2022-02-21T07:08:08.000Z | 2022-02-21T07:08:08.000Z | default_app_config = 'web.apps.WebConfig'
| 21 | 41 | 0.809524 | 6 | 42 | 5.333333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.071429 | 42 | 1 | 42 | 42 | 0.820513 | 0 | 0 | 0 | 0 | 0 | 0.428571 | 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 |
9edd8f1ef98fdd6022855fc73d7d93e9e61ee6d6 | 458 | py | Python | src/www/models/user.py | RuhuiCheng/ladybug | fa9e1ea660dd040d3ecfde96ad6c4db67df9bcb9 | [
"Apache-2.0"
] | 4 | 2020-03-14T10:43:29.000Z | 2020-09-23T11:15:44.000Z | src/www/models/user.py | RuhuiCheng/ladybug | fa9e1ea660dd040d3ecfde96ad6c4db67df9bcb9 | [
"Apache-2.0"
] | null | null | null | src/www/models/user.py | RuhuiCheng/ladybug | fa9e1ea660dd040d3ecfde96ad6c4db67df9bcb9 | [
"Apache-2.0"
] | null | null | null | import datetime
from flask_admin.contrib.sqla import ModelView
from src.www.orm import db
class User(db.Model):
__tablename__ = 'user'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(200))
password = db.Column(db.String(200))
email = db.Column(db.String(200), unique=True)
mobile = db.Column(db.String(20))
def __str__(self):
return self.email
class UserModelView(ModelView):
page_size = 15 | 25.444444 | 50 | 0.694323 | 67 | 458 | 4.58209 | 0.567164 | 0.130293 | 0.162866 | 0.208469 | 0.185668 | 0 | 0 | 0 | 0 | 0 | 0 | 0.034759 | 0.183406 | 458 | 18 | 51 | 25.444444 | 0.786096 | 0 | 0 | 0 | 0 | 0 | 0.008715 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.071429 | false | 0.071429 | 0.214286 | 0.071429 | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
9ee59e6b8e5486d90dc7980b999a1d0e18178a54 | 122 | py | Python | pages/components/button/_button.py | AnnMarieW/dmc-docs | 5db1790b61e85209b85adb75ccf6e7462d93f231 | [
"MIT"
] | 6 | 2022-01-28T17:12:58.000Z | 2022-03-16T01:29:18.000Z | pages/components/button/_button.py | AnnMarieW/dmc-docs | 5db1790b61e85209b85adb75ccf6e7462d93f231 | [
"MIT"
] | 1 | 2022-01-07T21:21:07.000Z | 2022-01-22T12:07:28.000Z | pages/components/button/_button.py | AnnMarieW/dmc-docs | 5db1790b61e85209b85adb75ccf6e7462d93f231 | [
"MIT"
] | 1 | 2022-02-05T18:00:36.000Z | 2022-02-05T18:00:36.000Z | import dash_mantine_components as dmc
component = dmc.Button("Click to open the app", fullWidth=True, variant="outline")
| 30.5 | 82 | 0.786885 | 18 | 122 | 5.222222 | 0.944444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.114754 | 122 | 3 | 83 | 40.666667 | 0.87037 | 0 | 0 | 0 | 0 | 0 | 0.229508 | 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 |
9ee93ad888341299a8406a1d1fdcf2f2d7c5ea94 | 122 | py | Python | D02/dictionary/change.py | shdx8/dtwrhs | 108decb8056931fc7601ed455a72ef0d65983ab0 | [
"MIT"
] | null | null | null | D02/dictionary/change.py | shdx8/dtwrhs | 108decb8056931fc7601ed455a72ef0d65983ab0 | [
"MIT"
] | null | null | null | D02/dictionary/change.py | shdx8/dtwrhs | 108decb8056931fc7601ed455a72ef0d65983ab0 | [
"MIT"
] | null | null | null | my_dictionary={
'nama': 'Elyas',
'usia': 19,
'status': 'mahasiswa'
}
my_dictionary["usia"]=20
print(my_dictionary) | 17.428571 | 25 | 0.655738 | 15 | 122 | 5.133333 | 0.666667 | 0.467532 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.038095 | 0.139344 | 122 | 7 | 26 | 17.428571 | 0.695238 | 0 | 0 | 0 | 0 | 0 | 0.260163 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.142857 | 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 |
9eeabd34fbfb4cf41cabddb89675c09df496a23e | 267 | py | Python | test2.py | rfyiamcool/redis_netlock | ac2f6c4639c3ceb89bd63ff0b1030aa3a4b569be | [
"MIT"
] | 29 | 2015-10-18T12:22:37.000Z | 2020-03-02T13:55:27.000Z | test2.py | zbing3/redis_netlock | d8932aa5beaa05a1b68d1d0ee866e44c4de5362b | [
"MIT"
] | 1 | 2019-01-03T03:16:11.000Z | 2019-01-03T03:16:11.000Z | test2.py | zbing3/redis_netlock | d8932aa5beaa05a1b68d1d0ee866e44c4de5362b | [
"MIT"
] | 15 | 2015-05-13T14:20:33.000Z | 2021-11-19T10:02:04.000Z | from __future__ import with_statement
import redis
import time
from redis_netlock import dist_lock
client = redis.Redis(connection_pool=redis.BlockingConnectionPool(max_connections=15, host='localhost', port=6379))
with dist_lock('test', client):
print 'hello'
| 26.7 | 115 | 0.808989 | 36 | 267 | 5.722222 | 0.666667 | 0.07767 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025105 | 0.104869 | 267 | 9 | 116 | 29.666667 | 0.83682 | 0 | 0 | 0 | 0 | 0 | 0.067669 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.571429 | null | null | 0.142857 | 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 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
9eeb9ce2c22da88c65e41828615a615d1d72095e | 767 | py | Python | era/utils/translation/string.py | doctorzeb8/django-era | 6fd433ef6081c5be295df22bcea70dc2642baaa4 | [
"MIT"
] | 1 | 2015-10-22T04:03:28.000Z | 2015-10-22T04:03:28.000Z | era/utils/translation/string.py | doctorzeb8/django-era | 6fd433ef6081c5be295df22bcea70dc2642baaa4 | [
"MIT"
] | 3 | 2020-02-11T21:30:20.000Z | 2021-06-10T17:24:30.000Z | era/utils/translation/string.py | doctorzeb8/django-era | 6fd433ef6081c5be295df22bcea70dc2642baaa4 | [
"MIT"
] | null | null | null | import re
import sys
from django.utils.text import capfirst
from django.utils.translation import get_language, ugettext_lazy
from ..functools import factual
def _(string, context=None):
t = ugettext_lazy(': '.join(factual([context, string])))
t.string = string
return t
def get_string(obj):
return obj if isinstance(obj, str) else obj.string
def normalize(string):
return ''.join(map(
lambda e: e[0] and re.sub(r'([A-Z])', r'-\g<1>', e[1]) or e[1],
enumerate(string))).lower()
def capitalize(string):
return ''.join(map(capfirst, string.split('-')))
def inflect(string):
inflector = sys.modules.get('.'.join([__package__ or __name__, get_language()]))
return inflector and inflector.inflect(string) or string
| 24.741935 | 84 | 0.680574 | 109 | 767 | 4.66055 | 0.449541 | 0.070866 | 0.059055 | 0.074803 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006279 | 0.169492 | 767 | 30 | 85 | 25.566667 | 0.791209 | 0 | 0 | 0 | 0 | 0 | 0.022164 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0.15 | 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 |
9ef88ccffe93d947a0144d5b16d3c8ead14a89c2 | 499 | py | Python | layerserver/tasks.py | aroiginfraplan/giscube-admin | b7f3131b0186f847f3902df97f982cb288b16a49 | [
"BSD-3-Clause"
] | 5 | 2018-06-07T12:54:35.000Z | 2022-01-14T10:38:38.000Z | layerserver/tasks.py | aroiginfraplan/giscube-admin | b7f3131b0186f847f3902df97f982cb288b16a49 | [
"BSD-3-Clause"
] | 140 | 2018-06-18T10:27:28.000Z | 2022-03-23T09:53:15.000Z | layerserver/tasks.py | aroiginfraplan/giscube-admin | b7f3131b0186f847f3902df97f982cb288b16a49 | [
"BSD-3-Clause"
] | 1 | 2021-04-13T11:20:54.000Z | 2021-04-13T11:20:54.000Z | from giscube.celery import app
@app.task()
def async_geojsonlayer_refresh(pk, force_refresh_data_file, generate_popup=False):
from layerserver.utils import geojsonlayer_refresh
return geojsonlayer_refresh(pk, force_refresh_data_file, generate_popup)
@app.task()
def async_generate_mapfile(pk):
from layerserver.mapserver import MapserverLayer
from layerserver.models import DataBaseLayer
layer = DataBaseLayer.objects.get(pk=pk)
ms = MapserverLayer(layer)
ms.write()
| 29.352941 | 82 | 0.791583 | 63 | 499 | 6.047619 | 0.47619 | 0.149606 | 0.052493 | 0.07874 | 0.283465 | 0.283465 | 0.283465 | 0.283465 | 0.283465 | 0 | 0 | 0 | 0.134269 | 499 | 16 | 83 | 31.1875 | 0.881944 | 0 | 0 | 0.166667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 0 | 0.583333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
730843a650c4b0072e8c08def4fd2fd825e2b45a | 125 | py | Python | rlpython/__init__.py | Bastian-Krause/rlpython | d687438219ac3468762e21457ee19b712b17caec | [
"MIT"
] | null | null | null | rlpython/__init__.py | Bastian-Krause/rlpython | d687438219ac3468762e21457ee19b712b17caec | [
"MIT"
] | null | null | null | rlpython/__init__.py | Bastian-Krause/rlpython | d687438219ac3468762e21457ee19b712b17caec | [
"MIT"
] | null | null | null | from rlpython.embed import embed # NOQA
VERSION = (0, 8)
VERSION_STRING = '{}'.format('.'.join([str(i) for i in VERSION]))
| 25 | 65 | 0.656 | 19 | 125 | 4.263158 | 0.789474 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018868 | 0.152 | 125 | 4 | 66 | 31.25 | 0.745283 | 0.032 | 0 | 0 | 0 | 0 | 0.02521 | 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 |
730c7c764c00d9689a4151dc370da69517467966 | 71 | py | Python | backend/idea/urls.py | www-norma-dev/idea-box-backend | 0457df8fc1b055620cef5a9000f579dda8723b60 | [
"MIT"
] | null | null | null | backend/idea/urls.py | www-norma-dev/idea-box-backend | 0457df8fc1b055620cef5a9000f579dda8723b60 | [
"MIT"
] | 2 | 2021-04-28T16:15:49.000Z | 2021-04-28T16:15:59.000Z | backend/idea/urls.py | www-norma-dev/idea-box-backend | 0457df8fc1b055620cef5a9000f579dda8723b60 | [
"MIT"
] | null | null | null | from django.urls import path
from idea import views
urlpatterns = [
]
| 11.833333 | 28 | 0.760563 | 10 | 71 | 5.4 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.183099 | 71 | 5 | 29 | 14.2 | 0.931034 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.