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
4a350541e53a4860842d8c22c293de549e943254
24,655
py
Python
test/geometry/subpix/test_spatial_softargmax.py
lferraz/kornia
c30ef6149bd92054d482339a2b0cd18f8272f5f5
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
test/geometry/subpix/test_spatial_softargmax.py
lferraz/kornia
c30ef6149bd92054d482339a2b0cd18f8272f5f5
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
test/geometry/subpix/test_spatial_softargmax.py
lferraz/kornia
c30ef6149bd92054d482339a2b0cd18f8272f5f5
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
import pytest import torch from torch.nn.functional import mse_loss from torch.autograd import gradcheck from torch.testing import assert_allclose import kornia as kornia import kornia.testing as utils # test utils from kornia.geometry.subpix.spatial_soft_argmax import _get_center_kernel2d, _get_center_kernel3d class TestCenterKernel2d: def test_smoke(self, device, dtype): kernel = _get_center_kernel2d(3, 4, device=device).to(dtype=dtype) assert kernel.shape == (2, 2, 3, 4) def test_odd(self, device, dtype): kernel = _get_center_kernel2d(3, 3, device=device).to(dtype=dtype) expected = torch.tensor([ [[[0., 0., 0.], [0., 1., 0.], [0., 0., 0.]], [[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]]], [[[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]], [[0., 0., 0.], [0., 1., 0.], [0., 0., 0.]]]], device=device, dtype=dtype) assert_allclose(kernel, expected, atol=1e-4, rtol=1e-4) def test_even(self, device, dtype): kernel = _get_center_kernel2d(2, 2, device=device).to(dtype=dtype) expected = torch.ones(2, 2, 2, 2, device=device, dtype=dtype) * 0.25 expected[0, 1] = 0 expected[1, 0] = 0 assert_allclose(kernel, expected, atol=1e-4, rtol=1e-4) class TestCenterKernel3d: def test_smoke(self, device, dtype): kernel = _get_center_kernel3d(6, 3, 4, device=device).to(dtype=dtype) assert kernel.shape == (3, 3, 6, 3, 4) def test_odd(self, device, dtype): kernel = _get_center_kernel3d(3, 5, 7, device=device).to(dtype=dtype) expected = torch.zeros(3, 3, 3, 5, 7, device=device, dtype=dtype) expected[0, 0, 1, 2, 3] = 1. expected[1, 1, 1, 2, 3] = 1. expected[2, 2, 1, 2, 3] = 1. assert_allclose(kernel, expected, atol=1e-4, rtol=1e-4) def test_even(self, device, dtype): kernel = _get_center_kernel3d(2, 4, 3, device=device).to(dtype=dtype) expected = torch.zeros(3, 3, 2, 4, 3, device=device, dtype=dtype) expected[0, 0, :, 1:3, 1] = 0.25 expected[1, 1, :, 1:3, 1] = 0.25 expected[2, 2, :, 1:3, 1] = 0.25 assert_allclose(kernel, expected, atol=1e-4, rtol=1e-4) class TestSpatialSoftArgmax2d: def test_smoke(self, device, dtype): input = torch.zeros(1, 1, 2, 3, device=device, dtype=dtype) m = kornia.SpatialSoftArgmax2d() assert m(input).shape == (1, 1, 2) def test_smoke_batch(self, device, dtype): input = torch.zeros(2, 1, 2, 3, device=device, dtype=dtype) m = kornia.SpatialSoftArgmax2d() assert m(input).shape == (2, 1, 2) def test_top_left_normalized(self, device, dtype): input = torch.zeros(1, 1, 2, 3, device=device, dtype=dtype) input[..., 0, 0] = 1e16 coord = kornia.spatial_soft_argmax2d(input, normalized_coordinates=True) assert_allclose(coord[..., 0].item(), -1.0, atol=1e-4, rtol=1e-4) assert_allclose(coord[..., 1].item(), -1.0, atol=1e-4, rtol=1e-4) def test_top_left(self, device, dtype): input = torch.zeros(1, 1, 2, 3, device=device, dtype=dtype) input[..., 0, 0] = 1e16 coord = kornia.spatial_soft_argmax2d(input, normalized_coordinates=False) assert_allclose(coord[..., 0].item(), 0.0, atol=1e-4, rtol=1e-4) assert_allclose(coord[..., 1].item(), 0.0, atol=1e-4, rtol=1e-4) def test_bottom_right_normalized(self, device, dtype): input = torch.zeros(1, 1, 2, 3, device=device, dtype=dtype) input[..., -1, -1] = 1e16 coord = kornia.spatial_soft_argmax2d(input, normalized_coordinates=True) assert_allclose(coord[..., 0].item(), 1.0, atol=1e-4, rtol=1e-4) assert_allclose(coord[..., 1].item(), 1.0, atol=1e-4, rtol=1e-4) def test_bottom_right(self, device, dtype): input = torch.zeros(1, 1, 2, 3, device=device, dtype=dtype) input[..., -1, -1] = 1e16 coord = kornia.spatial_soft_argmax2d(input, normalized_coordinates=False) assert_allclose(coord[..., 0].item(), 2.0, atol=1e-4, rtol=1e-4) assert_allclose(coord[..., 1].item(), 1.0, atol=1e-4, rtol=1e-4) def test_batch2_n2(self, device, dtype): input = torch.zeros(2, 2, 2, 3, device=device, dtype=dtype) input[0, 0, 0, 0] = 1e16 # top-left input[0, 1, 0, -1] = 1e16 # top-right input[1, 0, -1, 0] = 1e16 # bottom-left input[1, 1, -1, -1] = 1e16 # bottom-right coord = kornia.spatial_soft_argmax2d(input) assert_allclose(coord[0, 0, 0].item(), -1.0, atol=1e-4, rtol=1e-4) # top-left assert_allclose(coord[0, 0, 1].item(), -1.0, atol=1e-4, rtol=1e-4) assert_allclose(coord[0, 1, 0].item(), 1.0, atol=1e-4, rtol=1e-4) # top-right assert_allclose(coord[0, 1, 1].item(), -1.0, atol=1e-4, rtol=1e-4) assert_allclose(coord[1, 0, 0].item(), -1.0, atol=1e-4, rtol=1e-4) # bottom-left assert_allclose(coord[1, 0, 1].item(), 1.0, atol=1e-4, rtol=1e-4) assert_allclose(coord[1, 1, 0].item(), 1.0, atol=1e-4, rtol=1e-4) # bottom-right assert_allclose(coord[1, 1, 1].item(), 1.0, atol=1e-4, rtol=1e-4) def test_gradcheck(self, device, dtype): input = torch.rand(2, 3, 3, 2, device=device, dtype=dtype) input = utils.tensor_to_gradcheck_var(input) # to var assert gradcheck(kornia.spatial_soft_argmax2d, (input), raise_exception=True) def test_end_to_end(self, device, dtype): input = torch.full((1, 2, 7, 7), 1.0, requires_grad=True, device=device, dtype=dtype) target = torch.as_tensor([[[0.0, 0.0], [1.0, 1.0]]], device=device, dtype=dtype) std = torch.tensor([1.0, 1.0], device=device, dtype=dtype) hm = kornia.geometry.dsnt.spatial_softmax2d(input) assert_allclose( hm.sum(-1).sum(-1), torch.tensor([[1.0, 1.0]], device=device, dtype=dtype), atol=1e-4, rtol=1e-4) pred = kornia.geometry.dsnt.spatial_expectation2d(hm) assert_allclose( pred, torch.as_tensor([[[0.0, 0.0], [0.0, 0.0]]], device=device, dtype=dtype), atol=1e-4, rtol=1e-4) loss1 = mse_loss(pred, target, size_average=None, reduce=None, reduction='none').mean(-1, keepdim=False) expected_loss1 = torch.as_tensor([[0.0, 1.0]], device=device, dtype=dtype) assert_allclose(loss1, expected_loss1, atol=1e-4, rtol=1e-4) target_hm = kornia.geometry.dsnt.render_gaussian2d( target, std, input.shape[-2:]).contiguous() loss2 = kornia.losses.js_div_loss_2d(hm, target_hm, reduction='none') expected_loss2 = torch.as_tensor([[0.0087, 0.0818]], device=device, dtype=dtype) assert_allclose(loss2, expected_loss2, rtol=0, atol=1e-3) loss = (loss1 + loss2).mean() loss.backward() def test_jit(self, device, dtype): input = torch.rand((2, 3, 7, 7), dtype=dtype, device=device) op = kornia.spatial_soft_argmax2d op_jit = kornia.jit.spatial_soft_argmax2d assert_allclose(op(input), op_jit(input), rtol=0, atol=1e-5) def test_jit_trace(self, device, dtype): input = torch.rand((2, 3, 7, 7), dtype=dtype, device=device) op = kornia.spatial_soft_argmax2d op_jit = torch.jit.trace(op, (input,)) assert_allclose(op(input), op_jit(input), rtol=0, atol=1e-5) class TestConvSoftArgmax2d: def test_smoke(self, device, dtype): input = torch.zeros(1, 1, 3, 3, device=device, dtype=dtype) m = kornia.ConvSoftArgmax2d((3, 3)) assert m(input).shape == (1, 1, 2, 3, 3) def test_smoke_batch(self, device, dtype): input = torch.zeros(2, 5, 3, 3, device=device, dtype=dtype) m = kornia.ConvSoftArgmax2d() assert m(input).shape == (2, 5, 2, 3, 3) def test_smoke_with_val(self, device, dtype): input = torch.zeros(1, 1, 3, 3, device=device, dtype=dtype) m = kornia.ConvSoftArgmax2d((3, 3), output_value=True) coords, val = m(input) assert coords.shape == (1, 1, 2, 3, 3) assert val.shape == (1, 1, 3, 3) def test_smoke_batch_with_val(self, device, dtype): input = torch.zeros(2, 5, 3, 3, device=device, dtype=dtype) m = kornia.ConvSoftArgmax2d((3, 3), output_value=True) coords, val = m(input) assert coords.shape == (2, 5, 2, 3, 3) assert val.shape == (2, 5, 3, 3) def test_gradcheck(self, device, dtype): input = torch.rand(2, 3, 5, 5, device=device, dtype=dtype) input = utils.tensor_to_gradcheck_var(input) # to var assert gradcheck(kornia.conv_soft_argmax2d, (input), raise_exception=True) def test_cold_diag(self, device, dtype): input = torch.tensor([[[ [0., 0., 0., 0., 0.], [0., 1., 0., 0., 0.], [0., 0., 0., 0., 0.], [0., 0., 0., 1., 0.], [0., 0., 0., 0., 0.], ]]], device=device, dtype=dtype) softargmax = kornia.ConvSoftArgmax2d((3, 3), (2, 2), (0, 0), temperature=0.05, normalized_coordinates=False, output_value=True) expected_val = torch.tensor([[[[1., 0.], [0., 1.]]]], device=device, dtype=dtype) expected_coord = torch.tensor([[[[[1., 3.], [1., 3.]], [[1., 1.], [3., 3.]]]]], device=device, dtype=dtype) coords, val = softargmax(input) assert_allclose(val, expected_val, atol=1e-4, rtol=1e-4) assert_allclose(coords, expected_coord, atol=1e-4, rtol=1e-4) def test_hot_diag(self, device, dtype): input = torch.tensor([[[ [0., 0., 0., 0., 0.], [0., 1., 0., 0., 0.], [0., 0., 0., 0., 0.], [0., 0., 0., 1., 0.], [0., 0., 0., 0., 0.], ]]], device=device, dtype=dtype) softargmax = kornia.ConvSoftArgmax2d((3, 3), (2, 2), (0, 0), temperature=10., normalized_coordinates=False, output_value=True) expected_val = torch.tensor([[[[0.1214, 0.], [0., 0.1214]]]], device=device, dtype=dtype) expected_coord = torch.tensor([[[[[1., 3.], [1., 3.]], [[1., 1.], [3., 3.]]]]], device=device, dtype=dtype) coords, val = softargmax(input) assert_allclose(val, expected_val, atol=1e-4, rtol=1e-4) assert_allclose(coords, expected_coord, atol=1e-4, rtol=1e-4) def test_cold_diag_norm(self, device, dtype): input = torch.tensor([[[ [0., 0., 0., 0., 0.], [0., 1., 0., 0., 0.], [0., 0., 0., 0., 0.], [0., 0., 0., 1., 0.], [0., 0., 0., 0., 0.], ]]], device=device, dtype=dtype) softargmax = kornia.ConvSoftArgmax2d((3, 3), (2, 2), (0, 0), temperature=0.05, normalized_coordinates=True, output_value=True) expected_val = torch.tensor([[[[1., 0.], [0., 1.]]]], device=device, dtype=dtype) expected_coord = torch.tensor([[[[[-0.5, 0.5], [-0.5, 0.5]], [[-0.5, -0.5], [0.5, 0.5]]]]], device=device, dtype=dtype) coords, val = softargmax(input) assert_allclose(val, expected_val, atol=1e-4, rtol=1e-4) assert_allclose(coords, expected_coord, atol=1e-4, rtol=1e-4) def test_hot_diag_norm(self, device, dtype): input = torch.tensor([[[ [0., 0., 0., 0., 0.], [0., 1., 0., 0., 0.], [0., 0., 0., 0., 0.], [0., 0., 0., 1., 0.], [0., 0., 0., 0., 0.], ]]], device=device, dtype=dtype) softargmax = kornia.ConvSoftArgmax2d((3, 3), (2, 2), (0, 0), temperature=10., normalized_coordinates=True, output_value=True) expected_val = torch.tensor([[[[0.1214, 0.], [0., 0.1214]]]], device=device, dtype=dtype) expected_coord = torch.tensor([[[[[-0.5, 0.5], [-0.5, 0.5]], [[-0.5, -0.5], [0.5, 0.5]]]]], device=device, dtype=dtype) coords, val = softargmax(input) assert_allclose(val, expected_val, atol=1e-4, rtol=1e-4) assert_allclose(coords, expected_coord, atol=1e-4, rtol=1e-4) class TestConvSoftArgmax3d: def test_smoke(self, device, dtype): input = torch.zeros(1, 1, 3, 3, 3, device=device, dtype=dtype) m = kornia.ConvSoftArgmax3d((3, 3, 3), output_value=False) assert m(input).shape == (1, 1, 3, 3, 3, 3) def test_smoke_with_val(self, device, dtype): input = torch.zeros(1, 1, 3, 3, 3, device=device, dtype=dtype) m = kornia.ConvSoftArgmax3d((3, 3, 3), output_value=True) coords, val = m(input) assert coords.shape == (1, 1, 3, 3, 3, 3) assert val.shape == (1, 1, 3, 3, 3) def test_gradcheck(self, device, dtype): input = torch.rand(1, 2, 3, 5, 5, device=device, dtype=dtype) input = utils.tensor_to_gradcheck_var(input) # to var assert gradcheck(kornia.conv_soft_argmax3d, (input), raise_exception=True) def test_cold_diag(self, device, dtype): input = torch.tensor([[[[ [0., 0., 0., 0., 0.], [0., 1., 0., 0., 0.], [0., 0., 0., 0., 0.], [0., 0., 0., 1., 0.], [0., 0., 0., 0., 0.], ]]]], device=device, dtype=dtype) softargmax = kornia.ConvSoftArgmax3d((1, 3, 3), (1, 2, 2), (0, 0, 0), temperature=0.05, normalized_coordinates=False, output_value=True) expected_val = torch.tensor([[[[[1., 0.], [0., 1.]]]]], device=device, dtype=dtype) expected_coord = torch.tensor([[[ [[[0., 0.], [0., 0.]]], [[[1., 3.], [1., 3.]]], [[[1., 1.], [3., 3.]]]]]], device=device, dtype=dtype) coords, val = softargmax(input) assert_allclose(val, expected_val, atol=1e-4, rtol=1e-4) assert_allclose(coords, expected_coord, atol=1e-4, rtol=1e-4) def test_hot_diag(self, device, dtype): input = torch.tensor([[[[ [0., 0., 0., 0., 0.], [0., 1., 0., 0., 0.], [0., 0., 0., 0., 0.], [0., 0., 0., 1., 0.], [0., 0., 0., 0., 0.], ]]]], device=device, dtype=dtype) softargmax = kornia.ConvSoftArgmax3d((1, 3, 3), (1, 2, 2), (0, 0, 0), temperature=10., normalized_coordinates=False, output_value=True) expected_val = torch.tensor([[[[[0.1214, 0.], [0., 0.1214]]]]], device=device, dtype=dtype) expected_coord = torch.tensor([[[ [[[0., 0.], [0., 0.]]], [[[1., 3.], [1., 3.]]], [[[1., 1.], [3., 3.]]]]]], device=device, dtype=dtype) coords, val = softargmax(input) assert_allclose(val, expected_val, atol=1e-4, rtol=1e-4) assert_allclose(coords, expected_coord, atol=1e-4, rtol=1e-4) def test_cold_diag_norm(self, device, dtype): input = torch.tensor([[[[ [0., 0., 0., 0., 0.], [0., 1., 0., 0., 0.], [0., 0., 0., 0., 0.], [0., 0., 0., 1., 0.], [0., 0., 0., 0., 0.], ]]]], device=device, dtype=dtype) softargmax = kornia.ConvSoftArgmax3d((1, 3, 3), (1, 2, 2), (0, 0, 0), temperature=0.05, normalized_coordinates=True, output_value=True) expected_val = torch.tensor([[[[[1., 0.], [0., 1.]]]]], device=device, dtype=dtype) expected_coord = torch.tensor([[[ [[[-1., -1.], [-1., -1.]]], [[[-0.5, 0.5], [-0.5, 0.5]]], [[[-0.5, -0.5], [0.5, 0.5]]]]]], device=device, dtype=dtype) coords, val = softargmax(input) assert_allclose(val, expected_val, atol=1e-4, rtol=1e-4) assert_allclose(coords, expected_coord, atol=1e-4, rtol=1e-4) def test_hot_diag_norm(self, device, dtype): input = torch.tensor([[[[ [0., 0., 0., 0., 0.], [0., 1., 0., 0., 0.], [0., 0., 0., 0., 0.], [0., 0., 0., 1., 0.], [0., 0., 0., 0., 0.], ]]]], device=device, dtype=dtype) softargmax = kornia.ConvSoftArgmax3d((1, 3, 3), (1, 2, 2), (0, 0, 0), temperature=10., normalized_coordinates=True, output_value=True) expected_val = torch.tensor([[[[[0.1214, 0.], [0., 0.1214]]]]], device=device, dtype=dtype) expected_coord = torch.tensor([[[ [[[-1., -1.], [-1., -1.]]], [[[-0.5, 0.5], [-0.5, 0.5]]], [[[-0.5, -0.5], [0.5, 0.5]]]]]], device=device, dtype=dtype) coords, val = softargmax(input) assert_allclose(val, expected_val, atol=1e-4, rtol=1e-4) assert_allclose(coords, expected_coord, atol=1e-4, rtol=1e-4) class TestConvQuadInterp3d: def test_smoke(self, device, dtype): input = torch.randn(2, 3, 3, 4, 4, device=device, dtype=dtype) nms = kornia.geometry.ConvQuadInterp3d(1) coord, val = nms(input) assert coord.shape == (2, 3, 3, 3, 4, 4) assert val.shape == (2, 3, 3, 4, 4) def test_gradcheck(self, device, dtype): input = torch.rand(1, 1, 3, 5, 5, device=device, dtype=dtype) input[0, 0, 1, 2, 2] += 20. input = utils.tensor_to_gradcheck_var(input) # to var assert gradcheck(kornia.geometry.ConvQuadInterp3d(strict_maxima_bonus=0), (input), raise_exception=True, atol=1e-3, rtol=1e-3) def test_diag(self, device, dtype): input = torch.tensor([[ [[0., 0., 0., 0, 0], [0., 0., 0.0, 0, 0.], [0., 0, 0., 0, 0.], [0., 0., 0, 0, 0.], [0., 0., 0., 0, 0.]], [[0., 0., 0., 0, 0], [0., 0., 1, 0, 0.], [0., 1, 1.2, 1.1, 0.], [0., 0., 1., 0, 0.], [0., 0., 0., 0, 0.]], [[0., 0., 0., 0, 0], [0., 0., 0.0, 0, 0.], [0., 0, 0., 0, 0.], [0., 0., 0, 0, 0.], [0., 0., 0., 0, 0.], ]]], device=device, dtype=dtype) input = kornia.gaussian_blur2d(input, (5, 5), (0.5, 0.5)).unsqueeze(0) softargmax = kornia.geometry.ConvQuadInterp3d(10) expected_val = torch.tensor([[[ [[0., 0., 0., 0, 0], [0., 0., 0.0, 0, 0.], [0., 0, 0., 0, 0.], [0., 0., 0, 0, 0.], [0., 0., 0., 0, 0.]], [[2.2504e-04, 2.3146e-02, 1.6808e-01, 2.3188e-02, 2.3628e-04], [2.3146e-02, 1.8118e-01, 7.4338e-01, 1.8955e-01, 2.5413e-02], [1.6807e-01, 7.4227e-01, 1.1086e+01, 8.0414e-01, 1.8482e-01], [2.3146e-02, 1.8118e-01, 7.4338e-01, 1.8955e-01, 2.5413e-02], [2.2504e-04, 2.3146e-02, 1.6808e-01, 2.3188e-02, 2.3628e-04]], [[0., 0., 0., 0, 0], [0., 0., 0.0, 0, 0.], [0., 0, 0., 0, 0.], [0., 0., 0, 0, 0.], [0., 0., 0., 0, 0.]]]]], device=device, dtype=dtype) expected_coord = torch.tensor([[[[[[0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0]], [[1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0]], [[2.0, 2.0, 2.0, 2.0, 2.0], [2.0, 2.0, 2.0, 2.0, 2.0], [2.0, 2.0, 2.0, 2.0, 2.0], [2.0, 2.0, 2.0, 2.0, 2.0], [2.0, 2.0, 2.0, 2.0, 2.0]]], [[[0.0, 1.0, 2.0, 3.0, 4.0], [0.0, 1.0, 2.0, 3.0, 4.0], [0.0, 1.0, 2.0, 3.0, 4.0], [0.0, 1.0, 2.0, 3.0, 4.0], [0.0, 1.0, 2.0, 3.0, 4.0]], [[0.0, 1.0, 2.0, 3.0, 4.0], [0.0, 1.0, 2.0, 3.0, 4.0], [0.0, 1.0, 2.0, 3.0, 4.0], [0.0, 1.0, 2.0, 3.0, 4.0], [0.0, 1.0, 2.0, 3.0, 4.0]], [[0.0, 1.0, 2.0, 3.0, 4.0], [0.0, 1.0, 2.0, 3.0, 4.0], [0.0, 1.0, 2.0, 3.0, 4.0], [0.0, 1.0, 2.0, 3.0, 4.0], [0.0, 1.0, 2.0, 3.0, 4.0]]], [[[0.0, 0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0, 1.0], [2.0, 2.0, 2.0, 2.0, 2.0], [3.0, 3.0, 3.0, 3.0, 3.0], [4.0, 4.0, 4.0, 4.0, 4.0]], [[0.0, 0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0, 1.0], [2.0, 2.0, 2.0495, 2.0, 2.0], [3.0, 3.0, 3.0, 3.0, 3.0], [4.0, 4.0, 4.0, 4.0, 4.0]], [[0.0, 0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0, 1.0], [2.0, 2.0, 2.0, 2.0, 2.0], [3.0, 3.0, 3.0, 3.0, 3.0], [4.0, 4.0, 4.0, 4.0, 4.0]]]]]], device=device, dtype=dtype) coords, val = softargmax(input) assert_allclose(val, expected_val, atol=1e-4, rtol=1e-4) assert_allclose(coords, expected_coord, atol=1e-4, rtol=1e-4)
47.141491
112
0.437234
3,242
24,655
3.243985
0.049969
0.09014
0.110963
0.122849
0.856233
0.831891
0.815632
0.79652
0.768185
0.752781
0
0.126922
0.388035
24,655
522
113
47.231801
0.570122
0.005111
0
0.692308
0
0
0.000326
0
0
0
0
0
0.140659
1
0.079121
false
0
0.017582
0
0.10989
0
0
0
0
null
0
0
0
1
1
1
1
1
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
6
4a981cc07a82519d0f1b3462f59f3c4a95df0ccf
124
py
Python
blog/admin.py
Developer-R-7/CaffeineCode
1a489ef0da669dd6f7e5b1d80a3c6046e2e7b2fe
[ "MIT" ]
1
2022-02-03T18:42:52.000Z
2022-02-03T18:42:52.000Z
blog/admin.py
Developer-R-7/CaffeineCode
1a489ef0da669dd6f7e5b1d80a3c6046e2e7b2fe
[ "MIT" ]
null
null
null
blog/admin.py
Developer-R-7/CaffeineCode
1a489ef0da669dd6f7e5b1d80a3c6046e2e7b2fe
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Category, Post admin.site.register(Post) admin.site.register(Category)
24.8
34
0.822581
18
124
5.666667
0.555556
0.176471
0.254902
0.411765
0
0
0
0
0
0
0
0
0.08871
124
5
35
24.8
0.902655
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
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
1
0
1
0
0
0
0
6
434d66c624b5ccfb4ee901b6c0af7a5db1f24960
86
py
Python
util.py
midasvo/nec-bot
7a73e376675a8b6d616f8b42d8d996586b8af69a
[ "MIT" ]
null
null
null
util.py
midasvo/nec-bot
7a73e376675a8b6d616f8b42d8d996586b8af69a
[ "MIT" ]
null
null
null
util.py
midasvo/nec-bot
7a73e376675a8b6d616f8b42d8d996586b8af69a
[ "MIT" ]
null
null
null
import random def get_random_time(seed): return random.uniform(1.0, 3.0) * seed
14.333333
42
0.709302
15
86
3.933333
0.733333
0
0
0
0
0
0
0
0
0
0
0.056338
0.174419
86
5
43
17.2
0.774648
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
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
1
0
0
1
1
1
0
0
6
436f638b2712ca8b86377a0ff8795a6c643406af
353
py
Python
opennmt/models/__init__.py
mfomicheva/OpenNMT-tf
a367676a16f9e77f76bc58e138e78614eb4add1e
[ "MIT" ]
4
2020-06-21T13:56:27.000Z
2021-05-07T06:03:35.000Z
opennmt/models/__init__.py
mfomicheva/OpenNMT-tf
a367676a16f9e77f76bc58e138e78614eb4add1e
[ "MIT" ]
1
2020-06-22T23:38:33.000Z
2020-06-23T02:06:45.000Z
opennmt/models/__init__.py
mfomicheva/OpenNMT-tf
a367676a16f9e77f76bc58e138e78614eb4add1e
[ "MIT" ]
2
2021-04-15T08:51:30.000Z
2022-03-08T07:44:32.000Z
"""Module defining models.""" from opennmt.models.language_model import LanguageModel from opennmt.models.transformer import Transformer from opennmt.models.sequence_to_sequence import SequenceToSequence, EmbeddingsSharingLevel from opennmt.models.sequence_tagger import SequenceTagger from opennmt.models.sequence_classifier import SequenceClassifier
44.125
90
0.878187
39
353
7.820513
0.461538
0.180328
0.278689
0.245902
0
0
0
0
0
0
0
0
0.070822
353
7
91
50.428571
0.929878
0.065156
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
601e8cdfb6d91f141a28f678f370ba72274c9ac7
3,761
py
Python
custom/intrahealth/tests/reports/test_fiche_consommation_report_v2.py
kkrampa/commcare-hq
d64d7cad98b240325ad669ccc7effb07721b4d44
[ "BSD-3-Clause" ]
1
2020-05-05T13:10:01.000Z
2020-05-05T13:10:01.000Z
custom/intrahealth/tests/reports/test_fiche_consommation_report_v2.py
kkrampa/commcare-hq
d64d7cad98b240325ad669ccc7effb07721b4d44
[ "BSD-3-Clause" ]
1
2019-12-09T14:00:14.000Z
2019-12-09T14:00:14.000Z
custom/intrahealth/tests/reports/test_fiche_consommation_report_v2.py
MaciejChoromanski/commcare-hq
fd7f65362d56d73b75a2c20d2afeabbc70876867
[ "BSD-3-Clause" ]
5
2015-11-30T13:12:45.000Z
2019-07-01T19:27:07.000Z
# coding=utf-8 from __future__ import absolute_import from __future__ import unicode_literals import datetime from mock.mock import MagicMock from custom.intrahealth.tests.utils import YeksiTestCase from custom.intrahealth.reports import FicheConsommationReport2 from dimagi.utils.dates import DateSpan class TestFicheConsommationReport2(YeksiTestCase): def test_fiche_consommation_report(self): mock = MagicMock() mock.couch_user = self.user mock.GET = { 'startdate': '2014-06-01', 'enddate': '2014-07-31', 'location_id': '1991b4dfe166335e342f28134b85fcac', } mock.datespan = DateSpan(datetime.datetime(2014, 6, 1), datetime.datetime(2014, 7, 31)) fiche_consommation_report2_report = FicheConsommationReport2(request=mock, domain='test-pna') fiche_consommation_report = fiche_consommation_report2_report.report_context['reports'][0]['report_table'] headers = fiche_consommation_report['headers'].as_export_table[0] rows = fiche_consommation_report['rows'] self.assertEqual( headers, ['', 'CU', ' ', ' ', 'DIU', ' ', ' ', 'Depo-Provera', ' ', ' ', 'Jadelle', ' ', ' ', 'Microgynon/Lof.', ' ', ' ', 'Microlut/Ovrette', ' ', ' ', 'Preservatif Feminin', ' ', ' ', 'Preservatif Masculin', ' ', ' '] ) self.assertEqual( rows, [['LERANE COLY', 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0]] ) def test_fiche_consommation_report_countrywide(self): mock = MagicMock() mock.couch_user = self.user mock.GET = { 'startdate': '2014-06-01', 'enddate': '2014-07-31', 'location_id': '', } mock.datespan = DateSpan(datetime.datetime(2014, 6, 1), datetime.datetime(2014, 7, 31)) fiche_consommation_report2_report = FicheConsommationReport2(request=mock, domain='test-pna') fiche_consommation_report = fiche_consommation_report2_report.report_context['reports'][0]['report_table'] headers = fiche_consommation_report['headers'].as_export_table[0] rows = fiche_consommation_report['rows'] self.assertEqual( headers, ['', 'CU', ' ', ' ', 'Collier', ' ', ' ', 'DIU', ' ', ' ', 'Depo-Provera', ' ', ' ', 'Jadelle', ' ', ' ', 'Microgynon/Lof.', ' ', ' ', 'Microlut/Ovrette', ' ', ' ', 'Preservatif Feminin', ' ', ' ', 'Preservatif Masculin', ' ', ' '] ) self.assertEqual( rows, [ ['DEBI TIQUET', 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0], ['DIOGO', 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0], ['LERANE COLY', 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0], ['NDIAWAR RICHARD TOLL', 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0], ['NIANGUE DIAW', 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0], ['PS CAMP MILITAIRE', 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0], ['PS DIOKOUL WAGUE', 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0], ['PS NGOR', 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0], ['PS PLLES ASS. UNITE 12', 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0] ] )
46.432099
114
0.504653
525
3,761
3.514286
0.175238
0.092141
0.138211
0.162602
0.762602
0.719241
0.719241
0.719241
0.719241
0.719241
0
0.139652
0.312683
3,761
80
115
47.0125
0.574081
0.003191
0
0.470588
0
0
0.150254
0.00854
0
0
0
0
0.058824
1
0.029412
false
0
0.102941
0
0.147059
0
0
0
0
null
0
0
1
0
1
1
1
1
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
6
60547cc67cd7474bffa6836260e8ca26c0c87936
15,104
py
Python
tests/python/unit/test_timeseries_preparation.py
dataiku/dss-plugin-timeseries-preparation
bdb662c909a0ad6d7845325a70e3dac2bdcc6b28
[ "Apache-2.0" ]
2
2021-03-12T10:48:20.000Z
2021-04-23T09:37:18.000Z
tests/python/unit/test_timeseries_preparation.py
dataiku/dss-plugin-timeseries-preparation
bdb662c909a0ad6d7845325a70e3dac2bdcc6b28
[ "Apache-2.0" ]
27
2020-07-22T15:49:25.000Z
2021-06-18T09:40:48.000Z
tests/python/unit/test_timeseries_preparation.py
dataiku/dss-plugin-timeseries-preparation
bdb662c909a0ad6d7845325a70e3dac2bdcc6b28
[ "Apache-2.0" ]
1
2021-06-01T12:49:53.000Z
2021-06-01T12:49:53.000Z
import sys import numpy as np import pandas as pd import pytest if sys.version_info >= (3, 0): from dku_config.stl_config import DecompositionConfig from timeseries_preparation.preparation import TimeseriesPreparator @pytest.fixture def time_column_name(): return "date" @pytest.fixture def timeseries_identifiers_names(): return ["id"] @pytest.fixture def basic_config(time_column_name): config = {"transformation_type": "seasonal_decomposition", "time_decomposition_method": "STL", "frequency_unit": "M", "season_length_M": 12, "time_column": time_column_name, "target_columns": ["target"], "long_format": False, "decomposition_model": "multiplicative", "expert": False} return config @pytest.fixture def dku_config(basic_config,time_column_name): dku_config = DecompositionConfig() dku_config.add_parameters(basic_config, [time_column_name, "target", 'value1']) return dku_config @pytest.mark.skipif(sys.version_info < (3, 0), reason="requires Python3") class TestTimeseriesPreparation: def test_duplicate_dates(self, time_column_name, timeseries_identifiers_names, basic_config): df = pd.DataFrame( { "date": [ "2021-01-01 12:12:00", "2021-01-01 17:35:00", "2021-01-02 14:55:00", ], "id": [1, 1, 1], "target": [1, 2, 3] } ) dku_config = DecompositionConfig() basic_config["frequency"] = "D" dku_config.add_parameters(basic_config, list(df.columns)) df[time_column_name] = pd.to_datetime(df[time_column_name]).dt.tz_localize(tz=None) preparator = TimeseriesPreparator(dku_config) with pytest.raises(ValueError): _ = preparator._truncate_dates(df) def test_minutes_truncation(self, time_column_name, basic_config): df = pd.DataFrame( { "date": [ "2021-01-01 12:17:42", "2021-01-01 12:30:00", "2021-01-01 12:46:00", ], "id": [1, 1, 1], "target": [1, 2, 3] } ) dku_config = DecompositionConfig() basic_config["frequency_step_minutes"] = "15" basic_config["frequency_unit"] = "min" basic_config["season_length_min"] = 4 dku_config.add_parameters(basic_config, list(df.columns)) df[time_column_name] = pd.to_datetime(df[time_column_name]).dt.tz_localize(tz=None) preparator = TimeseriesPreparator(dku_config) dataframe_prepared = preparator._truncate_dates(df) dataframe_prepared = preparator._sort(dataframe_prepared) preparator._check_regular_frequency(dataframe_prepared) assert dataframe_prepared[time_column_name][0] == pd.Timestamp("2021-01-01 12:15:00") assert dataframe_prepared[time_column_name][2] == pd.Timestamp("2021-01-01 12:45:00") def test_hour_truncation(self, time_column_name, timeseries_identifiers_names, basic_config): df = pd.DataFrame( { "date": [ "2020-01-07 12:12:00", "2020-01-07 17:35:00", "2020-01-07 14:55:00", "2020-01-07 18:06:00", "2020-01-08 04:40:00", "2020-01-08 06:13:00", "2020-01-08 03:23:00", ], "id": [1, 1, 1, 1, 2, 2, 2], "target": [1, 2, 3, 4, 5, 6, 7] } ) df[time_column_name] = pd.to_datetime(df[time_column_name]).dt.tz_localize(tz=None) dku_config = DecompositionConfig() basic_config["frequency_step_hours"] = "2" basic_config["frequency_unit"] = "H" basic_config["season_length_H"] = 12 basic_config["long_format"] = True basic_config["timeseries_identifiers"] = timeseries_identifiers_names dku_config.add_parameters(basic_config, list(df.columns)) preparator = TimeseriesPreparator(dku_config, max_timeseries_length=2) dataframe_prepared = preparator._truncate_dates(df) dataframe_prepared = preparator._sort(dataframe_prepared) preparator._check_regular_frequency(dataframe_prepared) dataframe_prepared = preparator._keep_last_dates(dataframe_prepared) assert dataframe_prepared[time_column_name][0] == pd.Timestamp("2020-01-07 16:00:00") assert dataframe_prepared[time_column_name][3] == pd.Timestamp("2020-01-08 06:00:00") def test_day_truncation(self, time_column_name, timeseries_identifiers_names, basic_config): df = pd.DataFrame( { "date": [ "2021-01-01 12:17:42", "2021-01-02 00:00:00", "2021-01-03 12:46:00", ], "id": [1, 1, 1], "target": [1, 2, 3] } ) dku_config = DecompositionConfig() basic_config["frequency_unit"] = "D" basic_config["season_length_D"] = 12 basic_config["long_format"] = True basic_config["timeseries_identifiers"] = timeseries_identifiers_names dku_config.add_parameters(basic_config, list(df.columns)) preparator = TimeseriesPreparator(dku_config) df[time_column_name] = pd.to_datetime(df[time_column_name]).dt.tz_localize(tz=None) dataframe_prepared = preparator._truncate_dates(df) dataframe_prepared = preparator._sort(dataframe_prepared) preparator._check_regular_frequency(dataframe_prepared) assert dataframe_prepared[time_column_name][0] == pd.Timestamp("2021-01-01") assert dataframe_prepared[time_column_name][2] == pd.Timestamp("2021-01-03") def test_business_day_truncation(self, time_column_name, timeseries_identifiers_names, basic_config): df = pd.DataFrame( { "date": [ "2021-01-04 12:17:42", "2021-01-05 00:00:00", "2021-01-06 12:46:00", ], "id": [1, 1, 1], "target": [1, 2, 3] } ) dku_config = DecompositionConfig() basic_config["frequency_unit"] = "B" basic_config["season_length_B"] = 5 basic_config["long_format"] = True basic_config["timeseries_identifiers"] = timeseries_identifiers_names dku_config.add_parameters(basic_config, list(df.columns)) preparator = TimeseriesPreparator(dku_config) df[time_column_name] = pd.to_datetime(df[time_column_name]).dt.tz_localize(tz=None) dataframe_prepared = preparator._truncate_dates(df) dataframe_prepared = preparator._sort(dataframe_prepared) preparator._check_regular_frequency(dataframe_prepared) assert dataframe_prepared[time_column_name][0] == pd.Timestamp("2021-01-04") assert dataframe_prepared[time_column_name][2] == pd.Timestamp("2021-01-06") def test_week_sunday_truncation(self, time_column_name, timeseries_identifiers_names, basic_config): df = pd.DataFrame( { "date": [ "2021-01-03 12:12:00", "2021-01-05 17:35:00", "2021-01-15 14:55:00", ], "id": [1, 1, 1], "target": [1, 2, 3] } ) dku_config = DecompositionConfig() basic_config["frequency_unit"] = "W" basic_config["frequency_end_of_week"] = "SUN" basic_config["season_length_W"] = 7 basic_config["long_format"] = True basic_config["timeseries_identifiers"] = timeseries_identifiers_names dku_config.add_parameters(basic_config, list(df.columns)) preparator = TimeseriesPreparator(dku_config, max_timeseries_length=2) df[time_column_name] = pd.to_datetime(df[time_column_name]).dt.tz_localize(tz=None) dataframe_prepared = preparator._truncate_dates(df) dataframe_prepared = preparator._sort(dataframe_prepared) preparator._check_regular_frequency(dataframe_prepared) dataframe_prepared = preparator._keep_last_dates(dataframe_prepared) assert dataframe_prepared[time_column_name][0] == pd.Timestamp("2021-01-10") assert dataframe_prepared[time_column_name][1] == pd.Timestamp("2021-01-17") def test_quarter_truncation(self, time_column_name, timeseries_identifiers_names, basic_config): df = pd.DataFrame( { "date": [ "2020-12-15", "2021-03-28", "2021-06-11", ], "id": [1, 1, 1], "target": [1, 2, 3] } ) dku_config = DecompositionConfig() basic_config["frequency_unit"] = "3M" basic_config["season_length_3M"] = 4 basic_config["long_format"] = True basic_config["timeseries_identifiers"] = timeseries_identifiers_names dku_config.add_parameters(basic_config, list(df.columns)) preparator = TimeseriesPreparator(dku_config) df[time_column_name] = pd.to_datetime(df[time_column_name]).dt.tz_localize(tz=None) dataframe_prepared = preparator._truncate_dates(df) dataframe_prepared = preparator._sort(dataframe_prepared) preparator._check_regular_frequency(dataframe_prepared) assert dataframe_prepared[time_column_name][0] == pd.Timestamp("2020-12-31") assert dataframe_prepared[time_column_name][2] == pd.Timestamp("2021-06-30") def test_semester_truncation(self, time_column_name, timeseries_identifiers_names, basic_config): df = pd.DataFrame( { "date": [ "2020-12-15", "2021-06-28", "2021-12-01", ], "id": [1, 1, 1], "target": [1, 2, 3] } ) dku_config = DecompositionConfig() basic_config["frequency_unit"] = "6M" basic_config["long_format"] = True basic_config["season_length_6M"] = 2 basic_config["timeseries_identifiers"] = timeseries_identifiers_names dku_config.add_parameters(basic_config, list(df.columns)) preparator = TimeseriesPreparator(dku_config) df[time_column_name] = pd.to_datetime(df[time_column_name]).dt.tz_localize(tz=None) dataframe_prepared = preparator._truncate_dates(df) dataframe_prepared = preparator._sort(dataframe_prepared) preparator._check_regular_frequency(dataframe_prepared) assert dataframe_prepared[time_column_name][0] == pd.Timestamp("2020-12-31") assert dataframe_prepared[time_column_name][1] == pd.Timestamp("2021-06-30") assert dataframe_prepared[time_column_name][2] == pd.Timestamp("2021-12-31") def test_year_truncation(self, time_column_name, timeseries_identifiers_names, basic_config): df = pd.DataFrame( { "date": [ "2020-12-31", "2021-12-15", "2022-12-01", ], "id": [1, 1, 1], "target": [1, 2, 3] } ) dku_config = DecompositionConfig() basic_config["frequency_unit"] = "12M" basic_config["season_length_12M"] = 4 basic_config["long_format"] = True basic_config["timeseries_identifiers"] = timeseries_identifiers_names basic_config["season_length_12M"] = 4 dku_config.add_parameters(basic_config, list(df.columns)) preparator = TimeseriesPreparator(dku_config) df[time_column_name] = pd.to_datetime(df[time_column_name]).dt.tz_localize(tz=None) dataframe_prepared = preparator._truncate_dates(df) dataframe_prepared = preparator._sort(dataframe_prepared) preparator._check_regular_frequency(dataframe_prepared) assert dataframe_prepared[time_column_name][0] == pd.Timestamp("2020-12-31") assert dataframe_prepared[time_column_name][1] == pd.Timestamp("2021-12-31") assert dataframe_prepared[time_column_name][2] == pd.Timestamp("2022-12-31") def test_target_column_preparation(self, time_column_name, timeseries_identifiers_names, basic_config): df = pd.DataFrame( { "date": [ "2020-12-31", "2021-12-15", "2022-12-01", ], "id": [1, 1, 1], "target": [1, 2, 3], "invalid_target": ["a", "b", "c"], "missing_target": [1, np.nan, 2], "unformatted_target": ["1", "2", "3"] } ) dku_config = DecompositionConfig() basic_config["target_columns"] = ["target"] basic_config["frequency_unit"] = "12M" basic_config["season_length_12M"] = 4 dku_config.add_parameters(basic_config, list(df.columns)) preparator = TimeseriesPreparator(dku_config) df_prepared = preparator.prepare_timeseries_dataframe(df) assert df_prepared.loc[0, "target"] == 1 dku_config = DecompositionConfig() basic_config["target_columns"] = ["unformatted_target"] basic_config["frequency_unit"] = "12M" basic_config["season_length_12M"] = 4 dku_config.add_parameters(basic_config, list(df.columns)) preparator = TimeseriesPreparator(dku_config) df_prepared_unformatted = preparator.prepare_timeseries_dataframe(df) assert df_prepared_unformatted.loc[0, "unformatted_target"] == 1 dku_config = DecompositionConfig() basic_config["target_columns"] = ["invalid_target"] basic_config["frequency_unit"] = "12M" basic_config["season_length_12M"] = 4 dku_config.add_parameters(basic_config, list(df.columns)) preparator = TimeseriesPreparator(dku_config) with pytest.raises(ValueError) as err: _ = preparator.prepare_timeseries_dataframe(df) assert "must be numeric" in str(err.value) dku_config = DecompositionConfig() basic_config["target_columns"] = ["missing_target"] basic_config["frequency_unit"] = "12M" basic_config["season_length_12M"] = 4 dku_config.add_parameters(basic_config, list(df.columns)) preparator = TimeseriesPreparator(dku_config) with pytest.raises(ValueError) as err: _ = preparator.prepare_timeseries_dataframe(df) assert "missing value" in str(err.value) def test_empty_input_dataset(self, dku_config, time_column_name): empty_df = pd.DataFrame(columns=["value1", "target", time_column_name]) timeseries_preparator = TimeseriesPreparator(dku_config) with pytest.raises(ValueError) as err: _ = timeseries_preparator.prepare_timeseries_dataframe(empty_df) assert "empty" in str(err.value)
44.163743
122
0.620299
1,708
15,104
5.169204
0.09719
0.09095
0.084041
0.03262
0.81221
0.786726
0.782308
0.759882
0.744705
0.725903
0
0.065186
0.266684
15,104
341
123
44.293255
0.731943
0
0
0.545161
0
0
0.1346
0.016155
0
0
0
0
0.074194
1
0.048387
false
0
0.019355
0.006452
0.083871
0
0
0
0
null
0
0
0
1
1
1
1
1
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
6
606b0de794fee90fcd4b1e167240168ef0ca2868
7,386
py
Python
datasets/datasets.py
wjun0830/Out-of-Distribution-Baseline
33ffc8c719dcd1705fca1f53cce977e9d18b56bb
[ "MIT" ]
null
null
null
datasets/datasets.py
wjun0830/Out-of-Distribution-Baseline
33ffc8c719dcd1705fca1f53cce977e9d18b56bb
[ "MIT" ]
null
null
null
datasets/datasets.py
wjun0830/Out-of-Distribution-Baseline
33ffc8c719dcd1705fca1f53cce977e9d18b56bb
[ "MIT" ]
1
2021-12-08T02:38:17.000Z
2021-12-08T02:38:17.000Z
import os import torch import torchvision from torch.utils.data import DataLoader from torchvision.datasets import ImageFolder from torch.nn import functional as F import torchvision.transforms as transforms from torchvision.datasets import MNIST, KMNIST # import transform_layers as TL import numpy as np from PIL import Image # from fft_utils import mkdir_if_missing class MNISTRGB(MNIST): """MNIST Dataset. """ def __getitem__(self, index): img, target = self.data[index], int(self.targets[index]) img = Image.fromarray(img.numpy(), mode='L') img = img.convert("RGB") if self.transform is not None: img = self.transform(img) if self.target_transform is not None: target = self.target_transform(target) return img, target class KMNISTRGB(KMNIST): """KMNIST Dataset. """ def __getitem__(self, index): img, target = self.data[index], int(self.targets[index]) img = Image.fromarray(img.numpy(), mode='L') img = img.convert("RGB") if self.transform is not None: img = self.transform(img) if self.target_transform is not None: target = self.target_transform(target) return img, target class MNIST(object): def __init__(self, **options): transform = transforms.Compose([ transforms.Resize(32), transforms.ToTensor(), ]) batch_size = options['batch_size'] data_root = os.path.join(options['dataroot'], 'mnist') pin_memory = True if options['use_gpu'] else False trainset = MNISTRGB(root=data_root, train=True, download=True, transform=transform) trainloader = torch.utils.data.DataLoader( trainset, batch_size=batch_size, shuffle=True, num_workers=options['workers'], pin_memory=pin_memory, ) testset = MNISTRGB(root=data_root, train=False, download=True, transform=transform) testloader = torch.utils.data.DataLoader( testset, batch_size=batch_size, shuffle=False, num_workers=options['workers'], pin_memory=pin_memory, ) self.trainloader = trainloader self.testloader = testloader self.num_classes = 10 class KMNIST(object): def __init__(self, **options): transform = transforms.Compose([ transforms.Resize(32), transforms.ToTensor(), ]) batch_size = options['batch_size'] data_root = os.path.join(options['dataroot'], 'kmnist') pin_memory = True if options['use_gpu'] else False trainset = KMNISTRGB(root=data_root, train=True, download=True, transform=transform) trainloader = torch.utils.data.DataLoader( trainset, batch_size=batch_size, shuffle=True, num_workers=options['workers'], pin_memory=pin_memory, ) testset = KMNISTRGB(root=data_root, train=False, download=True, transform=transform) testloader = torch.utils.data.DataLoader( testset, batch_size=batch_size, shuffle=False, num_workers=options['workers'], pin_memory=pin_memory, ) self.trainloader = trainloader self.testloader = testloader self.num_classes = 10 class CIFAR10(object): def __init__(self, **options): transform_train = transforms.Compose([ transforms.RandomCrop(32, padding=4), transforms.RandomHorizontalFlip(), transforms.ToTensor(), # TL.Shifting() ]) transform = transforms.Compose([ transforms.ToTensor(), ]) batch_size = options['batch_size'] data_root = os.path.join(options['dataroot'], 'cifar10') pin_memory = True if options['use_gpu'] else False trainset = torchvision.datasets.CIFAR10(root=data_root, train=True, download=True, transform=transform_train) trainloader = torch.utils.data.DataLoader( trainset, batch_size=batch_size, shuffle=True, num_workers=options['workers'], pin_memory=pin_memory, ) testset = torchvision.datasets.CIFAR10(root=data_root, train=False, download=True, transform=transform) testloader = torch.utils.data.DataLoader( testset, batch_size=batch_size, shuffle=False, num_workers=options['workers'], pin_memory=pin_memory, ) self.num_classes = 10 self.trainloader = trainloader self.testloader = testloader class CIFAR100(object): def __init__(self, **options): transform_train = transforms.Compose([ transforms.RandomCrop(32, padding=4), transforms.RandomHorizontalFlip(), transforms.ToTensor(), ]) transform = transforms.Compose([ transforms.ToTensor(), ]) batch_size = options['batch_size'] data_root = os.path.join(options['dataroot'], 'cifar100') pin_memory = True if options['use_gpu'] else False trainset = torchvision.datasets.CIFAR100(root=data_root, train=True, download=True, transform=transform_train) trainloader = torch.utils.data.DataLoader( trainset, batch_size=batch_size, shuffle=True, num_workers=options['workers'], pin_memory=pin_memory, ) testset = torchvision.datasets.CIFAR100(root=data_root, train=False, download=True, transform=transform) testloader = torch.utils.data.DataLoader( testset, batch_size=batch_size, shuffle=False, num_workers=options['workers'], pin_memory=pin_memory, ) self.num_classes = 100 self.trainloader = trainloader self.testloader = testloader class SVHN(object): def __init__(self, **options): transform_train = transforms.Compose([ transforms.RandomCrop(32, padding=4), transforms.RandomHorizontalFlip(), transforms.ToTensor(), ]) transform = transforms.Compose([ transforms.ToTensor(), ]) batch_size = options['batch_size'] data_root = os.path.join(options['dataroot'], 'svhn') pin_memory = True if options['use_gpu'] else False trainset = torchvision.datasets.SVHN(root=data_root, split='train', download=True, transform=transform_train) trainloader = torch.utils.data.DataLoader( trainset, batch_size=batch_size, shuffle=True, num_workers=options['workers'], pin_memory=pin_memory, ) testset = torchvision.datasets.SVHN(root=data_root, split='test', download=True, transform=transform) testloader = torch.utils.data.DataLoader( testset, batch_size=batch_size, shuffle=False, num_workers=options['workers'], pin_memory=pin_memory, ) self.num_classes = 10 self.trainloader = trainloader self.testloader = testloader __factory = { 'mnist': MNIST, 'kmnist': KMNIST, 'cifar10': CIFAR10, 'cifar100': CIFAR100, 'svhn':SVHN, } def create(name, **options): if name not in __factory.keys(): raise KeyError("Unknown dataset: {}".format(name)) return __factory[name](**options)
32.826667
118
0.630923
786
7,386
5.753181
0.127226
0.059708
0.034056
0.066342
0.86621
0.858691
0.858691
0.8295
0.8295
0.8295
0
0.009925
0.263336
7,386
225
119
32.826667
0.821173
0.016789
0
0.668712
0
0
0.040138
0
0
0
0
0
0
1
0.04908
false
0
0.06135
0
0.171779
0
0
0
0
null
0
0
0
1
1
1
1
1
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
6
607154e37f1a0a0e95a307253f2e7dc3c332fc20
3,521
py
Python
tests/integration/test_distributed_format/test.py
mikhno-s/ClickHouse
83e95cd0120da00a60506fcf2f4d23d908c45977
[ "Apache-2.0" ]
2
2021-03-25T06:53:00.000Z
2021-04-29T07:32:51.000Z
tests/integration/test_distributed_format/test.py
mikhno-s/ClickHouse
83e95cd0120da00a60506fcf2f4d23d908c45977
[ "Apache-2.0" ]
1
2020-03-26T01:50:51.000Z
2020-03-26T01:50:51.000Z
tests/integration/test_distributed_format/test.py
mikhno-s/ClickHouse
83e95cd0120da00a60506fcf2f4d23d908c45977
[ "Apache-2.0" ]
null
null
null
import pytest from helpers.cluster import ClickHouseCluster cluster = ClickHouseCluster(__file__) node = cluster.add_instance('node', main_configs=['configs/remote_servers.xml']) cluster_param = pytest.mark.parametrize("cluster", [ ('test_cluster'), ('test_cluster_2'), ]) @pytest.fixture(scope="module") def started_cluster(): try: cluster.start() node.query("create database test") yield cluster finally: cluster.shutdown() @cluster_param def test_single_file(started_cluster, cluster): node.query( "create table test.distr_1 (x UInt64, s String) engine = Distributed('{}', database, table)".format(cluster)) node.query("insert into test.distr_1 values (1, 'a'), (2, 'bb'), (3, 'ccc')", settings={"use_compact_format_in_distributed_parts_names": "1"}) query = "select * from file('/var/lib/clickhouse/data/test/distr_1/shard1_replica1/1.bin', 'Distributed')" out = node.exec_in_container(['/usr/bin/clickhouse', 'local', '--stacktrace', '-q', query]) assert out == '1\ta\n2\tbb\n3\tccc\n' query = "create table t (x UInt64, s String) engine = File('Distributed', '/var/lib/clickhouse/data/test/distr_1/shard1_replica1/1.bin');" \ "select * from t" out = node.exec_in_container(['/usr/bin/clickhouse', 'local', '--stacktrace', '-q', query]) assert out == '1\ta\n2\tbb\n3\tccc\n' node.query("drop table test.distr_1") @cluster_param def test_two_files(started_cluster, cluster): node.query( "create table test.distr_2 (x UInt64, s String) engine = Distributed('{}', database, table)".format(cluster)) node.query("insert into test.distr_2 values (0, '_'), (1, 'a')", settings={"use_compact_format_in_distributed_parts_names": "1"}) node.query("insert into test.distr_2 values (2, 'bb'), (3, 'ccc')", settings={"use_compact_format_in_distributed_parts_names": "1"}) query = "select * from file('/var/lib/clickhouse/data/test/distr_2/shard1_replica1/{1,2,3,4}.bin', 'Distributed') order by x" out = node.exec_in_container(['/usr/bin/clickhouse', 'local', '--stacktrace', '-q', query]) assert out == '0\t_\n1\ta\n2\tbb\n3\tccc\n' query = "create table t (x UInt64, s String) engine = File('Distributed', '/var/lib/clickhouse/data/test/distr_2/shard1_replica1/{1,2,3,4}.bin');" \ "select * from t order by x" out = node.exec_in_container(['/usr/bin/clickhouse', 'local', '--stacktrace', '-q', query]) assert out == '0\t_\n1\ta\n2\tbb\n3\tccc\n' node.query("drop table test.distr_2") @cluster_param def test_single_file_old(started_cluster, cluster): node.query( "create table test.distr_3 (x UInt64, s String) engine = Distributed('{}', database, table)".format(cluster)) node.query("insert into test.distr_3 values (1, 'a'), (2, 'bb'), (3, 'ccc')") query = "select * from file('/var/lib/clickhouse/data/test/distr_3/default@not_existing:9000/1.bin', 'Distributed')" out = node.exec_in_container(['/usr/bin/clickhouse', 'local', '--stacktrace', '-q', query]) assert out == '1\ta\n2\tbb\n3\tccc\n' query = "create table t (x UInt64, s String) engine = File('Distributed', '/var/lib/clickhouse/data/test/distr_3/default@not_existing:9000/1.bin');" \ "select * from t" out = node.exec_in_container(['/usr/bin/clickhouse', 'local', '--stacktrace', '-q', query]) assert out == '1\ta\n2\tbb\n3\tccc\n' node.query("drop table test.distr_3")
40.471264
154
0.658336
499
3,521
4.48497
0.186373
0.064343
0.042895
0.037534
0.828418
0.828418
0.802502
0.792225
0.773458
0.684987
0
0.030529
0.162738
3,521
86
155
40.94186
0.72863
0
0
0.389831
0
0.135593
0.549844
0.205907
0
0
0
0
0.101695
1
0.067797
false
0
0.033898
0
0.101695
0
0
0
0
null
0
0
0
1
1
1
1
1
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
6
60744146a7c4403f2b2a8eee0e9a0e56d2b12f25
26,503
py
Python
test/recon/test_utils.py
DobromirM/swim-system-python
a5b4f05457f1eb2739a920c42dfc721c83a1226a
[ "Apache-2.0" ]
8
2019-11-11T19:38:59.000Z
2022-01-06T11:13:04.000Z
test/recon/test_utils.py
swimos/swim-system-python
727c09b6e7300b063e320364373ff724d9b8af90
[ "Apache-2.0" ]
40
2019-10-29T10:35:49.000Z
2021-05-14T22:18:35.000Z
test/recon/test_utils.py
DobromirM/swim-system-python
a5b4f05457f1eb2739a920c42dfc721c83a1226a
[ "Apache-2.0" ]
3
2020-01-31T18:28:58.000Z
2021-08-25T08:53:13.000Z
# Copyright 2015-2021 SWIM.AI inc. # # 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 unittest from swimai.recon._parsers import _ReconUtils, _OutputMessage, _InputMessage from test.utils import CustomString class TestUtils(unittest.TestCase): def test_is_valid_ident_start_char_A(self): # Given character = 'A' # When actual = _ReconUtils._is_ident_start_char(character) # Then self.assertTrue(actual) def test_is_valid_ident_start_char_Z(self): # Given character = 'Z' # When actual = _ReconUtils._is_ident_start_char(character) # Then self.assertTrue(actual) def test_is_valid_ident_start_char_P(self): # Given character = 'P' # When actual = _ReconUtils._is_ident_start_char(character) # Then self.assertTrue(actual) def test_is_valid_ident_start_char_a(self): # Given character = 'a' # When actual = _ReconUtils._is_ident_start_char(character) # Then self.assertTrue(actual) def test_is_valid_ident_start_char_z(self): # Given character = 'z' # When actual = _ReconUtils._is_ident_start_char(character) # Then self.assertTrue(actual) def test_is_valid_ident_start_char_h(self): # Given character = 'h' # When actual = _ReconUtils._is_ident_start_char(character) # Then self.assertTrue(actual) def test_is_valid_ident_start_char_underscore(self): # Given character = '_' # When actual = _ReconUtils._is_ident_start_char(character) # Then self.assertTrue(actual) def test_is_invalid_ident_start_char_digit(self): # Given character = '4' # When actual = _ReconUtils._is_ident_start_char(character) # Then self.assertFalse(actual) def test_is_invalid_ident_start_char_hyphen(self): # Given character = '-' # When actual = _ReconUtils._is_ident_start_char(character) # Then self.assertFalse(actual) def test_is_invalid_ident_start_char_dollar(self): # Given character = '$' # When actual = _ReconUtils._is_ident_start_char(character) # Then self.assertFalse(actual) def test_is_invalid_ident_start_char_empty(self): # Given character = '' # When actual = _ReconUtils._is_ident_start_char(character) # Then self.assertFalse(actual) def test_is_valid_ident_char_A(self): # Given character = 'A' # When actual = _ReconUtils._is_ident_char(character) # Then self.assertTrue(actual) def test_is_valid_ident_char_Z(self): # Given character = 'Z' # When actual = _ReconUtils._is_ident_char(character) # Then self.assertTrue(actual) def test_is_valid_ident_char_N(self): # Given character = 'N' # When actual = _ReconUtils._is_ident_char(character) # Then self.assertTrue(actual) def test_is_valid_ident_char_a(self): # Given character = 'a' # When actual = _ReconUtils._is_ident_char(character) # Then self.assertTrue(actual) def test_is_valid_ident_char_z(self): # Given character = 'z' # When actual = _ReconUtils._is_ident_char(character) # Then self.assertTrue(actual) def test_is_valid_ident_char_g(self): # Given character = 'g' # When actual = _ReconUtils._is_ident_char(character) # Then self.assertTrue(actual) def test_is_valid_ident_char_underscore(self): # Given character = '_' # When actual = _ReconUtils._is_ident_char(character) # Then self.assertTrue(actual) def test_is_valid_ident_char_hyphen(self): # Given character = '-' # When actual = _ReconUtils._is_ident_char(character) # Then self.assertTrue(actual) def test_is_valid_ident_char_0(self): # Given character = '0' # When actual = _ReconUtils._is_ident_char(character) # Then self.assertTrue(actual) def test_is_valid_ident_char_9(self): # Given character = '9' # When actual = _ReconUtils._is_ident_char(character) # Then self.assertTrue(actual) def test_is_valid_ident_char_5(self): # Given character = '5' # When actual = _ReconUtils._is_ident_char(character) # Then self.assertTrue(actual) def test_is_invalid_ident_char_dollar(self): # Given character = '$' # When actual = _ReconUtils._is_ident_char(character) # Then self.assertFalse(actual) def test_is_invalid_ident_char_empty(self): # Given character = '' # When actual = _ReconUtils._is_ident_char(character) # Then self.assertFalse(actual) def test_is_valid_ident(self): # Given value = 'test1' # When actual = _ReconUtils._is_ident(value) # Then self.assertTrue(actual) def test_is_invalid_ident_empty(self): # Given value = '' # When actual = _ReconUtils._is_ident(value) # Then self.assertFalse(actual) def test_is_invalid_ident_invalid_start_char(self): # Given value = '1test' # When actual = _ReconUtils._is_ident(value) # Then self.assertFalse(actual) def test_is_invalid_ident_invalid_middle_char(self): # Given value = 'test$test' # When actual = _ReconUtils._is_ident(value) # Then self.assertFalse(actual) def test_is_invalid_ident_invalid_end_char(self): # Given value = 'test$' # When actual = _ReconUtils._is_ident(value) # Then self.assertFalse(actual) def test_is_invalid_ident_invalid_all_chars(self): # Given value = '^%&*' # When actual = _ReconUtils._is_ident(value) # Then self.assertFalse(actual) def test_is_valid_space_char_space(self): # Given character = ' ' # When actual = _ReconUtils._is_space(character) # Then self.assertTrue(actual) def test_is_valid_space_char_tab(self): # Given character = '\t' # When actual = _ReconUtils._is_space(character) # Then self.assertTrue(actual) def test_is_invalid_space_char_digit(self): # Given character = '5' # When actual = _ReconUtils._is_space(character) # Then self.assertFalse(actual) def test_is_invalid_space_char_letter(self): # Given character = 'l' # When actual = _ReconUtils._is_space(character) # Then self.assertFalse(actual) def test_is_invalid_space_char_empty(self): # Given character = '' # When actual = _ReconUtils._is_space(character) # Then self.assertFalse(actual) def test_is_valid_digit_char_1(self): # Given character = '2' # When actual = _ReconUtils._is_digit(character) # Then self.assertTrue(actual) def test_is_valid_digit_char_0(self): # Given character = '0' # When actual = _ReconUtils._is_digit(character) # Then self.assertTrue(actual) def test_is_valid_digit_char_7(self): # Given character = '7' # When actual = _ReconUtils._is_digit(character) # Then self.assertTrue(actual) def test_is_valid_digit_char_9(self): # Given character = '9' # When actual = _ReconUtils._is_digit(character) # Then self.assertTrue(actual) def test_is_invalid_digit_char_letter(self): # Given character = 'b' # When actual = _ReconUtils._is_digit(character) # Then self.assertFalse(actual) def test_is_invalid_digit_char_underscore(self): # Given character = '_' # When actual = _ReconUtils._is_digit(character) # Then self.assertFalse(actual) def test_is_invalid_digit_char_empty(self): # Given character = '' # When actual = _ReconUtils._is_digit(character) # Then self.assertFalse(actual) def test_to_ord_str(self): # Given character = 'p' # When actual = _ReconUtils._to_ord(character) # Then self.assertEqual(112, actual) def test_to_ord_int(self): # Given character = 3 # When actual = _ReconUtils._to_ord(character) # Then self.assertEqual(3, actual) def test_to_ord_other(self): # Given character = 3.12 # When actual = _ReconUtils._to_ord(character) # Then self.assertEqual(None, actual) def test_output_message_create_empty(self): # Given chars = None # When actual = _OutputMessage._create(chars) # Then self.assertIsInstance(actual, _OutputMessage) self.assertEqual('', actual._value) self.assertEqual(0, actual._size) self.assertEqual('', actual._last_char) def test_output_message_create_single(self): # Given chars = 'p' # When actual = _OutputMessage._create(chars) # Then self.assertIsInstance(actual, _OutputMessage) self.assertEqual('p', actual._value) self.assertEqual(1, actual._size) self.assertEqual('p', actual._last_char) def test_output_message_create_multiple(self): # Given chars = 'foo_bar' # When actual = _OutputMessage._create(chars) # Then self.assertIsInstance(actual, _OutputMessage) self.assertEqual('foo_bar', actual._value) self.assertEqual(7, actual._size) self.assertEqual('r', actual._last_char) def test_output_message_append_str_to_empty(self): # Given output_message = _OutputMessage._create('') chars = 'bar' # When output_message._append(chars) # Then self.assertIsInstance(output_message, _OutputMessage) self.assertEqual('bar', output_message._value) self.assertEqual(3, output_message._size) self.assertEqual('r', output_message._last_char) def test_output_message_append_float_to_empty(self): # Given output_message = _OutputMessage._create('') chars = 21.12 # When output_message._append(chars) # Then self.assertIsInstance(output_message, _OutputMessage) self.assertEqual('21.12', output_message._value) self.assertEqual(5, output_message._size) self.assertEqual('2', output_message._last_char) def test_output_message_append_int_to_empty(self): # Given output_message = _OutputMessage._create('') chars = 13 # When output_message._append(chars) # Then self.assertIsInstance(output_message, _OutputMessage) self.assertEqual('13', output_message._value) self.assertEqual(2, output_message._size) self.assertEqual('3', output_message._last_char) def test_output_message_append_output_message_to_empty(self): # Given output_message = _OutputMessage._create('') chars = _OutputMessage._create('boo_fast') # When output_message._append(chars) # Then self.assertIsInstance(output_message, _OutputMessage) self.assertEqual('boo_fast', output_message._value) self.assertEqual(8, output_message._size) self.assertEqual('t', output_message._last_char) def test_output_message_append_input_message_to_empty(self): # Given output_message = _OutputMessage._create('') chars = _InputMessage._create('my_message') # When output_message._append(chars) # Then self.assertIsInstance(output_message, _OutputMessage) self.assertEqual('my_message', output_message._value) self.assertEqual(10, output_message._size) self.assertEqual('e', output_message._last_char) def test_output_message_append_invalid_to_empty(self): # Given output_message = _OutputMessage._create('') chars = CustomString('moo') # When with self.assertRaises(TypeError) as error: output_message._append(chars) # Then message = error.exception.args[0] self.assertEqual('Item of type CustomString cannot be added to Message!', message) def test_output_message_append_str_to_existing(self): # Given output_message = _OutputMessage._create('full') chars = '_qux' # When output_message._append(chars) # Then self.assertIsInstance(output_message, _OutputMessage) self.assertEqual('full_qux', output_message._value) self.assertEqual(8, output_message._size) self.assertEqual('x', output_message._last_char) def test_output_message_append_float_to_existing(self): # Given output_message = _OutputMessage._create('full') chars = 22.1 # When output_message._append(chars) # Then self.assertIsInstance(output_message, _OutputMessage) self.assertEqual('full22.1', output_message._value) self.assertEqual(8, output_message._size) self.assertEqual('1', output_message._last_char) def test_output_message_append_int_to_existing(self): # Given output_message = _OutputMessage._create('empty') chars = 73 # When output_message._append(chars) # Then self.assertIsInstance(output_message, _OutputMessage) self.assertEqual('empty73', output_message._value) self.assertEqual(7, output_message._size) self.assertEqual('3', output_message._last_char) def test_output_message_append_output_message_to_existing(self): # Given output_message = _OutputMessage._create('empty') chars = _OutputMessage._create(' house') # When output_message._append(chars) # Then self.assertIsInstance(output_message, _OutputMessage) self.assertEqual('empty house', output_message._value) self.assertEqual(11, output_message._size) self.assertEqual('e', output_message._last_char) def test_output_message_append_input_message_to_existing(self): # Given output_message = _OutputMessage._create('input_') chars = _InputMessage._create('message') # When output_message._append(chars) # Then self.assertIsInstance(output_message, _OutputMessage) self.assertEqual('input_message', output_message._value) self.assertEqual(13, output_message._size) self.assertEqual('e', output_message._last_char) def test_output_message_append_invalid_to_existing(self): # Given output_message = _OutputMessage._create('bar') chars = CustomString('foo') # When with self.assertRaises(TypeError) as error: output_message._append(chars) # Then message = error.exception.args[0] self.assertEqual('Item of type CustomString cannot be added to Message!', message) def test_input_message_create_empty(self): # Given chars = None # When actual = _InputMessage._create(chars) # Then self.assertIsInstance(actual, _InputMessage) self.assertEqual('', actual._value) self.assertEqual(0, actual._size) self.assertEqual('', actual._head) self.assertFalse(actual._is_cont) def test_input_message_create_single(self): # Given chars = 'm' # When actual = _InputMessage._create(chars) # Then self.assertIsInstance(actual, _InputMessage) self.assertEqual('m', actual._value) self.assertEqual(1, actual._size) self.assertEqual('m', actual._head) self.assertTrue(actual._is_cont) def test_input_message_create_multiple(self): # Given chars = 'moo_cow' # When actual = _InputMessage._create(chars) # Then self.assertIsInstance(actual, _InputMessage) self.assertEqual('moo_cow', actual._value) self.assertEqual(7, actual._size) self.assertEqual('m', actual._head) self.assertTrue(actual._is_cont) def test_input_message_append_str_to_empty(self): # Given input_message = _InputMessage._create('') chars = 'test' # When input_message._append(chars) # Then self.assertIsInstance(input_message, _InputMessage) self.assertEqual('test', input_message._value) self.assertEqual(4, input_message._size) self.assertEqual('t', input_message._head) self.assertTrue(input_message._is_cont) def test_input_message_append_float_to_empty(self): # Given input_message = _InputMessage._create('') chars = -0.12 # When input_message._append(chars) # Then self.assertIsInstance(input_message, _InputMessage) self.assertEqual('-0.12', input_message._value) self.assertEqual(5, input_message._size) self.assertEqual('-', input_message._head) self.assertTrue(input_message._is_cont) def test_input_message_append_int_to_empty(self): # Given input_message = _InputMessage._create('') chars = -32 # When input_message._append(chars) # Then self.assertIsInstance(input_message, _InputMessage) self.assertEqual('-32', input_message._value) self.assertEqual(3, input_message._size) self.assertEqual('-', input_message._head) self.assertTrue(input_message._is_cont) def test_input_message_append_input_message_to_empty(self): # Given input_message = _InputMessage._create('') chars = _InputMessage._create('input_bar') # When input_message._append(chars) # Then self.assertIsInstance(input_message, _InputMessage) self.assertEqual('input_bar', input_message._value) self.assertEqual(9, input_message._size) self.assertEqual('i', input_message._head) self.assertTrue(input_message._is_cont) def test_input_message_append_output_message_to_empty(self): # Given input_message = _InputMessage._create('') chars = _OutputMessage._create('output_bar') # When input_message._append(chars) # Then self.assertIsInstance(input_message, _InputMessage) self.assertEqual('output_bar', input_message._value) self.assertEqual(10, input_message._size) self.assertEqual('o', input_message._head) self.assertTrue(input_message._is_cont) def test_input_message_append_invalid_to_empty(self): # Given input_message = _InputMessage._create('') chars = None # When with self.assertRaises(TypeError) as error: input_message._append(chars) # Then message = error.exception.args[0] self.assertEqual('Item of type NoneType cannot be added to Message!', message) def test_input_message_append_str_to_existing(self): # Given input_message = _InputMessage._create('cow') chars = '_moo' # When input_message._append(chars) # Then self.assertIsInstance(input_message, _InputMessage) self.assertEqual('cow_moo', input_message._value) self.assertEqual(7, input_message._size) self.assertEqual('c', input_message._head) self.assertTrue(input_message._is_cont) def test_input_message_append_float_to_existing(self): # Given input_message = _InputMessage._create('paw_') chars = -1.23 # When input_message._append(chars) # Then self.assertIsInstance(input_message, _InputMessage) self.assertEqual('paw_-1.23', input_message._value) self.assertEqual(9, input_message._size) self.assertEqual('p', input_message._head) self.assertTrue(input_message._is_cont) def test_input_message_append_int_to_existing(self): # Given input_message = _InputMessage._create('+-111') chars = -1112 # When input_message._append(chars) # Then self.assertIsInstance(input_message, _InputMessage) self.assertEqual('+-111-1112', input_message._value) self.assertEqual(10, input_message._size) self.assertEqual('+', input_message._head) self.assertTrue(input_message._is_cont) def test_input_message_append_input_message_to_existing(self): # Given input_message = _InputMessage._create('+_/2') chars = _InputMessage._create('10-1-2') # When input_message._append(chars) # Then self.assertIsInstance(input_message, _InputMessage) self.assertEqual('+_/210-1-2', input_message._value) self.assertEqual(10, input_message._size) self.assertEqual('+', input_message._head) self.assertTrue(input_message._is_cont) def test_input_message_append_output_message_to_existing(self): # Given input_message = _InputMessage._create('bar') chars = _OutputMessage._create('_foo') # When input_message._append(chars) # Then self.assertIsInstance(input_message, _InputMessage) self.assertEqual('bar_foo', input_message._value) self.assertEqual(7, input_message._size) self.assertEqual('b', input_message._head) self.assertTrue(input_message._is_cont) def test_input_message_append_invalid_to_existing(self): # Given input_message = _InputMessage._create('bar') chars = None # When with self.assertRaises(TypeError) as error: input_message._append(chars) # Then message = error.exception.args[0] self.assertEqual('Item of type NoneType cannot be added to Message!', message) def test_input_message_skip_spaces_none(self): # Given message = _InputMessage._create('foo') # When message._skip_spaces(message) # Then self.assertEqual('f', message._head) def test_input_message_skip_spaces_single(self): # Given message = _InputMessage._create(' bar') # When message._skip_spaces(message) # Then self.assertEqual('b', message._head) def test_input_message_skip_spaces_multiple(self): # Given message = _InputMessage._create(' qux') # When message._skip_spaces(message) # Then self.assertEqual('q', message._head) def test_input_message_skip_spaces_spaces_only(self): # Given message = _InputMessage._create(' ') # When message._skip_spaces(message) # Then self.assertEqual('', message._head) def test_input_message_head_empty(self): # Given message = _InputMessage._create('') # When actual = message._head # Then self.assertEqual('', actual) def test_input_message_head_continuous(self): # Given message = _InputMessage._create('abc') # When message._step() actual = message._head # Then self.assertEqual('b', actual) def test_input_message_head_not_continuous(self): # Given message = _InputMessage._create('abc') # When message._step() message._step() message._step() actual = message._head # Then self.assertEqual('', actual) def test_input_message_is_continuous_empty(self): # Given message = _InputMessage._create('') # When actual = message._is_cont # Then self.assertFalse(actual) def test_input_message_is_continuous_existing_true(self): # Given message = _InputMessage._create('dog') # When actual = message._is_cont # Then self.assertTrue(actual) def test_input_message_is_continuous_existing_false(self): # Given message = _InputMessage._create('dog') # When message._step() message._step() message._step() actual = message._is_cont # Then self.assertFalse(actual) def test_input_message_step_once(self): # Given message = _InputMessage._create('dog') # When actual = message._step() # Then self.assertEqual('o', actual) def test_input_message_step_twice(self): # Given message = _InputMessage._create('dog') # When message._step() actual = message._step() # Then self.assertEqual('g', actual) def test_input_message_step_out_of_bound(self): # Given message = _InputMessage._create('dog') # When message._step() message._step() message._step() actual = message._step() # Then self.assertEqual('', actual)
30.817442
90
0.628419
2,836
26,503
5.479549
0.07158
0.082625
0.044337
0.059459
0.911068
0.869434
0.845496
0.83314
0.777735
0.698327
0
0.007371
0.283364
26,503
859
91
30.853318
0.810825
0.074369
0
0.579592
0
0
0.026636
0
0
0
0
0
0.373469
1
0.179592
false
0
0.006122
0
0.187755
0
0
0
0
null
0
0
0
1
1
1
1
1
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
6
607c968f0b95092734f013b0b90bde2ae32a1204
23,155
py
Python
src/genie/libs/parser/iosxr/tests/ShowPlacementProgramAll/cli/equal/golden_output_2_expected.py
balmasea/genieparser
d1e71a96dfb081e0a8591707b9d4872decd5d9d3
[ "Apache-2.0" ]
204
2018-06-27T00:55:27.000Z
2022-03-06T21:12:18.000Z
src/genie/libs/parser/iosxr/tests/ShowPlacementProgramAll/cli/equal/golden_output_2_expected.py
balmasea/genieparser
d1e71a96dfb081e0a8591707b9d4872decd5d9d3
[ "Apache-2.0" ]
468
2018-06-19T00:33:18.000Z
2022-03-31T23:23:35.000Z
src/genie/libs/parser/iosxr/tests/ShowPlacementProgramAll/cli/equal/golden_output_2_expected.py
balmasea/genieparser
d1e71a96dfb081e0a8591707b9d4872decd5d9d3
[ "Apache-2.0" ]
309
2019-01-16T20:21:07.000Z
2022-03-30T12:56:41.000Z
expected_output = { "program": { "auto_ip_ring": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1156", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "bfd": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1158", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "bgp": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "v4-routing", "jid": "1051", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", }, "test": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "Group_10_bgp2", "jid": "1052", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", }, "test1": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "Group_5_bgp3", "jid": "1053", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", }, "test2": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "Group_5_bgp4", "jid": "1054", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", }, } }, "bgp_epe": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "v4-routing", "jid": "1159", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "bpm": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "v4-routing", "jid": "1066", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "bundlemgr_distrib": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1157", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "domain_services": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1160", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "es_acl_mgr": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1169", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "eth_gl_cfg": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1151", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "ethernet_stats_controller_edm": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1161", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "ftp_fs": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1162", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "icpe_satmgr": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1163", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "igmp": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "mcast-routing", "jid": "1208", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "intf_mgbl": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1143", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "ipv4_connected": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "v4-routing", "jid": "1152", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "ipv4_local": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "v4-routing", "jid": "1153", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "ipv4_mfwd_ma": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "mcast-routing", "jid": "1204", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "ipv4_mpa": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1149", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "ipv4_rib": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "v4-routing", "jid": "1146", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "ipv4_rump": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "v4-routing", "jid": "1167", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "ipv4_static": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "v4-routing", "jid": "1043", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "ipv6_connected": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "v6-routing", "jid": "1154", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "ipv6_local": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "v6-routing", "jid": "1155", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "ipv6_mfwd_ma": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "mcast-routing", "jid": "1205", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "ipv6_mpa": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1150", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "ipv6_rib": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "v6-routing", "jid": "1147", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "ipv6_rump": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "v6-routing", "jid": "1168", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "l2tp_mgr": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "v4-routing", "jid": "1176", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "l2vpn_mgr": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "v4-routing", "jid": "1175", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "mld": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "mcast-routing", "jid": "1209", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "mpls_ldp": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "v4-routing", "jid": "1199", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "mpls_static": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "v4-routing", "jid": "1142", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "mrib": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "mcast-routing", "jid": "1206", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "mrib6": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "mcast-routing", "jid": "1207", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "netconf": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1189", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "nfmgr": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1145", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "ospf": { "instance": { "1": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "v4-routing", "jid": "1018", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "ospf_uv": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "v4-routing", "jid": "1114", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "pbr_ma": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1171", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "pim": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "mcast-routing", "jid": "1210", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "pim6": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "mcast-routing", "jid": "1211", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "policy_repository": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "v4-routing", "jid": "1148", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "python_process_manager": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1164", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "qos_ma": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1172", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "rcp_fs": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1165", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "rt_check_mgr": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "v4-routing", "jid": "1170", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "schema_server": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1177", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "snmppingd": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1195", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "spa_cfg_hlpr": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1130", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "ssh_conf_verifier": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1183", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "ssh_server": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1184", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "statsd_manager_g": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "netmgmt", "jid": "1144", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "telemetry_encoder": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1194", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "tty_verifyd": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1166", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "vservice_mgr": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1173", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "wanphy_proc": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1178", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, "xtc_agent": { "instance": { "default": { "active": "0/RSP1/CPU0", "active_state": "RUNNING", "group": "central-services", "jid": "1174", "standby": "0/RSP0/CPU0", "standby_state": "RUNNING", } } }, } }
32.384615
48
0.306672
1,375
23,155
5.031273
0.123636
0.208153
0.095403
0.130095
0.908933
0.908933
0.908933
0.711622
0.593813
0.587598
0
0.061643
0.546707
23,155
714
49
32.429972
0.597466
0
0
0.574438
0
0
0.318836
0.002203
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
1
0
0
1
1
1
1
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
60b6b84ab230556ae1607517486df38f09fd5b48
69,577
py
Python
coremltools/converters/mil/mil/passes/test_reduce_transposes_pass.py
seibert/coremltools
609188ebcfee2178293f0d4e93a5af2995c88645
[ "BSD-3-Clause" ]
null
null
null
coremltools/converters/mil/mil/passes/test_reduce_transposes_pass.py
seibert/coremltools
609188ebcfee2178293f0d4e93a5af2995c88645
[ "BSD-3-Clause" ]
null
null
null
coremltools/converters/mil/mil/passes/test_reduce_transposes_pass.py
seibert/coremltools
609188ebcfee2178293f0d4e93a5af2995c88645
[ "BSD-3-Clause" ]
null
null
null
# Copyright (c) 2020, Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can be # found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause from coremltools.converters.mil.mil import Builder as mb from coremltools.converters.mil.testing_utils import ( assert_op_count_match, assert_model_is_valid, get_op_types_in_program, apply_pass_and_basic_check, ) import unittest import pytest import numpy as np np.random.seed(1984) class TransposeOptimizationPass(unittest.TestCase): """""" """ Input graph: input -----> transpose(axis=[1,0]) -----> transpose(axis=[1,0]) ---> out Output graph: input -----> relu -----> out """ def test_simple_consecutive_ops_fusion_direct_output(self): @mb.program(input_specs=[mb.TensorSpec(shape=(10, 20))]) def prog(x): x = mb.transpose(x=x, perm=[1, 0]) x = mb.transpose(x=x, perm=[1, 0]) return x prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "transpose"] ) self.assertEqual(get_op_types_in_program(prog), ["identity"]) assert_model_is_valid( prog, {"x": (10, 20)}, expected_output_shapes={block.outputs[0].name: (10, 20)}, ) """ Input graph: input -----> transpose(axis=[1,0]) -----> transpose(axis=[1,0]) ----> relu ---> out Output graph: input -----> relu -----> out """ def test_simple_consecutive_ops_fusion(self): @mb.program(input_specs=[mb.TensorSpec(shape=(10, 20))]) def prog(x): x = mb.transpose(x=x, perm=[1, 0]) x = mb.transpose(x=x, perm=[1, 0]) x = mb.relu(x=x) return x prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "transpose", "relu"] ) self.assertEqual(get_op_types_in_program(prog), ["relu"]) assert_model_is_valid( prog, {"x": (10, 20)}, expected_output_shapes={block.outputs[0].name: (10, 20)}, ) """ Input graph: input---->transpose(axis=[0,3,1,2])---->relu---->log--->transpose(axis=[0,2,3,1])--->relu--->out Output graph: input----->relu----->log----->relu--->out """ def test_linear_graph_two_op_fusion(self): @mb.program(input_specs=[mb.TensorSpec(shape=(1, 2, 3, 4))]) def prog(x): x = mb.transpose(x=x, perm=[0, 3, 1, 2]) x = mb.relu(x=x) x = mb.log(x=x) x = mb.transpose(x=x, perm=[0, 2, 3, 1]) x = mb.relu(x=x) return x prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "relu", "log", "transpose", "relu"], ) self.assertEqual(get_op_types_in_program(prog), ["relu", "log", "relu"]) assert_model_is_valid( prog, {"x": (1, 2, 3, 4)}, expected_output_shapes={block.outputs[0].name: (1, 2, 3, 4)}, ) """ Input graph: input---->transpose(axis=[0,3,1,2])---->relu---->identity--->transpose(axis=[0,2,3,1])--->relu--->out Output graph: input----->relu----->identity----->relu--->out """ def test_linear_graph_two_op_fusion_1(self): @mb.program(input_specs=[mb.TensorSpec(shape=(1, 2, 3, 4))]) def prog(x): x = mb.transpose(x=x, perm=[0, 3, 1, 2]) x = mb.relu(x=x) x = mb.identity(x=x) x = mb.transpose(x=x, perm=[0, 2, 3, 1]) x = mb.relu(x=x) return x prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "relu", "identity", "transpose", "relu"], ) self.assertEqual(get_op_types_in_program(prog), ["relu", "identity", "relu"]) assert_model_is_valid( prog, {"x": (1, 2, 3, 4)}, expected_output_shapes={block.outputs[0].name: (1, 2, 3, 4)}, ) """ Input graph: input(shape=1,2,3,4)---->transpose(axis=[0,3,1,2])---->relu---->log--->transpose(axis=[0,2,3,1])--->relu--->out1(shape=1,2,3,4) | v out2(shape=1,4,2,3) Output graph: input(shape=1,2,3,4)---->relu---->log--->relu--->out1(shape=1,2,3,4) | |----->transpose(axis=[0,3,1,2])----->out2(shape=1,4,2,3) """ def test_fusion_with_output_edge_inbetween(self): @mb.program(input_specs=[mb.TensorSpec(shape=(1, 2, 3, 4))]) def prog(x): x = mb.transpose(x=x, perm=[0, 3, 1, 2]) x1 = mb.relu(x=x) x2 = mb.log(x=x1) x3 = mb.transpose(x=x2, perm=[0, 2, 3, 1]) x4 = mb.relu(x=x3) return x4, x1 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "relu", "log", "transpose", "relu"], ) self.assertEqual( get_op_types_in_program(prog), ["relu", "log", "relu", "transpose"] ) assert_model_is_valid( prog, {"x": (1, 2, 3, 4)}, expected_output_shapes={ block.outputs[0].name: (1, 2, 3, 4), block.outputs[1].name: (1, 4, 2, 3), }, ) """ Input graph: input---->transpose(axis=[0,3,1,2])---->relu---->transpose(axis=[0,2,3,1])--->out Output graph: input----->relu----->out """ def test_linear_graph_two_op_fusion_with_last_op_removal(self): @mb.program(input_specs=[mb.TensorSpec(shape=(1, 2, 3, 4))]) def prog(x): x = mb.transpose(x=x, perm=[0, 3, 1, 2]) x = mb.relu(x=x) x = mb.transpose(x=x, perm=[0, 2, 3, 1]) return x prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "relu", "transpose"] ) self.assertEqual(get_op_types_in_program(prog), ["relu"]) assert_model_is_valid( prog, {"x": (1, 2, 3, 4)}, expected_output_shapes={block.outputs[0].name: (1, 2, 3, 4)}, ) """ Input graph: input(shape=10,2,3)--->transpose(axis=[0,2,1])----->relu---->transpose(axis=[0,2,1])---->out1 | | --->relu----->log---->transpose(axis=[0,2,1])---->out2 Output graph: input(shape=10,2,3)----->relu---->out1 | | --->relu----->log---->out2 """ def test_multiple_fusions(self): @mb.program(input_specs=[mb.TensorSpec(shape=(10, 2, 3))]) def prog(x): x = mb.transpose(x=x, perm=[0, 2, 1]) x1 = mb.relu(x=x) x2 = mb.relu(x=x) y1 = mb.transpose(x=x1, perm=[0, 2, 1]) x3 = mb.log(x=x2) y2 = mb.transpose(x=x3, perm=[0, 2, 1]) return y1, y2 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "relu", "relu", "transpose", "log", "transpose"], ) self.assertEqual(get_op_types_in_program(prog), ["relu", "relu", "log"]) assert ( prev_block.inputs["x"] == prev_block.find_ops(op_type="transpose")[0].inputs["x"] ) assert block.find_ops(op_type="log")[0].outputs[0] in block.outputs assert_model_is_valid( prog, {"x": (10, 2, 3)}, expected_output_shapes={ block.outputs[0].name: (10, 2, 3), block.outputs[1].name: (10, 2, 3), }, ) """ Input graph: input(shape=10,2,3,5)--->transpose(axis=[0,2,3,1])----->relu---->pool----->out1 | | --->relu----->log---->transpose(axis=[0,3,1,2])---->out2 Output graph: input(shape=10,2,3,5)----->relu---->transpose(axis=[0,2,3,1])---->pool----->out1 | | --->relu----->log---->out2 """ def test_partial_fusion_0(self): @mb.program(input_specs=[mb.TensorSpec(shape=(10, 2, 3, 5))]) def prog(x): x = mb.transpose(x=x, perm=[0, 2, 3, 1]) x1 = mb.relu(x=x) x2 = mb.relu(x=x) y1 = mb.avg_pool( x=x1, kernel_sizes=[1, 1], strides=[1, 1], pad_type="valid" ) x3 = mb.log(x=x2) y2 = mb.transpose(x=x3, perm=[0, 3, 1, 2]) return y1, y2 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "relu", "relu", "avg_pool", "log", "transpose"], ) self.assertEqual( get_op_types_in_program(prog), ["relu", "relu", "transpose", "avg_pool", "log"], ) assert ( prev_block.inputs["x"] == prev_block.find_ops(op_type="transpose")[0].inputs["x"] ) assert block.find_ops(op_type="log")[0].outputs[0] == block.outputs[1] assert ( block.find_ops(op_type="transpose")[0].outputs[0] == block.find_ops(op_type="avg_pool")[0].inputs["x"] ) assert list(block.find_ops(op_type="transpose")[0].perm.val) == [0, 2, 3, 1] assert_model_is_valid( prog, {"x": (10, 2, 3, 5)}, expected_output_shapes={ block.outputs[0].name: (10, 3, 5, 2), block.outputs[1].name: (10, 2, 3, 5), }, ) """ Input graph: input(shape=10,2,3,5)--->transpose(axis=[0,2,1,3])----->relu---->transpose(axis=[0,2,1,3])---->out1 | | --->pool--->log---->transpose(axis=[0,2,1,3])---->out2 Output graph: input(shape=10,2,3,5)----->relu---->out1 | | --->transpose(axis=[0,2,1,3])---->pool----->log---->transpose(axis=[0,2,1,3])---->out2 """ def test_partial_fusion_1(self): @mb.program(input_specs=[mb.TensorSpec(shape=(10, 2, 3, 5))]) def prog(x): x = mb.transpose(x=x, perm=[0, 2, 1, 3]) x1 = mb.relu(x=x) x2 = mb.avg_pool(x=x, kernel_sizes=[1, 1], strides=[1, 1], pad_type="valid") y1 = mb.transpose(x=x1, perm=[0, 2, 1, 3]) x3 = mb.log(x=x2) y2 = mb.transpose(x=x3, perm=[0, 2, 1, 3]) return y1, y2 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "relu", "avg_pool", "transpose", "log", "transpose"], ) self.assertEqual( get_op_types_in_program(prog), ["relu", "transpose", "avg_pool", "log", "transpose"], ) assert block.inputs["x"] == block.find_ops(op_type="relu")[0].inputs["x"] assert block.outputs[0] == block.find_ops(op_type="relu")[0].outputs[0] assert_model_is_valid( prog, {"x": (10, 2, 3, 5)}, expected_output_shapes={ block.outputs[0].name: (10, 2, 3, 5), block.outputs[1].name: (10, 2, 3, 5), }, ) """ Input graph: |-------> transpose(axis=[0,2,1,3]) ---->out1(shape=10,2,3,5) | input(shape=10,2,3,5)-->relu-->transpose(axis=[0,2,1,3])--->relu--->transpose(axis=[0,2,1,3]) ---->out2(shape=10,2,3,5) | |----->pool--------------->out3(shape=10,3,2,5) | |----->pool--------------->out4(shape=10.3.2.5) Output graph: |---->out1(shape=10,2,3,5) | input---->relu---------->relu------->out2(shape=10,2,3,5) | |----->transpose(axis=[0,2,1,3])--->pool---->out3(shape=10,3,2,5) | |----->transpose(axis=[0,2,1,3])---->pool--->out4(shape=10.3.2.5) """ def test_partial_fusion_2(self): @mb.program(input_specs=[mb.TensorSpec(shape=(10, 2, 3, 5))]) def prog(x): x = mb.relu(x=x) x = mb.transpose(x=x, perm=[0, 2, 1, 3]) y1 = mb.transpose(x=x, perm=[0, 2, 1, 3]) x1 = mb.relu(x=x) y2 = mb.transpose(x=x1, perm=[0, 2, 1, 3]) y3 = mb.avg_pool( x=x1, kernel_sizes=[1, 1], strides=[1, 1], pad_type="valid" ) y4 = mb.avg_pool( x=x1, kernel_sizes=[1, 1], strides=[1, 1], pad_type="valid" ) return y1, y2, y3, y4 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), [ "relu", "transpose", "transpose", "relu", "transpose", "avg_pool", "avg_pool", ], ) self.assertEqual( get_op_types_in_program(prog), ["relu", "relu", "transpose", "avg_pool", "transpose", "avg_pool"], ) assert block.outputs[0] == block.find_ops(op_type="relu")[0].outputs[0] assert block.outputs[1] == block.find_ops(op_type="relu")[1].outputs[0] assert_model_is_valid( prog, {"x": (10, 2, 3, 5)}, expected_output_shapes={ block.outputs[0].name: (10, 2, 3, 5), block.outputs[1].name: (10, 2, 3, 5), block.outputs[2].name: (10, 3, 2, 5), block.outputs[3].name: (10, 3, 2, 5), }, ) """ Input graph: input(shape=10,2,3,5)-->relu--->transpose(axis=[0,2,1,3])----->transpose(axis=[0,2,1,3])---->out1(shape=10,2,3,5) | ---->relu------>out2(shape=10,3,2,5) Output graph: input(shape=10,2,3,5)-->relu---->out1(shape=10,2,3,5) | ---->relu--->transpose(axis=[0,2,1,3])------>out2(shape=10,3,2,5) """ def test_partial_fusion_3(self): @mb.program(input_specs=[mb.TensorSpec(shape=(10, 2, 3, 5))]) def prog(x): x = mb.relu(x=x) x = mb.transpose(x=x, perm=[0, 2, 1, 3]) x1 = mb.transpose(x=x, perm=[0, 2, 1, 3]) x2 = mb.relu(x=x) return x1, x2 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["relu", "transpose", "transpose", "relu"], ) self.assertEqual(get_op_types_in_program(prog), ["relu", "relu", "transpose"]) assert block.outputs[0] == block.find_ops(op_type="relu")[0].outputs[0] assert_model_is_valid( prog, {"x": (10, 2, 3, 5)}, expected_output_shapes={ block.outputs[0].name: (10, 2, 3, 5), block.outputs[1].name: (10, 3, 2, 5), }, ) """ Input graph: input(shape=10,2,3,5)-->relu--->transpose(axis=[0,2,1,3])----->transpose(axis=[0,2,1,3])---->out1(shape=10,2,3,5) | ------>out2(shape=10,3,2,5) Output graph: same as input graph as one of the optimizing transpose is connected to model output """ def test_partial_fusion_4(self): @mb.program(input_specs=[mb.TensorSpec(shape=(10, 2, 3, 5))]) def prog(x): x = mb.relu(x=x) out2 = mb.transpose(x=x, perm=[0, 2, 1, 3]) out1 = mb.transpose(x=out2, perm=[0, 2, 1, 3]) return out1, out2 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["relu", "transpose", "transpose"] ) self.assertEqual( get_op_types_in_program(prog), ["relu", "transpose", "transpose"] ) assert block.outputs[1] == block.find_ops(op_type="transpose")[0].outputs[0] assert_model_is_valid( prog, {"x": (10, 2, 3, 5)}, expected_output_shapes={ block.outputs[0].name: (10, 2, 3, 5), block.outputs[1].name: (10, 3, 2, 5), }, ) """ Input graph: input(shape=10,2,3,5)-->relu-->transpose(axis=[0,2,1,3])--->relu--->transpose(axis=[0,2,1,3]) ---->out1(shape=10,2,3,5) | |--->relu-->pool--------------->out2(shape=10,3,2,5) | |----->pool--------------->out3(shape=10.3.2.5) Output graph: same as the input graph as materialization ops are greater than cancel ops """ def test_no_fusion_more_materialization_ops(self): @mb.program(input_specs=[mb.TensorSpec(shape=(10, 2, 3, 5))]) def prog(x): x = mb.relu(x=x) x = mb.transpose(x=x, perm=[0, 2, 1, 3]) x1 = mb.relu(x=x) y2 = mb.transpose(x=x1, perm=[0, 2, 1, 3]) x2 = mb.relu(x=x1) y3 = mb.avg_pool( x=x2, kernel_sizes=[1, 1], strides=[1, 1], pad_type="valid" ) y4 = mb.avg_pool( x=x1, kernel_sizes=[1, 1], strides=[1, 1], pad_type="valid" ) return y2, y3, y4 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["relu", "transpose", "relu", "transpose", "relu", "avg_pool", "avg_pool"], ) self.assertEqual( get_op_types_in_program(prog), ["relu", "transpose", "relu", "transpose", "relu", "avg_pool", "avg_pool"], ) assert_model_is_valid( prog, {"x": (10, 2, 3, 5)}, expected_output_shapes={ block.outputs[0].name: (10, 2, 3, 5), block.outputs[1].name: (10, 3, 2, 5), block.outputs[2].name: (10, 3, 2, 5), }, ) """ Input graph: input(shape=10,2,3)--->transpose(axis=[0,2,1])----->relu---->transpose(axis=[0,2,1])---->out1 | | --->reduce(axis=2)----->log---->transpose(axis=[0,2,1])---->out2 Output graph: input(shape=10,2,3)----->relu---->out1 | | --->reduce(axis=1)----->log---->out2 """ def test_fusion_with_axis_op(self): @mb.program(input_specs=[mb.TensorSpec(shape=(10, 2, 3))]) def prog(x): x = mb.transpose(x=x, perm=[0, 2, 1]) x1 = mb.relu(x=x) x2 = mb.reduce_mean(x=x, axes=[2], keep_dims=True) y1 = mb.transpose(x=x1, perm=[0, 2, 1]) x3 = mb.log(x=x2) y2 = mb.transpose(x=x3, perm=[0, 2, 1]) return y1, y2 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "relu", "reduce_mean", "transpose", "log", "transpose"], ) self.assertEqual(get_op_types_in_program(prog), ["relu", "reduce_mean", "log"]) assert list(block.find_ops(op_type="reduce_mean")[0].inputs["axes"].val) == [1] assert_model_is_valid( prog, {"x": (10, 2, 3)}, expected_output_shapes={ block.outputs[0].name: (10, 2, 3), block.outputs[1].name: (10, 1, 3), }, ) """ Input graph: input(shape=11,2,3,6)--->transpose(axis=[0,3,1,2])--- | | --->pad(pad=[0,0,0,0,1,2,3,4]) | |-->log--->transpose(axis=[0,2,3,1])-->out1(shape=11,5,10,6) Output graph: same as input graph, as transpose cannot be pushed through the pad op since "reflect" mode is only supported along the last two axis """ def test_fusion_with_pad_reflective_op_0(self): @mb.program(input_specs=[mb.TensorSpec(shape=(11, 2, 3, 6))]) def prog(x): x = mb.transpose(x=x, perm=[0, 3, 1, 2]) x2 = mb.pad(x=x, pad=[0, 0, 0, 0, 1, 2, 3, 4], mode="reflect") x3 = mb.log(x=x2) y2 = mb.transpose(x=x3, perm=[0, 2, 3, 1]) return y2 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "pad", "log", "transpose"] ) self.assertEqual( get_op_types_in_program(prog), ["transpose", "pad", "log", "transpose"] ) assert list(block.find_ops(op_type="pad")[0].inputs["pad"].val.flatten()) == [ 0, 0, 0, 0, 1, 2, 3, 4, ] assert_model_is_valid( prog, {"x": (11, 2, 3, 6)}, expected_output_shapes={block.outputs[0].name: (11, 5, 10, 6)}, ) """ Input graph: input(shape=11,2,3,6)--->transpose(axis=[0,1,3,2])--- | | --->pad(pad=[0,0,0,0,1,2,3,4]) | |-->log--->transpose(axis=[0,1,3,2])-->out1(shape=11,2,10,9) Output graph: input(shape=11,2,3,6)--->pad(pad=[0,0,0,0,3,4,1,2])-->log-->out1(shape=11,2,10,9) """ def test_fusion_with_pad_reflective_op_1(self): @mb.program(input_specs=[mb.TensorSpec(shape=(11, 2, 3, 6))]) def prog(x): x = mb.transpose(x=x, perm=[0, 1, 3, 2]) x2 = mb.pad(x=x, pad=[0, 0, 0, 0, 1, 2, 3, 4], mode="reflect") x3 = mb.log(x=x2) y2 = mb.transpose(x=x3, perm=[0, 1, 3, 2]) return y2 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "pad", "log", "transpose"] ) self.assertEqual(get_op_types_in_program(prog), ["pad", "log"]) assert list(block.find_ops(op_type="pad")[0].inputs["pad"].val.flatten()) == [ 0, 0, 0, 0, 3, 4, 1, 2, ] assert_model_is_valid( prog, {"x": (11, 2, 3, 6)}, expected_output_shapes={block.outputs[0].name: (11, 2, 10, 9)}, ) """ Input graph: input(shape=11,2,3,6)--->transpose(axis=[0,3,1,2])--- | | --->pad(pad=[0,0,0,0,1,2,3,4]) | |-->log--->transpose(axis=[0,2,3,1])-->out1(shape=11,5,10,6) Output graph: input(shape=11,2,3,6)--->pad(pad=[0,0,1,2,3,4,0,0])-->log-->out1(shape=11,5,10,6) """ def test_fusion_with_pad_constant_op(self): @mb.program(input_specs=[mb.TensorSpec(shape=(11, 2, 3, 6))]) def prog(x): x = mb.transpose(x=x, perm=[0, 3, 1, 2]) x2 = mb.pad( x=x, pad=[0, 0, 0, 0, 1, 2, 3, 4], mode="constant", constant_val=3.0 ) x3 = mb.log(x=x2) y2 = mb.transpose(x=x3, perm=[0, 2, 3, 1]) return y2 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "pad", "log", "transpose"] ) self.assertEqual(get_op_types_in_program(prog), ["pad", "log"]) assert list(block.find_ops(op_type="pad")[0].inputs["pad"].val.flatten()) == [ 0, 0, 1, 2, 3, 4, 0, 0, ] assert_model_is_valid( prog, {"x": (11, 2, 3, 6)}, expected_output_shapes={block.outputs[0].name: (11, 5, 10, 6)}, ) """ Input graph: const(shape=2) | V input(shape=1,2,5,5)--->transpose(axis=[0,2,3,1])--->add---->transpose(axis=[0,3,1,2])--->out(shape=1,2,5,5) Output graph: const(shape=1,2,1,1) | V input(shape=1,2,5,5)--->add--->out(shape=1,2,5,5) """ def test_fusion_with_add_constant_op(self): @mb.program(input_specs=[mb.TensorSpec(shape=(1, 2, 5, 5))]) def prog(x): x = mb.transpose(x=x, perm=[0, 2, 3, 1]) x = mb.add(x=x, y=np.array([10, 100])) x = mb.transpose(x=x, perm=[0, 3, 1, 2]) return x prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "add", "transpose"] ) self.assertEqual(get_op_types_in_program(prog), ["add"]) assert_model_is_valid( prog, {"x": (1, 2, 5, 5)}, expected_output_shapes={block.outputs[0].name: (1, 2, 5, 5)}, ) """ Input graph: const(scalar) | V input(shape=1,2,5,5)--->transpose(axis=[0,2,3,1])--->add---->transpose(axis=[0,3,1,2])--->out(shape=1,2,5,5) Output graph: const(scalar) | V input(shape=1,2,5,5)--->add--->out(shape=1,2,5,5) """ def test_fusion_with_add_scalar_constant_op(self): @mb.program(input_specs=[mb.TensorSpec(shape=(1, 2, 5, 5))]) def prog(x): x = mb.transpose(x=x, perm=[0, 2, 3, 1]) x = mb.add(x=5, y=x) x = mb.transpose(x=x, perm=[0, 3, 1, 2]) return x prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "add", "transpose"] ) self.assertEqual(get_op_types_in_program(prog), ["add"]) assert_model_is_valid( prog, {"x": (1, 2, 5, 5)}, expected_output_shapes={block.outputs[0].name: (1, 2, 5, 5)}, ) """ Input graph: input(shape=1,2,5,5)----->transpose(axis=[0,2,3,1])--->add---->transpose(axis=[0,3,1,2])--->out(shape=1,2,5,5) | ^ | | |---->relu---->transpose(axis=[0,2,3,1]) Output graph: input(shape=1,2,5,5)----->add--->out(shape=1,2,5,5) | ^ | | |------>relu """ def test_fusion_with_add_broadcastable_0(self): @mb.program(input_specs=[mb.TensorSpec(shape=(1, 2, 5, 5))]) def prog(x): x1 = mb.transpose(x=x, perm=[0, 2, 3, 1]) x2 = mb.relu(x=x) x2 = mb.transpose(x=x2, perm=[0, 2, 3, 1]) x3 = mb.add(x=x1, y=x2) y = mb.transpose(x=x3, perm=[0, 3, 1, 2]) return y prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "relu", "transpose", "add", "transpose"], ) self.assertEqual(get_op_types_in_program(prog), ["relu", "add"]) assert block.find_ops(op_type="relu")[0].inputs["x"] == block.inputs["x"] assert block.find_ops(op_type="add")[0].inputs["x"] == block.inputs["x"] assert ( block.find_ops(op_type="add")[0].inputs["y"] == block.find_ops(op_type="relu")[0].outputs[0] ) assert_model_is_valid( prog, {"x": (1, 2, 5, 5)}, expected_output_shapes={block.outputs[0].name: (1, 2, 5, 5)}, ) """ Input graph: input(shape=1,2,5,5)----->transpose(axis=[0,2,3,1])--->add---->transpose(axis=[0,3,1,2])--->out(shape=1,2,5,5) | ^ | | |----------------------->transpose(axis=[0,2,3,1]) Output graph: input(shape=1,2,5,5)----->add--->out(shape=1,2,5,5) | ^ | | |--------- """ def test_fusion_with_add_broadcastable_1(self): @mb.program(input_specs=[mb.TensorSpec(shape=(1, 2, 5, 5))]) def prog(x): x1 = mb.transpose(x=x, perm=[0, 2, 3, 1]) x2 = mb.transpose(x=x, perm=[0, 2, 3, 1]) x3 = mb.add(x=x1, y=x2) y = mb.transpose(x=x3, perm=[0, 3, 1, 2]) return y prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "transpose", "add", "transpose"], ) self.assertEqual(get_op_types_in_program(prog), ["add"]) assert block.find_ops(op_type="add")[0].inputs["x"] == block.inputs["x"] assert block.find_ops(op_type="add")[0].inputs["y"] == block.inputs["x"] assert_model_is_valid( prog, {"x": (1, 2, 5, 5)}, expected_output_shapes={block.outputs[0].name: (1, 2, 5, 5)}, ) """ Input graph: input(shape=1,2,5,5)--->transpose(axis=[0,2,3,1])---> relu---->concat(axis=3)----->transpose(axis=[0,3,1,2])----->out1(shape=1,4,5,5) | ^ | | |->transpose(axis=[0,2,3,1])--->relu------------ Output graph: input(shape=1,2,5,5)------> relu---->concat(axis=1)--->out1(shape=1,4,5,5) | ^ | | |---->relu------------ """ def test_concat_pattern_0(self): @mb.program(input_specs=[mb.TensorSpec(shape=(1, 2, 5, 5))]) def prog(x): x1 = mb.transpose(x=x, perm=[0, 2, 3, 1]) x2 = mb.transpose(x=x, perm=[0, 2, 3, 1]) x1 = mb.relu(x=x1) x2 = mb.relu(x=x2) x3 = mb.concat(values=[x1, x2], axis=3) x4 = mb.transpose(x=x3, perm=[0, 3, 1, 2]) return x4 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "transpose", "relu", "relu", "concat", "transpose"], ) self.assertEqual(get_op_types_in_program(prog), ["relu", "relu", "concat"]) assert_model_is_valid( prog, {"x": (1, 2, 5, 5)}, expected_output_shapes={block.outputs[0].name: (1, 4, 5, 5)}, ) """ Input graph: input(shape=1,2,5,5)--->transpose(axis=[0,2,3,1])---> relu---->concat(axis=3)----->transpose(axis=[0,3,1,2])----->out1(shape=1,4,5,5) | ^ | | |->transpose(axis=[0,2,3,1])------->relu-------- | V pool--->out2(shape=1,5,5,2) Output graph: input(shape=1,2,5,5)------> relu---->concat(axis=1)--->out1(shape=1,4,5,5) | ^ | | |---->relu------------ | |--->transpose(axis=[0,2,3,1])---->pool--->out2(shape=1,5,5,2) """ def test_concat_pattern_1(self): @mb.program(input_specs=[mb.TensorSpec(shape=(1, 2, 5, 5))]) def prog(x): x1 = mb.transpose(x=x, perm=[0, 2, 3, 1]) x2 = mb.transpose(x=x, perm=[0, 2, 3, 1]) x1 = mb.relu(x=x1) x2 = mb.relu(x=x2) x3 = mb.concat(values=[x1, x2], axis=3) x4 = mb.transpose(x=x3, perm=[0, 3, 1, 2]) x5 = mb.avg_pool( x=x2, kernel_sizes=[1, 1], strides=[1, 1], pad_type="valid" ) return x4, x5 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), [ "transpose", "transpose", "relu", "relu", "concat", "transpose", "avg_pool", ], ) self.assertEqual( get_op_types_in_program(prog), ["relu", "relu", "concat", "transpose", "avg_pool"], ) assert_model_is_valid( prog, {"x": (1, 2, 5, 5)}, expected_output_shapes={ block.outputs[0].name: (1, 4, 5, 5), block.outputs[1].name: (1, 5, 5, 2), }, ) """ Input graph: input(shape=1,2,5,5)--->transpose(axis=[0,2,3,1])---> relu---->concat(axis=3)----->transpose(axis=[0,3,1,2])----->out1(shape=1,4,5,5) | ^ | | |->transpose(axis=[0,2,3,1])------->relu-------- | V relu--->out2(shape=1,5,5,2) Output graph: input(shape=1,2,5,5)------> relu---->concat(axis=1)--->out1(shape=1,4,5,5) | ^ | | |---->relu------------ | |--->relu---->transpose(axis=[0,2,3,1])---->out2(shape=1,5,5,2) """ def test_concat_pattern_2(self): @mb.program(input_specs=[mb.TensorSpec(shape=(1, 2, 5, 5))]) def prog(x): x1 = mb.transpose(x=x, perm=[0, 2, 3, 1]) x2 = mb.transpose(x=x, perm=[0, 2, 3, 1]) x1 = mb.relu(x=x1) x2 = mb.relu(x=x2) x3 = mb.concat(values=[x1, x2], axis=3) x4 = mb.transpose(x=x3, perm=[0, 3, 1, 2]) x5 = mb.relu(x=x2) return x4, x5 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "transpose", "relu", "relu", "concat", "transpose", "relu"], ) self.assertEqual( get_op_types_in_program(prog), ["relu", "relu", "concat", "relu", "transpose"], ) assert_model_is_valid( prog, {"x": (1, 2, 5, 5)}, expected_output_shapes={ block.outputs[0].name: (1, 4, 5, 5), block.outputs[1].name: (1, 5, 5, 2), }, ) """ Input graph: input(shape=1,2,5,5)--->transpose(axis=[0,2,3,1])---> relu---->concat(axis=3)----->transpose(axis=[0,3,1,2])----->out1(shape=1,4,5,5) | ^ | | |->transpose(axis=[0,2,3,1])------->relu-------- | V out2(shape=1,5,5,2) Output graph: input(shape=1,2,5,5)------> relu---->concat(axis=1)--->out1(shape=1,4,5,5) | ^ | | |---->relu------------ | |--->transpose(axis=[0,2,3,1])---->out2(shape=1,5,5,2) """ def test_concat_pattern_3(self): @mb.program(input_specs=[mb.TensorSpec(shape=(1, 2, 5, 5))]) def prog(x): x1 = mb.transpose(x=x, perm=[0, 2, 3, 1]) x2 = mb.transpose(x=x, perm=[0, 2, 3, 1]) x1 = mb.relu(x=x1) x2 = mb.relu(x=x2) x3 = mb.concat(values=[x1, x2], axis=3) x4 = mb.transpose(x=x3, perm=[0, 3, 1, 2]) return x4, x2 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "transpose", "relu", "relu", "concat", "transpose"], ) self.assertEqual( get_op_types_in_program(prog), ["relu", "relu", "concat", "transpose"] ) assert_model_is_valid( prog, {"x": (1, 2, 5, 5)}, expected_output_shapes={ block.outputs[0].name: (1, 4, 5, 5), block.outputs[1].name: (1, 5, 5, 2), }, ) """ Input graph: input(shape=1,2,5,5)--->transpose(axis=[0,2,3,1])---> relu---->concat(axis=3)----->transpose(axis=[0,3,1,2])----->out1(shape=1,4,5,5) | ^ | | |->transpose(axis=[0,2,3,1])------->relu-------- | V transpose(axis=[0,3,1,2]) -----> out2(shape=1,2,5,5) Output graph: input(shape=1,2,5,5)---> relu---->concat(axis=1)----->out1(shape=1,4,5,5) | ^ | | |------------------->relu-------->out2(shape=1,2,5,5) """ def test_concat_pattern_4(self): @mb.program(input_specs=[mb.TensorSpec(shape=(1, 2, 5, 5))]) def prog(x): x1 = mb.transpose(x=x, perm=[0, 2, 3, 1]) x2 = mb.transpose(x=x, perm=[0, 2, 3, 1]) x1 = mb.relu(x=x1) x2 = mb.relu(x=x2) x3 = mb.concat(values=[x1, x2], axis=3) x4 = mb.transpose(x=x3, perm=[0, 3, 1, 2]) x5 = mb.transpose(x=x2, perm=[0, 3, 1, 2]) return x4, x5 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), [ "transpose", "transpose", "relu", "relu", "concat", "transpose", "transpose", ], ) self.assertEqual(get_op_types_in_program(prog), ["relu", "relu", "concat"]) assert_model_is_valid( prog, {"x": (1, 2, 5, 5)}, expected_output_shapes={ block.outputs[0].name: (1, 4, 5, 5), block.outputs[1].name: (1, 2, 5, 5), }, ) """ Input graph: constant(shape=[30,10,5]) | V input(shape=10,20,30)--->transpose(axis=[2,0,1])--->concat(axis=2)----->transpose(axis=[1,2,0])----->out1(shape=10,25,30) Output graph: constant(shape=[10,5,30]) | V input(shape=10,20,30)--->concat(axis=1)----->out1(shape=10,25,30) """ def test_concat_pattern_5(self): const = np.random.rand(30, 10, 5) @mb.program(input_specs=[mb.TensorSpec(shape=(10, 20, 30))]) def prog(x): x1 = mb.transpose(x=x, perm=[2, 0, 1]) c = mb.const(val=const) x2 = mb.concat(values=[x1, c], axis=2) x3 = mb.transpose(x=x2, perm=[1, 2, 0]) return x3 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "concat", "transpose"] ) self.assertEqual(get_op_types_in_program(prog), ["concat"]) assert_model_is_valid( prog, {"x": (10, 20, 30)}, expected_output_shapes={block.outputs[0].name: (10, 25, 30)}, ) """ Input graph: input2(shape=30,10,20)-----| | input(shape=10,20,30)--->transpose(axis=[2,0,1])----->relu-----|----->concat(axis=2)------>out1(shape=90,10,20) | | |-->relu-----| | |-->relu---->transpose(axis=[1,2,0])---->out2(shape=10,20,30) | |-->relu---->transpose(axis=[1,2,0])---->out3(shape=10,20,30) | |-->relu---->transpose(axis=[1,2,0])---->out4(shape=10,20,30) Output graph: input2(shape=30,10,20)-----| | input(shape=10,20,30)----->relu--->transpose(axis=[2,0,1])-----|----->concat(axis=2)------>out1(shape=90,10,20) | | |-->relu--->transpose(axis=[2,0,1])-----| | |-->relu---->out2(shape=10,20,30) | |-->relu---->out3(shape=10,20,30) | |-->relu---->out4(shape=10,20,30) Output graph: """ def test_concat_pattern_6(self): @mb.program( input_specs=[ mb.TensorSpec(shape=(10, 20, 30)), mb.TensorSpec(shape=(30, 10, 20)), ] ) def prog(x, y): x1 = mb.transpose(x=x, perm=[2, 0, 1]) r1 = mb.relu(x=x1) r2 = mb.relu(x=x1) r3 = mb.relu(x=x1) r4 = mb.relu(x=x1) r5 = mb.relu(x=x1) x2 = mb.concat(values=[r1, r2, y], axis=0) x3 = mb.transpose(x=r3, perm=[1, 2, 0]) x4 = mb.transpose(x=r4, perm=[1, 2, 0]) x5 = mb.transpose(x=r5, perm=[1, 2, 0]) return x2, x3, x4, x5 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), [ "transpose", "relu", "relu", "relu", "relu", "relu", "concat", "transpose", "transpose", "transpose", ], ) self.assertEqual( get_op_types_in_program(prog), [ "relu", "relu", "relu", "relu", "relu", "transpose", "transpose", "concat", ], ) assert_model_is_valid( prog, {"x": (10, 20, 30), "y": (30, 10, 20)}, expected_output_shapes={ block.outputs[0].name: (90, 10, 20), block.outputs[1].name: (10, 20, 30), block.outputs[2].name: (10, 20, 30), block.outputs[3].name: (10, 20, 30), }, ) """ Input graph: input(shape=1,4,5,6)--->transpose(axis=[0,3,2,1])--->relu---->split(axis=1, num_splits=2)----->transpose(axis=[0,3,2,1])----->out1(shape=1,4,5,3) | v transpose(axis[0,3,2,1])-------------------------->out2(shape=1,4,5,3) Output graph: input(shape=1,4,5,6)------> relu ---->split(axis=3)--->out1(shape=1,4,5,3) | v out2(shape=1,4,5,3) """ def test_split_nd_pattern_0(self): @mb.program(input_specs=[mb.TensorSpec(shape=(1, 4, 5, 6))]) def prog(x): x1 = mb.transpose(x=x, perm=[0, 3, 2, 1]) x1 = mb.relu(x=x1) x2, x3 = mb.split(x=x1, axis=1, num_splits=2) x4 = mb.transpose(x=x2, perm=[0, 3, 2, 1]) x5 = mb.transpose(x=x3, perm=[0, 3, 2, 1]) return x4, x5 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "relu", "split", "transpose", "transpose"], ) self.assertEqual(get_op_types_in_program(prog), ["relu", "split"]) assert_model_is_valid( prog, {"x": (1, 4, 5, 6)}, expected_output_shapes={block.outputs[0].name: (1, 4, 5, 3), block.outputs[1].name: (1, 4, 5, 3)}, ) self.assertEqual(block.find_ops(op_type="split")[0].axis.val, 3) """ Input graph: input(shape=1,4,5,6)--->transpose(axis=[0,3,2,1])--->relu---->splitd(axis=1, num_splits=6)----->transpose(axis=[0,3,2,1])----->out1(shape=1,4,5,3) | v transpose(axis[0,3,2,1])-------------------------------------->out2(shape=1,4,5,3) Output graph: input(shape=1,4,5,6)------>relu---->split(axis=3)--->out1(shape=1,4,5,3) | v out2(shape=1,4,5,3) """ def test_split_nd_pattern_1(self): @mb.program(input_specs=[mb.TensorSpec(shape=(1, 4, 5, 6))]) def prog(x): x1 = mb.transpose(x=x, perm=[0, 3, 2, 1]) x1 = mb.relu(x=x1) x2, x3, x4, x5, x6, x7 = mb.split(x=x1, axis=1, num_splits=6) x2 = mb.transpose(x=x2, perm=[0, 3, 2, 1]) x3 = mb.transpose(x=x3, perm=[0, 3, 2, 1]) x4 = mb.transpose(x=x4, perm=[0, 3, 2, 1]) x5 = mb.transpose(x=x5, perm=[0, 3, 2, 1]) x6 = mb.transpose(x=x6, perm=[0, 3, 2, 1]) x7 = mb.transpose(x=x7, perm=[0, 3, 2, 1]) return x2, x3, x4, x5, x6, x7 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "relu", "split", "transpose", "transpose", "transpose", "transpose", "transpose", "transpose"], ) self.assertEqual(get_op_types_in_program(prog), ["relu", "split"]) assert_model_is_valid( prog, {"x": (1, 4, 5, 6)}, expected_output_shapes={block.outputs[0].name: (1, 4, 5, 1), block.outputs[1].name: (1, 4, 5, 1), block.outputs[2].name: (1, 4, 5, 1), block.outputs[3].name: (1, 4, 5, 1), block.outputs[4].name: (1, 4, 5, 1), block.outputs[5].name: (1, 4, 5, 1)}, ) self.assertEqual(block.find_ops(op_type="split")[0].axis.val, 3) """ Input graph: input(shape=1,4,5,6)--->transpose(axis=[0,3,2,1])---> split(axis=1, num_splits=2) ----> concat(axis=1) ----->transpose(axis=[0,3,2,1]) ----->out1(shape=1,4,5,6) | ^ v | relu() ---------------------- Output graph: input(shape=1,4,5,6)------>split(axis=3)--->concat(axis=3) -------> out1(shape=1,4,5,6) | ^ v | relu() -------------- """ def test_split_nd_pattern_2(self): @mb.program(input_specs=[mb.TensorSpec(shape=(1, 4, 5, 6))]) def prog(x): x1 = mb.transpose(x=x, perm=[0, 3, 2, 1]) x2, x3 = mb.split(x=x1, axis=1, num_splits=2) x4 = mb.relu(x=x2) x5 = mb.concat(values=[x4, x3], axis=1) x6 = mb.transpose(x=x5, perm=[0, 3, 2, 1]) return x6 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "split", "relu", "concat", "transpose"] ) self.assertEqual(get_op_types_in_program(prog), ["split", "relu", "concat"]) assert_model_is_valid( prog, {"x": (1, 4, 5, 6)}, expected_output_shapes={block.outputs[0].name: (1, 4, 5, 6)}, ) self.assertEqual(block.find_ops(op_type="split")[0].axis.val, 3) """ Input graph: input(shape=1,5,5,3)----->transpose(axis=[0,3,1,2]) | ---->relu-------------->transpose(axis=[0,2,3,1]) | | | V | relu | | | V | transpose(axis=[0,3,1,2]) | | | V ----------------> add --------> relu---->pool---->out(shape=1,3,5,5) Output graph: input(shape=1,5,5,3)---->relu------------------------> relu | | | V ----------------> add | V relu | V transpose(axis=[0,3,1,2])-->pool---->out(shape=1,3,5,5) """ def test_skip_connection_pattern_0(self): @mb.program(input_specs=[mb.TensorSpec(shape=(1, 5, 5, 3))]) def prog(x): x = mb.transpose(x=x, perm=[0, 3, 1, 2]) x = mb.relu(x=x) x1 = mb.transpose(x=x, perm=[0, 2, 3, 1]) x2 = mb.relu(x=x1) x3 = mb.transpose(x=x2, perm=[0, 3, 1, 2]) x4 = mb.add(x=x, y=x3) x5 = mb.relu(x=x4) x6 = mb.avg_pool( x=x5, kernel_sizes=[1, 1], strides=[1, 1], pad_type="valid" ) return x6 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), [ "transpose", "relu", "transpose", "relu", "transpose", "add", "relu", "avg_pool", ], ) self.assertEqual( get_op_types_in_program(prog), ["relu", "relu", "add", "relu", "transpose", "avg_pool"], ) assert_model_is_valid( prog, {"x": (1, 5, 5, 3)}, expected_output_shapes={block.outputs[0].name: (1, 3, 5, 5)}, ) """ Input graph: input(shape=1,5,5,3)----->transpose(axis=[0,3,1,2]) | ---->relu-------------->transpose(axis=[0,2,3,1]) | | | V | relu | | | V | transpose(axis=[0,3,1,2]) | | | V ----------------> add -->transpose(axis=[0,2,3,1]) | V relu---->pool---->out(shape=1,5,5,3) Output graph: input(shape=1,5,5,3)---->relu------------------------> relu | | | V ----------------> add | V relu | V pool---->out(shape=1,5,5,3) """ def test_skip_connection_pattern_1(self): @mb.program(input_specs=[mb.TensorSpec(shape=(1, 5, 5, 3))]) def prog(x): x = mb.transpose(x=x, perm=[0, 3, 1, 2]) x = mb.relu(x=x) x1 = mb.transpose(x=x, perm=[0, 2, 3, 1]) x2 = mb.relu(x=x1) x3 = mb.transpose(x=x2, perm=[0, 3, 1, 2]) x4 = mb.add(x=x, y=x3) x4 = mb.transpose(x=x4, perm=[0, 2, 3, 1]) x5 = mb.relu(x=x4) x6 = mb.avg_pool( x=x5, kernel_sizes=[1, 1], strides=[1, 1], pad_type="valid" ) return x6 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), [ "transpose", "relu", "transpose", "relu", "transpose", "add", "transpose", "relu", "avg_pool", ], ) self.assertEqual( get_op_types_in_program(prog), ["relu", "relu", "add", "relu", "avg_pool"] ) assert_model_is_valid( prog, {"x": (1, 5, 5, 3)}, expected_output_shapes={block.outputs[0].name: (1, 5, 5, 3)}, ) """ Input graph: input(shape=2,5)--->transpose(axis=[1,0])--->transpose(axis=[1,0])-->reduce(axis=1) | | | V | transpose(axis=[1,0]) | | | V -------------------------------------------->add------->out(shape=5,2) Output graph: input(shape=2,5)--->reduce(axis=1)---->add---->transpose(axis=[1,0])--->out(shape=5,2) | ^ | | ------------------------ """ def test_residual_with_unmaterialized_output(self): @mb.program(input_specs=[mb.TensorSpec(shape=(2, 5))]) def prog(x): x1 = mb.transpose(x=x, perm=[1,0]) t1 = mb.transpose(x=x1, perm=[1,0]) x2 = mb.reduce_mean(x=t1, axes=[1], keep_dims=True) t2 = mb.transpose(x=x2, perm=[1,0]) return mb.add(x=x1, y=t2) prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), [ 'transpose', 'transpose', 'reduce_mean', 'transpose', 'add' ] ) self.assertEqual( get_op_types_in_program(prog), ['reduce_mean', 'add', 'transpose'] ) assert_model_is_valid( prog, {'x': (2, 5)}, expected_output_shapes={block.outputs[0].name: (5,2)} ) """ Input graph: input(shape=2,5)--->transpose(axis=[1,0])--->transpose(axis=[1,0])-->reduce(axis=1) | | | V | transpose(axis=[1,0]) | | | V -------------------------------------------->add------->out1(shape=5,2) | V relu------->out2(shape=5,2) Output graph: input(shape=2,5)--->reduce(axis=1)----> add ----->transpose(axis=[1,0])----->out1(shape=5,2) | | | V ---------------------> relu----->transpose(axis=[1,0])----->out2(shape=5,2) """ def test_residual_with_unmaterialized_multiple_output(self): @mb.program(input_specs=[mb.TensorSpec(shape=(2, 5))]) def prog(x): x1 = mb.transpose(x=x, perm=[1,0]) t1 = mb.transpose(x=x1, perm=[1,0]) x2 = mb.reduce_mean(x=t1, axes=[1], keep_dims=True) t2 = mb.transpose(x=x2, perm=[1,0]) out1 = mb.add(x=x1, y=t2) out2 = mb.relu(x=out1) return out1, out2 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), [ 'transpose', 'transpose', 'reduce_mean', 'transpose', 'add', 'relu' ] ) self.assertEqual( get_op_types_in_program(prog), ['reduce_mean', 'add', 'relu', 'transpose', 'transpose'] ) assert_model_is_valid( prog, {'x': (2, 5)}, expected_output_shapes={block.outputs[0].name: (5,2), block.outputs[1].name: (5,2)} ) """ Input graph: input(shape=2,5)---->transpose(axis=[1,0])------>relu----->transpose(axis=[1,0])------>out2(shape=2,5) | ------->out1(shape=5,2) Output graph: input(shape=2,5)---->relu-----> out2(shape=2,5) | V transpose(axis=[1,0]) -----> out1(shape=5,2) """ def test_materialized_output_reuse(self): @mb.program(input_specs=[mb.TensorSpec(shape=(2, 5))]) def prog(x): x1 = mb.transpose(x=x, perm=[1,0]) y1 = mb.relu(x=x1) y2 = mb.transpose(x=y1, perm=[1,0]) return y1, y2 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), [ 'transpose', 'relu', 'transpose', ] ) self.assertEqual( get_op_types_in_program(prog), ['relu', 'transpose'] ) assert_model_is_valid( prog, {'x': (2, 5)}, expected_output_shapes={block.outputs[0].name: (5,2), block.outputs[1].name: (2,5)} ) """ Input graph: input(shape=1,2,5,5)----->transpose(axis=[0,2,3,1])------->add------------>transpose(axis=[0,3,1,2])--->out1(shape=1,2,5,5) | ^ | | | | ---->relu ----->transpose(axis=[0,3,1,2])--->out2(shape=1,2,5,5) Output graph: input(shape=1,2,5,5)----->add------->out1(shape=1,2,5,5) | ^ | | | | |------>relu ------identity(renaming)---->out2(shape=1,2,5,5) """ def test_fusion_with_double_outputs(self): @mb.program(input_specs=[mb.TensorSpec(shape=(1, 2, 5, 5))]) def prog(x): x1 = mb.transpose(x=x, perm=[0, 2, 3, 1]) x2 = mb.relu(x=x1) x3 = mb.add(x=x1, y=x2) y1 = mb.transpose(x=x3, perm=[0, 3, 1, 2]) y2 = mb.transpose(x=x3, perm=[0, 3, 1, 2]) return y1, y2 prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "relu", "add", "transpose", "transpose"], ) self.assertEqual(get_op_types_in_program(prog), ["relu", "add", "identity"]) assert block.find_ops(op_type="relu")[0].inputs["x"] == block.inputs["x"] assert block.find_ops(op_type="add")[0].inputs["x"] == block.inputs["x"] assert ( block.find_ops(op_type="add")[0].inputs["y"] == block.find_ops(op_type="relu")[0].outputs[0] ) assert_model_is_valid( prog, {"x": (1, 2, 5, 5)}, expected_output_shapes={block.outputs[0].name: (1, 2, 5, 5)}, ) def test_pass_through_broadcasted_binary_op(self): """ Input graph: const | input --> transpose --> add --> transpose --> relu Output graph: const | input --> add --> relu Note: the `const` op is of shape (1, 1, 1, 3) which is pre-broadcasted. """ @mb.program(input_specs=[mb.TensorSpec(shape=(1, 4, 3, 2))]) def prog(x): x = mb.transpose(x=x, perm=[0, 3, 1, 2]) x = mb.add(x=x, y=np.array(np.ones(shape=(1, 1, 1, 3)))) x = mb.transpose(x=x, perm=[0, 2, 3, 1]) x = mb.relu(x=x) return x prev_prog, prev_block, block = apply_pass_and_basic_check( prog, "common::reduce_transposes" ) self.assertEqual( get_op_types_in_program(prev_prog), ["transpose", "add", "transpose", "relu"], ) self.assertEqual(get_op_types_in_program(prog), ["add", "relu"]) assert_model_is_valid( prog, {"x": (1, 4, 3, 2)}, expected_output_shapes={block.outputs[0].name: (1, 4, 3, 2)}, )
37.978712
164
0.39983
7,730
69,577
3.4511
0.028461
0.011021
0.045882
0.034637
0.925854
0.908236
0.887731
0.861604
0.842598
0.80039
0
0.071548
0.432514
69,577
1,831
165
37.999454
0.604093
0.006755
0
0.651121
0
0
0.0754
0.021845
0
0
0
0
0.128251
1
0.068161
false
0.036771
0.004484
0
0.107623
0
0
0
0
null
0
0
0
1
1
1
1
1
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
6
60badf36df1ebd2ae661d265f51549a384bd6cfe
25
py
Python
backend/apps/authentication/__init__.py
apopovidis/speechex
e38da51d8b3e58cbaf5965a832de4e14fa0a73db
[ "MIT" ]
null
null
null
backend/apps/authentication/__init__.py
apopovidis/speechex
e38da51d8b3e58cbaf5965a832de4e14fa0a73db
[ "MIT" ]
null
null
null
backend/apps/authentication/__init__.py
apopovidis/speechex
e38da51d8b3e58cbaf5965a832de4e14fa0a73db
[ "MIT" ]
null
null
null
from ...settings import *
25
25
0.72
3
25
6
1
0
0
0
0
0
0
0
0
0
0
0
0.12
25
1
25
25
0.818182
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
60ee197ecac98cd2aa48ab62c72e28451c3962d8
15,992
py
Python
resources/tests.py
wencakisa/freesource
7f33b337fe92ac4b675d2194266920779b13cdb8
[ "MIT" ]
null
null
null
resources/tests.py
wencakisa/freesource
7f33b337fe92ac4b675d2194266920779b13cdb8
[ "MIT" ]
null
null
null
resources/tests.py
wencakisa/freesource
7f33b337fe92ac4b675d2194266920779b13cdb8
[ "MIT" ]
null
null
null
from django.contrib.auth.models import User from django.shortcuts import reverse from rest_framework.test import APITestCase, APIClient from rest_framework import status from .models import Category, Resource, Comment class AbstractTestCase(APITestCase): def setUp(self): self.client = APIClient() self.user = User.objects.create_user( username='test_user', password='passtestword123' ) self.category = Category.objects.create(name='Test') self.unauthorized_message = 'Authentication credentials were not provided.' self.forbidden_message = 'You do not have permission to perform this action.' self.not_found_message = 'Not found.' class CategoryListViewTestCase(AbstractTestCase): def setUp(self): super().setUp() self.url = reverse('resources:category-list') self.admin_user = User.objects.create_superuser( username='admin_user', email='admin@gmail.com', password='you1can2not3guess4my5password6' ) self.post_data = {'name': 'Music'} def test_category_list_with_non_authenticated_user(self): response = self.client.get(self.url) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual(response.data['detail'], self.unauthorized_message) def test_category_list_with_authenticated_user(self): self.client.force_authenticate(self.user) response = self.client.get(self.url) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.data[0]['id'], self.category.id) self.assertEqual(response.data[0]['name'], self.category.name) def test_category_creation_with_non_authenticated_user(self): response = self.client.post(self.url, data=self.post_data) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual(response.data['detail'], self.unauthorized_message) def test_category_creation_with_normal_user(self): self.client.force_authenticate(self.user) response = self.client.post(self.url, data=self.post_data) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.data['detail'], self.forbidden_message) def test_category_creation_with_admin_user(self): self.client.force_authenticate(self.admin_user) response = self.client.post(self.url, data=self.post_data) self.assertEqual(response.status_code, status.HTTP_201_CREATED) self.assertEqual(Category.objects.count(), 2) self.assertEqual(response.data['name'], Category.objects.last().name) class ResourceAbstractTestCase(AbstractTestCase): def setUp(self): super().setUp() self.resource = Resource.objects.create( title='Test resource', resource_url='http://www.django-rest-framework.org/api-guide/testing/', owner=self.user ) self.resource.categories.add(self.category) class ResourceCategoryListTestCase(ResourceAbstractTestCase): def setUp(self): super().setUp() self.url_name = 'resources:resource-category-list' def test_resource_category_list_with_non_authorized_user(self): response = self.client.get( reverse( self.url_name, kwargs={'category_name': self.category.name.lower()} ) ) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual(response.data['detail'], self.unauthorized_message) def test_resource_category_list_with_invalid_category(self): self.client.force_authenticate(self.user) response = self.client.get( reverse( self.url_name, kwargs={'category_name': 'wrong'} ) ) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual(response.data['detail'], self.not_found_message) def test_resource_category_list_with_valid_category(self): self.client.force_authenticate(self.user) response = self.client.get( reverse( self.url_name, kwargs={'category_name': self.category.name.lower()} ) ) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.data[0]['id'], self.resource.id) self.assertEqual(response.data[0]['categories'][0]['id'], self.category.id) class ResourceViewSetTestCase(ResourceAbstractTestCase): def setUp(self): super().setUp() self.non_owner_user = User.objects.create_user( username='nonowner', password='123456789' ) self.list_url_name = 'resources:resources-list' self.detail_url_name = 'resources:resources-detail' self.post_data = { 'title': 'Sample title', 'resource_url': 'http://www.diveintopython3.net/' } self.put_data = { 'title': 'skydive' } self.forbidden_message = 'You are not the resource owner.' def test_resource_creation_with_non_authenticated_user(self): response = self.client.post(reverse(self.list_url_name), data=self.post_data) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual(response.data['detail'], self.unauthorized_message) def test_resource_creation_with_authenticated_user(self): self.client.force_authenticate(self.user) response = self.client.post(reverse(self.list_url_name), data=self.post_data) self.assertEqual(response.status_code, status.HTTP_201_CREATED) self.assertEqual(Resource.objects.count(), 2) def test_resource_list_with_non_authenticated_user(self): response = self.client.get(reverse(self.list_url_name)) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual(response.data['detail'], self.unauthorized_message) def test_resource_list_with_authenticated_user(self): self.client.force_authenticate(self.user) response = self.client.get(reverse(self.list_url_name)) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.data[0]['title'], self.resource.title) def test_resource_detail_with_non_authenticated_user(self): response = self.client.get( reverse( self.detail_url_name, kwargs={'pk': self.resource.id} ) ) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual(response.data['detail'], self.unauthorized_message) def test_resource_detail_with_authenticated_user(self): self.client.force_authenticate(self.user) response = self.client.get( reverse( self.detail_url_name, kwargs={'pk': self.resource.id} ) ) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.data['title'], self.resource.title) def test_resource_update_with_non_authenticated_user(self): response = self.client.put( reverse( self.detail_url_name, kwargs={'pk': self.resource.id} ), data=self.put_data ) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual(response.data['detail'], self.unauthorized_message) def test_resource_update_with_non_resource_owner(self): self.client.force_authenticate(self.non_owner_user) response = self.client.put( reverse( self.detail_url_name, kwargs={'pk': self.resource.id} ), data=self.put_data ) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.data['detail'], self.forbidden_message) def test_resource_update_with_resource_owner(self): self.client.force_authenticate(self.resource.owner) response = self.client.put( reverse( self.detail_url_name, kwargs={'pk': self.resource.id} ), data=self.put_data ) self.assertEqual(response.status_code, status.HTTP_200_OK) def test_resource_destroy_with_non_authenticated_user(self): response = self.client.delete( reverse( self.detail_url_name, kwargs={'pk': self.resource.id} ) ) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual(response.data['detail'], self.unauthorized_message) def test_resource_destroy_with_non_resource_owner(self): self.client.force_authenticate(self.non_owner_user) response = self.client.delete( reverse( self.detail_url_name, kwargs={'pk': self.resource.id} ) ) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.data['detail'], self.forbidden_message) def test_resource_destroy_with_resource_owner(self): self.client.force_authenticate(self.resource.owner) response = self.client.delete( reverse( self.detail_url_name, kwargs={'pk': self.resource.id} ) ) self.assertFalse(Resource.objects.all()) class CommentViewSetTestCase(ResourceAbstractTestCase): def setUp(self): super().setUp() self.non_author_user = User.objects.create_user( username='non_author', password='iamnottheauthor123' ) self.comment = Comment.objects.create( resource=self.resource, content='testestestest', author=self.user ) self.list_url_name = 'resources:resource-comments-list' self.detail_url_name = 'resources:resource-comments-detail' self.post_data = { 'content': 'blablablabla.' } self.forbidden_message = 'You can delete only your own comments.' def test_comment_creation_with_non_authenticated_user(self): response = self.client.post( reverse( self.list_url_name, kwargs={'resource_pk': self.resource.id} ), data=self.post_data ) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual(response.data['detail'], self.unauthorized_message) def test_comment_creation_with_authenticated_user(self): self.client.force_authenticate(self.user) response = self.client.post( reverse( self.list_url_name, kwargs={'resource_pk': self.resource.id} ), data=self.post_data ) self.assertEqual(response.status_code, status.HTTP_201_CREATED) self.assertEqual(Comment.objects.count(), 2) def test_comment_list_with_non_authenticated_user(self): response = self.client.get( reverse( self.list_url_name, kwargs={'resource_pk': self.resource.id} ) ) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual(response.data['detail'], self.unauthorized_message) def test_comment_list_with_authenticated_user(self): self.client.force_authenticate(self.user) response = self.client.get( reverse( self.list_url_name, kwargs={'resource_pk': self.resource.id} ) ) self.assertEqual(response.status_code, status.HTTP_200_OK) def test_comment_detail_with_non_authenticated_user(self): response = self.client.get( reverse( self.detail_url_name, kwargs={ 'resource_pk': self.resource.id, 'pk': self.comment.id } ) ) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual(response.data['detail'], self.unauthorized_message) def test_comment_detail_with_authenticated_user(self): self.client.force_authenticate(self.user) response = self.client.get( reverse( self.detail_url_name, kwargs={ 'resource_pk': self.resource.id, 'pk': self.comment.id } ) ) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.data['content'], self.comment.content) def test_comment_update_with_non_authenticated_user(self): response = self.client.put( reverse( self.detail_url_name, kwargs={ 'resource_pk': self.resource.id, 'pk': self.comment.id } ), data=self.post_data ) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual(response.data['detail'], self.unauthorized_message) def test_comment_update_with_non_comment_author(self): self.client.force_authenticate(self.non_author_user) response = self.client.put( reverse( self.detail_url_name, kwargs={ 'resource_pk': self.resource.id, 'pk': self.comment.id } ), data=self.post_data ) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.data['detail'], self.forbidden_message) def test_comment_update_with_comment_author(self): self.client.force_authenticate(self.comment.author) response = self.client.put( reverse( self.detail_url_name, kwargs={ 'resource_pk': self.resource.id, 'pk': self.comment.id } ), data=self.post_data ) self.assertEqual(response.status_code, status.HTTP_200_OK) def test_comment_destroy_with_non_authenticated_user(self): response = self.client.delete( reverse( self.detail_url_name, kwargs={ 'resource_pk': self.resource.id, 'pk': self.comment.id } ) ) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) self.assertEqual(response.data['detail'], self.unauthorized_message) def test_comment_destroy_with_non_comment_author(self): self.client.force_authenticate(self.non_author_user) response = self.client.delete( reverse( self.detail_url_name, kwargs={ 'resource_pk': self.resource.id, 'pk': self.comment.id } ) ) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.data['detail'], self.forbidden_message) def test_comment_destroy_with_comment_author(self): self.client.force_authenticate(self.comment.author) response = self.client.delete( reverse( self.detail_url_name, kwargs={ 'resource_pk': self.resource.id, 'pk': self.comment.id } ) ) self.assertFalse(Comment.objects.all())
33.386221
85
0.628502
1,705
15,992
5.641056
0.076246
0.093575
0.136307
0.090455
0.830318
0.807548
0.765856
0.729466
0.717613
0.717613
0
0.010421
0.273949
15,992
478
86
33.456067
0.817931
0
0
0.57377
0
0
0.063657
0.012569
0
0
0
0
0.169399
1
0.103825
false
0.010929
0.013661
0
0.13388
0
0
0
0
null
0
0
0
1
1
1
1
1
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
6
60fb124c084a07c8fb48054bec97a15188c12f3d
192
py
Python
dvc/dependency/local.py
yfarjoun/dvc
eaca7dc80c765dd3a8dbe4c8fb3b206656bbc5e2
[ "Apache-2.0" ]
2
2019-06-23T14:24:48.000Z
2019-07-08T12:22:53.000Z
dvc/dependency/local.py
yfarjoun/dvc
eaca7dc80c765dd3a8dbe4c8fb3b206656bbc5e2
[ "Apache-2.0" ]
null
null
null
dvc/dependency/local.py
yfarjoun/dvc
eaca7dc80c765dd3a8dbe4c8fb3b206656bbc5e2
[ "Apache-2.0" ]
1
2019-09-02T00:29:40.000Z
2019-09-02T00:29:40.000Z
from __future__ import unicode_literals from dvc.dependency.base import DependencyBase from dvc.output.local import OutputLOCAL class DependencyLOCAL(DependencyBase, OutputLOCAL): pass
21.333333
51
0.838542
22
192
7.090909
0.681818
0.089744
0
0
0
0
0
0
0
0
0
0
0.119792
192
8
52
24
0.923077
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.2
0.6
0
0.8
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
1
1
0
1
0
0
6
88063efe36a7f0fc1588166734ca233ccbd273ac
14,465
py
Python
eagleeye/riemann/protobuf.py
hawkowl/eagleeye
7f0cbad5e001b879180d37b06a8f98a879f9dc0a
[ "MIT" ]
5
2016-06-15T13:16:34.000Z
2017-05-26T12:34:01.000Z
eagleeye/riemann/protobuf.py
hawkowl/eagleeye
7f0cbad5e001b879180d37b06a8f98a879f9dc0a
[ "MIT" ]
null
null
null
eagleeye/riemann/protobuf.py
hawkowl/eagleeye
7f0cbad5e001b879180d37b06a8f98a879f9dc0a
[ "MIT" ]
null
null
null
# Generated by the protocol buffer compiler. DO NOT EDIT! from google.protobuf import descriptor from google.protobuf import message from google.protobuf import reflection from google.protobuf import descriptor_pb2 # @@protoc_insertion_point(imports) DESCRIPTOR = descriptor.FileDescriptor( name='proto.proto', package='', serialized_pb='\n\x0bproto.proto\"\x81\x01\n\x05State\x12\x0c\n\x04time\x18\x01 \x01(\x03\x12\r\n\x05state\x18\x02 \x01(\t\x12\x0f\n\x07service\x18\x03 \x01(\t\x12\x0c\n\x04host\x18\x04 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12\x0c\n\x04once\x18\x06 \x01(\x08\x12\x0c\n\x04tags\x18\x07 \x03(\t\x12\x0b\n\x03ttl\x18\x08 \x01(\x02\"\xce\x01\n\x05\x45vent\x12\x0c\n\x04time\x18\x01 \x01(\x03\x12\r\n\x05state\x18\x02 \x01(\t\x12\x0f\n\x07service\x18\x03 \x01(\t\x12\x0c\n\x04host\x18\x04 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12\x0c\n\x04tags\x18\x07 \x03(\t\x12\x0b\n\x03ttl\x18\x08 \x01(\x02\x12\x1e\n\nattributes\x18\t \x03(\x0b\x32\n.Attribute\x12\x15\n\rmetric_sint64\x18\r \x01(\x12\x12\x10\n\x08metric_d\x18\x0e \x01(\x01\x12\x10\n\x08metric_f\x18\x0f \x01(\x02\"\x17\n\x05Query\x12\x0e\n\x06string\x18\x01 \x01(\t\"g\n\x03Msg\x12\n\n\x02ok\x18\x02 \x01(\x08\x12\r\n\x05\x65rror\x18\x03 \x01(\t\x12\x16\n\x06states\x18\x04 \x03(\x0b\x32\x06.State\x12\x15\n\x05query\x18\x05 \x01(\x0b\x32\x06.Query\x12\x16\n\x06\x65vents\x18\x06 \x03(\x0b\x32\x06.Event\"\'\n\tAttribute\x12\x0b\n\x03key\x18\x01 \x02(\t\x12\r\n\x05value\x18\x02 \x01(\tB\x1a\n\x11\x63om.aphyr.riemannB\x05Proto') _STATE = descriptor.Descriptor( name='State', full_name='State', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ descriptor.FieldDescriptor( name='time', full_name='State.time', index=0, number=1, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='state', full_name='State.state', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=unicode("", "utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='service', full_name='State.service', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=unicode("", "utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='host', full_name='State.host', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=unicode("", "utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='description', full_name='State.description', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=unicode("", "utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='once', full_name='State.once', index=5, number=6, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='tags', full_name='State.tags', index=6, number=7, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='ttl', full_name='State.ttl', index=7, number=8, type=2, cpp_type=6, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), ], extensions=[ ], nested_types=[], enum_types=[ ], options=None, is_extendable=False, extension_ranges=[], serialized_start=16, serialized_end=145, ) _EVENT = descriptor.Descriptor( name='Event', full_name='Event', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ descriptor.FieldDescriptor( name='time', full_name='Event.time', index=0, number=1, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='state', full_name='Event.state', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=unicode("", "utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='service', full_name='Event.service', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=unicode("", "utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='host', full_name='Event.host', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=unicode("", "utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='description', full_name='Event.description', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=unicode("", "utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='tags', full_name='Event.tags', index=5, number=7, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='ttl', full_name='Event.ttl', index=6, number=8, type=2, cpp_type=6, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='attributes', full_name='Event.attributes', index=7, number=9, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='metric_sint64', full_name='Event.metric_sint64', index=8, number=13, type=18, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='metric_d', full_name='Event.metric_d', index=9, number=14, type=1, cpp_type=5, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='metric_f', full_name='Event.metric_f', index=10, number=15, type=2, cpp_type=6, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), ], extensions=[ ], nested_types=[], enum_types=[ ], options=None, is_extendable=False, extension_ranges=[], serialized_start=148, serialized_end=354, ) _QUERY = descriptor.Descriptor( name='Query', full_name='Query', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ descriptor.FieldDescriptor( name='string', full_name='Query.string', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=unicode("", "utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), ], extensions=[ ], nested_types=[], enum_types=[ ], options=None, is_extendable=False, extension_ranges=[], serialized_start=356, serialized_end=379, ) _MSG = descriptor.Descriptor( name='Msg', full_name='Msg', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ descriptor.FieldDescriptor( name='ok', full_name='Msg.ok', index=0, number=2, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='error', full_name='Msg.error', index=1, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=unicode("", "utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='states', full_name='Msg.states', index=2, number=4, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='query', full_name='Msg.query', index=3, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='events', full_name='Msg.events', index=4, number=6, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), ], extensions=[ ], nested_types=[], enum_types=[ ], options=None, is_extendable=False, extension_ranges=[], serialized_start=381, serialized_end=484, ) _ATTRIBUTE = descriptor.Descriptor( name='Attribute', full_name='Attribute', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ descriptor.FieldDescriptor( name='key', full_name='Attribute.key', index=0, number=1, type=9, cpp_type=9, label=2, has_default_value=False, default_value=unicode("", "utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor( name='value', full_name='Attribute.value', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=unicode("", "utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), ], extensions=[ ], nested_types=[], enum_types=[ ], options=None, is_extendable=False, extension_ranges=[], serialized_start=486, serialized_end=525, ) _EVENT.fields_by_name['attributes'].message_type = _ATTRIBUTE _MSG.fields_by_name['states'].message_type = _STATE _MSG.fields_by_name['query'].message_type = _QUERY _MSG.fields_by_name['events'].message_type = _EVENT DESCRIPTOR.message_types_by_name['State'] = _STATE DESCRIPTOR.message_types_by_name['Event'] = _EVENT DESCRIPTOR.message_types_by_name['Query'] = _QUERY DESCRIPTOR.message_types_by_name['Msg'] = _MSG DESCRIPTOR.message_types_by_name['Attribute'] = _ATTRIBUTE class State(message.Message): __metaclass__ = reflection.GeneratedProtocolMessageType DESCRIPTOR = _STATE # @@protoc_insertion_point(class_scope:State) class Event(message.Message): __metaclass__ = reflection.GeneratedProtocolMessageType DESCRIPTOR = _EVENT # @@protoc_insertion_point(class_scope:Event) class Query(message.Message): __metaclass__ = reflection.GeneratedProtocolMessageType DESCRIPTOR = _QUERY # @@protoc_insertion_point(class_scope:Query) class Msg(message.Message): __metaclass__ = reflection.GeneratedProtocolMessageType DESCRIPTOR = _MSG # @@protoc_insertion_point(class_scope:Msg) class Attribute(message.Message): __metaclass__ = reflection.GeneratedProtocolMessageType DESCRIPTOR = _ATTRIBUTE # @@protoc_insertion_point(class_scope:Attribute) # @@protoc_insertion_point(module_scope)
41.09375
1,221
0.645627
1,810
14,465
4.932597
0.092818
0.077061
0.064516
0.060484
0.787186
0.74888
0.700045
0.700045
0.695789
0.695789
0
0.050645
0.228759
14,465
352
1,222
41.09375
0.749641
0.024265
0
0.696203
1
0.003165
0.122785
0.07472
0
0
0
0
0
1
0
false
0
0.012658
0
0.060127
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
714813dfda71aa14d9c2ae76c853fff9a97ba212
79,322
py
Python
tests/test_sd.py
afflux/someip
b08a17260e934afa4c2f150023be690b25f9add9
[ "MIT" ]
null
null
null
tests/test_sd.py
afflux/someip
b08a17260e934afa4c2f150023be690b25f9add9
[ "MIT" ]
null
null
null
tests/test_sd.py
afflux/someip
b08a17260e934afa4c2f150023be690b25f9add9
[ "MIT" ]
null
null
null
# vim:foldmethod=marker:foldlevel=0 import asyncio import ipaddress import itertools import logging import os import socket import struct import sys import typing import unittest import unittest.mock from dataclasses import replace import someip.header as hdr import someip.config as cfg import someip.sd as sd logging.captureWarnings(True) logging.basicConfig(level=logging.DEBUG) logging.getLogger("asyncio").setLevel(logging.WARNING) logging.getLogger("someip").setLevel(logging.WARNING) PRECISION = 0.4 if os.environ.get("CI") == "true" else 0.2 # in seconds def ticks(n): return PRECISION * n def setUpModule(): if sys.platform.startswith("win"): asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) # {{{ Utilities: pack_sd and _SendTiming def pack_sd(entries, reboot=True, unicast=True, session_id=1): msg = hdr.SOMEIPSDHeader( flag_reboot=reboot, flag_unicast=unicast, entries=tuple(entries), ).assign_option_indexes() data = hdr.SOMEIPHeader( service_id=hdr.SD_SERVICE, method_id=hdr.SD_METHOD, client_id=0, session_id=session_id, interface_version=hdr.SD_INTERFACE_VERSION, message_type=hdr.SOMEIPMessageType.NOTIFICATION, payload=msg.build(), ).build() return data class _SendTiming(unittest.TestCase): def setup_timing(self, *mocks): self.send_times: typing.Dict[unittest.mock.Mock, typing.List[float]] = {} for mock in mocks: self.send_times[mock] = [] mock.side_effect = self.record_time(mock) self.t_start = asyncio.get_running_loop().time() def record_time(self, mock): def _mock_side_effect(*args, **kwargs): self.send_times[mock].append(asyncio.get_running_loop().time()) return unittest.mock.DEFAULT return _mock_side_effect def reset_mock(self, reset_start=False): for mock, send_times in self.send_times.items(): send_times.clear() mock.reset_mock() if reset_start: self.t_start = asyncio.get_running_loop().time() def assertTiming(self, *expected): # noqa: N802 tdiffs = { m: [t - self.t_start for t in times] for m, times in self.send_times.items() } # self.assertEqual(len(self.send_times), len(expected)) for i, (expected_td, mock, expected_call) in enumerate(expected): actual_call = mock.call_args_list.pop(0) actual_td = tdiffs[mock].pop(0) self.assertEqual(actual_call, expected_call, msg=f"index {i} failed") self.assertLess( abs(ticks(expected_td) - actual_td), PRECISION, msg=f"{ticks(expected_td)=} {actual_td=}", ) self.assertDictEqual( tdiffs, {m: [] for m in tdiffs.keys()}, msg="some calls were not asserted" ) async def settle(): fut: asyncio.Future[None] = asyncio.Future() asyncio.get_event_loop().call_soon(fut.set_result, None) await fut # }}} class TestSD(unittest.IsolatedAsyncioTestCase): multi_addr = ("2001:db8::1", 30490, 0, 0) fake_addr = ("2001:db8::2", 30490, 0, 0) async def _test_endpoint(self, family, host): sock = None trsp, prot = await sd.SOMEIPDatagramProtocol.create_unicast_endpoint( local_addr=(host, 0), ) try: prot.message_received = unittest.mock.Mock() local_sockname = trsp.get_extra_info("sockname") message = hdr.SOMEIPHeader( service_id=0xDEAD, method_id=0xBEEF, client_id=0xCCCC, session_id=0xDDDD, protocol_version=1, interface_version=2, message_type=hdr.SOMEIPMessageType.REQUEST_ACK, return_code=hdr.SOMEIPReturnCode.E_NOT_READY, ) data = b"\xde\xad\xbe\xef\x00\x00\x00\x08\xcc\xcc\xdd\xdd\x01\x02\x40\x04" sock = socket.socket(family, socket.SOCK_DGRAM, socket.IPPROTO_UDP) addrs = await asyncio.get_event_loop().getaddrinfo( host, 0, family=sock.family, type=sock.type, proto=sock.proto, flags=socket.AI_NUMERICHOST | socket.AI_NUMERICSERV, ) bind_addr = addrs[0][4] sock.bind(bind_addr) sock.sendto(data, local_sockname) sender_sockname = sock.getsockname() await asyncio.sleep(0.01) prot.message_received.assert_called_once_with( message, sender_sockname, False ) prot.message_received.reset_mock() data = b"\xde\xad\xbe\xef\x00\x00\x00\x08\xcc\xcc\xdd\xdd\x00\x02\x40\x04" sock.sendto(data, local_sockname) with self.assertLogs("someip", level="ERROR"): await asyncio.sleep(0.01) prot.message_received.assert_not_called() finally: if sock: sock.close() trsp.close() async def test_endpoint_v6(self): await self._test_endpoint(socket.AF_INET6, "::1") async def test_endpoint_v4(self): await self._test_endpoint(socket.AF_INET, "127.0.0.1") async def test_send_session_id(self): entry = cfg.Service(service_id=0x1234).create_find_entry() prot = sd.ServiceDiscoveryProtocol(self.multi_addr) _mock = prot.transport = unittest.mock.Mock() # session_id wraps to 1 instead of 0 r = itertools.chain( range(1, 0x10000), range(0x100001, 0x20000), range(0x200001, 0x20020), ) for i in r: prot.send_sd([entry], self.fake_addr) _mock.sendto.assert_called_once_with( pack_sd((entry,), session_id=i & 0xFFFF, reboot=i < 0x10000), self.fake_addr, ) _mock.reset_mock() if i < 0x10020: prot.send_sd([entry]) _mock.sendto.assert_called_once_with( pack_sd((entry,), session_id=i & 0xFFFF, reboot=i < 0x10000), self.multi_addr, ) _mock.reset_mock() if i % 64 == 0: # yield to event loop every couple iterations await settle() async def test_no_send_empty_sd(self): prot = sd.ServiceDiscoveryProtocol(self.multi_addr) _mock = prot.transport = unittest.mock.Mock() prot.send_sd([]) _mock.assert_not_called() @unittest.mock.patch("someip.sd.ServiceAnnouncer", spec_set=True) @unittest.mock.patch("someip.sd.ServiceSubscriber", spec_set=True) @unittest.mock.patch("someip.sd.ServiceDiscover", spec_set=True) async def test_sd_connection_lost(self, discover, subscribe, announce): prot = sd.ServiceDiscoveryProtocol(self.multi_addr) await settle() self.assertEqual(discover().method_calls, []) self.assertEqual(subscribe().method_calls, []) self.assertEqual(announce().method_calls, []) sentinel = object() with self.assertLogs("someip.sd", "ERROR") as cm: prot.connection_lost(sentinel) await settle() self.assertTrue(any("connection lost" in msg for msg in cm.output)) self.assertEqual( discover().method_calls, [unittest.mock.call.connection_lost(sentinel)] ) self.assertEqual( subscribe().method_calls, [unittest.mock.call.connection_lost(sentinel)] ) self.assertEqual( announce().method_calls, [unittest.mock.call.connection_lost(sentinel)] ) discover().reset_mock() subscribe().reset_mock() announce().reset_mock() await settle() self.assertEqual(discover().method_calls, []) self.assertEqual(subscribe().method_calls, []) self.assertEqual(announce().method_calls, []) @unittest.mock.patch("someip.sd.ServiceAnnouncer", spec_set=True) @unittest.mock.patch("someip.sd.ServiceSubscriber", spec_set=True) @unittest.mock.patch("someip.sd.ServiceDiscover", spec_set=True) async def test_sd_reboot(self, discover, subscribe, announce): prot = sd.ServiceDiscoveryProtocol(self.multi_addr) prot.datagram_received( pack_sd((), session_id=1, reboot=True), self.fake_addr, multicast=True ) await settle() self.assertEqual(discover().method_calls, []) self.assertEqual(subscribe().method_calls, []) self.assertEqual(announce().method_calls, []) prot.datagram_received( pack_sd((), session_id=2, reboot=True), self.fake_addr, multicast=True ) await settle() self.assertEqual(discover().method_calls, []) self.assertEqual(subscribe().method_calls, []) self.assertEqual(announce().method_calls, []) prot.datagram_received( pack_sd((), session_id=1, reboot=False), self.fake_addr, multicast=True ) await settle() self.assertEqual(discover().method_calls, []) self.assertEqual(subscribe().method_calls, []) self.assertEqual(announce().method_calls, []) prot.datagram_received( pack_sd((), session_id=2, reboot=True), self.fake_addr, multicast=True ) await settle() self.assertEqual( discover().method_calls, [unittest.mock.call.reboot_detected(self.fake_addr)], ) self.assertEqual( subscribe().method_calls, [unittest.mock.call.reboot_detected(self.fake_addr)], ) self.assertEqual( announce().method_calls, [unittest.mock.call.reboot_detected(self.fake_addr)], ) discover().reset_mock() subscribe().reset_mock() announce().reset_mock() prot.datagram_received( pack_sd((), session_id=1, reboot=False), self.fake_addr, multicast=True ) await settle() self.assertEqual(discover().method_calls, []) self.assertEqual(subscribe().method_calls, []) self.assertEqual(announce().method_calls, []) @unittest.mock.patch("someip.sd.ServiceAnnouncer", spec_set=True) @unittest.mock.patch("someip.sd.ServiceSubscriber", spec_set=True) @unittest.mock.patch("someip.sd.ServiceDiscover", spec_set=True) async def test_sd_malformed(self, discover, subscribe, announce): prot = sd.ServiceDiscoveryProtocol(self.multi_addr) msg = hdr.SOMEIPHeader( service_id=hdr.SD_SERVICE, method_id=hdr.SD_METHOD, client_id=0, session_id=1, interface_version=hdr.SD_INTERFACE_VERSION, message_type=hdr.SOMEIPMessageType.NOTIFICATION, payload=b"deadbeef", ) prot.sd_message_received = unittest.mock.Mock() with self.assertLogs("someip", "ERROR"): prot.datagram_received(msg.build(), self.fake_addr, multicast=False) prot.sd_message_received.assert_not_called() payload = ( b"\x40\x00\x00\x00" b"\x00\x00\x00\x30" b"\x06\x00\x00\x00\x88\x99\x66\x77\xEE\x00\x00\x00\x00\x00\x00\x10" b"\x01\x00\x00\x00\x55\x66\x77\x88\x99\x00\x00\x00\xde\xad\xbe\xef" b"\x01\x00\x00\x00\x55\x67\x77\x88\x99\x00\x00\x00\xde\xad\xbe\xef" b"\x00\x00\x00\x00" ) msg = replace(msg, payload=payload) with self.assertLogs("someip", "ERROR"): prot.datagram_received( replace(msg, service_id=0x1234).build(), self.fake_addr, multicast=False, ) prot.sd_message_received.assert_not_called() with self.assertLogs("someip", "ERROR"): prot.datagram_received( replace(msg, method_id=0x1234).build(), self.fake_addr, multicast=False, ) prot.sd_message_received.assert_not_called() with self.assertLogs("someip", "ERROR"): prot.datagram_received( replace(msg, interface_version=12).build(), self.fake_addr, multicast=False, ) prot.sd_message_received.assert_not_called() with self.assertLogs("someip", "ERROR"): prot.datagram_received( replace(msg, message_type=hdr.SOMEIPMessageType.REQUEST).build(), self.fake_addr, multicast=False, ) prot.sd_message_received.assert_not_called() with self.assertLogs("someip", "ERROR"): prot.datagram_received( replace(msg, return_code=hdr.SOMEIPReturnCode.E_NOT_OK).build(), self.fake_addr, multicast=False, ) prot.sd_message_received.assert_not_called() self.assertEqual(discover().method_calls, []) self.assertEqual(subscribe().method_calls, []) self.assertEqual(announce().method_calls, []) @unittest.mock.patch("someip.sd.ServiceAnnouncer", spec_set=True) @unittest.mock.patch("someip.sd.ServiceSubscriber", spec_set=True) @unittest.mock.patch("someip.sd.ServiceDiscover", spec_set=True) async def test_sd_entries(self, discover, subscribe, announce): prot = sd.ServiceDiscoveryProtocol(self.multi_addr) find_entry = hdr.SOMEIPSDEntry( sd_type=hdr.SOMEIPSDEntryType.FindService, service_id=0x5566, instance_id=0xFFFF, major_version=0xFF, ttl=5, minver_or_counter=0xFFFFFFFF, ) offer_entry = hdr.SOMEIPSDEntry( sd_type=hdr.SOMEIPSDEntryType.OfferService, service_id=0x1111, instance_id=0x2222, major_version=1, ttl=0, minver_or_counter=0xDEADBEEF, options_1=( hdr.IPv4EndpointOption( address=ipaddress.IPv4Address("254.253.252.251"), l4proto=hdr.L4Protocols.UDP, port=65535, ), ), ) subscribe_entry = hdr.SOMEIPSDEntry( sd_type=hdr.SOMEIPSDEntryType.Subscribe, service_id=0xAAAA, instance_id=0xBBBB, major_version=0xCC, minver_or_counter=0x23333, ttl=1, options_1=( hdr.IPv6EndpointOption( ipaddress.IPv6Address("2001:db8::2"), port=1, l4proto=hdr.L4Protocols.UDP, ), ), options_2=(hdr.SOMEIPSDConfigOption(configs=(("foo", "bar"),)),), ) entries = ( find_entry, offer_entry, subscribe_entry, ) prot.datagram_received(pack_sd(entries), self.fake_addr, multicast=False) await settle() self.assertEqual(subscribe().method_calls, []) self.assertEqual( discover().method_calls, [unittest.mock.call.handle_offer(offer_entry, self.fake_addr)], ) self.assertCountEqual( announce().method_calls, [ unittest.mock.call.handle_findservice( find_entry, self.fake_addr, False, True ), unittest.mock.call.handle_subscribe(subscribe_entry, self.fake_addr), ], ) discover().reset_mock() subscribe().reset_mock() announce().reset_mock() with self.assertLogs("someip.sd", "WARNING") as cm: prot.datagram_received(pack_sd(entries), self.fake_addr, multicast=True) await settle() self.assertTrue(any("received over multicast" in msg for msg in cm.output)) self.assertEqual(subscribe().method_calls, []) self.assertEqual( discover().method_calls, [unittest.mock.call.handle_offer(offer_entry, self.fake_addr)], ) self.assertEqual( announce().method_calls, [ unittest.mock.call.handle_findservice( find_entry, self.fake_addr, True, True ), ], ) async def test_sd_multicast_bad_af(self): with self.assertRaises(ValueError): await sd.ServiceDiscoveryProtocol.create_endpoints( family=socket.AF_IPX, local_addr="127.0.0.1", multicast_addr="224.244.224.245", port=30490, multicast_interface="lo", ) async def test_sd_multicast_bad_mc_addr(self): with self.assertRaises(ValueError): await sd.ServiceDiscoveryProtocol.create_endpoints( family=socket.AF_INET, local_addr="127.0.0.1", multicast_addr="127.0.0.1", port=30490, multicast_interface="lo", ) async def test_sd_multicast_ipv6_missing_if(self): with self.assertRaises(ValueError): await sd.ServiceDiscoveryProtocol.create_endpoints( family=socket.AF_INET6, local_addr="::1", multicast_addr="ff02::dead:beef%lo", port=30490, ) # {{{ ServiceDiscover OfferService class _BaseSDDiscoveryTest(unittest.IsolatedAsyncioTestCase): multi_addr = ("2001:db8::1", 30490, 0, 0) fake_addr = ("2001:db8::2", 30490, 0, 0) TTL = sd.TTL_FOREVER async def asyncSetUp(self): # noqa: N802 mock_sd = unittest.mock.Mock(spec_set=["timings", "log", "send_sd"]) mock_sd.timings = sd.Timings() mock_sd.log = logging.getLogger("someip.sd") self._mock_send_sd = mock_sd.send_sd = unittest.mock.Mock() self.prot = sd.ServiceDiscover(mock_sd) self.offer_5566 = hdr.SOMEIPSDEntry( sd_type=hdr.SOMEIPSDEntryType.OfferService, service_id=0x5566, instance_id=0x7788, major_version=1, ttl=self.TTL, minver_or_counter=0xDEADBEEF, options_1=( hdr.IPv4EndpointOption( address=ipaddress.IPv4Address("254.253.252.251"), l4proto=hdr.L4Protocols.UDP, port=65535, ), ), ) self.offer_5567 = replace(self.offer_5566, service_id=0x5567) self.cfg_offer_5566 = cfg.Service.from_offer_entry(self.offer_5566) self.cfg_offer_5567 = cfg.Service.from_offer_entry(self.offer_5567) self.stop_offer_5566 = replace(self.offer_5566, ttl=0) self.mock = unittest.mock.Mock() self.mock_single = unittest.mock.Mock() self.prot.watch_all_services(self.mock) self.prot.watch_service(cfg.Service(service_id=0x5566), self.mock_single) self.prot.handle_offer(self.offer_5566, self.fake_addr) self.prot.handle_offer(self.offer_5567, self.fake_addr) await settle() self.assertEqual( self.mock.service_offered.call_args_list, [ unittest.mock.call(self.cfg_offer_5566, self.fake_addr), unittest.mock.call(self.cfg_offer_5567, self.fake_addr), ], ) self.mock_single.service_offered.assert_called_once_with( self.cfg_offer_5566, self.fake_addr ) self.mock.service_stopped.assert_not_called() self.mock_single.service_stopped.assert_not_called() await settle() self.mock.reset_mock() self.mock_single.reset_mock() class TestSDDiscoveryTTLForever(_BaseSDDiscoveryTest): TTL = sd.TTL_FOREVER async def test_sd_reboot_ttl_forever(self): self.prot.handle_offer(self.offer_5566, self.fake_addr) self.prot.handle_offer(self.offer_5567, self.fake_addr) await settle() self.assertEqual(self.mock.method_calls, []) self.assertEqual(self.mock_single.method_calls, []) self.prot.reboot_detected(self.fake_addr) await settle() self.prot.handle_offer(self.offer_5566, self.fake_addr) self.prot.handle_offer(self.offer_5567, self.fake_addr) await settle() self.assertCountEqual( self.mock.method_calls[:2], [ unittest.mock.call.service_stopped(self.cfg_offer_5566, self.fake_addr), unittest.mock.call.service_stopped(self.cfg_offer_5567, self.fake_addr), ], ) self.assertEqual( self.mock.method_calls[2:], [ unittest.mock.call.service_offered(self.cfg_offer_5566, self.fake_addr), unittest.mock.call.service_offered(self.cfg_offer_5567, self.fake_addr), ], ) self.assertEqual( self.mock_single.method_calls, [ unittest.mock.call.service_stopped(self.cfg_offer_5566, self.fake_addr), unittest.mock.call.service_offered(self.cfg_offer_5566, self.fake_addr), ], ) # send stopoffer, should reach listener self.mock.reset_mock() self.mock_single.reset_mock() self.prot.handle_offer(self.stop_offer_5566, self.fake_addr) self.prot.handle_offer(self.offer_5567, self.fake_addr) await settle() self.assertEqual( self.mock.method_calls, [unittest.mock.call.service_stopped(self.cfg_offer_5566, self.fake_addr)], ) self.assertEqual( self.mock_single.method_calls, [unittest.mock.call.service_stopped(self.cfg_offer_5566, self.fake_addr)], ) async def test_sd_disconnect(self): self.prot.connection_lost(None) await settle() self.assertCountEqual( self.mock.method_calls, [ unittest.mock.call.service_stopped(self.cfg_offer_5566, self.fake_addr), unittest.mock.call.service_stopped(self.cfg_offer_5567, self.fake_addr), ], ) self.assertEqual( self.mock_single.method_calls, [unittest.mock.call.service_stopped(self.cfg_offer_5566, self.fake_addr)], ) async def test_sd_ignore(self): self.prot.stop_watch_all_services(self.mock) await settle() self.assertCountEqual( self.mock.method_calls, [ unittest.mock.call.service_stopped(self.cfg_offer_5566, self.fake_addr), unittest.mock.call.service_stopped(self.cfg_offer_5567, self.fake_addr), ], ) self.mock.reset_mock() offer_7777 = replace(self.offer_5566, service_id=0x7777) self.prot.handle_offer(offer_7777, self.fake_addr) await settle() self.assertEqual(self.mock.method_calls, []) async def test_watch_all_while_running(self): newmock = unittest.mock.Mock() self.prot.watch_all_services(newmock) await settle() self.assertEqual( newmock.service_offered.call_args_list, [ unittest.mock.call(self.cfg_offer_5566, self.fake_addr), unittest.mock.call(self.cfg_offer_5567, self.fake_addr), ], ) newmock.service_stopped.assert_not_called() async def test_stop_watch_all(self): self.prot.stop_watch_all_services(self.mock) await settle() self.assertEqual( self.mock.service_stopped.call_args_list, [ unittest.mock.call(self.cfg_offer_5566, self.fake_addr), unittest.mock.call(self.cfg_offer_5567, self.fake_addr), ], ) self.mock.reset_mock() offer_5568 = replace(self.offer_5566, service_id=0x5568) self.prot.handle_offer(offer_5568, self.fake_addr) await settle() self.assertEqual(self.mock.method_calls, []) async def test_stop_watch_single(self): self.prot.stop_watch_service(cfg.Service(service_id=0x5566), self.mock_single) await settle() self.assertEqual( self.mock_single.service_stopped.call_args_list, [ unittest.mock.call(self.cfg_offer_5566, self.fake_addr), ], ) self.mock_single.reset_mock() # clear already known services to re-trigger callbacks self.prot.found_services.stop_all() await settle() self.assertEqual(self.mock_single.method_calls, []) # after found_services.stop_all(), new offer would trigger callbacks, # but the listener is removed self.prot.handle_offer(self.offer_5566, self.fake_addr) await settle() self.assertEqual(self.mock_single.method_calls, []) async def test_watch_while_running(self): self.prot.stop_watch_all_services(self.mock) await settle() newmock = unittest.mock.Mock() self.prot.watch_service(cfg.Service(service_id=0x5566), newmock) await settle() self.assertEqual( newmock.service_offered.call_args_list, [unittest.mock.call(self.cfg_offer_5566, self.fake_addr)], ) newmock.service_stopped.assert_not_called() # 0x5567 was previously monitored from watch_all_services # TTL is forever, so it's still in the found_services list # so it will immediately trigger a service_offered callback newmock = unittest.mock.Mock() self.prot.watch_service(cfg.Service(service_id=0x5567), newmock) await settle() self.assertEqual( newmock.service_offered.call_args_list, [unittest.mock.call(self.cfg_offer_5567, self.fake_addr)], ) newmock.service_stopped.assert_not_called() class TestSDDiscoveryTTL1(_BaseSDDiscoveryTest): TTL = 1 async def test_sd_disconnect(self): self.prot.connection_lost(None) await settle() self.assertCountEqual( self.mock.method_calls, [ unittest.mock.call.service_stopped(self.cfg_offer_5566, self.fake_addr), unittest.mock.call.service_stopped(self.cfg_offer_5567, self.fake_addr), ], ) self.assertEqual( self.mock_single.method_calls, [unittest.mock.call.service_stopped(self.cfg_offer_5566, self.fake_addr)], ) async def test_sd_reboot(self): self.prot.reboot_detected(self.fake_addr) await settle() self.prot.handle_offer(self.offer_5566, self.fake_addr) self.prot.handle_offer(self.offer_5567, self.fake_addr) await settle() self.assertCountEqual( self.mock.method_calls[:2], [ unittest.mock.call.service_stopped(self.cfg_offer_5566, self.fake_addr), unittest.mock.call.service_stopped(self.cfg_offer_5567, self.fake_addr), ], ) self.assertEqual( self.mock.method_calls[2:], [ unittest.mock.call.service_offered(self.cfg_offer_5566, self.fake_addr), unittest.mock.call.service_offered(self.cfg_offer_5567, self.fake_addr), ], ) self.assertEqual( self.mock_single.method_calls, [ unittest.mock.call.service_stopped(self.cfg_offer_5566, self.fake_addr), unittest.mock.call.service_offered(self.cfg_offer_5566, self.fake_addr), ], ) # wait for timeout of initial service, should not call service_stopped since # it was removed by reboot detection self.mock.reset_mock() self.mock_single.reset_mock() await asyncio.sleep(0.8) self.assertEqual(self.mock.method_calls, []) self.assertEqual(self.mock_single.method_calls, []) async def test_sd(self): self.prot.handle_offer(self.offer_5566, self.fake_addr) self.prot.handle_offer(self.offer_5567, self.fake_addr) await settle() self.assertEqual(self.mock.method_calls, []) self.assertEqual(self.mock_single.method_calls, []) await asyncio.sleep(1.2) self.assertCountEqual( self.mock.method_calls, [ unittest.mock.call.service_stopped(self.cfg_offer_5566, self.fake_addr), unittest.mock.call.service_stopped(self.cfg_offer_5567, self.fake_addr), ], ) self.assertEqual( self.mock_single.method_calls, [unittest.mock.call.service_stopped(self.cfg_offer_5566, self.fake_addr)], ) self.mock.reset_mock() self.mock_single.reset_mock() self.prot.handle_offer(self.offer_5566, self.fake_addr) self.prot.handle_offer(self.offer_5567, self.fake_addr) await settle() self.assertEqual( self.mock.method_calls, [ unittest.mock.call.service_offered(self.cfg_offer_5566, self.fake_addr), unittest.mock.call.service_offered(self.cfg_offer_5567, self.fake_addr), ], ) self.assertEqual( self.mock_single.method_calls, [unittest.mock.call.service_offered(self.cfg_offer_5566, self.fake_addr)], ) self.mock.reset_mock() self.mock_single.reset_mock() await asyncio.sleep(1.2) self.assertCountEqual( self.mock.method_calls, [ unittest.mock.call.service_stopped(self.cfg_offer_5566, self.fake_addr), unittest.mock.call.service_stopped(self.cfg_offer_5567, self.fake_addr), ], ) self.assertEqual( self.mock_single.method_calls, [unittest.mock.call.service_stopped(self.cfg_offer_5566, self.fake_addr)], ) # service already removed by timeout detection above. # send stopoffer again, should not reach listener self.mock.reset_mock() self.mock_single.reset_mock() self.prot.handle_offer(self.stop_offer_5566, self.fake_addr) self.prot.handle_offer(self.offer_5567, self.fake_addr) await settle() self.assertEqual( self.mock.method_calls, [unittest.mock.call.service_offered(self.cfg_offer_5567, self.fake_addr)], ) self.assertEqual(self.mock_single.method_calls, []) async def test_watch_all_while_running(self): newmock = unittest.mock.Mock() self.prot.watch_all_services(newmock) await settle() self.assertEqual( newmock.service_offered.call_args_list, [ unittest.mock.call(self.cfg_offer_5566, self.fake_addr), unittest.mock.call(self.cfg_offer_5567, self.fake_addr), ], ) newmock.service_stopped.assert_not_called() async def test_stop_watch_all(self): self.prot.stop_watch_all_services(self.mock) await settle() self.assertEqual( self.mock.service_stopped.call_args_list, [ unittest.mock.call(self.cfg_offer_5566, self.fake_addr), unittest.mock.call(self.cfg_offer_5567, self.fake_addr), ], ) self.mock.reset_mock() # time out all offers await asyncio.sleep(1.2) offer_5568 = replace(self.offer_5566, service_id=0x5568) self.prot.handle_offer(offer_5568, self.fake_addr) self.prot.handle_offer(self.offer_5566, self.fake_addr) await settle() self.assertEqual(self.mock.method_calls, []) async def test_stop_watch_single(self): self.prot.stop_watch_service(cfg.Service(service_id=0x5566), self.mock_single) await settle() self.assertEqual( self.mock_single.service_stopped.call_args_list, [ unittest.mock.call(self.cfg_offer_5566, self.fake_addr), ], ) self.mock_single.reset_mock() # time out all offers await asyncio.sleep(1.2) self.assertEqual(self.mock_single.method_calls, []) # after found_services.stop_all(), new offer would trigger callbacks, # but the listener is removed self.prot.handle_offer(self.offer_5566, self.fake_addr) await settle() self.assertEqual(self.mock_single.method_calls, []) async def test_watch_while_running(self): self.prot.stop_watch_all_services(self.mock) await settle() # 0x5566 is still monitored from watch_service(0x5566) newmock = unittest.mock.Mock() self.prot.watch_service(cfg.Service(service_id=0x5566), newmock) await settle() self.assertEqual( newmock.service_offered.call_args_list, [unittest.mock.call(self.cfg_offer_5566, self.fake_addr)], ) newmock.service_stopped.assert_not_called() # 0x5567 is not monitored since stop_watch_all_services() # TTL is 1, therefore the service will expire from found_services await asyncio.sleep(0.6) self.prot.handle_offer(self.offer_5567, self.fake_addr) await asyncio.sleep(0.6) self.prot.handle_offer(self.offer_5567, self.fake_addr) await settle() newmock = unittest.mock.Mock() self.prot.watch_service(cfg.Service(service_id=0x5567), newmock) await settle() newmock.service_offered.assert_not_called() newmock.service_stopped.assert_not_called() self.prot.handle_offer(self.offer_5567, self.fake_addr) await settle() self.assertEqual( newmock.service_offered.call_args_list, [unittest.mock.call(self.cfg_offer_5567, self.fake_addr)], ) # }}} # {{{ ServiceDiscover FindService class TestSDFind(unittest.IsolatedAsyncioTestCase, _SendTiming): multi_addr = ("2001:db8::1", 30490, 0, 0) fake_addr = ("2001:db8::2", 30490, 0, 0) async def asyncSetUp(self): # noqa: N802 mock_sd = unittest.mock.Mock( spec_set=["timings", "log", "send_sd", "subscriber"] ) mock_sd.timings = sd.Timings( INITIAL_DELAY_MIN=ticks(2), INITIAL_DELAY_MAX=ticks(2), REPETITIONS_BASE_DELAY=ticks(1), REPETITIONS_MAX=3, FIND_TTL=5, ) mock_sd.log = logging.getLogger("someip.sd") self._mock_send_sd = mock_sd.send_sd = unittest.mock.Mock() self._mock_subscribe_start = mock_sd.subscriber.subscribe_eventgroup self._mock_subscribe_stop = mock_sd.subscriber.stop_subscribe_eventgroup self.prot = sd.ServiceDiscover(mock_sd) self.setup_timing( self._mock_send_sd, self._mock_subscribe_start, self._mock_subscribe_stop ) async def test_send_find(self): mock = unittest.mock.Mock() self.prot.watch_service(cfg.Service(service_id=0x5566), mock) await self.prot.send_find_services() find_5566 = hdr.SOMEIPSDEntry( sd_type=hdr.SOMEIPSDEntryType.FindService, service_id=0x5566, instance_id=0xFFFF, major_version=0xFF, ttl=5, minver_or_counter=0xFFFFFFFF, ) self.assertTiming( (2, self._mock_send_sd, unittest.mock.call([find_5566])), (3, self._mock_send_sd, unittest.mock.call([find_5566])), (5, self._mock_send_sd, unittest.mock.call([find_5566])), (9, self._mock_send_sd, unittest.mock.call([find_5566])), ) async def test_send_no_finds_after_early_offer(self): mock = unittest.mock.Mock() self.prot.watch_service(cfg.Service(service_id=0x5566), mock) t = asyncio.create_task(self.prot.send_find_services()) await asyncio.sleep(ticks(2)) data = hdr.SOMEIPSDEntry( sd_type=hdr.SOMEIPSDEntryType.OfferService, service_id=0x5566, instance_id=0x7788, major_version=1, ttl=1, minver_or_counter=0xDEADBEEF, options_1=( hdr.IPv4EndpointOption( address=ipaddress.IPv4Address("254.253.252.251"), l4proto=hdr.L4Protocols.UDP, port=65535, ), ), ) self.prot.handle_offer(data, self.fake_addr) await t self.assertTiming() async def test_send_no_finds_after_late_offer(self): mock = unittest.mock.Mock() self.prot.watch_service(cfg.Service(service_id=0x5566), mock) t = asyncio.create_task(self.prot.send_find_services()) await asyncio.sleep(ticks(3.5)) data = hdr.SOMEIPSDEntry( sd_type=hdr.SOMEIPSDEntryType.OfferService, service_id=0x5566, instance_id=0x7788, major_version=1, ttl=1, minver_or_counter=0xDEADBEEF, options_1=( hdr.IPv4EndpointOption( address=ipaddress.IPv4Address("254.253.252.251"), l4proto=hdr.L4Protocols.UDP, port=65535, ), ), ) self.prot.handle_offer(data, self.fake_addr) await t find_5566 = hdr.SOMEIPSDEntry( sd_type=hdr.SOMEIPSDEntryType.FindService, service_id=0x5566, instance_id=0xFFFF, major_version=0xFF, ttl=5, minver_or_counter=0xFFFFFFFF, ) self.assertTiming( (2, self._mock_send_sd, unittest.mock.call([find_5566])), (3, self._mock_send_sd, unittest.mock.call([find_5566])), ) async def test_send_no_finds(self): await self.prot.send_find_services() self.assertTiming() async def test_send_multiple_services_one_offer_early(self): mock = unittest.mock.Mock() self.prot.watch_service(cfg.Service(service_id=0x5566), mock) self.prot.watch_service(cfg.Service(service_id=0x4433), mock) t = asyncio.create_task(self.prot.send_find_services()) await asyncio.sleep(ticks(0.2)) data = hdr.SOMEIPSDEntry( sd_type=hdr.SOMEIPSDEntryType.OfferService, service_id=0x4433, instance_id=0x7788, major_version=1, ttl=int(ticks(10)), minver_or_counter=0xDEADBEEF, options_1=( hdr.IPv4EndpointOption( address=ipaddress.IPv4Address("254.253.252.251"), l4proto=hdr.L4Protocols.UDP, port=65535, ), ), ) self.prot.handle_offer(data, self.fake_addr) await t find_5566 = hdr.SOMEIPSDEntry( sd_type=hdr.SOMEIPSDEntryType.FindService, service_id=0x5566, instance_id=0xFFFF, major_version=0xFF, ttl=5, minver_or_counter=0xFFFFFFFF, ) self.assertTiming( (2, self._mock_send_sd, unittest.mock.call([find_5566])), (3, self._mock_send_sd, unittest.mock.call([find_5566])), (5, self._mock_send_sd, unittest.mock.call([find_5566])), (9, self._mock_send_sd, unittest.mock.call([find_5566])), ) async def test_find_subscribe(self): local_addr = ("2001:db8::1111", 3333, 0, 0) cfg_eventgroup = cfg.Eventgroup( service_id=0x5566, instance_id=0xFFFF, major_version=0xFF, eventgroup_id=0x0000AAAA, sockname=local_addr, protocol=hdr.L4Protocols.UDP, ) self.prot.find_subscribe_eventgroup(cfg_eventgroup) t = asyncio.create_task(self.prot.send_find_services()) await asyncio.sleep(ticks(2.5)) data = hdr.SOMEIPSDEntry( sd_type=hdr.SOMEIPSDEntryType.OfferService, service_id=0x5566, instance_id=0x7788, major_version=1, ttl=ticks(10), minver_or_counter=0xDEADBEEF, options_1=( hdr.IPv4EndpointOption( address=ipaddress.IPv4Address("254.253.252.251"), l4proto=hdr.L4Protocols.UDP, port=65535, ), ), ) self.prot.handle_offer(data, self.fake_addr) # let offer time out await asyncio.sleep(ticks(10.1)) await t find = hdr.SOMEIPSDEntry( sd_type=hdr.SOMEIPSDEntryType.FindService, service_id=0x5566, instance_id=0xFFFF, major_version=0xFF, ttl=5, minver_or_counter=0xFFFFFFFF, ) evgrp = cfg.Eventgroup( service_id=0x5566, instance_id=0x7788, major_version=1, eventgroup_id=0x0000AAAA, sockname=local_addr, protocol=hdr.L4Protocols.UDP, ) self.prot.handle_offer(data, self.fake_addr) await asyncio.sleep(ticks(2)) self.prot.stop_find_subscribe_eventgroup(cfg_eventgroup) await asyncio.sleep(ticks(1)) self.assertTiming( (2, self._mock_send_sd, unittest.mock.call([find])), ( 2.5, self._mock_subscribe_start, unittest.mock.call(evgrp, self.fake_addr), ), ( 12.5, self._mock_subscribe_stop, unittest.mock.call(evgrp, self.fake_addr), ), ( 12.5, self._mock_subscribe_start, unittest.mock.call(evgrp, self.fake_addr), ), ( 14.5, self._mock_subscribe_stop, unittest.mock.call(evgrp, self.fake_addr), ), ) # }}} # {{{ ServiceSubscriber Eventgroup Client subscribe / stop subscribe class TestSubscribeEventgroup(unittest.IsolatedAsyncioTestCase): local_addr = ("2001:db8::ff", 30331, 0, 0) remote1_addr = ("2001:db8::1", 30332, 0, 0) remote2_addr = ("2001:db8::2", 30337, 0, 0) maxDiff: typing.Optional[int] = None TTL = typing.ClassVar[int] REFRESH_INTERVAL = typing.ClassVar[float] async def asyncSetUp(self): # noqa: N802 mock_sd = unittest.mock.Mock(spec_set=["timings", "log", "send_sd"]) mock_sd.timings = sd.Timings( SUBSCRIBE_TTL=self.TTL, SUBSCRIBE_REFRESH_INTERVAL=self.REFRESH_INTERVAL ) mock_sd.log = logging.getLogger("someip.sd") mock_sd.send_sd = unittest.mock.Mock() self._mock_send_sd = mock_sd.send_sd self.prot = sd.ServiceSubscriber(mock_sd) self.evgrp_1 = cfg.Eventgroup( service_id=0x1111, instance_id=0x4444, major_version=0x66, eventgroup_id=0xCCDD, sockname=self.local_addr, protocol=hdr.L4Protocols.UDP, ) self.sub_evgrp_1 = self.evgrp_1.create_subscribe_entry(self.TTL or 0xFFFFFF) self.stop_sub_evgrp_1 = self.evgrp_1.create_subscribe_entry(0) self.evgrp_2 = cfg.Eventgroup( service_id=0x2222, instance_id=0x5555, major_version=0x66, eventgroup_id=0xCCDD, sockname=self.local_addr, protocol=hdr.L4Protocols.UDP, ) self.sub_evgrp_2 = self.evgrp_2.create_subscribe_entry(self.TTL or 0xFFFFFF) self.stop_sub_evgrp_2 = self.evgrp_2.create_subscribe_entry(0) self.evgrp_3 = cfg.Eventgroup( service_id=0x3333, instance_id=0x6666, major_version=0x77, eventgroup_id=0xAABB, sockname=self.local_addr, protocol=hdr.L4Protocols.UDP, ) self.sub_evgrp_3 = self.evgrp_3.create_subscribe_entry(self.TTL or 0xFFFFFF) self.stop_sub_evgrp_3 = self.evgrp_3.create_subscribe_entry(0) class TestSubscribeEventgroupTTL3(TestSubscribeEventgroup): TTL = 3 REFRESH_INTERVAL = 1 async def test_subscribe(self): self.prot.subscribe_eventgroup(self.evgrp_1, self.remote1_addr) self.prot.subscribe_eventgroup(self.evgrp_2, self.remote2_addr) self.prot.start() await settle() self.assertCountEqual( self._mock_send_sd.call_args_list, ( unittest.mock.call([self.sub_evgrp_1], remote=self.remote1_addr), unittest.mock.call([self.sub_evgrp_2], remote=self.remote2_addr), ), ) self._mock_send_sd.reset_mock() # add new eventgroup, show subscription in next cycle self.prot.subscribe_eventgroup(self.evgrp_3, self.remote1_addr) await asyncio.sleep(0.1) self.assertCountEqual( self._mock_send_sd.call_args_list, (unittest.mock.call([self.sub_evgrp_3], remote=self.remote1_addr),), ) self._mock_send_sd.reset_mock() # wait one refresh cycle await asyncio.sleep(1) self.assertCountEqual( self._mock_send_sd.call_args_list, ( unittest.mock.call( [self.sub_evgrp_1, self.sub_evgrp_3], remote=self.remote1_addr, ), unittest.mock.call([self.sub_evgrp_2], remote=self.remote2_addr), ), ) self._mock_send_sd.reset_mock() # remove eventgroup, send stop subscribe self.prot.stop_subscribe_eventgroup(self.evgrp_1, self.remote1_addr) await settle() self._mock_send_sd.assert_called_once_with( [self.stop_sub_evgrp_1], remote=self.remote1_addr, ) self._mock_send_sd.reset_mock() # remove eventgroup again => don't send stop again self.prot.stop_subscribe_eventgroup(self.evgrp_1, self.remote1_addr) await settle() self._mock_send_sd.assert_not_called() self._mock_send_sd.reset_mock() # show changed subscription messages after stop await asyncio.sleep(1) self.assertCountEqual( self._mock_send_sd.call_args_list, ( unittest.mock.call([self.sub_evgrp_3], remote=self.remote1_addr), unittest.mock.call([self.sub_evgrp_2], remote=self.remote2_addr), ), ) self._mock_send_sd.reset_mock() # remove last eventgroup of endpoint, send stop subscribe self.prot.stop_subscribe_eventgroup(self.evgrp_3, self.remote1_addr, send=False) await settle() self._mock_send_sd.assert_not_called() self._mock_send_sd.reset_mock() # show changed subscription messages after stop await asyncio.sleep(1) self._mock_send_sd.assert_called_once_with( [self.sub_evgrp_2], remote=self.remote2_addr, ) self._mock_send_sd.reset_mock() class TestSubscribeEventgroupTTLForever(TestSubscribeEventgroup): TTL = sd.TTL_FOREVER REFRESH_INTERVAL = None async def test_subscribe(self): self.prot.subscribe_eventgroup(self.evgrp_1, self.remote1_addr) self.prot.subscribe_eventgroup(self.evgrp_2, self.remote2_addr) self.prot.start() await settle() self.assertCountEqual( self._mock_send_sd.call_args_list, ( unittest.mock.call([self.sub_evgrp_1], remote=self.remote1_addr), unittest.mock.call([self.sub_evgrp_2], remote=self.remote2_addr), ), ) self._mock_send_sd.reset_mock() self.prot.subscribe_eventgroup(self.evgrp_3, self.remote1_addr) await settle() self._mock_send_sd.assert_called_once_with( [self.sub_evgrp_3], remote=self.remote1_addr, ) async def test_sd_stop_send_stop(self): self.prot.subscribe_eventgroup(self.evgrp_1, self.remote1_addr) self.prot.start() await settle() self._mock_send_sd.assert_called_once_with( [self.sub_evgrp_1], remote=self.remote1_addr, ) self._mock_send_sd.reset_mock() self.prot.stop() await settle() self._mock_send_sd.assert_called_once_with( [self.stop_sub_evgrp_1], remote=self.remote1_addr, ) async def test_sd_stop_no_send_stop(self): self.prot.subscribe_eventgroup(self.evgrp_1, self.remote1_addr) self.prot.start() await settle() self._mock_send_sd.assert_called_once_with( [self.sub_evgrp_1], remote=self.remote1_addr, ) self._mock_send_sd.reset_mock() self.prot.stop(send_stop_subscribe=False) await settle() self._mock_send_sd.assert_not_called() # }}} # {{{ ServiceAnnouncer class TestSDAnnounce(unittest.IsolatedAsyncioTestCase, _SendTiming): multi_addr = ("2001:db8::1", 30490, 0, 0) fake_addr = ("2001:db8::2", 30490, 0, 0) async def asyncSetUp(self): # noqa: N802 mock_sd = unittest.mock.Mock(spec_set=["timings", "log", "send_sd"]) ttl_ticks = ticks(30) assert ttl_ticks.is_integer() self.TTL = int(ttl_ticks) mock_sd.timings = sd.Timings( INITIAL_DELAY_MIN=ticks(1), INITIAL_DELAY_MAX=ticks(1), CYCLIC_OFFER_DELAY=ticks(20), ANNOUNCE_TTL=self.TTL, REPETITIONS_MAX=0, REPETITIONS_BASE_DELAY=ticks(1), REQUEST_RESPONSE_DELAY_MIN=0, REQUEST_RESPONSE_DELAY_MAX=0, ) mock_sd.log = logging.getLogger("someip.sd") mock_sd.send_sd = unittest.mock.Mock() self._mock_send_sd = mock_sd.send_sd self.prot = sd.ServiceAnnouncer(mock_sd) self.setup_timing(self._mock_send_sd) self.ep_1 = hdr.IPv4EndpointOption( address=ipaddress.IPv4Address("254.253.252.251"), l4proto=hdr.L4Protocols.UDP, port=30335, ) self.ep_2 = hdr.IPv4EndpointOption( address=ipaddress.IPv6Address("2001:db8::abcd:f00b"), l4proto=hdr.L4Protocols.TCP, port=30330, ) self.cfg_service_5566 = cfg.Service( service_id=0x5566, instance_id=0x7788, major_version=12, minor_version=345, options_1=(self.ep_1,), ) self.cfg_service_2233 = cfg.Service( service_id=0x2233, instance_id=0x0001, major_version=1, minor_version=0, options_1=(self.ep_2,), ) self.cfg_service_9999 = cfg.Service( service_id=0x9999, ) self.listener_5566 = unittest.mock.Mock() self.listener_2233 = unittest.mock.Mock() self.prot.announce_service(self.cfg_service_5566, self.listener_5566) self.prot.announce_service(self.cfg_service_2233, self.listener_2233) async def test_announce_non_cyclic(self): self.prot.timings.REPETITIONS_MAX = 2 self.prot.timings.CYCLIC_OFFER_DELAY = 0 self.prot.start() with self.assertLogs("someip.sd.announce", "WARNING") as cm: await asyncio.sleep(ticks(13)) self.prot.stop() self.assertTrue(any("CYCLIC_OFFER_DELAY" in msg for msg in cm.output)) call = unittest.mock.call( [ self.cfg_service_5566.create_offer_entry(self.TTL), self.cfg_service_2233.create_offer_entry(self.TTL), ], remote=None, ) self.assertTiming( (1, self._mock_send_sd, call), (2, self._mock_send_sd, call), (4, self._mock_send_sd, call), ) self.reset_mock() await asyncio.sleep(ticks(0.01)) self._mock_send_sd.assert_called_once_with( [ self.cfg_service_5566.create_offer_entry(0), self.cfg_service_2233.create_offer_entry(0), ], remote=None, ) async def test_announce_cyclic(self): self.prot.timings.REPETITIONS_MAX = 3 self.prot.timings.CYCLIC_OFFER_DELAY = ticks(2) self.prot.start() await asyncio.sleep(ticks(13)) self.prot.stop() call = unittest.mock.call( [ self.cfg_service_5566.create_offer_entry(self.TTL), self.cfg_service_2233.create_offer_entry(self.TTL), ], remote=None, ) self.assertTiming( (1, self._mock_send_sd, call), (2, self._mock_send_sd, call), (4, self._mock_send_sd, call), (8, self._mock_send_sd, call), (10, self._mock_send_sd, call), (12, self._mock_send_sd, call), ) self.reset_mock() await asyncio.sleep(ticks(0.01)) self._mock_send_sd.assert_called_once_with( [ self.cfg_service_5566.create_offer_entry(0), self.cfg_service_2233.create_offer_entry(0), ], remote=None, ) async def test_announce_stop_initial(self): self.prot.timings.REPETITIONS_MAX = 3 self.prot.timings.CYCLIC_OFFER_DELAY = ticks(2) self.prot.start() # sleep until just before end of initial wait phase await asyncio.sleep(ticks(0.9)) self.prot.stop() await asyncio.sleep(ticks(0.01)) self.assertTiming() async def test_find_service_initial(self): data = self.cfg_service_5566.create_find_entry(self.TTL) await self.prot.handle_findservice( data, self.fake_addr, received_over_multicast=True, unicast_supported=True ) self.assertTiming() self.prot.start() # sleep until middle of initial wait phase await self.prot.handle_findservice( data, self.fake_addr, received_over_multicast=True, unicast_supported=True ) await asyncio.sleep(ticks(0.5)) self.prot.stop() self.assertTiming() async def test_find_service_unknown(self): self.prot.start() await asyncio.sleep(ticks(0.01)) self.reset_mock() data = self.cfg_service_9999.create_find_entry() await self.prot.handle_findservice( data, self.fake_addr, received_over_multicast=True, unicast_supported=True ) self.prot.stop() self.assertTiming() async def test_find_service_known_answer_unicast(self): self.prot.timings.INITIAL_DELAY_MIN = self.prot.timings.INITIAL_DELAY_MAX = 0 self.prot.timings.REQUEST_RESPONSE_DELAY_MIN = ticks(1) self.prot.timings.REQUEST_RESPONSE_DELAY_MAX = ticks(1) self.prot.start() await asyncio.sleep(ticks(1)) self.reset_mock() await self.prot.handle_findservice( self.cfg_service_5566.create_find_entry(), self.fake_addr, received_over_multicast=True, unicast_supported=True, ) await self.prot.handle_findservice( self.cfg_service_9999.create_find_entry(), self.fake_addr, received_over_multicast=True, unicast_supported=True, ) self.prot.stop() self.assertTiming( ( 2, self._mock_send_sd, unittest.mock.call( [self.cfg_service_5566.create_offer_entry(self.TTL)], remote=self.fake_addr, ), ), ) async def test_find_service_known_request_unicast_no_delay(self): self.prot.timings.INITIAL_DELAY_MIN = self.prot.timings.INITIAL_DELAY_MAX = 0 self.prot.timings.REQUEST_RESPONSE_DELAY_MIN = ticks(1) self.prot.timings.REQUEST_RESPONSE_DELAY_MAX = ticks(1) self.prot.start() await asyncio.sleep(ticks(1)) self.reset_mock() await self.prot.handle_findservice( self.cfg_service_5566.create_find_entry(), self.fake_addr, received_over_multicast=False, unicast_supported=True, ) await self.prot.handle_findservice( self.cfg_service_9999.create_find_entry(), self.fake_addr, received_over_multicast=False, unicast_supported=True, ) self.prot.stop() self.assertTiming( ( 1, self._mock_send_sd, unittest.mock.call( [self.cfg_service_5566.create_offer_entry(self.TTL)], remote=self.fake_addr, ), ), ) async def test_find_service_known_answer_multicast_supported(self): self.prot.timings.INITIAL_DELAY_MIN = self.prot.timings.INITIAL_DELAY_MAX = 0 self.prot.timings.REQUEST_RESPONSE_DELAY_MIN = ticks(1) self.prot.timings.REQUEST_RESPONSE_DELAY_MAX = ticks(1) self.prot.start() await asyncio.sleep(ticks(1)) self.reset_mock() await self.prot.handle_findservice( self.cfg_service_5566.create_find_entry(), self.fake_addr, received_over_multicast=True, unicast_supported=False, ) await self.prot.handle_findservice( self.cfg_service_9999.create_find_entry(), self.fake_addr, received_over_multicast=True, unicast_supported=False, ) self.prot.stop() self.assertTiming( ( 2, self._mock_send_sd, unittest.mock.call( [self.cfg_service_5566.create_offer_entry(self.TTL)], remote=None ), ), ) async def test_find_service_known_answer_multicast_delay(self): self.prot.timings.INITIAL_DELAY_MIN = self.prot.timings.INITIAL_DELAY_MAX = 0 self.prot.timings.REQUEST_RESPONSE_DELAY_MIN = ticks(1) self.prot.timings.REQUEST_RESPONSE_DELAY_MAX = ticks(1) self.prot.start() await asyncio.sleep(ticks(11.5)) self.reset_mock() await self.prot.handle_findservice( self.cfg_service_5566.create_find_entry(), self.fake_addr, received_over_multicast=True, unicast_supported=True, ) await self.prot.handle_findservice( self.cfg_service_9999.create_find_entry(), self.fake_addr, received_over_multicast=True, unicast_supported=True, ) await asyncio.sleep(ticks(1.1)) self.prot.stop() self.assertTiming( ( 12.5, self._mock_send_sd, unittest.mock.call( [self.cfg_service_5566.create_offer_entry(self.TTL)], remote=None ), ), ) async def test_announce_stop_single_service(self): self.prot.timings.CYCLIC_OFFER_DELAY = ticks(1) self.prot.start() await asyncio.sleep(ticks(0.9)) self.reset_mock() self.prot.stop_announce_service(self.cfg_service_5566, self.listener_5566) await asyncio.sleep(ticks(0.01)) self.assertTiming( ( 0.9, self._mock_send_sd, unittest.mock.call( [self.cfg_service_5566.create_offer_entry(0)], remote=None ), ), ) self.reset_mock() await asyncio.sleep(ticks(0.2)) self.assertTiming( ( 1.0, self._mock_send_sd, unittest.mock.call( [self.cfg_service_2233.create_offer_entry(self.TTL)], remote=None ), ), ) # }}} # {{{ ServiceAnnouncer Server subscription handling class _BaseSDSubscriptionTest(unittest.IsolatedAsyncioTestCase): multi_addr = ("2001:db8::1", 30490, 0, 0) fake_sd_addr = ("2001:db8::2", 30490, 0, 0) fake_addr = ("2001:db8::2", 30321, 0, 0) TTL: int async def asyncSetUp(self): # noqa: N802 mock_sd = unittest.mock.Mock(spec_set=["timings", "log", "send_sd"]) mock_sd.timings = sd.Timings() mock_sd.log = logging.getLogger("someip.sd") mock_sd.send_sd = unittest.mock.Mock() self._mock_send_sd = mock_sd.send_sd self.prot = sd.ServiceAnnouncer(mock_sd) self.cfg_5566 = cfg.Service( service_id=0x5566, instance_id=0x7788, major_version=1, minor_version=0, eventgroups=(0x3333, 0x4444), ) self.cfg_5567 = replace(self.cfg_5566, service_id=0x5567) endpoint = hdr.IPv6EndpointOption( ipaddress.IPv6Address(self.fake_addr[0]), port=self.fake_addr[1], l4proto=hdr.L4Protocols.UDP, ) self.subscribe_5566_3333 = hdr.SOMEIPSDEntry( sd_type=hdr.SOMEIPSDEntryType.Subscribe, service_id=0x5566, instance_id=0x7788, major_version=1, minver_or_counter=0x3333, ttl=self.TTL, options_1=(endpoint,), options_2=(hdr.SOMEIPSDConfigOption(configs=(("foo", "bar"),)),), ) self.subscribe_5566_1234 = replace( self.subscribe_5566_3333, minver_or_counter=0x11234 ) self.subscription_5566_3333 = sd.EventgroupSubscription.from_subscribe_entry( self.subscribe_5566_3333 ) self.ack_5566_3333 = self.subscription_5566_3333.to_ack_entry() self.nack_5566_3333 = self.subscription_5566_3333.to_nack_entry() self.nack_5566_1234 = replace(self.nack_5566_3333, minver_or_counter=0x11234) self.stop_subscribe_5566_3333 = replace(self.subscribe_5566_3333, ttl=0) self.mock = unittest.mock.Mock() self.prot.announce_service(self.cfg_5566, self.mock._5566) self.prot.announce_service(self.cfg_5567, self.mock._5567) await self.prot.handle_subscribe(self.subscribe_5566_3333, self.fake_sd_addr) await settle() self._mock_send_sd.assert_called_once_with( [self.ack_5566_3333], remote=self.fake_sd_addr ) self.assertEqual( self.mock.method_calls, [ unittest.mock.call._5566.client_subscribed( self.subscription_5566_3333, self.fake_sd_addr ), ], ) await settle() self.reset_mock() def reset_mock(self): self.mock.reset_mock() self._mock_send_sd.reset_mock() async def _test_sd_reject_subscription(self): self.mock._5566.client_subscribed.side_effect = sd.NakSubscription await self.prot.handle_subscribe( self.stop_subscribe_5566_3333, self.fake_sd_addr ) await settle() self.reset_mock() await self.prot.handle_subscribe(self.subscribe_5566_3333, self.fake_sd_addr) await settle() self._mock_send_sd.assert_called_once_with( [self.nack_5566_3333], remote=self.fake_sd_addr ) self.assertEqual( self.mock.method_calls, [ unittest.mock.call._5566.client_subscribed( self.subscription_5566_3333, self.fake_sd_addr ), ], ) self.reset_mock() self.mock._5566.client_subscribed.side_effect = None await self.prot.handle_subscribe(self.subscribe_5566_3333, self.fake_sd_addr) await settle() self._mock_send_sd.assert_called_once_with( [self.ack_5566_3333], remote=self.fake_sd_addr ) self.assertEqual( self.mock.method_calls, [ unittest.mock.call._5566.client_subscribed( self.subscription_5566_3333, self.fake_sd_addr ), ], ) async def _test_sd_disconnect(self): self.prot.connection_lost(None) await settle() self.assertEqual( self.mock.method_calls, [ unittest.mock.call._5566.client_unsubscribed( self.subscription_5566_3333, self.fake_sd_addr ), ], ) async def _test_sd_stopping_service(self): self.prot.stop_announce_service(self.cfg_5566, self.mock._5566) await settle() self.assertEqual( self.mock.method_calls, [ unittest.mock.call._5566.client_unsubscribed( self.subscription_5566_3333, self.fake_sd_addr ), ], ) class TestSDSubscriptionTTLForever(_BaseSDSubscriptionTest): TTL = sd.TTL_FOREVER test_sd_reject_subscription = _BaseSDSubscriptionTest._test_sd_reject_subscription test_sd_disconnect = _BaseSDSubscriptionTest._test_sd_disconnect test_sd_stopping_service = _BaseSDSubscriptionTest._test_sd_stopping_service async def test_sd_reboot_ttl_forever(self): await self.prot.handle_subscribe(self.subscribe_5566_3333, self.fake_sd_addr) await settle() self._mock_send_sd.assert_called_once_with( [self.ack_5566_3333], remote=self.fake_sd_addr ) self.mock.assert_not_called() self.reset_mock() await self.prot.handle_subscribe(self.subscribe_5566_3333, self.fake_sd_addr) await settle() self._mock_send_sd.assert_called_once_with( [self.ack_5566_3333], remote=self.fake_sd_addr ) self.mock.assert_not_called() self.reset_mock() self.prot.reboot_detected(self.fake_sd_addr) await settle() await self.prot.handle_subscribe(self.subscribe_5566_3333, self.fake_sd_addr) await settle() self._mock_send_sd.assert_called_once_with( [self.ack_5566_3333], remote=self.fake_sd_addr ) self.assertEqual( self.mock.method_calls, [ unittest.mock.call._5566.client_unsubscribed( self.subscription_5566_3333, self.fake_sd_addr ), unittest.mock.call._5566.client_subscribed( self.subscription_5566_3333, self.fake_sd_addr ), ], ) self.reset_mock() # send stopsubscribe, should reach listener await self.prot.handle_subscribe( self.stop_subscribe_5566_3333, self.fake_sd_addr ) await settle() self._mock_send_sd.assert_not_called() self.assertEqual( self.mock.method_calls, [ unittest.mock.call._5566.client_unsubscribed( self.subscription_5566_3333, self.fake_sd_addr ), ], ) async def test_sd_multiple_listener(self): await self.prot.handle_subscribe( self.stop_subscribe_5566_3333, self.fake_sd_addr ) await settle() self.reset_mock() self.prot.announce_service(self.cfg_5566, self.mock._5566_2) with self.assertLogs("someip.sd.announce", "WARNING") as cm: await self.prot.handle_subscribe( self.subscribe_5566_3333, self.fake_sd_addr ) await settle() self.assertTrue(any("multiple configured" in msg for msg in cm.output)) self.assertEqual( self.mock.method_calls, [ unittest.mock.call._5566.client_subscribed( self.subscription_5566_3333, self.fake_sd_addr ), ], ) class TestSDSubscriptionTTL1(_BaseSDSubscriptionTest): TTL = 1 test_sd_reject_subscription = _BaseSDSubscriptionTest._test_sd_reject_subscription test_sd_disconnect = _BaseSDSubscriptionTest._test_sd_disconnect test_sd_stopping_service = _BaseSDSubscriptionTest._test_sd_stopping_service async def test_sd_reboot(self): self.prot.reboot_detected(self.fake_sd_addr) await settle() await self.prot.handle_subscribe(self.subscribe_5566_3333, self.fake_sd_addr) await settle() self._mock_send_sd.assert_called_once_with( [self.ack_5566_3333], remote=self.fake_sd_addr ) self.assertEqual( self.mock.method_calls, [ unittest.mock.call._5566.client_unsubscribed( self.subscription_5566_3333, self.fake_sd_addr ), unittest.mock.call._5566.client_subscribed( self.subscription_5566_3333, self.fake_sd_addr ), ], ) self.reset_mock() # wait for timeout of initial service, should not call client_unsubscribed since # it was removed by reboot detection await asyncio.sleep(0.8) self.mock.assert_not_called() async def test_sd(self): await self.prot.handle_subscribe(self.subscribe_5566_3333, self.fake_sd_addr) await settle() self._mock_send_sd.assert_called_once_with( [self.ack_5566_3333], remote=self.fake_sd_addr ) self.mock.assert_not_called() await asyncio.sleep(0.2) await self.prot.handle_subscribe( self.stop_subscribe_5566_3333, self.fake_sd_addr ) await settle() self.assertEqual( self.mock.method_calls, [ unittest.mock.call._5566.client_unsubscribed( self.subscription_5566_3333, self.fake_sd_addr ), ], ) self.reset_mock() await self.prot.handle_subscribe(self.subscribe_5566_3333, self.fake_sd_addr) await settle() self._mock_send_sd.assert_called_once_with( [self.ack_5566_3333], remote=self.fake_sd_addr ) self.assertEqual( self.mock.method_calls, [ unittest.mock.call._5566.client_subscribed( self.subscription_5566_3333, self.fake_sd_addr ), ], ) self.reset_mock() await asyncio.sleep(1.2) self.assertEqual( self.mock.method_calls, [ unittest.mock.call._5566.client_unsubscribed( self.subscription_5566_3333, self.fake_sd_addr ), ], ) self.reset_mock() # service already removed by timeout detection above. # send stopoffer again, should not reach listener await self.prot.handle_subscribe( self.stop_subscribe_5566_3333, self.fake_sd_addr ) await settle() self.mock.assert_not_called() async def test_sd_unknown(self): with self.assertLogs("someip.sd.announce", "WARNING") as cm: await self.prot.handle_subscribe( self.subscribe_5566_1234, self.fake_sd_addr ) await settle() self.assertTrue(any("subscribe for unknown" in msg for msg in cm.output)) self._mock_send_sd.assert_called_once_with( [self.nack_5566_1234], remote=self.fake_sd_addr ) self.mock.assert_not_called() # }}} # {{{ ServiceDiscoveryProtocol multicast endpoints class _MulticastEndpointsTest: maxDiff: typing.Optional[int] = None AF: socket.AddressFamily bind_lo_addr: str bind_mc_addr: str bind_interface: str send_addr: str sender_lo_addr: str send_mc_addr: str def _mc_sockopts(self, sock: socket.socket) -> None: ... async def asyncSetUp(self): # noqa: N802 ( self.trsp_u, self.trsp_m, self.prot, ) = await sd.ServiceDiscoveryProtocol.create_endpoints( family=self.AF, local_addr=self.bind_lo_addr, multicast_addr=self.bind_mc_addr, port=30490, multicast_interface=self.bind_interface, ) async def asyncTearDown(self): # noqa: N802 self.trsp_u.close() self.trsp_m.close() async def test_endpoint_recv_unicast(self): payload = ( b"\x40\x00\x00\x00" b"\x00\x00\x00\x30" b"\x06\x00\x00\x21\x88\x99\x66\x77\xEE\x20\x21\x22\x00\x00\x00\x10" b"\x01\x01\x01\x01\x55\x66\x77\x88\x99\x00\x00\x01\xde\xad\xbe\xef" b"\x01\x01\x01\x01\x55\x67\x77\x88\x99\x00\x00\x01\xde\xad\xbe\xef" b"\x00\x00\x00\x20" b"\x00\x09\x04\x00\x01\x02\x03\x04\x00\x11\x07\xff" b"\x00\x09\x04\x00\xfe\xfd\xfc\xfb\x00\x11\xff\xff" b"\x00\x05\x02\x00\x22\x22\x33\x33" ) data = hdr.SOMEIPHeader( service_id=hdr.SD_SERVICE, method_id=hdr.SD_METHOD, client_id=0, session_id=1, interface_version=hdr.SD_INTERFACE_VERSION, message_type=hdr.SOMEIPMessageType.NOTIFICATION, payload=payload, ).build() mock = unittest.mock.Mock() self.prot.datagram_received = mock ais = socket.getaddrinfo( self.send_addr, 30490, self.AF, socket.SOCK_DGRAM, socket.IPPROTO_UDP, flags=socket.AI_NUMERICHOST | socket.AI_NUMERICSERV, ) dst_ai = ais[0] sender_sock = socket.socket(self.AF, socket.SOCK_DGRAM, socket.IPPROTO_UDP) self._mc_sockopts(sender_sock) try: sender_sock.sendto(data, dst_ai[4]) await asyncio.sleep(0.01) sender_port = sender_sock.getsockname()[1] ais = socket.getaddrinfo( self.sender_lo_addr, sender_port, self.AF, socket.SOCK_DGRAM, socket.IPPROTO_UDP, flags=( socket.AI_NUMERICHOST | socket.AI_NUMERICSERV | socket.AI_PASSIVE ), ) src_ai = ais[0] mock.assert_called_once_with(data, src_ai[4], multicast=False) finally: sender_sock.close() async def test_endpoint_recv_multicast(self): payload = ( b"\x40\x00\x00\x00" b"\x00\x00\x00\x30" b"\x06\x00\x00\x21\x88\x99\x66\x77\xEE\x20\x21\x22\x00\x00\x00\x10" b"\x01\x01\x01\x01\x55\x66\x77\x88\x99\x00\x00\x01\xde\xad\xbe\xef" b"\x01\x01\x01\x01\x55\x67\x77\x88\x99\x00\x00\x01\xde\xad\xbe\xef" b"\x00\x00\x00\x20" b"\x00\x09\x04\x00\x01\x02\x03\x04\x00\x11\x07\xff" b"\x00\x09\x04\x00\xfe\xfd\xfc\xfb\x00\x11\xff\xff" b"\x00\x05\x02\x00\x22\x22\x33\x33" ) data = hdr.SOMEIPHeader( service_id=hdr.SD_SERVICE, method_id=hdr.SD_METHOD, client_id=0, session_id=1, interface_version=hdr.SD_INTERFACE_VERSION, message_type=hdr.SOMEIPMessageType.NOTIFICATION, payload=payload, ).build() mock = unittest.mock.Mock() self.prot.datagram_received = mock ais = socket.getaddrinfo( self.send_mc_addr, 30490, self.AF, socket.SOCK_DGRAM, socket.IPPROTO_UDP, flags=socket.AI_NUMERICHOST | socket.AI_NUMERICSERV, ) dst_ai = ais[0] sender_sock = socket.socket(self.AF, socket.SOCK_DGRAM, socket.IPPROTO_UDP) self._mc_sockopts(sender_sock) try: sender_sock.sendto(data, dst_ai[4]) await asyncio.sleep(0.01) sender_port = sender_sock.getsockname()[1] ais = socket.getaddrinfo( self.sender_lo_addr, sender_port, self.AF, socket.SOCK_DGRAM, socket.IPPROTO_UDP, flags=( socket.AI_NUMERICHOST | socket.AI_NUMERICSERV | socket.AI_PASSIVE ), ) src_ai = ais[0] mock.assert_called_once_with(data, src_ai[4], multicast=True) finally: sender_sock.close() class TestMulticastEndpointsV4( _MulticastEndpointsTest, unittest.IsolatedAsyncioTestCase ): bind_lo_addr = "127.0.0.1" sender_lo_addr = "127.0.0.1" send_addr = "127.0.0.1" bind_mc_addr = "224.244.224.245" send_mc_addr = "224.244.224.245" bind_interface = "lo" AF = socket.AF_INET def _mc_sockopts(self, sock: socket.socket) -> None: sock.setsockopt( socket.IPPROTO_IP, socket.IP_MULTICAST_IF, ipaddress.IPv4Address(self.sender_lo_addr).packed, ) sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 1) # For Linux, the loopback interface does the loopback already, so # IP_MULTICAST_LOOP is not required. BSD however does not receive own multicast # packets on a loopback interface, therefore IP_MULTICAST_LOOP=1 is required for # BSD. sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_LOOP, 1) class TestMulticastEndpointsV6( _MulticastEndpointsTest, unittest.IsolatedAsyncioTestCase ): """ required setup on Linux: ip link add type veth ip link set dev veth0 address 02:00:00:00:00:00 ip link set dev veth1 address 02:00:00:00:00:01 ip link set up dev veth0 ip link set up dev veth1 """ bind_lo_addr = "fe80::ff:fe00:0%veth0" sender_lo_addr = "fe80::ff:fe00:1%veth0" send_addr = "fe80::ff:fe00:0%veth1" bind_mc_addr = "ff02::dead:beef%veth0" send_mc_addr = "ff02::dead:beef%veth1" bind_interface = "veth0" send_interface = "veth1" AF = socket.AF_INET6 def setUp(self): try: socket.if_nametoindex(self.bind_interface) socket.if_nametoindex(self.send_interface) except OSError as exc: raise unittest.SkipTest("test interfaces veth0 / veth1 not up") from exc def _mc_sockopts(self, sock: socket.socket) -> None: ifindex = socket.if_nametoindex(self.send_interface) sock.setsockopt( socket.IPPROTO_IPV6, socket.IPV6_MULTICAST_IF, struct.pack("=i", ifindex) ) sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_MULTICAST_HOPS, 1) sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_MULTICAST_LOOP, 0) # }}} if __name__ == "__main__": unittest.main()
32.535685
88
0.603011
9,170
79,322
4.940131
0.063359
0.031964
0.032582
0.022251
0.825986
0.799364
0.77548
0.752345
0.72643
0.69334
0
0.051898
0.297975
79,322
2,437
89
32.549036
0.76161
0.032513
0
0.649869
0
0.007874
0.033466
0.01824
0
0
0.009433
0
0.099738
1
0.006824
false
0.00105
0.007874
0.000525
0.054593
0
0
0
0
null
0
0
0
1
1
1
1
1
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
6
715fdf490c3a92297f8da446941513fde6f5f97a
5,524
py
Python
tests/features/scheduling/test_scheduling.py
josephmancuso/masonite
e9ed31331268bd4966609fbc1e5c55afa5cb0a79
[ "MIT" ]
35
2018-01-08T01:20:16.000Z
2018-02-06T02:37:14.000Z
tests/features/scheduling/test_scheduling.py
josephmancuso/masonite
e9ed31331268bd4966609fbc1e5c55afa5cb0a79
[ "MIT" ]
55
2018-01-03T02:42:03.000Z
2018-02-06T13:35:54.000Z
tests/features/scheduling/test_scheduling.py
josephmancuso/masonite
e9ed31331268bd4966609fbc1e5c55afa5cb0a79
[ "MIT" ]
4
2018-01-08T13:13:14.000Z
2018-01-12T19:35:32.000Z
import pendulum from src.masonite.tests import TestCase from src.masonite.scheduling import Task class MockTask(Task): run_every = "5 minutes" timezone = "America/New_York" class TestScheduler(TestCase): def setUp(self): super().setUp() self.task = MockTask() def test_scheduler_should_run(self): assert self.task.run_every == "5 minutes" time = pendulum.now().on(2018, 5, 21).at(22, 5, 5) self.task._date = time assert self.task.should_run(time) == True time = pendulum.now().on(2018, 5, 21).at(22, 6, 5) self.task._date = time assert self.task.should_run(time) == False def test_scheduler_should_run_every_minute(self): self.task.run_every = "1 minute" time = pendulum.now().on(2018, 5, 21).at(22, 5, 5) self.task._date = time assert self.task.should_run(time) == True time = pendulum.now().on(2018, 5, 21).at(22, 6, 5) self.task._date = time assert self.task.should_run(time) == True def test_scheduler_should_run_every_2_minutes(self): self.task.run_every = "2 minutes" time = pendulum.now().on(2018, 5, 21).at(14, 56, 5) self.task._date = time assert self.task.should_run(time) == True time = pendulum.now().on(2018, 5, 21).at(14, 58, 5) self.task._date = time assert self.task.should_run(time) == True def test_scheduler_should_run_every_hour(self): self.task.run_every = "1 hour" time = pendulum.now().on(2018, 5, 21).at(2, 0, 1) self.task._date = time assert self.task.should_run(time) == True time = pendulum.now().on(2018, 5, 21).at(3, 0, 1) self.task._date = time assert self.task.should_run(time) == True self.task.run_every = "2 hours" time = pendulum.now().on(2018, 5, 21).at(2, 0, 1) self.task._date = time assert self.task.should_run(time) == True self.task.run_every = "2 hours" time = pendulum.now().on(2018, 5, 21).at(3, 0, 1) self.task._date = time assert self.task.should_run(time) == False time = pendulum.now().on(2018, 5, 21).at(4, 0, 1) self.task._date = time assert self.task.should_run(time) == True def test_scheduler_should_run_every_days(self): self.task.run_every = "2 days" time = pendulum.now().on(2018, 5, 21).at(0, 0, 1) self.task._date = time assert self.task.should_run(time) == False time = pendulum.now().on(2018, 5, 23).at(0, 0, 1) self.task._date = time assert self.task.should_run(time) == False self.task.run_at = "5:30" time = pendulum.now().on(2018, 5, 22).at(5, 30, 0) self.task._date = time assert self.task.should_run(time) == True self.task.run_at = "5:35" time = pendulum.now().on(2018, 5, 22).at(5, 30, 0) self.task._date = time assert self.task.should_run(time) == False def test_scheduler_should_run_every_months(self): self.task.run_every = "2 months" time = pendulum.now().on(2018, 1, 1).at(0, 0, 1) self.task._date = time assert self.task.should_run(time) == False time = pendulum.now().on(2018, 2, 1).at(0, 0, 1) self.task._date = time assert self.task.should_run(time) == True time = pendulum.now().on(2018, 2, 1).at(10, 0, 1) self.task._date = time assert self.task.should_run(time) == False self.task.run_at = "5:30" time = pendulum.now().on(2018, 2, 1).at(5, 30, 0) self.task._date = time assert self.task.should_run(time) == False def test_twice_daily_at_correct_time(self): time = pendulum.now().on(2018, 1, 1).at(1, 20, 5) self.task.run_every = "" self.task.twice_daily = (1, 13) self.task._date = time assert self.task.should_run() time = pendulum.now().on(2018, 1, 1).at(13, 20, 5) self.task._date = time assert self.task.should_run() def test_twice_daily_at_incorrect_time(self): time = pendulum.now().on(2018, 1, 1).at(12, 20, 5) self.task.run_every = "" self.task.twice_daily = (1, 13) self.task._date = time assert self.task.should_run() is False def test_run_at(self): self.task.run_every = "" self.task.run_at = "13:00" time = pendulum.now().on(2018, 1, 1).at(13, 0, 5) self.task._date = time self.task.run_at = "13:05" time = pendulum.now().on(2018, 1, 1).at(13, 5, 5) self.task._date = time assert self.task.should_run() is True time = pendulum.now().on(2018, 1, 1).at(13, 6, 5) self.task._date = time assert self.task.should_run() is False def test_method_calls(self): task = MockTask() task.at("13:00") time = pendulum.now().on(2018, 1, 1).at(13, 0, 5) task._date = time assert task.should_run(time) == True task = MockTask() task.every_minute() time = pendulum.now().on(2018, 5, 21).at(22, 5, 5) task._date = time assert task.should_run(time) == True def test_should_run_task_immediately_by_class(self): self.craft("schedule:run", "--task TaskTest --force").assertSuccess() def test_should_run_task_immediately_by_name(self): self.craft("schedule:run", "--task task_test --force").assertSuccess()
32.686391
78
0.590333
837
5,524
3.740741
0.0908
0.176302
0.129352
0.146599
0.875439
0.833919
0.773555
0.752475
0.73427
0.695624
0
0.078094
0.262853
5,524
168
79
32.880952
0.690815
0
0
0.603175
0
0
0.033128
0
0
0
0
0
0.230159
1
0.103175
false
0
0.02381
0
0.15873
0
0
0
0
null
0
0
0
1
1
1
1
1
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
6
7163ecf8c2e93e5428add81ad62e4da2dccca8e4
24
py
Python
tests/test_mypkg.py
RamizRzayev/pycounts
dd0e7e46d69b6b25b2ea041c5a679c2ab66f99b7
[ "MIT" ]
null
null
null
tests/test_mypkg.py
RamizRzayev/pycounts
dd0e7e46d69b6b25b2ea041c5a679c2ab66f99b7
[ "MIT" ]
null
null
null
tests/test_mypkg.py
RamizRzayev/pycounts
dd0e7e46d69b6b25b2ea041c5a679c2ab66f99b7
[ "MIT" ]
null
null
null
from mypkg import mypkg
12
23
0.833333
4
24
5
0.75
0
0
0
0
0
0
0
0
0
0
0
0.166667
24
1
24
24
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
7176c26a76e32225bb900d07b6f8fbce5dacd4bb
138
py
Python
src/app/admin/__init__.py
Ezequiel-Vega/peg
ff5c41c91df7885e0fd3d4c750497dd2d8290b67
[ "MIT" ]
null
null
null
src/app/admin/__init__.py
Ezequiel-Vega/peg
ff5c41c91df7885e0fd3d4c750497dd2d8290b67
[ "MIT" ]
null
null
null
src/app/admin/__init__.py
Ezequiel-Vega/peg
ff5c41c91df7885e0fd3d4c750497dd2d8290b67
[ "MIT" ]
null
null
null
from flask import Blueprint admin_bp : Blueprint = Blueprint("admin", __name__, template_folder='templates/admin') from . import routes
23
86
0.782609
17
138
6
0.647059
0.27451
0
0
0
0
0
0
0
0
0
0
0.123188
138
5
87
27.6
0.842975
0
0
0
0
0
0.144928
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0.666667
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
1
0
1
0
0
1
0
6
e0e9115f513a386f0246351c12de5d915cef6833
88
py
Python
toolsrequests/__init__.py
gboacloth/toolsrequests
b392f8e5506db6e78173ee6dc1d2ac137580b739
[ "MIT" ]
null
null
null
toolsrequests/__init__.py
gboacloth/toolsrequests
b392f8e5506db6e78173ee6dc1d2ac137580b739
[ "MIT" ]
null
null
null
toolsrequests/__init__.py
gboacloth/toolsrequests
b392f8e5506db6e78173ee6dc1d2ac137580b739
[ "MIT" ]
null
null
null
try: from TraceyShellClient import * except: from .TraceyShellClient import *
22
36
0.715909
8
88
7.875
0.625
0.666667
0.857143
0
0
0
0
0
0
0
0
0
0.227273
88
4
37
22
0.926471
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
6
e0ee98e9cb9824df2049646118fc1efba2211842
62
py
Python
test_main.py
autoscatto/mastojeppetto
c343b95cf6d8f7e79225d5055759d27d141dfa01
[ "MIT" ]
1
2019-11-16T02:10:16.000Z
2019-11-16T02:10:16.000Z
test_main.py
autoscatto/mastojeppetto
c343b95cf6d8f7e79225d5055759d27d141dfa01
[ "MIT" ]
2
2019-11-15T10:08:28.000Z
2019-11-15T10:08:30.000Z
test_main.py
autoscatto/mastojeppetto
c343b95cf6d8f7e79225d5055759d27d141dfa01
[ "MIT" ]
null
null
null
def test_import(): from mastojeppetto import download_all
20.666667
42
0.790323
8
62
5.875
0.875
0
0
0
0
0
0
0
0
0
0
0
0.16129
62
2
43
31
0.903846
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
true
0
1
0
1.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
1
1
0
1
0
1
0
0
6
e0f8bff52611242b65b6653d36c2749a0db10a06
96
py
Python
venv/lib/python3.8/site-packages/setuptools/depends.py
GiulianaPola/select_repeats
17a0d053d4f874e42cf654dd142168c2ec8fbd11
[ "MIT" ]
2
2022-03-13T01:58:52.000Z
2022-03-31T06:07:54.000Z
venv/lib/python3.8/site-packages/setuptools/depends.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
19
2021-11-20T04:09:18.000Z
2022-03-23T15:05:55.000Z
venv/lib/python3.8/site-packages/setuptools/depends.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
null
null
null
/home/runner/.cache/pip/pool/41/84/08/69daf90f02f13f3904ae136de6199186f1a15b1a1764c4570a6fe3710d
96
96
0.895833
9
96
9.555556
1
0
0
0
0
0
0
0
0
0
0
0.46875
0
96
1
96
96
0.427083
0
0
0
0
0
0
0
0
1
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
1
0
0
0
1
0
0
0
0
0
0
0
0
6
460082f14f5cf0a254fe43ec27c2d8800d0540c6
17,527
py
Python
packages/esp32_LoBo/frozen/display/fonts/ubuntu_mono_20.py
TheVinhLuong102/micropy-stubs
55ff1773008f7c4dfc3d70a403986486226eb6b3
[ "MIT" ]
18
2019-07-11T13:31:09.000Z
2022-01-27T06:38:40.000Z
packages/esp32_LoBo/frozen/display/fonts/ubuntu_mono_20.py
TheVinhLuong102/micropy-stubs
55ff1773008f7c4dfc3d70a403986486226eb6b3
[ "MIT" ]
9
2019-09-01T21:44:49.000Z
2022-02-04T20:55:08.000Z
packages/esp32_LoBo/frozen/display/fonts/ubuntu_mono_20.py
TheVinhLuong102/micropy-stubs
55ff1773008f7c4dfc3d70a403986486226eb6b3
[ "MIT" ]
6
2019-10-08T05:31:21.000Z
2021-04-22T10:21:01.000Z
_FONT = { 32: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575], 33: [10, 1048575, 1048575, 1048575, 1048575, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1048575, 1048575, 1032447, 1032447, 1032447, 1048575, 1048575, 1048575, 1048575], 34: [10, 1048575, 1048575, 1048575, 1045455, 1045455, 1045455, 1045455, 1045455, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575], 35: [10, 1048575, 1048575, 1048575, 1048575, 986895, 986895, 986895, 786435, 786435, 986895, 986895, 986895, 786435, 786435, 986895, 986895, 1048575, 1048575, 1048575, 1048575], 36: [10, 1048575, 1048575, 1048575, 1044735, 1044735, 983103, 983043, 1048515, 1048515, 1044483, 983055, 787455, 802815, 802803, 786435, 1032207, 1044735, 1044735, 1048575, 1048575], 37: [10, 1048575, 1048575, 1048575, 1048575, 851907, 999228, 1036092, 1036092, 1045308, 1047747, 986367, 848703, 848847, 848847, 848883, 987132, 1048575, 1048575, 1048575, 1048575], 38: [10, 1048575, 1048575, 1048575, 1048575, 1032255, 983055, 986895, 986895, 1032255, 798735, 786639, 787395, 987075, 790275, 835587, 61455, 1048575, 1048575, 1048575, 1048575], 39: [10, 1048575, 1048575, 1048575, 1044735, 1044735, 1044735, 1044735, 1044735, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575], 40: [10, 1048575, 1048575, 1048575, 1048575, 987135, 1033215, 1044735, 1047615, 1047615, 1048335, 1048335, 1048335, 1048335, 1048335, 1047615, 1047615, 1044735, 984063, 987135, 1048575], 41: [10, 1048575, 1048575, 1048575, 1048575, 1048335, 1047567, 1044735, 1033215, 1033215, 987135, 987135, 987135, 987135, 987135, 1033215, 1033215, 1044735, 1047615, 1048335, 1048575], 42: [10, 1048575, 1048575, 1048575, 1048575, 1044735, 1044735, 798915, 786435, 1044735, 1032255, 986895, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575], 43: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1047807, 1047807, 1047807, 1047807, 983043, 1047807, 1047807, 1047807, 1047807, 1048575, 1048575, 1048575, 1048575], 44: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1032447, 1032447, 1032447, 1033215, 1044735, 1047615, 1048575], 45: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1032255, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575], 46: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1044543, 1044543, 1044543, 1048575, 1048575, 1048575, 1048575], 47: [10, 1048575, 1048575, 1048575, 999423, 1036287, 1036287, 1036287, 1045503, 1045503, 1045503, 1047807, 1047807, 1048383, 1048383, 1048383, 1048527, 1048527, 1048527, 1048563, 1048575], 48: [10, 1048575, 1048575, 1048575, 1048575, 1032255, 983055, 986895, 802755, 802755, 798915, 798915, 802755, 802755, 986895, 983055, 1032255, 1048575, 1048575, 1048575, 1048575], 49: [10, 1048575, 1048575, 1048575, 1048575, 1033215, 1032447, 1032207, 1033155, 1033215, 1033215, 1033215, 1033215, 1033215, 1033215, 786447, 786447, 1048575, 1048575, 1048575, 1048575], 50: [10, 1048575, 1048575, 1048575, 1048575, 1032207, 983043, 987123, 987135, 987135, 1033215, 1044735, 1047615, 1048335, 1048527, 983043, 983043, 1048575, 1048575, 1048575, 1048575], 51: [10, 1048575, 1048575, 1048575, 1048575, 1032207, 786435, 802767, 802815, 790527, 983103, 983103, 790527, 802815, 790515, 983043, 1032207, 1048575, 1048575, 1048575, 1048575], 52: [10, 1048575, 1048575, 1048575, 1048575, 987135, 984063, 983295, 986175, 986943, 986895, 987075, 786435, 786435, 987135, 987135, 987135, 1048575, 1048575, 1048575, 1048575], 53: [10, 1048575, 1048575, 1048575, 1048575, 786447, 786447, 1048335, 1048335, 1032207, 983055, 790527, 802815, 802815, 790515, 983043, 1032207, 1048575, 1048575, 1048575, 1048575], 54: [10, 1048575, 1048575, 1048575, 1048575, 984063, 983103, 1047567, 1048335, 1032195, 983043, 802755, 802755, 802755, 790275, 983055, 1032255, 1048575, 1048575, 1048575, 1048575], 55: [10, 1048575, 1048575, 1048575, 1048575, 786435, 786435, 802815, 987135, 1033215, 1033215, 1044735, 1044735, 1044735, 1047615, 1047615, 1047615, 1048575, 1048575, 1048575, 1048575], 56: [10, 1048575, 1048575, 1048575, 1048575, 1032255, 786447, 802755, 802755, 986883, 1032207, 983055, 790467, 802755, 802755, 983043, 1032255, 1048575, 1048575, 1048575, 1048575], 57: [10, 1048575, 1048575, 1048575, 1048575, 1032255, 983055, 790275, 802755, 802755, 802755, 786447, 786495, 987135, 984063, 1032207, 1047567, 1048575, 1048575, 1048575, 1048575], 58: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1044543, 1044543, 1044543, 1048575, 1048575, 1048575, 1044543, 1044543, 1044543, 1048575, 1048575, 1048575, 1048575], 59: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1044543, 1044543, 1044543, 1048575, 1048575, 1048575, 1032447, 1032447, 1032447, 1033215, 1044735, 1047615, 1048575], 60: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 802815, 984063, 1047567, 1048515, 1047567, 984063, 802815, 1048575, 1048575, 1048575, 1048575, 1048575], 61: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 786435, 1048575, 1048575, 786435, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575], 62: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048515, 1047567, 984063, 802815, 984063, 1047567, 1048515, 1048575, 1048575, 1048575, 1048575, 1048575], 63: [10, 1048575, 1048575, 1048575, 1048575, 1032207, 983043, 987123, 987135, 1033215, 1044735, 1047615, 1048575, 1048575, 1044543, 1044543, 1044543, 1048575, 1048575, 1048575, 1048575], 64: [10, 1048575, 1048575, 1048575, 1048575, 1032447, 983103, 790287, 802575, 802755, 787395, 786627, 798915, 798915, 786627, 787395, 1048335, 1047567, 983103, 983295, 1048575], 65: [10, 1048575, 1048575, 1048575, 1048575, 1044543, 1032975, 1032975, 1032975, 1032975, 986883, 987075, 987075, 983043, 983040, 802800, 802800, 1048575, 1048575, 1048575, 1048575], 66: [10, 1048575, 1048575, 1048575, 1048575, 1044483, 983043, 987075, 987075, 987075, 1044483, 983043, 802755, 802755, 790467, 983043, 1032195, 1048575, 1048575, 1048575, 1048575], 67: [10, 1048575, 1048575, 1048575, 1048575, 983295, 786495, 850959, 1048323, 1048515, 1048515, 1048515, 1048515, 1048323, 851727, 786447, 983295, 1048575, 1048575, 1048575, 1048575], 68: [10, 1048575, 1048575, 1048575, 1048575, 1044483, 983043, 987075, 802755, 802755, 802755, 802755, 802755, 802755, 987075, 983043, 1044483, 1048575, 1048575, 1048575, 1048575], 69: [10, 1048575, 1048575, 1048575, 1048575, 786447, 786447, 1048335, 1048335, 1048335, 983055, 983055, 1048335, 1048335, 1048335, 786447, 786447, 1048575, 1048575, 1048575, 1048575], 70: [10, 1048575, 1048575, 1048575, 1048575, 786447, 786447, 1048335, 1048335, 1048335, 983055, 983055, 1048335, 1048335, 1048335, 1048335, 1048335, 1048575, 1048575, 1048575, 1048575], 71: [10, 1048575, 1048575, 1048575, 1048575, 983295, 786495, 850959, 1048323, 1048515, 1048515, 802755, 802755, 802563, 802575, 786447, 786687, 1048575, 1048575, 1048575, 1048575], 72: [10, 1048575, 1048575, 1048575, 1048575, 802755, 802755, 802755, 802755, 802755, 786435, 786435, 802755, 802755, 802755, 802755, 802755, 1048575, 1048575, 1048575, 1048575], 73: [10, 1048575, 1048575, 1048575, 1048575, 983055, 983055, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 983055, 983055, 1048575, 1048575, 1048575, 1048575], 74: [10, 1048575, 1048575, 1048575, 1048575, 983055, 983055, 987135, 987135, 987135, 987135, 987135, 987135, 987135, 984051, 1032195, 1044495, 1048575, 1048575, 1048575, 1048575], 75: [10, 1048575, 1048575, 1048575, 1048575, 802755, 987075, 1033155, 1032387, 1044675, 1047555, 1044483, 1044675, 1033155, 987075, 987075, 802755, 1048575, 1048575, 1048575, 1048575], 76: [10, 1048575, 1048575, 1048575, 1048575, 1048335, 1048335, 1048335, 1048335, 1048335, 1048335, 1048335, 1048335, 1048335, 1048335, 786447, 786447, 1048575, 1048575, 1048575, 1048575], 77: [10, 1048575, 1048575, 1048575, 1048575, 986895, 986895, 986895, 789519, 798915, 798915, 798915, 798915, 802755, 802755, 802755, 802755, 1048575, 1048575, 1048575, 1048575], 78: [10, 1048575, 1048575, 1048575, 1048575, 802755, 802563, 802563, 801987, 801987, 799683, 799683, 799683, 790467, 790467, 802755, 802755, 1048575, 1048575, 1048575, 1048575], 79: [10, 1048575, 1048575, 1048575, 1048575, 1032255, 983055, 986895, 802755, 802755, 802755, 802755, 802755, 802755, 986895, 983055, 1032255, 1048575, 1048575, 1048575, 1048575], 80: [10, 1048575, 1048575, 1048575, 1048575, 1032195, 983043, 790467, 802755, 802755, 790467, 983043, 1032195, 1048515, 1048515, 1048515, 1048515, 1048575, 1048575, 1048575, 1048575], 81: [10, 1048575, 1048575, 1048575, 1048575, 1032255, 983055, 986895, 802755, 802755, 802755, 802755, 802755, 802755, 790275, 983055, 1032255, 1032447, 787455, 802815, 1048575], 82: [10, 1048575, 1048575, 1048575, 1048575, 1032195, 983043, 790467, 802755, 802755, 790467, 983043, 1032195, 987075, 987075, 802755, 65475, 1048575, 1048575, 1048575, 1048575], 83: [10, 1048575, 1048575, 1048575, 1048575, 983103, 786447, 851907, 1048515, 1048323, 1032207, 983103, 790527, 802815, 802803, 786435, 1032207, 1048575, 1048575, 1048575, 1048575], 84: [10, 1048575, 1048575, 1048575, 1048575, 786435, 786435, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1048575, 1048575, 1048575, 1048575], 85: [10, 1048575, 1048575, 1048575, 1048575, 802755, 802755, 802755, 802755, 802755, 802755, 802755, 802755, 802755, 790275, 983055, 1032255, 1048575, 1048575, 1048575, 1048575], 86: [10, 1048575, 1048575, 1048575, 1048575, 802800, 802800, 987075, 987075, 987075, 986883, 1032975, 1032975, 1032207, 1044543, 1044543, 1044543, 1048575, 1048575, 1048575, 1048575], 87: [10, 1048575, 1048575, 1048575, 1048575, 65520, 65520, 65520, 65520, 61680, 61680, 61680, 53040, 53040, 53040, 16320, 16320, 1048575, 1048575, 1048575, 1048575], 88: [10, 1048575, 1048575, 1048575, 1048575, 802800, 987075, 987075, 1032975, 1044543, 1044543, 1044543, 1032207, 1032975, 987075, 987075, 802800, 1048575, 1048575, 1048575, 1048575], 89: [10, 1048575, 1048575, 1048575, 1048575, 65520, 802755, 802755, 986895, 986895, 1032255, 1032255, 1044735, 1044735, 1044735, 1044735, 1044735, 1048575, 1048575, 1048575, 1048575], 90: [10, 1048575, 1048575, 1048575, 1048575, 786435, 786435, 790527, 987135, 1033215, 1044735, 1044543, 1047615, 1048335, 1048323, 786435, 786435, 1048575, 1048575, 1048575, 1048575], 91: [10, 1048575, 1048575, 1048575, 1048575, 1032255, 1048383, 1048383, 1048383, 1048383, 1048383, 1048383, 1048383, 1048383, 1048383, 1048383, 1048383, 1048383, 1048383, 1032255, 1048575], 92: [10, 1048575, 1048575, 1048575, 1048563, 1048527, 1048527, 1048527, 1048383, 1048383, 1048383, 1047807, 1047807, 1045503, 1045503, 1045503, 1036287, 1036287, 1036287, 999423, 1048575], 93: [10, 1048575, 1048575, 1048575, 1048575, 1032255, 1036287, 1036287, 1036287, 1036287, 1036287, 1036287, 1036287, 1036287, 1036287, 1036287, 1036287, 1036287, 1036287, 1032255, 1048575], 94: [10, 1048575, 1048575, 1048575, 1048575, 1047807, 1044543, 1045311, 1036239, 987075, 999411, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575], 95: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 786432, 1048575], 96: [10, 1048575, 1048575, 1048575, 1048383, 1047807, 1045503, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575], 97: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 983055, 786447, 802815, 786495, 802755, 802755, 802755, 786435, 786495, 1048575, 1048575, 1048575, 1048575], 98: [10, 1048575, 1048575, 1048575, 1048515, 1048515, 1048515, 1048515, 1032195, 983043, 790467, 802755, 802755, 802755, 790467, 983043, 1032195, 1048575, 1048575, 1048575, 1048575], 99: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 786687, 786447, 1048323, 1048515, 1048515, 1048515, 1048323, 786447, 786495, 1048575, 1048575, 1048575, 1048575], 100: [10, 1048575, 1048575, 1048575, 802815, 802815, 802815, 802815, 786495, 786447, 802563, 802755, 802755, 802755, 802563, 786447, 786495, 1048575, 1048575, 1048575, 1048575], 101: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1032255, 786447, 802755, 786435, 1048515, 1048515, 1048323, 983055, 983103, 1048575, 1048575, 1048575, 1048575], 102: [10, 1048575, 1048575, 1048575, 255, 63, 1047615, 1047615, 786435, 786435, 1047615, 1047615, 1047615, 1047615, 1047615, 1047615, 1047615, 1048575, 1048575, 1048575, 1048575], 103: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 786495, 786447, 802563, 802755, 802755, 802755, 802563, 786447, 786495, 802815, 983043, 1032195, 1048575], 104: [10, 1048575, 1048575, 1048575, 1048515, 1048515, 1048515, 1048515, 1032195, 983043, 790467, 802755, 802755, 802755, 802755, 802755, 802755, 1048575, 1048575, 1048575, 1048575], 105: [10, 1048575, 1048575, 1048575, 1048575, 1044735, 1044735, 1048575, 1044483, 1044483, 1044735, 1044735, 1044735, 1044735, 1044735, 786687, 787455, 1048575, 1048575, 1048575, 1048575], 106: [10, 1048575, 1048575, 1048575, 1048575, 1033215, 1033215, 1048575, 983055, 983055, 987135, 987135, 987135, 987135, 987135, 987135, 987135, 987135, 983043, 1032207, 1048575], 107: [10, 1048575, 1048575, 1048575, 1048515, 1048515, 1048515, 1048515, 790467, 984003, 1032387, 1044483, 1047555, 1044675, 1033155, 987075, 802755, 1048575, 1048575, 1048575, 1048575], 108: [10, 1048575, 1048575, 1048575, 1044483, 1044483, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 786687, 787455, 1048575, 1048575, 1048575, 1048575], 109: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 983043, 786435, 798915, 798915, 798915, 798915, 802755, 802755, 802755, 1048575, 1048575, 1048575, 1048575], 110: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1032195, 983043, 790467, 802755, 802755, 802755, 802755, 802755, 802755, 1048575, 1048575, 1048575, 1048575], 111: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1032255, 983055, 790275, 802755, 802755, 802755, 790275, 983055, 1032255, 1048575, 1048575, 1048575, 1048575], 112: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1032195, 983043, 790467, 802755, 802755, 802755, 790467, 983043, 1032195, 1048515, 1048515, 1048515, 1048575], 113: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 786495, 786447, 802563, 802755, 802755, 802755, 802563, 786447, 786495, 802815, 802815, 802815, 1048575], 114: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 786495, 786447, 1048335, 1048335, 1048335, 1048335, 1048335, 1048335, 1048335, 1048575, 1048575, 1048575, 1048575], 115: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 786495, 786435, 1048515, 1047555, 983055, 787455, 802803, 786435, 983055, 1048575, 1048575, 1048575, 1048575], 116: [10, 1048575, 1048575, 1048575, 1048575, 1047615, 1047615, 1047615, 786435, 786435, 1047615, 1047615, 1047615, 1047615, 1047615, 786495, 786687, 1048575, 1048575, 1048575, 1048575], 117: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 802755, 802755, 802755, 802755, 802755, 802755, 802563, 786447, 786495, 1048575, 1048575, 1048575, 1048575], 118: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 802755, 802755, 986895, 986895, 986895, 986895, 1032255, 1032255, 1032255, 1048575, 1048575, 1048575, 1048575], 119: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 802800, 802800, 802032, 802032, 998451, 983811, 983811, 983811, 987075, 1048575, 1048575, 1048575, 1048575], 120: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 802755, 986895, 1032255, 1032255, 1044735, 1032255, 1035327, 986895, 802755, 1048575, 1048575, 1048575, 1048575], 121: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 802755, 802755, 802575, 986895, 986895, 986175, 986175, 983103, 1032447, 1032447, 1044483, 1047555, 1048575], 122: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 983043, 983043, 1033215, 1044735, 1047615, 1048335, 1048335, 983043, 983043, 1048575, 1048575, 1048575, 1048575], 123: [10, 1048575, 1048575, 1048575, 787455, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1048335, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 787455, 1048575], 124: [10, 1048575, 1048575, 1048575, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1048575], 125: [10, 1048575, 1048575, 1048575, 1047555, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 987135, 1044735, 1044735, 1044735, 1044735, 1044735, 1044735, 1047555, 1048575], 126: [10, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 850959, 786435, 984051, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575, 1048575], }
178.846939
190
0.750271
2,091
17,527
6.288379
0.0923
0.727204
0.811316
0.717621
0.730474
0.657845
0.582174
0.521028
0.451441
0.329303
0
0.851746
0.119473
17,527
97
191
180.690722
0.000259
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
1
0
0
0
0
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
4604333b6e8eadfa7c35aec2acacece0f69cefd8
19,105
py
Python
cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_ncs1k_macsec_ea_oper.py
tkamata-test/ydk-py
b637e7853a8edbbd31fbc05afa3aa4110b31c5f9
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_ncs1k_macsec_ea_oper.py
tkamata-test/ydk-py
b637e7853a8edbbd31fbc05afa3aa4110b31c5f9
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_ncs1k_macsec_ea_oper.py
tkamata-test/ydk-py
b637e7853a8edbbd31fbc05afa3aa4110b31c5f9
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
import re import collections from enum import Enum from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLIST, REFERENCE_IDENTITY_CLASS, REFERENCE_ENUM_CLASS, REFERENCE_BITS, REFERENCE_UNION from ydk.errors import YPYError, YPYModelError from ydk.providers._importer import _yang_ns _meta_table = { 'Ncs1KCipherSuitEnum' : _MetaInfoEnum('Ncs1KCipherSuitEnum', 'ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_macsec_ea_oper', { 'gcm-aes-256':'GCM_AES_256', 'gcm-aes-128':'GCM_AES_128', 'gcm-aes-xpn-256':'GCM_AES_XPN_256', }, 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', _yang_ns._namespaces['Cisco-IOS-XR-ncs1k-macsec-ea-oper']), 'Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo.EncryptScStatus.ActiveAssociation' : { 'meta_info' : _MetaInfoClass('Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo.EncryptScStatus.ActiveAssociation', False, [ _MetaInfoClassMember('association-number', ATTRIBUTE, 'int' , None, None, [('0', '255')], [], ''' Assocition Number ''', 'association_number', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('device-association-number', ATTRIBUTE, 'int' , None, None, [('0', '255')], [], ''' Devive Association Number ''', 'device_association_number', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('key-crc', ATTRIBUTE, 'int' , None, None, [('0', '4294967295')], [], ''' 32bit CRC of Programmed Key ''', 'key_crc', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('programmed-time', ATTRIBUTE, 'str' , None, None, [(0, 30)], [], ''' Key Programmed Time ''', 'programmed_time', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('short-secure-channel-id', ATTRIBUTE, 'int' , None, None, [('0', '4294967295')], [], ''' Short Secure Channel Id ''', 'short_secure_channel_id', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('xpn-salt', REFERENCE_LEAFLIST, 'int' , None, None, [('0', '4294967295')], [], ''' XPN Salt ''', 'xpn_salt', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), ], 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', 'active-association', _yang_ns._namespaces['Cisco-IOS-XR-ncs1k-macsec-ea-oper'], 'ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_macsec_ea_oper' ), }, 'Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo.EncryptScStatus' : { 'meta_info' : _MetaInfoClass('Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo.EncryptScStatus', False, [ _MetaInfoClassMember('active-association', REFERENCE_LIST, 'ActiveAssociation' , 'ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_macsec_ea_oper', 'Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo.EncryptScStatus.ActiveAssociation', [], [], ''' Active Associations ''', 'active_association', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('cipher-suite', REFERENCE_ENUM_CLASS, 'Ncs1KCipherSuitEnum' , 'ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_macsec_ea_oper', 'Ncs1KCipherSuitEnum', [], [], ''' Cipher Suite ''', 'cipher_suite', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('confidentiality-offset', ATTRIBUTE, 'int' , None, None, [('0', '4294967295')], [], ''' Confidentiality offset ''', 'confidentiality_offset', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('initial-packet-number', ATTRIBUTE, 'int' , None, None, [('0', '18446744073709551615')], [], ''' Initial Packet Number ''', 'initial_packet_number', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('max-packet-number', ATTRIBUTE, 'int' , None, None, [('0', '18446744073709551615')], [], ''' Maximum Packet Number ''', 'max_packet_number', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('protection-enabled', ATTRIBUTE, 'bool' , None, None, [], [], ''' Protection Enabled ''', 'protection_enabled', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('recent-packet-number', ATTRIBUTE, 'int' , None, None, [('0', '18446744073709551615')], [], ''' Recent Packet Number ''', 'recent_packet_number', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('secure-channel-id', ATTRIBUTE, 'int' , None, None, [('0', '18446744073709551615')], [], ''' Secure Channel Id ''', 'secure_channel_id', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('secure-tag-length', ATTRIBUTE, 'int' , None, None, [('0', '4294967295')], [], ''' Secure Tag Length ''', 'secure_tag_length', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), ], 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', 'encrypt-sc-status', _yang_ns._namespaces['Cisco-IOS-XR-ncs1k-macsec-ea-oper'], 'ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_macsec_ea_oper' ), }, 'Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo.DecryptScStatus.ActiveAssociation' : { 'meta_info' : _MetaInfoClass('Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo.DecryptScStatus.ActiveAssociation', False, [ _MetaInfoClassMember('association-number', ATTRIBUTE, 'int' , None, None, [('0', '255')], [], ''' Assocition Number ''', 'association_number', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('device-association-number', ATTRIBUTE, 'int' , None, None, [('0', '255')], [], ''' Devive Association Number ''', 'device_association_number', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('key-crc', ATTRIBUTE, 'int' , None, None, [('0', '4294967295')], [], ''' 32bit CRC of Programmed Key ''', 'key_crc', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('programmed-time', ATTRIBUTE, 'str' , None, None, [(0, 30)], [], ''' Key Programmed Time ''', 'programmed_time', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('short-secure-channel-id', ATTRIBUTE, 'int' , None, None, [('0', '4294967295')], [], ''' Short Secure Channel Id ''', 'short_secure_channel_id', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('xpn-salt', REFERENCE_LEAFLIST, 'int' , None, None, [('0', '4294967295')], [], ''' XPN Salt ''', 'xpn_salt', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), ], 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', 'active-association', _yang_ns._namespaces['Cisco-IOS-XR-ncs1k-macsec-ea-oper'], 'ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_macsec_ea_oper' ), }, 'Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo.DecryptScStatus' : { 'meta_info' : _MetaInfoClass('Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo.DecryptScStatus', False, [ _MetaInfoClassMember('active-association', REFERENCE_LIST, 'ActiveAssociation' , 'ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_macsec_ea_oper', 'Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo.DecryptScStatus.ActiveAssociation', [], [], ''' Active Associations ''', 'active_association', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('cipher-suite', REFERENCE_ENUM_CLASS, 'Ncs1KCipherSuitEnum' , 'ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_macsec_ea_oper', 'Ncs1KCipherSuitEnum', [], [], ''' Cipher Suite ''', 'cipher_suite', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('confidentiality-offset', ATTRIBUTE, 'int' , None, None, [('0', '4294967295')], [], ''' Confidentiality offset ''', 'confidentiality_offset', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('initial-packet-number', ATTRIBUTE, 'int' , None, None, [('0', '18446744073709551615')], [], ''' Initial Packet Number ''', 'initial_packet_number', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('max-packet-number', ATTRIBUTE, 'int' , None, None, [('0', '18446744073709551615')], [], ''' Maximum Packet Number ''', 'max_packet_number', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('protection-enabled', ATTRIBUTE, 'bool' , None, None, [], [], ''' Protection Enabled ''', 'protection_enabled', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('recent-packet-number', ATTRIBUTE, 'int' , None, None, [('0', '18446744073709551615')], [], ''' Recent Packet Number ''', 'recent_packet_number', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('secure-channel-id', ATTRIBUTE, 'int' , None, None, [('0', '18446744073709551615')], [], ''' Secure Channel Id ''', 'secure_channel_id', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('secure-tag-length', ATTRIBUTE, 'int' , None, None, [('0', '4294967295')], [], ''' Secure Tag Length ''', 'secure_tag_length', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), ], 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', 'decrypt-sc-status', _yang_ns._namespaces['Cisco-IOS-XR-ncs1k-macsec-ea-oper'], 'ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_macsec_ea_oper' ), }, 'Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo' : { 'meta_info' : _MetaInfoClass('Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo', False, [ _MetaInfoClassMember('decrypt-sc-status', REFERENCE_CLASS, 'DecryptScStatus' , 'ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_macsec_ea_oper', 'Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo.DecryptScStatus', [], [], ''' Decrypt Secure Channel Status ''', 'decrypt_sc_status', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('encrypt-sc-status', REFERENCE_CLASS, 'EncryptScStatus' , 'ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_macsec_ea_oper', 'Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo.EncryptScStatus', [], [], ''' Encrypt Secure Channel Status ''', 'encrypt_sc_status', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('must-secure', ATTRIBUTE, 'bool' , None, None, [], [], ''' Must Secure ''', 'must_secure', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), _MetaInfoClassMember('replay-window-size', ATTRIBUTE, 'int' , None, None, [('0', '4294967295')], [], ''' Replay Window Size ''', 'replay_window_size', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), ], 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', 'ncs1k-status-info', _yang_ns._namespaces['Cisco-IOS-XR-ncs1k-macsec-ea-oper'], 'ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_macsec_ea_oper' ), }, 'Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName' : { 'meta_info' : _MetaInfoClass('Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName', False, [ _MetaInfoClassMember('name', ATTRIBUTE, 'str' , None, None, [], ['(([a-zA-Z0-9_]*\\d+/){3,4}\\d+)|(([a-zA-Z0-9_]*\\d+/){3,4}\\d+\\.\\d+)|(([a-zA-Z0-9_]*\\d+/){2}([a-zA-Z0-9_]*\\d+))|(([a-zA-Z0-9_]*\\d+/){2}([a-zA-Z0-9_]+))|([a-zA-Z0-9_-]*\\d+)|([a-zA-Z0-9_-]*\\d+\\.\\d+)|(mpls)|(dwdm)'], ''' Port name ''', 'name', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', True), _MetaInfoClassMember('ncs1k-status-info', REFERENCE_CLASS, 'Ncs1KStatusInfo' , 'ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_macsec_ea_oper', 'Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo', [], [], ''' controller data ''', 'ncs1k_status_info', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), ], 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', 'ncs1k-macsec-ctrlr-name', _yang_ns._namespaces['Cisco-IOS-XR-ncs1k-macsec-ea-oper'], 'ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_macsec_ea_oper' ), }, 'Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames' : { 'meta_info' : _MetaInfoClass('Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames', False, [ _MetaInfoClassMember('ncs1k-macsec-ctrlr-name', REFERENCE_LIST, 'Ncs1KMacsecCtrlrName' , 'ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_macsec_ea_oper', 'Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName', [], [], ''' Interface name ''', 'ncs1k_macsec_ctrlr_name', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), ], 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', 'ncs1k-macsec-ctrlr-names', _yang_ns._namespaces['Cisco-IOS-XR-ncs1k-macsec-ea-oper'], 'ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_macsec_ea_oper' ), }, 'Ncs1KMacsecOper' : { 'meta_info' : _MetaInfoClass('Ncs1KMacsecOper', False, [ _MetaInfoClassMember('ncs1k-macsec-ctrlr-names', REFERENCE_CLASS, 'Ncs1KMacsecCtrlrNames' , 'ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_macsec_ea_oper', 'Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames', [], [], ''' All Macsec operational data ''', 'ncs1k_macsec_ctrlr_names', 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', False), ], 'Cisco-IOS-XR-ncs1k-macsec-ea-oper', 'ncs1k-macsec-oper', _yang_ns._namespaces['Cisco-IOS-XR-ncs1k-macsec-ea-oper'], 'ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_macsec_ea_oper' ), }, } _meta_table['Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo.EncryptScStatus.ActiveAssociation']['meta_info'].parent =_meta_table['Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo.EncryptScStatus']['meta_info'] _meta_table['Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo.DecryptScStatus.ActiveAssociation']['meta_info'].parent =_meta_table['Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo.DecryptScStatus']['meta_info'] _meta_table['Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo.EncryptScStatus']['meta_info'].parent =_meta_table['Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo']['meta_info'] _meta_table['Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo.DecryptScStatus']['meta_info'].parent =_meta_table['Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo']['meta_info'] _meta_table['Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName.Ncs1KStatusInfo']['meta_info'].parent =_meta_table['Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName']['meta_info'] _meta_table['Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames.Ncs1KMacsecCtrlrName']['meta_info'].parent =_meta_table['Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames']['meta_info'] _meta_table['Ncs1KMacsecOper.Ncs1KMacsecCtrlrNames']['meta_info'].parent =_meta_table['Ncs1KMacsecOper']['meta_info']
55.057637
266
0.55865
1,625
19,105
6.332923
0.078769
0.071519
0.089399
0.107861
0.895831
0.878437
0.8591
0.828977
0.766009
0.736663
0
0.04336
0.307092
19,105
346
267
55.216763
0.734023
0
0
0.604651
0
0.003322
0.483369
0.372988
0
0
0
0
0
1
0
false
0
0.026578
0
0.026578
0
0
0
0
null
0
0
0
1
1
1
1
1
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
6
4606f4e422cac3728119b4c8a654488c48898ed9
35,293
py
Python
test/test_electrophysiology.py
GMattheisen/fairgraph
4b60e2b03869ff8276ad9c74147064af947dc282
[ "Apache-2.0" ]
null
null
null
test/test_electrophysiology.py
GMattheisen/fairgraph
4b60e2b03869ff8276ad9c74147064af947dc282
[ "Apache-2.0" ]
null
null
null
test/test_electrophysiology.py
GMattheisen/fairgraph
4b60e2b03869ff8276ad9c74147064af947dc282
[ "Apache-2.0" ]
null
null
null
# encoding: utf-8 """ Tests of fairgraph.electrophysiology module, using a mock Http client which returns data loaded from the files in the test_data directory. """ from fairgraph.base import KGQuery, KGProxy, as_list, Distribution from fairgraph.commons import BrainRegion, CellType, QuantitativeValue from fairgraph.core import use_namespace as use_core_namespace from fairgraph.electrophysiology import ( Trace, MultiChannelMultiTrialRecording, PatchedCell, Slice, BrainSlicingActivity, PatchedSlice, PatchedCellCollection, PatchClampActivity, PatchClampExperiment, QualifiedTraceGeneration, QualifiedMultiTraceGeneration, IntraCellularSharpElectrodeExperiment, IntraCellularSharpElectrodeRecordedCell, IntraCellularSharpElectrodeRecordedCellCollection, IntraCellularSharpElectrodeRecordedSlice, IntraCellularSharpElectrodeRecording, ElectrodeImplantationActivity, ExtracellularElectrodeExperiment, ImplantedBrainTissue, ExtracellularElectrodeExperiment,ECoGExperiment, CulturingActivity, Device, Task, Sensor, ElectrodeArrayExperiment, ElectrodePlacementActivity, EEGExperiment, CellCulture, list_kg_classes, use_namespace as use_electrophysiology_namespace) from fairgraph.minds import Dataset from .utils import kg_client, MockKGObject, test_data_lookup, BaseTestKG from pyxus.resources.entity import Instance import pytest test_data_lookup.update({ "/v0/data/neuralactivity/experiment/brainslicing/v0.1.0/": "test/test_data/nexus/electrophysiology/brainslicing_list_0_10.json", "/v0/data/neuralactivity/experiment/brainslicingactivity/v0.1.0/": "test/test_data/nexus/electrophysiology/brainslicingactivity_list_0_10.json", "/v0/data/neuralactivity/experiment/intracellularsharpelectrodeexperiment/v0.1.0/": "test/test_data/nexus/electrophysiology/intracellularsharpelectrodeexperiment_list_0_10.json", "/v0/data/neuralactivity/experiment/intrasharprecordedcell/v0.1.0/": "test/test_data/nexus/electrophysiology/intracellularsharpelectroderecordedcell_list_0_10.json", "/v0/data/neuralactivity/experiment/intrasharprecordedcellcollection/v0.1.0/": "test/test_data/nexus/electrophysiology/intracellularsharpelectroderecordedcellcollection_list_0_10.json", "/v0/data/neuralactivity/experiment/intrasharprecordedslice/v0.1.0/": "test/test_data/nexus/electrophysiology/intracellularsharpelectroderecordedslice_list_0_10.json", "/v0/data/neuralactivity/experiment/intrasharpelectrode/v0.1.0/": "test/test_data/nexus/electrophysiology/intracellularsharpelectroderecording_list_0_10.json", "/v0/data/neuralactivity/electrophysiology/multichannelmultitrialrecording/v0.1.0/": "test/test_data/nexus/electrophysiology/multichannelmultitrialrecording_list_0_10.json", "/v0/data/neuralactivity/electrophysiology/multitrace/v0.1.0/": "test/test_data/nexus/electrophysiology/multitrace_list_0_10.json", "/v0/data/neuralactivity/electrophysiology/multitrace/v0.1.1/": "test/test_data/nexus/electrophysiology/multitrace_list_0_10.json", "/v0/data/neuralactivity/electrophysiology/multitrace/v0.2.0/": "test/test_data/nexus/electrophysiology/multitrace_list_0_10.json", "/v0/data/neuralactivity/experiment/multitracegeneration/v0.1.0/": "test/test_data/nexus/electrophysiology/multitracegeneration_list_0_10.json", "/v0/data/neuralactivity/experiment/patchclampactivity/v0.1.0/": "test/test_data/nexus/electrophysiology/patchclampactivity_list_0_10.json", "/v0/data/neuralactivity/experiment/patchclampexperiment/v0.1.0/": "test/test_data/nexus/electrophysiology/patchclampexperiment_list_0_10.json", "/v0/data/neuralactivity/experiment/patchedcell/v0.1.0/": "test/test_data/nexus/electrophysiology/patchedcell_list_0_50.json", "/v0/data/neuralactivity/experiment/patchedcellcollection/v0.1.0/": "test/test_data/nexus/electrophysiology/patchedcellcollection_list_0_10.json", "/v0/data/neuralactivity/experiment/patchedslice/v0.1.0/": "test/test_data/nexus/electrophysiology/patchedslice_list_0_10.json", "/v0/data/neuralactivity/electrophysiology/multitracegeneration/v0.1.0/": "test/test_data/nexus/electrophysiology/qualifiedmultitracegeneration_list_0_10.json", "/v0/data/neuralactivity/electrophysiology/multitracegeneration/v0.2.3/": "test/test_data/nexus/electrophysiology/qualifiedmultitracegeneration_list_0_10.json", "/v0/data/neuralactivity/experiment/qualifiedtracegeneration/v0.1.0/": "test/test_data/nexus/electrophysiology/qualifiedtracegeneration_list_0_10.json", "/v0/data/neuralactivity/core/slice/v0.1.0/": "test/test_data/nexus/electrophysiology/slice_list_0_10.json", "/v0/data/neuralactivity/electrophysiology/stimulusexperiment/v0.1.0/": "test/test_data/nexus/electrophysiology/patchclampexperiment_list_0_10.json", "/v0/data/neuralactivity/electrophysiology/stimulusexperiment/v0.2.1/": "test/test_data/nexus/electrophysiology/intracellularsharpelectrodeexperiment_list_0_10.json", "/v0/data/neuralactivity/electrophysiology/stimulusexperiment/v0.3.0/": "test/test_data/nexus/electrophysiology/patchclampexperiment_list_0_10.json", "/v0/data/neuralactivity/electrophysiology/trace/v0.1.0/": "test/test_data/nexus/electrophysiology/trace_list_0_10.json", "/v0/data/neuralactivity/electrophysiology/tracegeneration/v0.1.0/": "test/test_data/nexus/electrophysiology/tracegeneration_list_0_10.json", "/v0/data/neuralactivity/experiment/wholecellpatchclamp/v0.1.0/": "test/test_data/nexus/electrophysiology/wholecellpatchclamp_list_0_10.json", "/v0/data/neuralactivity/experiment/wholecellpatchclamp/v0.3.0/": "test/test_data/nexus/electrophysiology/wholecellpatchclamp_list_0_10.json", "/v0/data/neuralactivity/experiment/patchedcell/v0.1.0/5ab24291-8dca-4a45-a484-8a8c28d396e2": "test/test_data/nexus/electrophysiology/patchedcell_example.json", "/query/neuralactivity/experiment/patchedcell/v0.1.0/fgModified/instances": "test/test_data/kgquery/electrophysiology/patchedcell_list_simple_0_10.json", "/query/neuralactivity/experiment/patchedcell/v0.1.0/fgResolvedModified/instances": "test/test_data/kgquery/electrophysiology/patchedcell_list_resolved_0_10.json", "/query/neuralactivity/experiment/brainslicing/v0.1.0/fgResolved/instances": "test/test_data/kgquery/electrophysiology/brainslicingactivity_list_resolved_0_10.json", "/query/neuralactivity/electrophysiology/stimulusexperiment/v0.2.1/fgResolved/instances": "test/test_data/kgquery/electrophysiology/intracellularsharpelectrodeexperiment_list_resolved_0_10.json", "/query/neuralactivity/experiment/intrasharprecordedcell/v0.1.0/fgResolvedModified/instances": "test/test_data/kgquery/electrophysiology/intracellularsharpelectroderecordedcell_list_resolved_0_10.json", "/query/neuralactivity/experiment/intrasharprecordedcellcollection/v0.1.0/fgResolved/instances": "test/test_data/kgquery/electrophysiology/intracellularsharpelectroderecordedcellcollection_list_resolved_0_10.json", "/query/neuralactivity/experiment/intrasharprecordedslice/v0.1.0/fgResolved/instances": "test/test_data/kgquery/electrophysiology/intracellularsharpelectroderecordedslice_list_resolved_0_10.json", "/query/neuralactivity/experiment/intrasharpelectrode/v0.1.0/fgResolved/instances": "test/test_data/kgquery/electrophysiology/intracellularsharpelectroderecording_list_resolved_0_10.json", "/query/neuralactivity/electrophysiology/multitrace/v0.1.0/fgResolved/instances": "test/test_data/kgquery/electrophysiology/multichannelmultitrialrecording_list_resolved_0_10.json", "/query/neuralactivity/electrophysiology/multitrace/v0.1.1/fgResolved/instances": "test/test_data/kgquery/electrophysiology/multichannelmultitrialrecording_list_resolved_0_10.json", "/query/neuralactivity/electrophysiology/multitrace/v0.2.0/fgResolved/instances": "test/test_data/kgquery/electrophysiology/multichannelmultitrialrecording_list_resolved_0_10.json", "/query/neuralactivity/experiment/wholecellpatchclamp/v0.1.0/fgResolved/instances": "test/test_data/kgquery/electrophysiology/patchclampactivity_list_resolved_0_10.json", "/query/neuralactivity/experiment/wholecellpatchclamp/v0.3.0/fgResolved/instances": "test/test_data/kgquery/electrophysiology/patchclampactivity_list_resolved_0_10.json", "/query/neuralactivity/electrophysiology/stimulusexperiment/v0.1.0/fgResolved/instances": "test/test_data/kgquery/electrophysiology/patchclampexperiment_list_resolved_0_10.json", "/query/neuralactivity/electrophysiology/stimulusexperiment/v0.3.0/fgResolved/instances": "test/test_data/kgquery/electrophysiology/patchclampexperiment_list_resolved_0_10.json", "/query/neuralactivity/experiment/patchedcellcollection/v0.1.0/fgResolved/instances": "test/test_data/kgquery/electrophysiology/patchedcellcollection_list_resolved_0_10.json", "/query/neuralactivity/experiment/patchedslice/v0.1.0/fgResolved/instances": "test/test_data/kgquery/electrophysiology/patchedslice_list_resolved_0_10.json", "/query/neuralactivity/electrophysiology/multitracegeneration/v0.1.0/fgResolved/instances": "test/test_data/kgquery/electrophysiology/qualifiedmultitracegeneration_list_resolved_0_10.json", "/query/neuralactivity/electrophysiology/multitracegeneration/v0.2.3/fgResolved/instances": "test/test_data/kgquery/electrophysiology/qualifiedmultitracegeneration_list_resolved_0_10.json", "/query/neuralactivity/electrophysiology/tracegeneration/v0.1.0/fgResolved/instances": "test/test_data/kgquery/electrophysiology/qualifiedtracegeneration_list_resolved_0_10.json", "/query/neuralactivity/core/slice/v0.1.0/fgResolved/instances": "test/test_data/kgquery/electrophysiology/slice_list_resolved_0_10.json", "/query/neuralactivity/electrophysiology/trace/v0.1.0/fgResolved/instances": "test/test_data/kgquery/electrophysiology/trace_list_resolved_0_10.json", "/query/neuralactivity/experiment/brainslicing/v0.1.0/fgSimple/instances": "test/test_data/kgquery/electrophysiology/brainslicingactivity_list_resolved_0_10.json", "/query/neuralactivity/electrophysiology/stimulusexperiment/v0.2.1/fgSimple/instances": "test/test_data/kgquery/electrophysiology/intracellularsharpelectrodeexperiment_list_resolved_0_10.json", "/query/neuralactivity/experiment/intrasharprecordedcell/v0.1.0/fgModified/instances": "test/test_data/kgquery/electrophysiology/intracellularsharpelectroderecordedcell_list_resolved_0_10.json", "/query/neuralactivity/experiment/intrasharprecordedcellcollection/v0.1.0/fgSimple/instances": "test/test_data/kgquery/electrophysiology/intracellularsharpelectroderecordedcellcollection_list_resolved_0_10.json", "/query/neuralactivity/experiment/intrasharprecordedslice/v0.1.0/fgSimple/instances": "test/test_data/kgquery/electrophysiology/intracellularsharpelectroderecordedslice_list_resolved_0_10.json", "/query/neuralactivity/experiment/intrasharpelectrode/v0.1.0/fgSimple/instances": "test/test_data/kgquery/electrophysiology/intracellularsharpelectroderecording_list_resolved_0_10.json", "/query/neuralactivity/electrophysiology/multitrace/v0.1.0/fgSimple/instances": "test/test_data/kgquery/electrophysiology/multichannelmultitrialrecording_list_resolved_0_10.json", "/query/neuralactivity/electrophysiology/multitrace/v0.1.1/fgSimple/instances": "test/test_data/kgquery/electrophysiology/multichannelmultitrialrecording_list_resolved_0_10.json", "/query/neuralactivity/electrophysiology/multitrace/v0.2.0/fgSimple/instances": "test/test_data/kgquery/electrophysiology/multichannelmultitrialrecording_list_resolved_0_10.json", "/query/neuralactivity/experiment/wholecellpatchclamp/v0.1.0/fgSimple/instances": "test/test_data/kgquery/electrophysiology/patchclampactivity_list_resolved_0_10.json", "/query/neuralactivity/experiment/wholecellpatchclamp/v0.3.0/fgSimple/instances": "test/test_data/kgquery/electrophysiology/patchclampactivity_list_resolved_0_10.json", "/query/neuralactivity/electrophysiology/stimulusexperiment/v0.1.0/fgSimple/instances": "test/test_data/kgquery/electrophysiology/patchclampexperiment_list_resolved_0_10.json", "/query/neuralactivity/electrophysiology/stimulusexperiment/v0.3.0/fgSimple/instances": "test/test_data/kgquery/electrophysiology/patchclampexperiment_list_resolved_0_10.json", "/query/neuralactivity/experiment/patchedcellcollection/v0.1.0/fgSimple/instances": "test/test_data/kgquery/electrophysiology/patchedcellcollection_list_resolved_0_10.json", "/query/neuralactivity/experiment/patchedslice/v0.1.0/fgSimple/instances": "test/test_data/kgquery/electrophysiology/patchedslice_list_resolved_0_10.json", "/query/neuralactivity/electrophysiology/multitracegeneration/v0.1.0/fgSimple/instances": "test/test_data/kgquery/electrophysiology/qualifiedmultitracegeneration_list_resolved_0_10.json", "/query/neuralactivity/electrophysiology/multitracegeneration/v0.2.3/fgSimple/instances": "test/test_data/kgquery/electrophysiology/qualifiedmultitracegeneration_list_resolved_0_10.json", "/query/neuralactivity/electrophysiology/tracegeneration/v0.1.0/fgSimple/instances": "test/test_data/kgquery/electrophysiology/qualifiedtracegeneration_list_resolved_0_10.json", "/query/neuralactivity/core/slice/v0.1.0/fgSimple/instances": "test/test_data/kgquery/electrophysiology/slice_list_resolved_0_10.json", "/query/neuralactivity/electrophysiology/trace/v0.1.0/fgSimple/instances": "test/test_data/kgquery/electrophysiology/trace_list_resolved_0_10.json", }) use_core_namespace("neuralactivity") use_electrophysiology_namespace("neuralactivity") class TestPatchedCell(BaseTestKG): class_under_test = PatchedCell def test_list_nexus(self, kg_client): cells = PatchedCell.list(kg_client, api="nexus", size=50) assert len(cells) == 30 assert cells[0].brain_location == BrainRegion("hippocampus CA1") assert isinstance(cells[0].collection, KGQuery) assert cells[0].cell_type == CellType("hippocampus CA1 pyramidal cell") assert isinstance(cells[0].experiments, KGQuery) assert cells[0].pipette_id is None assert cells[0].seal_resistance is None assert cells[0].pipette_resistance is None assert cells[0].liquid_junction_potential is None assert cells[0].labeling_compound is None assert cells[0].reversal_potential_cl == QuantitativeValue(-16.0, unit_text="mV") def test_list_with_filter(self, kg_client): cells = PatchedCell.list(kg_client, api="nexus", brain_region=BrainRegion("hippocampus CA1"), size=50) assert len(cells) == 26 def test_list_kgquery_simple(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=False) assert len(objects) == 10, len(objects) def test_list_kgquery_resolved(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=True) assert len(objects) == 10, len(objects) def test_get_from_uri_nexus(self, kg_client): uri = "https://nexus.humanbrainproject.org/v0/data/neuralactivity/experiment/patchedcell/v0.1.0/5ab24291-8dca-4a45-a484-8a8c28d396e2" cell = PatchedCell.from_uri(uri, kg_client, api="nexus") assert isinstance(cell, PatchedCell) assert cell.id == uri assert cell.brain_location == [BrainRegion('lobule 5 of the cerebellar vermis'), BrainRegion('lobule 6 of the cerebellar vermis'), BrainRegion('lobule 7 of the cerebellar vermis'), BrainRegion('lobule 8 of the cerebellar vermis')] assert isinstance(cell.collection, KGQuery) assert isinstance(cell.experiments, KGQuery) def test_get_from_uri_kgquery_simple(self, kg_client): # TODO: UPDATE STORED QUERY uri = "https://nexus.humanbrainproject.org/v0/data/neuralactivity/experiment/patchedcell/v0.1.0/b813a2f7-5e87-4827-81cd-0008da041648" cell = PatchedCell.from_uri(uri, kg_client, api="query", resolved=False) assert isinstance(cell, PatchedCell) assert cell.brain_location == [BrainRegion('5th cerebellar lobule'), BrainRegion('6th cerebellar lobule'), BrainRegion('7th cerebellar lobule'), BrainRegion('8th cerebellar lobule')] assert isinstance(cell.collection, KGQuery) assert isinstance(cell.experiments, KGQuery) def test_get_from_uri_kgquery_resolved(self, kg_client): uri = "https://nexus.humanbrainproject.org/v0/data/neuralactivity/experiment/patchedcell/v0.1.0/b813a2f7-5e87-4827-81cd-0008da041648" cell = PatchedCell.from_uri(uri, kg_client, api="query", resolved=True) assert isinstance(cell, PatchedCell) assert cell.id == uri assert cell.brain_location == [BrainRegion('5th cerebellar lobule'), BrainRegion('6th cerebellar lobule'), BrainRegion('7th cerebellar lobule'), BrainRegion('8th cerebellar lobule')] assert isinstance(cell.collection, KGQuery) assert isinstance(cell.experiments, KGQuery) def test_get_from_uuid(self, kg_client): uri = "https://nexus.humanbrainproject.org/v0/data/neuralactivity/experiment/patchedcell/v0.1.0/5ab24291-8dca-4a45-a484-8a8c28d396e2" a = PatchedCell.from_uri(uri, kg_client, api="nexus") b = PatchedCell.from_uuid("5ab24291-8dca-4a45-a484-8a8c28d396e2", kg_client, api="nexus") assert a == b assert a.id == uri def test_get_from_uri_with_cache(self, kg_client): assert len(kg_client.cache) == 0 assert kg_client._nexus_client._http_client.request_count == 0 uri = "https://nexus.humanbrainproject.org/v0/data/neuralactivity/experiment/patchedcell/v0.1.0/5ab24291-8dca-4a45-a484-8a8c28d396e2" # 1st call cell1 = PatchedCell.from_uri(uri, kg_client, api="nexus") assert len(kg_client.cache) == 1 assert kg_client._nexus_client._http_client.request_count == 1 assert uri in kg_client.cache # 2nd call cell2 = PatchedCell.from_uri(uri, kg_client, api="nexus") assert kg_client._nexus_client._http_client.request_count == 1 # should be unchanged if cache was used # 3rd call, without cache cell3 = PatchedCell.from_uri(uri, kg_client, use_cache=False, api="nexus") assert kg_client._nexus_client._http_client.request_count == 2 assert cell1.id == cell2.id == cell3.id == uri def test_by_name_nexus(self, kg_client): cell = PatchedCell.by_name("sub2epsp.samp1", kg_client, api="nexus") assert cell.uuid == "5ab24291-8dca-4a45-a484-8a8c28d396e2" def test_by_name_nexus_not_found(self, kg_client): cell = PatchedCell.by_name("qwertyuiop", kg_client, api="nexus") assert cell is None def test_by_name_kgquery(self, kg_client): cell = PatchedCell.by_name("GF1.samp1", kg_client, api="query") assert cell.uuid == "b813a2f7-5e87-4827-81cd-0008da041648" def test_round_trip(self, kg_client): cell1 = PatchedCell("example001", brain_location=BrainRegion("primary auditory cortex"), collection=None, cell_type=CellType("pyramidal cell"), experiments=None, pipette_id=31, seal_resistance=QuantitativeValue(1.2, "GΩ"), pipette_resistance=QuantitativeValue(1.5, "MΩ"), liquid_junction_potential=QuantitativeValue(5.0, "mV"), labeling_compound="0.1% biocytin ", reversal_potential_cl=QuantitativeValue(-65, "mV")) instance = Instance(PatchedCell.path, cell1._build_data(kg_client), Instance.path) instance.data["@id"] = "http://fake_uuid_93f9cd9a9b" instance.data["@type"] = PatchedCell.type cell2 = PatchedCell.from_kg_instance(instance, kg_client) for field in ("name", "brain_location", "cell_type", "pipette_id", "seal_resistance", "pipette_resistance", "liquid_junction_potential", "labeling_compound", "reversal_potential_cl"): assert getattr(cell1, field) == getattr(cell2, field) def test_repr(self): try: unicode except NameError: cell = PatchedCell("example001", brain_location=BrainRegion("primary auditory cortex"), collection=None, cell_type=CellType("pyramidal cell"), experiments=None, pipette_id=31, seal_resistance=QuantitativeValue(1.2, "GΩ"), pipette_resistance=QuantitativeValue(1.5, "MΩ"), liquid_junction_potential=None, labeling_compound="0.1% biocytin ", reversal_potential_cl=None) expected_repr = ("PatchedCell(name='example001', " "brain_location=BrainRegion('primary auditory cortex', 'http://purl.obolibrary.org/obo/UBERON_0034751'), " "cell_type=CellType('pyramidal cell', 'http://purl.obolibrary.org/obo/CL_0000598'), " "pipette_id=31, seal_resistance=QuantitativeValue(1.2 'GΩ'), " "pipette_resistance=QuantitativeValue(1.5 'MΩ'), " "labeling_compound='0.1% biocytin ', id=None)") assert repr(cell) == expected_repr else: pytest.skip( "The remaining lifespan of Python 2 is too short to fix unicode representation errors") class TestTrace(BaseTestKG): class_under_test = Trace def test_list_nexus(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="nexus", size=10) assert len(objects) == 10, len(objects) def test_list_kgquery_simple(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=False) assert len(objects) == 10, len(objects) def test_list_kgquery_resolved(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=True) assert len(objects) == 10, len(objects) def test_round_trip(self, kg_client): trace1 = Trace("example001", data_location=Distribution("http://example.com/example.csv", content_type="text/tab-separated-values"), generated_by=MockKGObject(id="http://fake_uuid_abc123", type=PatchClampExperiment.type), generation_metadata=MockKGObject(id="http://fake_uuid_def456", type=QualifiedTraceGeneration.type), channel=42, data_unit="mV", time_step=QuantitativeValue(0.1, "ms"), part_of=MockKGObject(id="http://fake_uuid_ghi789", type=Dataset.type)) instance = Instance(Trace.path, trace1._build_data(kg_client), Instance.path) instance.data["@id"] = "http://fake_uuid_6a5d6ecf87" instance.data["@type"] = Trace.type trace2 = Trace.from_kg_instance(instance, kg_client) for field in ("name", "data_location", "channel", "data_unit", "time_step"): assert getattr(trace1, field) == getattr(trace2, field) for field in ("generated_by", "generation_metadata", "part_of"): obj1 = getattr(trace1, field) obj2 = getattr(trace2, field) assert isinstance(obj2, KGProxy) assert obj1.id == obj2.id assert obj1.type == obj2.type class TestMultiChannelMultiTrialRecording(BaseTestKG): class_under_test = MultiChannelMultiTrialRecording def test_list_nexus(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="nexus", size=10) assert len(objects) == 4, len(objects) def test_list_kgquery_simple(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=False) assert len(objects) == 10, len(objects) def test_list_kgquery_resolved(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=True) assert len(objects) == 10, len(objects) class TestSlice(BaseTestKG): class_under_test = Slice def test_list_nexus(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="nexus", size=10) assert len(objects) == 10, len(objects) def test_list_kgquery_simple(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=False) assert len(objects) == 10, len(objects) def test_list_kgquery_resolved(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=True) assert len(objects) == 10, len(objects) class TestBrainSlicingActivity(BaseTestKG): class_under_test = BrainSlicingActivity def test_list_nexus(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="nexus", size=10) assert len(objects) == 10, len(objects) def test_list_kgquery_simple(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=False) assert len(objects) == 10, len(objects) def test_list_kgquery_resolved(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=True) assert len(objects) == 10, len(objects) class TestPatchedSlice(BaseTestKG): class_under_test = PatchedSlice def test_list_nexus(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="nexus", size=10) assert len(objects) == 10, len(objects) def test_list_kgquery_simple(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=False) assert len(objects) == 10, len(objects) def test_list_kgquery_resolved(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=True) assert len(objects) == 10, len(objects) class TestPatchedCellCollection(BaseTestKG): class_under_test = PatchedCellCollection def test_list_nexus(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="nexus", size=10) assert len(objects) == 10, len(objects) def test_list_kgquery_resolved(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=True) assert len(objects) == 10, len(objects) class TestPatchClampActivity(BaseTestKG): class_under_test = PatchClampActivity def test_list_nexus(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="nexus", size=10) assert len(objects) == 10, len(objects) def test_list_kgquery_simple(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=False) assert len(objects) == 10, len(objects) def test_list_kgquery_resolved(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=True) assert len(objects) == 10, len(objects) class TestPatchClampExperiment(BaseTestKG): class_under_test = PatchClampExperiment def test_list_nexus(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="nexus", size=10) assert len(objects) == 10, len(objects) def test_list_kgquery_simple(self, kg_client): cls = self.class_under_test cls.set_strict_mode(False, field_name="name") # some examples have empty names cls.set_strict_mode(False, field_name="stimulus") objects = cls.list(kg_client, api="query", size=10, resolved=False) assert len(objects) == 10, len(objects) def test_list_kgquery_resolved(self, kg_client): cls = self.class_under_test cls.set_strict_mode(False, field_name="name") # some examples have empty names cls.set_strict_mode(False, field_name="stimulus") objects = cls.list(kg_client, api="query", size=10, resolved=True) assert len(objects) == 10, len(objects) class TestQualifiedTraceGeneration(BaseTestKG): class_under_test = QualifiedTraceGeneration def test_list_nexus(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="nexus", size=10) assert len(objects) == 10, len(objects) def test_list_kgquery_simple(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=False) assert len(objects) == 10, len(objects) def test_list_kgquery_resolved(self, kg_client): cls = self.class_under_test IntraCellularSharpElectrodeExperiment.set_strict_mode(False, "stimulus") objects = cls.list(kg_client, api="query", size=10, resolved=True) assert len(objects) == 10, len(objects) class TestQualifiedMultiTraceGeneration(BaseTestKG): class_under_test = QualifiedMultiTraceGeneration def test_list_nexus(self, kg_client): tracegens = QualifiedMultiTraceGeneration.list(kg_client, api="nexus", size=10) assert len(tracegens) == 10, len(objects) def test_list_kgquery_simple(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=False) assert len(objects) == 10, len(objects) def test_list_kgquery_resolved(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=True) assert len(objects) == 10, len(objects) class TestIntraCellularSharpElectrodeRecordedCell(BaseTestKG): class_under_test = IntraCellularSharpElectrodeRecordedCell def test_list_nexus(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="nexus", size=10) assert len(objects) == 8, len(objects) def test_list_kgquery_simple(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=False) assert len(objects) == 8, len(objects) def test_list_kgquery_resolved(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=True) assert len(objects) == 8, len(objects) class TestIntraCellularSharpElectrodeRecording(BaseTestKG): class_under_test = IntraCellularSharpElectrodeRecording def test_list_nexus(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="nexus", size=10) assert len(objects) == 8, len(objects) def test_list_kgquery_simple(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=False) assert len(objects) == 8, len(objects) def test_list_kgquery_resolved(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=True) assert len(objects) == 8, len(objects) class TestIntraCellularSharpElectrodeRecordedCellCollection(BaseTestKG): class_under_test = IntraCellularSharpElectrodeRecordedCellCollection def test_list_nexus(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="nexus", size=10) assert len(objects) == 8, len(objects) def test_list_kgquery_simple(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=False) assert len(objects) == 8, len(objects) def test_list_kgquery_resolved(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=True) assert len(objects) == 8, len(objects) class TestIntraCellularSharpElectrodeRecordedSlice(BaseTestKG): class_under_test = IntraCellularSharpElectrodeRecordedSlice def test_list_nexus(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="nexus", size=10) assert len(objects) == 8, len(objects) def test_list_kgquery_simple(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=False) assert len(objects) == 8, len(objects) def test_list_kgquery_resolved(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=True) assert len(objects) == 8, len(objects) class TestIntraCellularSharpElectrodeExperiment(BaseTestKG): class_under_test = IntraCellularSharpElectrodeExperiment def test_list_nexus(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="nexus", size=10) assert len(objects) == 8, len(objects) def test_list_kgquery_simple(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=False) assert len(objects) == 8, len(objects) def test_list_kgquery_resolved(self, kg_client): cls = self.class_under_test objects = cls.list(kg_client, api="query", size=10, resolved=True) assert len(objects) == 8, len(objects) class TestModuleFunctions(object): def test_list_kg_classes(self): expected_classes = set(( Trace, MultiChannelMultiTrialRecording, PatchedCell, Slice, BrainSlicingActivity, PatchedSlice, PatchedCellCollection, PatchClampActivity, PatchClampExperiment, QualifiedTraceGeneration, QualifiedMultiTraceGeneration, IntraCellularSharpElectrodeExperiment, IntraCellularSharpElectrodeRecordedCell, IntraCellularSharpElectrodeRecordedCellCollection, IntraCellularSharpElectrodeRecordedSlice, IntraCellularSharpElectrodeRecording, ElectrodeImplantationActivity, ImplantedBrainTissue, ExtracellularElectrodeExperiment,ECoGExperiment, CulturingActivity, Device, Task, Sensor, ElectrodeArrayExperiment, ElectrodePlacementActivity, EEGExperiment, CellCulture )) assert set(list_kg_classes()) == expected_classes
60.536878
218
0.7287
4,057
35,293
6.117821
0.074193
0.041579
0.034327
0.029009
0.819581
0.800967
0.775141
0.76394
0.711966
0.701853
0
0.033637
0.165217
35,293
582
219
60.640893
0.808805
0.009152
0
0.514831
0
0.014831
0.391503
0.330883
0
0
0
0.001718
0.194915
1
0.127119
false
0
0.016949
0
0.213983
0
0
0
0
null
0
0
0
1
1
1
1
1
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
6
e80f07205b6386ce286468c5d915f0920fb97094
15,001
py
Python
instances/simulation/inst-20210422-1717/timetabling_closed-SV/inst-20210422-1717-c50-pas4e-1_optDelivery_9h-3h.py
LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure
bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11
[ "BSD-3-Clause" ]
null
null
null
instances/simulation/inst-20210422-1717/timetabling_closed-SV/inst-20210422-1717-c50-pas4e-1_optDelivery_9h-3h.py
LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure
bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11
[ "BSD-3-Clause" ]
null
null
null
instances/simulation/inst-20210422-1717/timetabling_closed-SV/inst-20210422-1717-c50-pas4e-1_optDelivery_9h-3h.py
LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure
bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11
[ "BSD-3-Clause" ]
null
null
null
""" PERIODS """ numPeriods = 180 """ STOPS """ numStations = 13 station_names = ( "Hamburg Hbf", # 0 "Landwehr", # 1 "Hasselbrook", # 2 "Wansbeker Chaussee*", # 3 "Friedrichsberg*", # 4 "Barmbek*", # 5 "Alte Woehr (Stadtpark)", # 6 "Ruebenkamp (City Nord)", # 7 "Ohlsdorf*", # 8 "Kornweg", # 9 "Hoheneichen", # 10 "Wellingsbuettel", # 11 "Poppenbuettel*", # 12 ) numStops = 26 stops_position = ( (0, 0), # Stop 0 (2, 0), # Stop 1 (3, 0), # Stop 2 (4, 0), # Stop 3 (5, 0), # Stop 4 (6, 0), # Stop 5 (7, 0), # Stop 6 (8, 0), # Stop 7 (9, 0), # Stop 8 (11, 0), # Stop 9 (13, 0), # Stop 10 (14, 0), # Stop 11 (15, 0), # Stop 12 (15, 1), # Stop 13 (15, 1), # Stop 14 (13, 1), # Stop 15 (12, 1), # Stop 16 (11, 1), # Stop 17 (10, 1), # Stop 18 (9, 1), # Stop 19 (8, 1), # Stop 20 (7, 1), # Stop 21 (6, 1), # Stop 22 (4, 1), # Stop 23 (2, 1), # Stop 24 (1, 1), # Stop 25 ) stops_distance = ( (0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # Stop 0 (0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # Stop 1 (0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # Stop 2 (0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # Stop 3 (0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # Stop 4 (0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # Stop 5 (0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # Stop 6 (0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # Stop 7 (0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # Stop 8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # Stop 9 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # Stop 10 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # Stop 11 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # Stop 12 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # Stop 13 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # Stop 14 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0), # Stop 15 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0), # Stop 16 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), # Stop 17 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0), # Stop 18 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0), # Stop 19 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0), # Stop 20 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0), # Stop 21 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0), # Stop 22 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), # Stop 23 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2), # Stop 24 (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # Stop 25 ) station_start = 0 """ TRAMS """ numTrams = 18 tram_capacity = 514 tram_capacity_cargo = 304 tram_capacity_min_passenger = 208 tram_capacity_min_cargo = 0 tram_speed = 1 tram_headway = 1 tram_min_service = 1 tram_max_service = 10 min_time_next_tram = 0.333 tram_travel_deviation = 0.167 """ PASSENGERS """ passenger_set = "pas-20210422-1717-int4e-1" passenger_service_time_board = 0.0145 passenger_service_time_alight = 0.0145 """ CARGO """ numCargo = 50 cargo_size = 4 cargo_station_destination = ( 8, # 0 4, # 1 5, # 2 4, # 3 3, # 4 5, # 5 4, # 6 5, # 7 8, # 8 8, # 9 5, # 10 12, # 11 8, # 12 4, # 13 8, # 14 5, # 15 12, # 16 4, # 17 3, # 18 12, # 19 12, # 20 12, # 21 4, # 22 3, # 23 4, # 24 12, # 25 5, # 26 3, # 27 12, # 28 5, # 29 4, # 30 3, # 31 12, # 32 5, # 33 3, # 34 8, # 35 8, # 36 12, # 37 8, # 38 4, # 39 3, # 40 3, # 41 8, # 42 3, # 43 4, # 44 12, # 45 12, # 46 5, # 47 3, # 48 4, # 49 ) cargo_release = ( 2, # 0 3, # 1 5, # 2 7, # 3 8, # 4 8, # 5 14, # 6 16, # 7 17, # 8 22, # 9 24, # 10 25, # 11 26, # 12 27, # 13 28, # 14 30, # 15 32, # 16 33, # 17 33, # 18 34, # 19 35, # 20 37, # 21 37, # 22 37, # 23 37, # 24 38, # 25 39, # 26 41, # 27 41, # 28 44, # 29 45, # 30 46, # 31 47, # 32 48, # 33 49, # 34 49, # 35 56, # 36 57, # 37 61, # 38 61, # 39 62, # 40 65, # 41 65, # 42 66, # 43 67, # 44 70, # 45 70, # 46 71, # 47 71, # 48 72, # 49 ) cargo_station_deadline = ( 33, # 0 119, # 1 176, # 2 72, # 3 18, # 4 171, # 5 105, # 6 155, # 7 156, # 8 123, # 9 126, # 10 91, # 11 36, # 12 87, # 13 144, # 14 134, # 15 141, # 16 101, # 17 163, # 18 108, # 19 144, # 20 175, # 21 76, # 22 162, # 23 47, # 24 97, # 25 87, # 26 114, # 27 164, # 28 142, # 29 55, # 30 56, # 31 57, # 32 118, # 33 59, # 34 160, # 35 170, # 36 139, # 37 71, # 38 71, # 39 82, # 40 161, # 41 109, # 42 151, # 43 77, # 44 80, # 45 169, # 46 97, # 47 129, # 48 99, # 49 ) cargo_max_delay = 3 cargo_service_time_load = 0.3333333333333333 cargo_service_time_unload = 0.25 """ parameters for reproducibiliy. More information: https://numpy.org/doc/stable/reference/random/parallel.html """ #initial entropy entropy = 8991598675325360468762009371570610170 #index for seed sequence child child_seed_index = ( 0, # 0 ) """ Results from timetabling """ scheme = "SV" method = "timetabling_closed" passengerData = "0-rep" downstream_cargo = False delivery_optional = True assignment_method = "timetabling_closed" operating = ( False, # 0 False, # 1 False, # 2 False, # 3 False, # 4 True, # 5 True, # 6 True, # 7 True, # 8 True, # 9 True, # 10 True, # 11 True, # 12 True, # 13 True, # 14 True, # 15 True, # 16 True, # 17 ) tram_tour = ( (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25), # 0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25), # 1 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25), # 2 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25), # 3 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25), # 4 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25), # 5 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25), # 6 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25), # 7 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25), # 8 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25), # 9 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25), # 10 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25), # 11 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25), # 12 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25), # 13 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25), # 14 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25), # 15 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25), # 16 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25), # 17 ) tram_time_arrival = ( (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 0 (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 1 (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 2 (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 3 (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 4 (10.0, 14.0, 16.0, 18.0, 22.0, 24.0, 27.0, 29.0, 31.0, 34.0, 37.0, 39.0, 41.0, 46.0, 57.0, 61.0, 69.0, 75.0, 77.0, 79.0, 82.0, 84.0, 89.0, 100.0, 111.0, 116.0), # 5 (29.0, 41.0, 43.0, 45.0, 47.0, 49.0, 51.0, 53.0, 55.0, 61.0, 64.0, 66.0, 73.0, 76.0, 82.0, 86.0, 94.0, 97.0, 101.0, 104.0, 106.0, 108.0, 112.0, 116.0, 126.0, 133.0), # 6 (54.0, 66.0, 68.0, 70.0, 72.0, 74.0, 76.0, 78.0, 80.0, 83.0, 86.0, 88.0, 90.0, 94.0, 96.0, 98.0, 103.0, 110.0, 113.0, 115.0, 117.0, 120.0, 131.0, 140.0, 146.0, 155.0), # 7 (65.0, 73.0, 75.0, 77.0, 79.0, 81.0, 83.0, 85.0, 88.0, 91.0, 94.0, 96.0, 98.0, 100.0, 108.0, 111.0, 115.0, 118.0, 126.0, 137.0, 139.0, 143.0, 145.0, 147.0, 157.0, 160.0), # 8 (72.0, 75.0, 82.0, 87.0, 89.0, 91.0, 100.0, 105.0, 112.0, 122.0, 129.0, 131.0, 133.0, 135.0, 137.0, 139.0, 142.0, 145.0, 147.0, 149.0, 151.0, 153.0, 155.0, 157.0, 159.0, 162.0), # 9 (84.0, 88.0, 94.0, 99.0, 110.0, 112.0, 114.0, 116.0, 122.0, 128.0, 131.0, 133.0, 135.0, 137.0, 139.0, 141.0, 144.0, 147.0, 149.0, 151.0, 153.0, 155.0, 157.0, 159.0, 161.0, 164.0), # 10 (102.0, 113.0, 115.0, 117.0, 119.0, 121.0, 123.0, 125.0, 127.0, 130.0, 133.0, 135.0, 137.0, 139.0, 141.0, 143.0, 146.0, 149.0, 151.0, 153.0, 155.0, 157.0, 159.0, 161.0, 163.0, 166.0), # 11 (112.0, 115.0, 117.0, 119.0, 121.0, 123.0, 125.0, 127.0, 129.0, 132.0, 135.0, 137.0, 139.0, 141.0, 143.0, 145.0, 148.0, 151.0, 153.0, 155.0, 157.0, 159.0, 161.0, 163.0, 165.0, 168.0), # 12 (114.0, 117.0, 119.0, 121.0, 123.0, 125.0, 127.0, 129.0, 131.0, 134.0, 137.0, 139.0, 141.0, 143.0, 145.0, 147.0, 150.0, 153.0, 155.0, 157.0, 159.0, 161.0, 163.0, 165.0, 167.0, 170.0), # 13 (116.0, 119.0, 121.0, 123.0, 125.0, 127.0, 129.0, 131.0, 133.0, 136.0, 139.0, 141.0, 143.0, 145.0, 147.0, 149.0, 152.0, 155.0, 157.0, 159.0, 161.0, 163.0, 165.0, 167.0, 169.0, 172.0), # 14 (118.0, 121.0, 123.0, 125.0, 127.0, 129.0, 131.0, 133.0, 135.0, 138.0, 141.0, 143.0, 145.0, 147.0, 149.0, 151.0, 154.0, 157.0, 159.0, 161.0, 163.0, 165.0, 167.0, 169.0, 171.0, 174.0), # 15 (120.0, 123.0, 125.0, 127.0, 129.0, 131.0, 133.0, 135.0, 137.0, 140.0, 143.0, 145.0, 147.0, 149.0, 151.0, 153.0, 156.0, 159.0, 161.0, 163.0, 165.0, 167.0, 169.0, 171.0, 173.0, 176.0), # 16 (122.0, 125.0, 127.0, 129.0, 131.0, 133.0, 135.0, 137.0, 139.0, 142.0, 145.0, 147.0, 149.0, 151.0, 153.0, 155.0, 158.0, 161.0, 163.0, 165.0, 167.0, 169.0, 171.0, 173.0, 175.0, 178.0), # 17 ) tram_time_departure = ( (-0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.0, -0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.0, -0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.0, -0.0), # 0 (-0.0, -0.0, -0.0, -0.0, -0.0, 0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0), # 1 (-0.0, -0.0, -0.0, -0.0, -0.0, 0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, 0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0), # 2 (-0.0, -0.0, -0.0, -0.0, 0.0, 0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, 0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0), # 3 (-0.0, -0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.0, -0.0, -0.0, -0.0, 0.0, 0.0, -0.0, 0.0, -0.0, -0.0, -0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.0, -0.0, -0.0), # 4 (12.0, 15.0, 17.0, 21.0, 23.0, 26.0, 28.0, 30.0, 32.0, 35.0, 38.0, 40.0, 45.0, 56.0, 60.0, 67.0, 73.0, 76.0, 78.0, 81.0, 83.0, 88.0, 99.0, 110.0, 114.0, 125.0), # 5 (39.0, 42.0, 44.0, 46.0, 48.0, 50.0, 52.0, 54.0, 59.0, 62.0, 65.0, 72.0, 75.0, 81.0, 85.0, 92.0, 95.0, 100.0, 103.0, 105.0, 107.0, 111.0, 115.0, 125.0, 131.0, 140.0), # 6 (64.0, 67.0, 69.0, 71.0, 73.0, 75.0, 77.0, 79.0, 81.0, 84.0, 87.0, 89.0, 93.0, 95.0, 97.0, 101.0, 108.0, 112.0, 114.0, 116.0, 119.0, 130.0, 139.0, 145.0, 153.0, 157.0), # 7 (71.0, 74.0, 76.0, 78.0, 80.0, 82.0, 84.0, 87.0, 89.0, 92.0, 95.0, 97.0, 99.0, 107.0, 110.0, 113.0, 116.0, 125.0, 136.0, 138.0, 142.0, 144.0, 146.0, 156.0, 158.0, 161.0), # 8 (73.0, 81.0, 86.0, 88.0, 90.0, 99.0, 104.0, 111.0, 120.0, 127.0, 130.0, 132.0, 134.0, 136.0, 138.0, 140.0, 143.0, 146.0, 148.0, 150.0, 152.0, 154.0, 156.0, 158.0, 160.0, 163.0), # 9 (86.0, 93.0, 98.0, 109.0, 111.0, 113.0, 115.0, 121.0, 126.0, 129.0, 132.0, 134.0, 136.0, 138.0, 140.0, 142.0, 145.0, 148.0, 150.0, 152.0, 154.0, 156.0, 158.0, 160.0, 162.0, 165.0), # 10 (111.0, 114.0, 116.0, 118.0, 120.0, 122.0, 124.0, 126.0, 128.0, 131.0, 134.0, 136.0, 138.0, 140.0, 142.0, 144.0, 147.0, 150.0, 152.0, 154.0, 156.0, 158.0, 160.0, 162.0, 164.0, 167.0), # 11 (113.0, 116.0, 118.0, 120.0, 122.0, 124.0, 126.0, 128.0, 130.0, 133.0, 136.0, 138.0, 140.0, 142.0, 144.0, 146.0, 149.0, 152.0, 154.0, 156.0, 158.0, 160.0, 162.0, 164.0, 166.0, 169.0), # 12 (115.0, 118.0, 120.0, 122.0, 124.0, 126.0, 128.0, 130.0, 132.0, 135.0, 138.0, 140.0, 142.0, 144.0, 146.0, 148.0, 151.0, 154.0, 156.0, 158.0, 160.0, 162.0, 164.0, 166.0, 168.0, 171.0), # 13 (117.0, 120.0, 122.0, 124.0, 126.0, 128.0, 130.0, 132.0, 134.0, 137.0, 140.0, 142.0, 144.0, 146.0, 148.0, 150.0, 153.0, 156.0, 158.0, 160.0, 162.0, 164.0, 166.0, 168.0, 170.0, 173.0), # 14 (119.0, 122.0, 124.0, 126.0, 128.0, 130.0, 132.0, 134.0, 136.0, 139.0, 142.0, 144.0, 146.0, 148.0, 150.0, 152.0, 155.0, 158.0, 160.0, 162.0, 164.0, 166.0, 168.0, 170.0, 172.0, 175.0), # 15 (121.0, 124.0, 126.0, 128.0, 130.0, 132.0, 134.0, 136.0, 138.0, 141.0, 144.0, 146.0, 148.0, 150.0, 152.0, 154.0, 157.0, 160.0, 162.0, 164.0, 166.0, 168.0, 170.0, 172.0, 174.0, 177.0), # 16 (123.0, 126.0, 128.0, 130.0, 132.0, 134.0, 136.0, 138.0, 140.0, 143.0, 146.0, 148.0, 150.0, 152.0, 154.0, 156.0, 159.0, 162.0, 164.0, 166.0, 168.0, 170.0, 172.0, 174.0, 176.0, 179.0), # 17 ) cargo_tram_assignment = ( 5, # 0 5, # 1 5, # 2 5, # 3 5, # 4 13, # 5 6, # 6 6, # 7 14, # 8 7, # 9 7, # 10 6, # 11 6, # 12 7, # 13 6, # 14 17, # 15 11, # 16 6, # 17 6, # 18 7, # 19 11, # 20 17, # 21 7, # 22 6, # 23 6, # 24 6, # 25 7, # 26 7, # 27 10, # 28 7, # 29 7, # 30 7, # 31 7, # 32 7, # 33 7, # 34 7, # 35 11, # 36 11, # 37 7, # 38 7, # 39 7, # 40 14, # 41 8, # 42 9, # 43 8, # 44 8, # 45 17, # 46 9, # 47 15, # 48 9, # 49 )
32.260215
190
0.461636
3,867
15,001
1.775537
0.073959
0.325663
0.462715
0.584911
0.590009
0.545441
0.544713
0.524177
0.523595
0.519225
0
0.506292
0.263716
15,001
464
191
32.329741
0.115346
0.10006
0
0.464286
0
0
0.018537
0.001931
0
0
0
0
0
1
0
false
0.012755
0
0
0
0
0
0
1
null
1
1
1
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
1c0a1d8865120ed0b658142cfd39906a7715a293
18,996
py
Python
src/ipycbm/plugins/foi/foi_panel.py
VP-GEO/cbm
4ed229f6b6455435b6d032deb8a39dba4ecee7a2
[ "BSD-3-Clause" ]
null
null
null
src/ipycbm/plugins/foi/foi_panel.py
VP-GEO/cbm
4ed229f6b6455435b6d032deb8a39dba4ecee7a2
[ "BSD-3-Clause" ]
null
null
null
src/ipycbm/plugins/foi/foi_panel.py
VP-GEO/cbm
4ed229f6b6455435b6d032deb8a39dba4ecee7a2
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # This file is part of CbM (https://github.com/ec-jrc/cbm). # Author : Konstantinos Anastasakis # Credits : GTCAP Team # Copyright : 2021 European Commission, Joint Research Centre # License : 3-Clause BSD import os import glob from ipywidgets import (Text, Label, HBox, VBox, Layout, Tab, Dropdown, ToggleButtons, Output, SelectMultiple, HTML, Button, FileUpload, Checkbox, Accordion, IntText, RadioButtons) from src.ipycbm.utils import config, settings from src.ipycbm.sources import database from src.ipycbm.ui_proc import proc_func from src.ipycbm.plugins.foi import foi_proc from src.ipycbm.plugins.foi import foi_proc_v2 def foi(): path_plug = "ipycbm/plugins/foi/foi_db_func/" path_data = f"{config.get_value(['paths', 'temp'])}foi/" progress = Output() def outlog(*text): with progress: print(*text) foi_info = HTML( value="""FOI procedures need direct access to the database. <br> In case there no image is provided, access to object storage will be needed to generate the base image from sentinel images. """, placeholder='FOI Information', ) # Connect to database db_info = Label( f"1. Connect to database and object storage.") db_select = Dropdown( options=[db for db in config.get_value(['db'])], description='Configure:', disabled=True, layout=Layout(width='140px') ) db_config = Button( value=False, disabled=False, button_style='info', tooltip='Configure db connection.', icon='cogs', layout=Layout(width='40px') ) db_box = HBox([db_select, db_config]) parcels_table = RadioButtons( options=[('Upload .shp', 0), ('From database', 1)], # value='pineapple', # Defaults to 'pineapple' # layout={'width': 'max-content'}, # If the items' names are long # description='Pizza topping:', disabled=False ) par_box = HBox([]) def on_parcels_table(method): if method.new == 0: par_box.children = [] elif method.new == 1: par_box.children = [] parcels_table.observe(on_parcels_table, 'value') # Generate or upload image. img_info = Label( f"3. Upload or generate raster base image. (Only upload is currently available)") img_option = ToggleButtons( options=['Upload', 'Generate'], value=None, disabled=True, button_style='info', # 'success', 'info', 'warning', 'danger' or '' tooltips=['Upnload your base image', 'Get from object storage'] ) img_dist_folder = Text( value=f"{path_data}raster/", placeholder='tmp/', description='Folder:', disabled=False ) img_select = FileUpload( description='Select file:', icon='plus', accept='.tif, .tiff', multiple=True # True to accept multiple files upload else False ) img_clear = Button( value=False, disabled=False, button_style='info', tooltip='Clear selections.', icon='broom', layout=Layout(width='40px') ) img_upload = Button( value=False, disabled=False, button_style='info', tooltip='Upload foi base image (.tif)', icon='fa-upload', layout=Layout(width='40px') ) img_box = HBox([HBox([img_dist_folder, img_select, img_clear, img_upload])]) # YAML File upload yml_select = FileUpload( description='Select file:', icon='plus', accept='.yml, .yaml, .txt', multiple=False ) yml_clear = Button( value=False, disabled=False, button_style='info', tooltip='Clear selection.', icon='broom', layout=Layout(width='40px') ) yml_upload = Button( value=False, disabled=False, button_style='info', tooltip='Upload yaml file.', icon='fa-upload', layout=Layout(width='40px') ) yml_box = HBox([yml_select, yml_clear, yml_upload]) # Prepare procedures pre_info = Label("4. Prepare FOI procedure.") pre_ins_func = Button( value=False, disabled=False, button_style='info', tooltip='Insert functions to database.', icon='fa-share-square', layout=Layout(width='40px') ) pre_ins_func_box = HBox([Label("Add functions to database:"), pre_ins_func]) vector_file = Dropdown( options=[s for s in glob.glob(f'{path_data}vector/*' ) if '.shp' in s], description='Vector file:', disabled=False, ) raster_file = Dropdown( options=[s for s in glob.glob(f'{path_data}raster/*' ) if '.tif' in s], description='Raster file:', disabled=False, ) yaml_file = Dropdown( options=[s for s in glob.glob(f'{path_data}/*' ) if '.yml' in s], description='yaml file:', disabled=False, ) # heterogeneity_threshold pre_heto_chec = HTML(""" Minimum and maximum thresholds for heterogeneity checks. In the example, any parcel with percentage of pixels for one class between 30 and 70 from the total, will be considered heterogenous. """) pre_min_het = IntText( value=30, description='MIN:', tooltip="Minimum threshold for heterogeneity checks", disabled=False, layout=Layout(width='150px') ) pre_max_het = IntText( value=70, description='MAX:', tooltip="Maximum threshold for heterogeneity checks", disabled=False, layout=Layout(width='150px') ) pre_heto_chec_box = HBox([pre_min_het, pre_max_het]) pre_min_area = IntText( value=2000, description='area:', tooltip="Minimum area for clusters selection.", disabled=False, layout=Layout(width='200px') ) refresh_selections = Button( layout=Layout(width='35px'), icon='fa-refresh' ) pre_box = VBox([ pre_info, pre_ins_func_box, HBox([Label("Select the requared files:"), refresh_selections]), HTML("""a. Spatial data to be tested - parcels that will be checked for heterogeneity and cardinality."""), HBox([vector_file]), HTML("""b. Thematic raster - classification raster, or raster from other source that will be used for testing heterogeneity and cardinality."""), HBox([raster_file]), HTML("""c. YAML file that holds the classes form the thematic raster file - can be also a simple list of values in the notebook corespondence between pixel values and names for the classes"""), HBox([yaml_file, yml_box]), pre_heto_chec, pre_heto_chec_box, HBox([pre_min_area, HTML( "Minimum area for clusters selection - only clusters bigger from this threshold will be counted.")]) ]) # Run procedures run_info = Label("5. Run FOI procedure.") run_proc = Button( description='Run FOI procedure', value=False, disabled=False, button_style='info', tooltip='Run', icon='play', ) run_box = HBox([run_proc]) def on_img_option_change(change): if img_option.value == 'Upload': img_box.children = [HBox([img_dist_folder, img_select, img_clear, img_upload])] else: img_box.children = () img_option.observe(on_img_option_change, 'value') @refresh_selections.on_click def refresh_selections_on_click(b): vector_file.options = [s for s in glob.glob(f'{path_data}vector/*' ) if '.shp' in s] raster_file.options = [s for s in glob.glob(f'{path_data}raster/*' ) if '.tif' in s] yaml_file.options = [s for s in glob.glob(f'{path_data}/*' ) if '.yml' in s] @img_clear.on_click def img_clear_on_click(b): img_select.value.clear() img_select._counter = 0 @img_upload.on_click def img_upload_on_click(b): progress.clear_output() os.makedirs(img_dist_folder.value, exist_ok=True) for key in img_select.value: content = img_select.value[key]['content'] with open(f'{img_dist_folder.value}{key}', 'wb') as f: f.write(content) outlog("All files are uploaded.") @yml_clear.on_click def yml_clear_on_click(b): yml_select.value.clear() yml_select._counter = 0 @yml_upload.on_click def yml_upload_on_click(b): progress.clear_output() yml_dist_folder = f'{path_data}' os.makedirs(yml_dist_folder, exist_ok=True) for key in yml_select.value: content = yml_select.value[key]['content'] with open(f'{yml_dist_folder}{key}', 'wb') as f: f.write(content) outlog("The yaml file is uploaded.") db_conf_box = HBox([]) @db_config.on_click def db_config_on_click(b): if db_conf_box.children == (): db_conf_box.children = [settings.direct_conn()] else: db_conf_box.children = () @pre_ins_func.on_click def pre_ins_func_on_click(b): progress.clear_output() try: functions = glob.glob(f"{path_plug}*.func") db = config.get_value(['set', 'db_conn']) sche = config.get_value(['db', db, 'conn', 'sche']) user = config.get_value(['db', db, 'conn', 'user']) for f in functions: database.insert_function(open(f).read().format( schema=sche, owner=user)) finc_list = [f"ipycbm_{f.split('/')[-1].split('.')[0]}, " for f in functions] outlog(f"The functions: {('').join(finc_list)}where added to the database") except Exception as err: outlog("Could not add functions to dattabase.", err) @run_proc.on_click def run_proc_on_click(b): with progress: foi_proc.proc(vector_file.value, raster_file.value, yaml_file.value, pre_min_het.value, pre_max_het.value, pre_min_area.value) wbox = VBox([foi_info, db_info, db_box, db_conf_box, proc_func.upload_shp(path_data), img_info, img_option, img_box, pre_box, run_info, run_box, progress]) return wbox def foi_v2(): path_data = f"{config.get_value(['paths', 'temp'])}foi/" progress = Output() def outlog(*text): with progress: print(*text) imp_refresh = Button( layout=Layout(width='35px'), icon='fa-refresh' ) foi_info = HTML( value="""FOI procedures version 2 does not need direct access to the database. """, placeholder='FOI Information', ) # Generate or upload image. img_info = Label( f"3. Upload or generate raster base image. (Only upload is currently available)") img_option = ToggleButtons( options=['Upload', 'Generate'], value=None, disabled=True, button_style='info', # 'success', 'info', 'warning', 'danger' or '' tooltips=['Upnload your base image', 'Get from object storage'] ) img_dist_folder = Text( value=f"{path_data}raster/", placeholder='tmp/', description='Folder:', disabled=False ) img_select = FileUpload( description='Select file:', icon='plus', accept='.tif, .tiff', multiple=True # True to accept multiple files upload else False ) img_clear = Button( value=False, disabled=False, button_style='info', tooltip='Upload foi reference data (.shp)', icon='broom', layout=Layout(width='40px') ) img_upload = Button( value=False, disabled=False, button_style='info', tooltip='Upload foi base image (.tif)', icon='fa-upload', layout=Layout(width='40px') ) img_box = HBox([HBox([img_dist_folder, img_select, img_clear, img_upload])]) # YAML File upload yml_select = FileUpload( description='Select file:', icon='plus', accept='.yml, .yaml, .txt', multiple=False ) yml_clear = Button( value=False, disabled=False, button_style='info', tooltip='Clear selection.', icon='broom', layout=Layout(width='40px') ) yml_upload = Button( value=False, disabled=False, button_style='info', tooltip='Upload yaml file.', icon='fa-upload', layout=Layout(width='40px') ) yml_box = HBox([yml_select, yml_clear, yml_upload]) # Prepare procedures pre_info = Label("4. Prepare FOI procedure.") vector_file = Dropdown( options=[s for s in glob.glob(f'{path_data}vector/*' ) if '.shp' in s], description='Vector file:', disabled=False, ) raster_file = Dropdown( options=[s for s in glob.glob(f'{path_data}raster/*' ) if '.tif' in s], description='Raster file:', disabled=False, ) yaml_file = Dropdown( options=[s for s in glob.glob(f'{path_data}/*' ) if '.yml' in s], description='yaml file:', disabled=False, ) # heterogeneity_threshold pre_heto_chec = HTML(""" Minimum and maximum thresholds for heterogeneity checks. In the example, any parcel with percentage of pixels for one class between 30 and 70 from the total, will be considered heterogenous. """) pre_min_het = IntText( value=30, description='MIN:', tooltip="Minimum threshold for heterogeneity checks", disabled=False, layout=Layout(width='150px') ) pre_max_het = IntText( value=70, description='MAX:', tooltip="Maximum threshold for heterogeneity checks", disabled=False, layout=Layout(width='150px') ) pre_heto_chec_box = HBox([pre_min_het, pre_max_het]) pre_min_cluster_size = IntText( value=20, description='pixels:', tooltip="Minimum area for clusters selection.", disabled=False, layout=Layout(width='200px') ) pre_pixel_connectivity = IntText( value=8, description='connectivity type:', tooltip="Type of pixel connectivity in analysis. Accepted values: 4 or 8.", disabled=False, layout=Layout(width='200px') ) pre_negative_buffer = IntText( value=-10, description='negative buffer:', tooltip="Negative buffer to be applied on the FOI", disabled=False, layout=Layout(width='200px') ) refresh_selections = Button( layout=Layout(width='35px'), icon='fa-refresh' ) pre_box = VBox([ pre_info, Label("Select the requared files:"), HBox([vector_file, HTML( "Spatial data to be tested - parcels that will be checked for heterogeneity and cardinality.")]), HBox([raster_file, HTML("""Thematic raster - classification raster, or raster from other source that will be used for testing heterogeneity and cardinality.""")]), HTML("""YAML file that holds the classes form the thematic raster file - can be also a simple list of values in the notebook corespondence between pixel values and names for the classes"""), HBox([yaml_file, yml_box]), pre_heto_chec, pre_heto_chec_box, pre_pixel_connectivity, pre_negative_buffer, HBox([pre_min_cluster_size, HTML( "Minimum area for clusters selection - only clusters bigger from this threshold will be counted.")]) ]) # Run procedures run_info = Label("5. Run FOI procedure.") run_proc = Button( description='Run FOI procedure version 2', value=False, disabled=False, button_style='info', tooltip='Run v2 FOI', icon='play', ) run_box = HBox([run_proc]) def on_img_option_change(change): if img_option.value == 'Upload': img_box.children = [HBox([img_dist_folder, img_select, img_clear, img_upload])] else: img_box.children = () img_option.observe(on_img_option_change, 'value') @refresh_selections.on_click def refresh_selections_on_click(b): vector_file.options = [s for s in glob.glob(f'{path_data}vector/*' ) if '.shp' in s] raster_file.options = [s for s in glob.glob(f'{path_data}raster/*' ) if '.tif' in s] yaml_file.options = [s for s in glob.glob(f'{path_data}/*' ) if '.yml' in s] @img_clear.on_click def img_clear_on_click(b): img_select.value.clear() img_select._counter = 0 @img_upload.on_click def img_upload_on_click(b): progress.clear_output() os.makedirs(img_dist_folder.value, exist_ok=True) for key in img_select.value: content = img_select.value[key]['content'] with open(f'{img_dist_folder.value}{key}', 'wb') as f: f.write(content) outlog("All files are uploaded.") @yml_clear.on_click def yml_clear_on_click(b): yml_select.value.clear() yml_select._counter = 0 @yml_upload.on_click def yml_upload_on_click(b): progress.clear_output() yml_dist_folder = f'{path_data}' os.makedirs(yml_dist_folder, exist_ok=True) for key in yml_select.value: content = yml_select.value[key]['content'] with open(f'{yml_dist_folder}{key}', 'wb') as f: f.write(content) outlog("The yaml file is uploaded.") @run_proc.on_click def run_proc_on_click(b): with progress: foi_proc_v2.proc(vector_file.value, raster_file.value, yaml_file.value, pre_negative_buffer.value, pre_min_het.value, pre_max_het.value, pre_pixel_connectivity.value, pre_min_cluster_size.value) wbox_v2 = VBox([proc_func.upload_shp(path_data), img_info, img_option, img_box, pre_box, run_info, run_box, progress]) return wbox_v2
33.151832
218
0.584439
2,287
18,996
4.668561
0.135549
0.03531
0.035029
0.015828
0.783834
0.776716
0.755081
0.747307
0.736817
0.718273
0
0.008463
0.303327
18,996
572
219
33.20979
0.798323
0.042377
0
0.70303
0
0.00202
0.240145
0.013874
0
0
0
0
0
1
0.042424
false
0
0.016162
0
0.062626
0.00404
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
1c600349997b469f77f1570725a81f12a07a96b4
132
py
Python
lekcja_w06d.py
pawel-gbr/pawel-gbr.github.io
69cae413b21ed59509751432929bb42a1991bd1c
[ "BSD-2-Clause" ]
null
null
null
lekcja_w06d.py
pawel-gbr/pawel-gbr.github.io
69cae413b21ed59509751432929bb42a1991bd1c
[ "BSD-2-Clause" ]
1
2018-09-26T16:20:08.000Z
2018-09-26T16:50:03.000Z
lekcja_w06d.py
pawel-gbr/pawel-gbr.github.io
69cae413b21ed59509751432929bb42a1991bd1c
[ "BSD-2-Clause" ]
null
null
null
print("Podaj a:") a = int(input()) print("Podaj b:") b = int(input()) print("A") if a > b else print("=") if a == b else print("B")
22
61
0.55303
25
132
2.92
0.32
0.273973
0.356164
0.219178
0.356164
0
0
0
0
0
0
0
0.174242
132
5
62
26.4
0.669725
0
0
0
0
0
0.143939
0
0
0
0
0
0
1
0
false
0
0
0
0
0.6
1
0
0
null
1
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
1
0
6
98c6607d490e7afdcbeea840c64f42ba524fa26b
37
py
Python
h5Nastran/h5Nastran/h5/nastran/__init__.py
ACea15/pyNastran
5ffc37d784b52c882ea207f832bceb6b5eb0e6d4
[ "BSD-3-Clause" ]
293
2015-03-22T20:22:01.000Z
2022-03-14T20:28:24.000Z
h5Nastran/h5Nastran/h5/nastran/__init__.py
ACea15/pyNastran
5ffc37d784b52c882ea207f832bceb6b5eb0e6d4
[ "BSD-3-Clause" ]
512
2015-03-14T18:39:27.000Z
2022-03-31T16:15:43.000Z
h5Nastran/h5Nastran/h5/nastran/__init__.py
ACea15/pyNastran
5ffc37d784b52c882ea207f832bceb6b5eb0e6d4
[ "BSD-3-Clause" ]
136
2015-03-19T03:26:06.000Z
2022-03-25T22:14:54.000Z
from .nastran_node import NastranNode
37
37
0.891892
5
37
6.4
1
0
0
0
0
0
0
0
0
0
0
0
0.081081
37
1
37
37
0.941176
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
c70230752f13e55c3d6b044565190468f11c2e73
5,204
py
Python
tests/unit/dataactvalidator/test_fabs37_detached_award_financial_assistance_1.py
brianherman/data-act-broker-backend
80eb055b9d245046192f7ad4fd0be7d0e11d2dec
[ "CC0-1.0" ]
null
null
null
tests/unit/dataactvalidator/test_fabs37_detached_award_financial_assistance_1.py
brianherman/data-act-broker-backend
80eb055b9d245046192f7ad4fd0be7d0e11d2dec
[ "CC0-1.0" ]
null
null
null
tests/unit/dataactvalidator/test_fabs37_detached_award_financial_assistance_1.py
brianherman/data-act-broker-backend
80eb055b9d245046192f7ad4fd0be7d0e11d2dec
[ "CC0-1.0" ]
1
2020-07-17T23:50:56.000Z
2020-07-17T23:50:56.000Z
from tests.unit.dataactcore.factories.staging import DetachedAwardFinancialAssistanceFactory from dataactcore.models.domainModels import CFDAProgram from tests.unit.dataactvalidator.utils import number_of_errors, query_columns _FILE = 'fabs37_detached_award_financial_assistance_1' def test_column_headers(database): expected_subset = {'row_number', 'cfda_number', 'action_date', 'action_type', 'correction_delete_indicatr', 'uniqueid_AssistanceTransactionUniqueKey'} actual = set(query_columns(_FILE, database)) assert expected_subset == actual def test_success(database): """ Test valid. For ActionType = A, the CFDA_Number must be active as of the ActionDate. Not apply to those with CorrectionDeleteIndicator = C. If publish_date <= action_date <= archived_date, it passes validation (active). """ cfda = CFDAProgram(program_number=12.340, published_date='20130427', archived_date='') det_award_1 = DetachedAwardFinancialAssistanceFactory(cfda_number='12.340', action_date='20140111', action_type='a', correction_delete_indicatr='B') det_award_2 = DetachedAwardFinancialAssistanceFactory(cfda_number='12.340', action_date='20140111', action_type='A', correction_delete_indicatr=None) det_award_3 = DetachedAwardFinancialAssistanceFactory(cfda_number='12.340', action_date='20130427', action_type='a', correction_delete_indicatr='B') det_award_4 = DetachedAwardFinancialAssistanceFactory(cfda_number='12.340', action_date='20110111', action_type='B', correction_delete_indicatr='B') det_award_5 = DetachedAwardFinancialAssistanceFactory(cfda_number='12.340', action_date='20110111', action_type='A', correction_delete_indicatr='C') # Ignore correction delete indicator of D det_award_6 = DetachedAwardFinancialAssistanceFactory(cfda_number='12.340', action_date='20110111', action_type='a', correction_delete_indicatr='d') errors = number_of_errors(_FILE, database, models=[det_award_1, det_award_2, det_award_3, det_award_4, det_award_5, det_award_6, cfda]) assert errors == 0 cfda = CFDAProgram(program_number=12.350, published_date='20130427', archived_date='20150427') det_award_1 = DetachedAwardFinancialAssistanceFactory(cfda_number='12.350', action_date='20140111', action_type='A', correction_delete_indicatr='B') det_award_2 = DetachedAwardFinancialAssistanceFactory(cfda_number='12.350', action_date='20140111', action_type='a', correction_delete_indicatr=None) det_award_3 = DetachedAwardFinancialAssistanceFactory(cfda_number='12.350', action_date='20130427', action_type='A', correction_delete_indicatr='B') det_award_4 = DetachedAwardFinancialAssistanceFactory(cfda_number='12.350', action_date='20110111', action_type='B', correction_delete_indicatr='B') det_award_5 = DetachedAwardFinancialAssistanceFactory(cfda_number='12.350', action_date='20110111', action_type='a', correction_delete_indicatr='C') errors = number_of_errors(_FILE, database, models=[det_award_1, det_award_2, det_award_3, det_award_4, det_award_5, cfda]) assert errors == 0 def test_failure(database): """ Test invalid. For ActionType = A, the CFDA_Number must be active as of the ActionDate. Not apply to those with CorrectionDeleteIndicator = C. If publish_date > action_date > archive_date, reject that (not active). """ cfda = CFDAProgram(program_number=12.340, published_date='20130427', archived_date='') det_award_1 = DetachedAwardFinancialAssistanceFactory(cfda_number='12.340', action_date='20120111', action_type='a', correction_delete_indicatr='B') det_award_2 = DetachedAwardFinancialAssistanceFactory(cfda_number='12.340', action_date='20120111', action_type='A', correction_delete_indicatr=None) det_award_3 = DetachedAwardFinancialAssistanceFactory(cfda_number='12.340', action_date='20120111', action_type='a', correction_delete_indicatr='B') det_award_4 = DetachedAwardFinancialAssistanceFactory(cfda_number='12.340', action_date='20120111', action_type='A', correction_delete_indicatr=None) errors = number_of_errors(_FILE, database, models=[det_award_1, det_award_2, det_award_3, det_award_4, cfda]) assert errors == 4
69.386667
113
0.637202
524
5,204
5.975191
0.183206
0.076653
0.122645
0.244331
0.783136
0.763015
0.763015
0.759182
0.759182
0.759182
0
0.073818
0.276326
5,204
74
114
70.324324
0.757568
0.091084
0
0.326923
0
0
0.08984
0.023316
0
0
0
0
0.076923
1
0.057692
false
0
0.057692
0
0.115385
0
0
0
0
null
0
0
1
0
1
1
1
1
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
6
c711a9281c3787b4fa0eb6834942fcc0e7d904a8
46
py
Python
src/python/rodney/__init__.py
mesnardo/petibm-decoupledibpm
675615a882cc8418b15a34e1100ccfb421f1d9d1
[ "BSD-3-Clause" ]
null
null
null
src/python/rodney/__init__.py
mesnardo/petibm-decoupledibpm
675615a882cc8418b15a34e1100ccfb421f1d9d1
[ "BSD-3-Clause" ]
null
null
null
src/python/rodney/__init__.py
mesnardo/petibm-decoupledibpm
675615a882cc8418b15a34e1100ccfb421f1d9d1
[ "BSD-3-Clause" ]
null
null
null
from .lietal2016 import * from .misc import *
15.333333
25
0.73913
6
46
5.666667
0.666667
0
0
0
0
0
0
0
0
0
0
0.105263
0.173913
46
2
26
23
0.789474
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
c72417352c408dabec2d4e7865ca4250806a6b80
30
py
Python
alsa_tooltip/__init__.py
theelous3/alsa-tooltip
b8e96b742d5a133f5e8e57781802812b2eca9084
[ "MIT" ]
null
null
null
alsa_tooltip/__init__.py
theelous3/alsa-tooltip
b8e96b742d5a133f5e8e57781802812b2eca9084
[ "MIT" ]
null
null
null
alsa_tooltip/__init__.py
theelous3/alsa-tooltip
b8e96b742d5a133f5e8e57781802812b2eca9084
[ "MIT" ]
null
null
null
from .alsa_tooltip import main
30
30
0.866667
5
30
5
1
0
0
0
0
0
0
0
0
0
0
0
0.1
30
1
30
30
0.925926
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
c76c534f136d9aee58b843eeabbaacdf39f27b43
205
py
Python
machineLearning/api/socketServer/src/config/__init__.py
guilhermeKodama/Closetinn
44d6792cfb0db9cce56db83f2e8c4b8777530f68
[ "MIT" ]
null
null
null
machineLearning/api/socketServer/src/config/__init__.py
guilhermeKodama/Closetinn
44d6792cfb0db9cce56db83f2e8c4b8777530f68
[ "MIT" ]
null
null
null
machineLearning/api/socketServer/src/config/__init__.py
guilhermeKodama/Closetinn
44d6792cfb0db9cce56db83f2e8c4b8777530f68
[ "MIT" ]
null
null
null
import os if os.getenv('CLOSETINN_ENV', 'development') == 'development': from development import * elif os.getenv('CLOSETINN_ENV') == 'production': print 'PRODUCTION' from production import *
25.625
62
0.702439
23
205
6.173913
0.478261
0.112676
0.239437
0.28169
0
0
0
0
0
0
0
0
0.165854
205
7
63
29.285714
0.830409
0
0
0
0
0
0.331707
0
0
0
0
0
0
0
null
null
0
0.5
null
null
0.166667
1
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
1
0
0
0
1
0
0
0
0
6
c7be6f288664ac7715733f6bd85b56ac9e4f6357
122
py
Python
app/project/__init__.py
MashSoftware/flux-api
8763f752d44868b53a351f44f243ae760b28be31
[ "MIT" ]
1
2021-06-19T18:06:34.000Z
2021-06-19T18:06:34.000Z
app/project/__init__.py
MashSoftware/flux-api
8763f752d44868b53a351f44f243ae760b28be31
[ "MIT" ]
null
null
null
app/project/__init__.py
MashSoftware/flux-api
8763f752d44868b53a351f44f243ae760b28be31
[ "MIT" ]
null
null
null
from flask import Blueprint project = Blueprint("project", __name__) from app.project import routes # noqa: E402, F401
20.333333
50
0.762295
16
122
5.5625
0.6875
0.359551
0
0
0
0
0
0
0
0
0
0.058252
0.155738
122
5
51
24.4
0.805825
0.131148
0
0
0
0
0.067308
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0.666667
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
1
0
1
1
0
6
4070742e277cd53474765332c944e9da1da29e95
4,889
py
Python
AutomationFramework/tests/qos/test_qos_scheduler.py
sbarguil/Testing-framework
f3ef69f1c4f0aeafd02e222d846162c711783b15
[ "Apache-2.0" ]
1
2020-04-23T15:22:16.000Z
2020-04-23T15:22:16.000Z
AutomationFramework/tests/qos/test_qos_scheduler.py
sbarguil/Testing-framework
f3ef69f1c4f0aeafd02e222d846162c711783b15
[ "Apache-2.0" ]
44
2020-08-13T19:35:41.000Z
2021-03-01T09:08:00.000Z
AutomationFramework/tests/qos/test_qos_scheduler.py
sbarguil/Testing-framework
f3ef69f1c4f0aeafd02e222d846162c711783b15
[ "Apache-2.0" ]
6
2020-04-23T15:29:38.000Z
2022-03-03T14:23:38.000Z
import pytest from AutomationFramework.page_objects.qos.qos import QOS from AutomationFramework.tests.base_test import BaseTest class TestQOSScheduler(BaseTest): test_case_file = 'qos_scheduler.yml' @pytest.mark.parametrize('create_page_object_arg', [{'test_case_file': test_case_file, 'test_case_name': 'qos_scheduler_policy_name', 'page_object_class': QOS}]) def test_qos_scheduler_policy_name(self, create_page_object): create_page_object.execute_qos_scheduler_edit_config_test_case() assert create_page_object.generic_validate_test_case_params(), create_page_object.get_test_case_description() @pytest.mark.parametrize('create_page_object_arg', [{'test_case_file': test_case_file, 'test_case_name': 'qos_scheduler_sequence', 'page_object_class': QOS}]) def test_qos_scheduler_sequence(self, create_page_object): create_page_object.execute_qos_scheduler_edit_config_test_case() assert create_page_object.generic_validate_test_case_params(), create_page_object.get_test_case_description() @pytest.mark.parametrize('create_page_object_arg', [{'test_case_file': test_case_file, 'test_case_name': 'qos_scheduler_id', 'page_object_class': QOS}]) def test_qos_scheduler_id(self, create_page_object): create_page_object.execute_qos_scheduler_edit_config_test_case() assert create_page_object.generic_validate_test_case_params(), create_page_object.get_test_case_description() @pytest.mark.parametrize('multiple_create_page_objects_arg', [{'test_case_file': test_case_file, 'test_case_name': 'qos_scheduler_queue', 'page_object_rpcs_classes': [QOS, QOS], 'rpc_clean_order': [1, 0], }]) def test_qos_scheduler_queue(self, multiple_create_page_objects): multiple_create_page_objects[0].execute_qos_queue_edit_config_test_case() assert multiple_create_page_objects[0].validate_rpc(), multiple_create_page_objects[0].get_test_case_description() multiple_create_page_objects[1].execute_qos_scheduler_edit_config_test_case() assert multiple_create_page_objects[1].validate_rpc(), multiple_create_page_objects[1].get_test_case_description() @pytest.mark.parametrize('create_page_object_arg', [{'test_case_file': test_case_file, 'test_case_name': 'qos_scheduler_weight', 'page_object_class': QOS}]) def test_qos_scheduler_weight(self, create_page_object): create_page_object.execute_qos_scheduler_edit_config_test_case() assert create_page_object.generic_validate_test_case_params(), create_page_object.get_test_case_description() @pytest.mark.parametrize('create_page_object_arg', [{'test_case_file': test_case_file, 'test_case_name': 'qos_scheduler_cir', 'page_object_class': QOS}]) def test_qos_scheduler_cir(self, create_page_object): create_page_object.execute_qos_scheduler_edit_config_test_case() assert create_page_object.generic_validate_test_case_params(), create_page_object.get_test_case_description() @pytest.mark.parametrize('create_page_object_arg', [{'test_case_file': test_case_file, 'test_case_name': 'qos_scheduler_max_queue_depth_bytes', 'page_object_class': QOS}]) def test_qos_scheduler_max_queue_depth_bytes(self, create_page_object): create_page_object.execute_qos_scheduler_edit_config_test_case() assert create_page_object.generic_validate_test_case_params(), create_page_object.get_test_case_description() @pytest.mark.parametrize('create_page_object_arg', [{'test_case_file': test_case_file, 'test_case_name': 'qos_scheduler_bc', 'page_object_class': QOS}]) def test_qos_scheduler_bc(self, create_page_object): create_page_object.execute_qos_scheduler_edit_config_test_case() assert create_page_object.generic_validate_test_case_params(), create_page_object.get_test_case_description()
71.897059
122
0.635713
539
4,889
5.148423
0.096475
0.144144
0.201802
0.092252
0.859099
0.838919
0.8
0.8
0.69982
0.664505
0
0.002309
0.291266
4,889
67
123
72.970149
0.798557
0
0
0.491228
0
0
0.154428
0.059726
0
0
0
0
0.157895
1
0.140351
false
0
0.052632
0
0.22807
0
0
0
0
null
0
1
0
1
1
1
1
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
6
40d3f4875fbb175940229321cb61ab5959f2c22f
38
py
Python
python/testData/formatter/spacesBeforeFromImportSource_after.py
jnthn/intellij-community
8fa7c8a3ace62400c838e0d5926a7be106aa8557
[ "Apache-2.0" ]
2
2018-12-29T09:53:39.000Z
2018-12-29T09:53:42.000Z
python/testData/formatter/spacesBeforeFromImportSource_after.py
Cyril-lamirand/intellij-community
60ab6c61b82fc761dd68363eca7d9d69663cfa39
[ "Apache-2.0" ]
173
2018-07-05T13:59:39.000Z
2018-08-09T01:12:03.000Z
python/testData/formatter/spacesBeforeFromImportSource_after.py
Cyril-lamirand/intellij-community
60ab6c61b82fc761dd68363eca7d9d69663cfa39
[ "Apache-2.0" ]
2
2020-03-15T08:57:37.000Z
2020-04-07T04:48:14.000Z
from sys import path print(sys.path)
9.5
20
0.763158
7
38
4.142857
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.157895
38
3
21
12.666667
0.90625
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.5
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
1
0
1
0
0
1
0
6
40ec1fb276682d9b007fb24bdc29b75cbec9bb10
38
py
Python
replaybuffer/__init__.py
mattbev/replaybuffer
ed2f2bd8e10ab6f118bda49d8c4b26d257bcb5c5
[ "MIT" ]
null
null
null
replaybuffer/__init__.py
mattbev/replaybuffer
ed2f2bd8e10ab6f118bda49d8c4b26d257bcb5c5
[ "MIT" ]
null
null
null
replaybuffer/__init__.py
mattbev/replaybuffer
ed2f2bd8e10ab6f118bda49d8c4b26d257bcb5c5
[ "MIT" ]
null
null
null
from .replaybuffer import ReplayBuffer
38
38
0.894737
4
38
8.5
0.75
0
0
0
0
0
0
0
0
0
0
0
0.078947
38
1
38
38
0.971429
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
40fbe4ea8abc7bd803bfe7e42f0814470c5ff971
320
py
Python
toontown/coghq/DistributedSellbotHQDoorAI.py
TrueBlueDogemon/Toontown
ebed7fc3f2ef06a529cf02eda7ab46361aceef9d
[ "MIT" ]
1
2021-02-25T06:22:49.000Z
2021-02-25T06:22:49.000Z
toontown/coghq/DistributedSellbotHQDoorAI.py
journeyfan/toontown-journey
7a4db507e5c1c38a014fc65588086d9655aaa5b4
[ "MIT" ]
null
null
null
toontown/coghq/DistributedSellbotHQDoorAI.py
journeyfan/toontown-journey
7a4db507e5c1c38a014fc65588086d9655aaa5b4
[ "MIT" ]
2
2020-09-26T20:37:18.000Z
2020-11-15T20:55:33.000Z
from direct.directnotify import DirectNotifyGlobal from toontown.coghq.DistributedCogHQDoorAI import DistributedCogHQDoorAI class DistributedSellbotHQDoorAI(DistributedCogHQDoorAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedSellbotHQDoorAI") def informPlayer(self, todo0): pass
32
86
0.834375
24
320
11.125
0.708333
0
0
0
0
0
0
0
0
0
0
0.003521
0.1125
320
9
87
35.555556
0.93662
0
0
0
0
0
0.081505
0.081505
0
0
0
0
0
1
0.166667
false
0.166667
0.333333
0
0.833333
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
1
1
0
1
0
0
6
9076935ffd8b2ebbae7f02ff6322f92fb6ea59e7
96
py
Python
venv/lib/python3.8/site-packages/requests_toolbelt/adapters/__init__.py
Retraces/UkraineBot
3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71
[ "MIT" ]
2
2022-03-13T01:58:52.000Z
2022-03-31T06:07:54.000Z
venv/lib/python3.8/site-packages/requests_toolbelt/adapters/__init__.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
19
2021-11-20T04:09:18.000Z
2022-03-23T15:05:55.000Z
venv/lib/python3.8/site-packages/requests_toolbelt/adapters/__init__.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
null
null
null
/home/runner/.cache/pip/pool/68/77/c0/07b1ade470edaef35669139b72653725395fc112cb5d7c5920e6bd0569
96
96
0.895833
9
96
9.555556
1
0
0
0
0
0
0
0
0
0
0
0.458333
0
96
1
96
96
0.4375
0
0
0
0
0
0
0
0
1
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
1
0
0
0
1
0
0
0
0
0
0
0
0
6
90af3837824055232c7aa3f0afef3a3394468fe9
104
py
Python
tests/conftest.py
sethmccombs/tau-intro-to-pytest
a4e8983841e6afcae6b0264ff48e47c37778b443
[ "Apache-2.0" ]
null
null
null
tests/conftest.py
sethmccombs/tau-intro-to-pytest
a4e8983841e6afcae6b0264ff48e47c37778b443
[ "Apache-2.0" ]
null
null
null
tests/conftest.py
sethmccombs/tau-intro-to-pytest
a4e8983841e6afcae6b0264ff48e47c37778b443
[ "Apache-2.0" ]
null
null
null
import pytest from stuff.accum import Accumulator @pytest.fixture def accum(): return Accumulator()
17.333333
35
0.778846
13
104
6.230769
0.692308
0
0
0
0
0
0
0
0
0
0
0
0.144231
104
6
36
17.333333
0.910112
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
true
0
0.4
0.2
0.8
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
1
1
1
0
0
6
90f9b168505ebf6376594befb0593270974245eb
81
py
Python
xquantum/qdk/__init__.py
caccio/CrossQuantumClassifier
eede8a2d46220d9a9f2fbe8977abd98801c11d5a
[ "Apache-2.0" ]
null
null
null
xquantum/qdk/__init__.py
caccio/CrossQuantumClassifier
eede8a2d46220d9a9f2fbe8977abd98801c11d5a
[ "Apache-2.0" ]
null
null
null
xquantum/qdk/__init__.py
caccio/CrossQuantumClassifier
eede8a2d46220d9a9f2fbe8977abd98801c11d5a
[ "Apache-2.0" ]
null
null
null
from .qdk import testModel, classifiedLableProbability, circuitDerivativeByParams
81
81
0.901235
6
81
12.166667
1
0
0
0
0
0
0
0
0
0
0
0
0.061728
81
1
81
81
0.960526
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
290856475e810b21bcc547989d14e51c999c556a
761
py
Python
mini-apps/tic-tac-toe-full/tic_tac_toe_module.py
CrtomirJuren/python-delavnica
db96470d2cb1870390545cfbe511552a9ef08720
[ "MIT" ]
null
null
null
mini-apps/tic-tac-toe-full/tic_tac_toe_module.py
CrtomirJuren/python-delavnica
db96470d2cb1870390545cfbe511552a9ef08720
[ "MIT" ]
null
null
null
mini-apps/tic-tac-toe-full/tic_tac_toe_module.py
CrtomirJuren/python-delavnica
db96470d2cb1870390545cfbe511552a9ef08720
[ "MIT" ]
null
null
null
import random # def generate_board(): # """ # funkcija ki generira naključno tic tac toe board - igralno ploščo # vzorci = ['X','O'] # nakljucen_vzorec = random.choice(vzorci) # """ # return board # def print_board(board): # """ funkcija za lepši terminal print board """ # pass # def display_board(): # pass # def check_win_condition(board, player): # """ """ # return win # def check_tie_condition(board): # """ """ # return tie # def check_rows(board, player): # """ """ # return win # def check_columns(board, player): # """ """ # return win # def check_diagonals(board, player): # """ """ # return win # testiraj funkcijo # print_board(generate_random_board())
15.854167
71
0.584757
83
761
5.192771
0.445783
0.092807
0.157773
0.185615
0.194896
0.194896
0
0
0
0
0
0
0.262812
761
48
72
15.854167
0.768271
0.881735
0
0
1
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
2921605405b3945fb53689ec7975f3876770448c
48
py
Python
safe/src/ManSite_vseukr/python/scripts/script4.py
Valentyn-coder/Manproject
e2f73fa82f3878ed424e603e0a859969ffa1c308
[ "MIT" ]
null
null
null
safe/src/ManSite_vseukr/python/scripts/script4.py
Valentyn-coder/Manproject
e2f73fa82f3878ed424e603e0a859969ffa1c308
[ "MIT" ]
null
null
null
safe/src/ManSite_vseukr/python/scripts/script4.py
Valentyn-coder/Manproject
e2f73fa82f3878ed424e603e0a859969ffa1c308
[ "MIT" ]
null
null
null
import sys print(str(sys.argv[1])[::3], end='')
24
36
0.604167
9
48
3.222222
0.888889
0
0
0
0
0
0
0
0
0
0
0.045455
0.083333
48
2
36
24
0.613636
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.5
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
1
0
1
0
0
1
0
6
2937f90faea482387318fd770284e4a0703f0297
57,156
py
Python
tests/test_h3.py
vranem1/aioquic
f3904da6022bdf687e476d74b7d4799dc4f92eca
[ "BSD-3-Clause" ]
null
null
null
tests/test_h3.py
vranem1/aioquic
f3904da6022bdf687e476d74b7d4799dc4f92eca
[ "BSD-3-Clause" ]
null
null
null
tests/test_h3.py
vranem1/aioquic
f3904da6022bdf687e476d74b7d4799dc4f92eca
[ "BSD-3-Clause" ]
1
2022-03-06T10:04:52.000Z
2022-03-06T10:04:52.000Z
import binascii from unittest import TestCase from aioquic.buffer import Buffer, encode_uint_var from aioquic.h3.connection import ( H3_ALPN, ErrorCode, FrameType, FrameUnexpected, H3Connection, MessageError, Setting, SettingsError, StreamType, encode_frame, encode_settings, parse_settings, validate_push_promise_headers, validate_request_headers, validate_response_headers, validate_trailers, ) from aioquic.h3.events import DataReceived, HeadersReceived, PushPromiseReceived from aioquic.h3.exceptions import NoAvailablePushIDError from aioquic.quic.configuration import QuicConfiguration from aioquic.quic.events import StreamDataReceived from aioquic.quic.logger import QuicLogger from .test_connection import client_and_server, transfer DUMMY_SETTINGS = { Setting.QPACK_MAX_TABLE_CAPACITY: 4096, Setting.QPACK_BLOCKED_STREAMS: 16, Setting.DUMMY: 1, } def h3_client_and_server(): return client_and_server( client_options={"alpn_protocols": H3_ALPN}, server_options={"alpn_protocols": H3_ALPN}, ) def h3_transfer(quic_sender, h3_receiver): quic_receiver = h3_receiver._quic if hasattr(quic_sender, "stream_queue"): quic_receiver._events.extend(quic_sender.stream_queue) quic_sender.stream_queue.clear() else: transfer(quic_sender, quic_receiver) # process QUIC events http_events = [] event = quic_receiver.next_event() while event is not None: http_events.extend(h3_receiver.handle_event(event)) event = quic_receiver.next_event() return http_events class FakeQuicConnection: def __init__(self, configuration): self.closed = None self.configuration = configuration self.stream_queue = [] self._events = [] self._next_stream_bidi = 0 if configuration.is_client else 1 self._next_stream_uni = 2 if configuration.is_client else 3 self._quic_logger = QuicLogger().start_trace( is_client=configuration.is_client, odcid=b"" ) def close(self, error_code, reason_phrase): self.closed = (error_code, reason_phrase) def get_next_available_stream_id(self, is_unidirectional=False): if is_unidirectional: stream_id = self._next_stream_uni self._next_stream_uni += 4 else: stream_id = self._next_stream_bidi self._next_stream_bidi += 4 return stream_id def next_event(self): try: return self._events.pop(0) except IndexError: return None def send_stream_data(self, stream_id, data, end_stream=False): # chop up data into individual bytes for c in data: self.stream_queue.append( StreamDataReceived( data=bytes([c]), end_stream=False, stream_id=stream_id ) ) if end_stream: self.stream_queue.append( StreamDataReceived(data=b"", end_stream=end_stream, stream_id=stream_id) ) class H3ConnectionTest(TestCase): maxDiff = None def _make_request(self, h3_client, h3_server): quic_client = h3_client._quic quic_server = h3_server._quic # send request stream_id = quic_client.get_next_available_stream_id() h3_client.send_headers( stream_id=stream_id, headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/"), (b"x-foo", b"client"), ], ) h3_client.send_data(stream_id=stream_id, data=b"", end_stream=True) # receive request events = h3_transfer(quic_client, h3_server) self.assertEqual( events, [ HeadersReceived( headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/"), (b"x-foo", b"client"), ], stream_id=stream_id, stream_ended=False, ), DataReceived(data=b"", stream_id=stream_id, stream_ended=True), ], ) # send response h3_server.send_headers( stream_id=stream_id, headers=[ (b":status", b"200"), (b"content-type", b"text/html; charset=utf-8"), (b"x-foo", b"server"), ], ) h3_server.send_data( stream_id=stream_id, data=b"<html><body>hello</body></html>", end_stream=True, ) # receive response events = h3_transfer(quic_server, h3_client) self.assertEqual( events, [ HeadersReceived( headers=[ (b":status", b"200"), (b"content-type", b"text/html; charset=utf-8"), (b"x-foo", b"server"), ], stream_id=stream_id, stream_ended=False, ), DataReceived( data=b"<html><body>hello</body></html>", stream_id=stream_id, stream_ended=True, ), ], ) def test_handle_control_frame_headers(self): """ We should not receive HEADERS on the control stream. """ quic_server = FakeQuicConnection( configuration=QuicConfiguration(is_client=False) ) h3_server = H3Connection(quic_server) # receive SETTINGS h3_server.handle_event( StreamDataReceived( stream_id=2, data=encode_uint_var(StreamType.CONTROL) + encode_frame(FrameType.SETTINGS, encode_settings(DUMMY_SETTINGS)), end_stream=False, ) ) self.assertIsNone(quic_server.closed) # receive unexpected HEADERS h3_server.handle_event( StreamDataReceived( stream_id=2, data=encode_frame(FrameType.HEADERS, b""), end_stream=False, ) ) self.assertEqual( quic_server.closed, (ErrorCode.H3_FRAME_UNEXPECTED, "Invalid frame type on control stream"), ) def test_handle_control_frame_max_push_id_from_client_before_settings(self): """ A server should not receive MAX_PUSH_ID before SETTINGS. """ quic_server = FakeQuicConnection( configuration=QuicConfiguration(is_client=False) ) h3_server = H3Connection(quic_server) # receive unexpected MAX_PUSH_ID h3_server.handle_event( StreamDataReceived( stream_id=2, data=encode_uint_var(StreamType.CONTROL) + encode_frame(FrameType.MAX_PUSH_ID, b""), end_stream=False, ) ) self.assertEqual( quic_server.closed, (ErrorCode.H3_MISSING_SETTINGS, ""), ) def test_handle_control_frame_max_push_id_from_server(self): """ A client should not receive MAX_PUSH_ID on the control stream. """ quic_client = FakeQuicConnection( configuration=QuicConfiguration(is_client=True) ) h3_client = H3Connection(quic_client) # receive SETTINGS h3_client.handle_event( StreamDataReceived( stream_id=3, data=encode_uint_var(StreamType.CONTROL) + encode_frame(FrameType.SETTINGS, encode_settings(DUMMY_SETTINGS)), end_stream=False, ) ) self.assertIsNone(quic_client.closed) # receive unexpected MAX_PUSH_ID h3_client.handle_event( StreamDataReceived( stream_id=3, data=encode_frame(FrameType.MAX_PUSH_ID, b""), end_stream=False, ) ) self.assertEqual( quic_client.closed, (ErrorCode.H3_FRAME_UNEXPECTED, "Servers must not send MAX_PUSH_ID"), ) def test_handle_control_settings_twice(self): """ We should not receive HEADERS on the control stream. """ quic_server = FakeQuicConnection( configuration=QuicConfiguration(is_client=False) ) h3_server = H3Connection(quic_server) # receive SETTINGS h3_server.handle_event( StreamDataReceived( stream_id=2, data=encode_uint_var(StreamType.CONTROL) + encode_frame(FrameType.SETTINGS, encode_settings(DUMMY_SETTINGS)), end_stream=False, ) ) self.assertIsNone(quic_server.closed) # receive unexpected SETTINGS h3_server.handle_event( StreamDataReceived( stream_id=2, data=encode_frame(FrameType.SETTINGS, encode_settings(DUMMY_SETTINGS)), end_stream=False, ) ) self.assertEqual( quic_server.closed, (ErrorCode.H3_FRAME_UNEXPECTED, "SETTINGS have already been received"), ) def test_handle_control_stream_close(self): """ Closing the control stream is not allowed. """ quic_client = FakeQuicConnection( configuration=QuicConfiguration(is_client=True) ) h3_client = H3Connection(quic_client) # receive SETTINGS h3_client.handle_event( StreamDataReceived( stream_id=3, data=encode_uint_var(StreamType.CONTROL) + encode_frame(FrameType.SETTINGS, encode_settings(DUMMY_SETTINGS)), end_stream=False, ) ) self.assertIsNone(quic_client.closed) # receive unexpected FIN h3_client.handle_event( StreamDataReceived( stream_id=3, data=b"", end_stream=True, ) ) self.assertEqual( quic_client.closed, ( ErrorCode.H3_CLOSED_CRITICAL_STREAM, "Closing control stream is not allowed", ), ) def test_handle_control_stream_duplicate(self): """ We must only receive a single control stream. """ quic_server = FakeQuicConnection( configuration=QuicConfiguration(is_client=False) ) h3_server = H3Connection(quic_server) # receive a first control stream h3_server.handle_event( StreamDataReceived( stream_id=2, data=encode_uint_var(StreamType.CONTROL), end_stream=False ) ) # receive a second control stream h3_server.handle_event( StreamDataReceived( stream_id=6, data=encode_uint_var(StreamType.CONTROL), end_stream=False ) ) self.assertEqual( quic_server.closed, ( ErrorCode.H3_STREAM_CREATION_ERROR, "Only one control stream is allowed", ), ) def test_handle_push_frame_wrong_frame_type(self): """ We should not received SETTINGS on a push stream. """ quic_client = FakeQuicConnection( configuration=QuicConfiguration(is_client=True) ) h3_client = H3Connection(quic_client) h3_client.handle_event( StreamDataReceived( stream_id=15, data=encode_uint_var(StreamType.PUSH) + encode_uint_var(0) # push ID + encode_frame(FrameType.SETTINGS, b""), end_stream=False, ) ) self.assertEqual( quic_client.closed, (ErrorCode.H3_FRAME_UNEXPECTED, "Invalid frame type on push stream"), ) def test_handle_qpack_decoder_duplicate(self): """ We must only receive a single QPACK decoder stream. """ quic_client = FakeQuicConnection( configuration=QuicConfiguration(is_client=True) ) h3_client = H3Connection(quic_client) # receive a first decoder stream h3_client.handle_event( StreamDataReceived( stream_id=11, data=encode_uint_var(StreamType.QPACK_DECODER), end_stream=False, ) ) # receive a second decoder stream h3_client.handle_event( StreamDataReceived( stream_id=15, data=encode_uint_var(StreamType.QPACK_DECODER), end_stream=False, ) ) self.assertEqual( quic_client.closed, ( ErrorCode.H3_STREAM_CREATION_ERROR, "Only one QPACK decoder stream is allowed", ), ) def test_handle_qpack_decoder_stream_error(self): """ Receiving garbage on the QPACK decoder stream triggers an exception. """ quic_client = FakeQuicConnection( configuration=QuicConfiguration(is_client=True) ) h3_client = H3Connection(quic_client) h3_client.handle_event( StreamDataReceived( stream_id=11, data=encode_uint_var(StreamType.QPACK_DECODER) + b"\x00", end_stream=False, ) ) self.assertEqual(quic_client.closed, (ErrorCode.QPACK_DECODER_STREAM_ERROR, "")) def test_handle_qpack_encoder_duplicate(self): """ We must only receive a single QPACK encoder stream. """ quic_client = FakeQuicConnection( configuration=QuicConfiguration(is_client=True) ) h3_client = H3Connection(quic_client) # receive a first encoder stream h3_client.handle_event( StreamDataReceived( stream_id=11, data=encode_uint_var(StreamType.QPACK_ENCODER), end_stream=False, ) ) # receive a second encoder stream h3_client.handle_event( StreamDataReceived( stream_id=15, data=encode_uint_var(StreamType.QPACK_ENCODER), end_stream=False, ) ) self.assertEqual( quic_client.closed, ( ErrorCode.H3_STREAM_CREATION_ERROR, "Only one QPACK encoder stream is allowed", ), ) def test_handle_qpack_encoder_stream_error(self): """ Receiving garbage on the QPACK encoder stream triggers an exception. """ quic_client = FakeQuicConnection( configuration=QuicConfiguration(is_client=True) ) h3_client = H3Connection(quic_client) h3_client.handle_event( StreamDataReceived( stream_id=7, data=encode_uint_var(StreamType.QPACK_ENCODER) + b"\x00", end_stream=False, ) ) self.assertEqual(quic_client.closed, (ErrorCode.QPACK_ENCODER_STREAM_ERROR, "")) def test_handle_request_frame_bad_headers(self): """ We should not receive HEADERS which cannot be decoded. """ quic_server = FakeQuicConnection( configuration=QuicConfiguration(is_client=False) ) h3_server = H3Connection(quic_server) h3_server.handle_event( StreamDataReceived( stream_id=0, data=encode_frame(FrameType.HEADERS, b""), end_stream=False ) ) self.assertEqual(quic_server.closed, (ErrorCode.QPACK_DECOMPRESSION_FAILED, "")) def test_handle_request_frame_data_before_headers(self): """ We should not receive DATA before receiving headers. """ quic_server = FakeQuicConnection( configuration=QuicConfiguration(is_client=False) ) h3_server = H3Connection(quic_server) h3_server.handle_event( StreamDataReceived( stream_id=0, data=encode_frame(FrameType.DATA, b""), end_stream=False ) ) self.assertEqual( quic_server.closed, ( ErrorCode.H3_FRAME_UNEXPECTED, "DATA frame is not allowed in this state", ), ) def test_handle_request_frame_headers_after_trailers(self): """ We should not receive HEADERS after receiving trailers. """ quic_client = FakeQuicConnection( configuration=QuicConfiguration(is_client=True) ) quic_server = FakeQuicConnection( configuration=QuicConfiguration(is_client=False) ) h3_client = H3Connection(quic_client) h3_server = H3Connection(quic_server) stream_id = quic_client.get_next_available_stream_id() h3_client.send_headers( stream_id=stream_id, headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/"), ], ) h3_client.send_headers( stream_id=stream_id, headers=[(b"x-some-trailer", b"foo")], end_stream=True ) h3_transfer(quic_client, h3_server) h3_server.handle_event( StreamDataReceived( stream_id=0, data=encode_frame(FrameType.HEADERS, b""), end_stream=False ) ) self.assertEqual( quic_server.closed, ( ErrorCode.H3_FRAME_UNEXPECTED, "HEADERS frame is not allowed in this state", ), ) def test_handle_request_frame_push_promise_from_client(self): """ A server should not receive PUSH_PROMISE on a request stream. """ quic_server = FakeQuicConnection( configuration=QuicConfiguration(is_client=False) ) h3_server = H3Connection(quic_server) h3_server.handle_event( StreamDataReceived( stream_id=0, data=encode_frame(FrameType.PUSH_PROMISE, b""), end_stream=False, ) ) self.assertEqual( quic_server.closed, (ErrorCode.H3_FRAME_UNEXPECTED, "Clients must not send PUSH_PROMISE"), ) def test_handle_request_frame_wrong_frame_type(self): quic_server = FakeQuicConnection( configuration=QuicConfiguration(is_client=False) ) h3_server = H3Connection(quic_server) h3_server.handle_event( StreamDataReceived( stream_id=0, data=encode_frame(FrameType.SETTINGS, b""), end_stream=False, ) ) self.assertEqual( quic_server.closed, (ErrorCode.H3_FRAME_UNEXPECTED, "Invalid frame type on request stream"), ) def test_request(self): with h3_client_and_server() as (quic_client, quic_server): h3_client = H3Connection(quic_client) h3_server = H3Connection(quic_server) # make first request self._make_request(h3_client, h3_server) # make second request self._make_request(h3_client, h3_server) # make third request -> dynamic table self._make_request(h3_client, h3_server) def test_request_headers_only(self): with h3_client_and_server() as (quic_client, quic_server): h3_client = H3Connection(quic_client) h3_server = H3Connection(quic_server) # send request stream_id = quic_client.get_next_available_stream_id() h3_client.send_headers( stream_id=stream_id, headers=[ (b":method", b"HEAD"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/"), (b"x-foo", b"client"), ], end_stream=True, ) # receive request events = h3_transfer(quic_client, h3_server) self.assertEqual( events, [ HeadersReceived( headers=[ (b":method", b"HEAD"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/"), (b"x-foo", b"client"), ], stream_id=stream_id, stream_ended=True, ) ], ) # send response h3_server.send_headers( stream_id=stream_id, headers=[ (b":status", b"200"), (b"content-type", b"text/html; charset=utf-8"), (b"x-foo", b"server"), ], end_stream=True, ) # receive response events = h3_transfer(quic_server, h3_client) self.assertEqual( events, [ HeadersReceived( headers=[ (b":status", b"200"), (b"content-type", b"text/html; charset=utf-8"), (b"x-foo", b"server"), ], stream_id=stream_id, stream_ended=True, ) ], ) def test_request_fragmented_frame(self): quic_client = FakeQuicConnection( configuration=QuicConfiguration(is_client=True) ) quic_server = FakeQuicConnection( configuration=QuicConfiguration(is_client=False) ) h3_client = H3Connection(quic_client) h3_server = H3Connection(quic_server) # send request stream_id = quic_client.get_next_available_stream_id() h3_client.send_headers( stream_id=stream_id, headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/"), (b"x-foo", b"client"), ], ) h3_client.send_data(stream_id=stream_id, data=b"hello", end_stream=True) # receive request events = h3_transfer(quic_client, h3_server) self.assertEqual( events, [ HeadersReceived( headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/"), (b"x-foo", b"client"), ], stream_id=stream_id, stream_ended=False, ), DataReceived(data=b"h", stream_id=0, stream_ended=False), DataReceived(data=b"e", stream_id=0, stream_ended=False), DataReceived(data=b"l", stream_id=0, stream_ended=False), DataReceived(data=b"l", stream_id=0, stream_ended=False), DataReceived(data=b"o", stream_id=0, stream_ended=False), DataReceived(data=b"", stream_id=0, stream_ended=True), ], ) # send push promise push_stream_id = h3_server.send_push_promise( stream_id=stream_id, headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/app.txt"), ], ) self.assertEqual(push_stream_id, 15) # send response h3_server.send_headers( stream_id=stream_id, headers=[ (b":status", b"200"), (b"content-type", b"text/html; charset=utf-8"), ], end_stream=False, ) h3_server.send_data(stream_id=stream_id, data=b"html", end_stream=True) #  fulfill push promise h3_server.send_headers( stream_id=push_stream_id, headers=[(b":status", b"200"), (b"content-type", b"text/plain")], end_stream=False, ) h3_server.send_data(stream_id=push_stream_id, data=b"text", end_stream=True) # receive push promise / reponse events = h3_transfer(quic_server, h3_client) self.assertEqual( events, [ PushPromiseReceived( headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/app.txt"), ], push_id=0, stream_id=stream_id, ), HeadersReceived( headers=[ (b":status", b"200"), (b"content-type", b"text/html; charset=utf-8"), ], stream_id=0, stream_ended=False, ), DataReceived(data=b"h", stream_id=0, stream_ended=False), DataReceived(data=b"t", stream_id=0, stream_ended=False), DataReceived(data=b"m", stream_id=0, stream_ended=False), DataReceived(data=b"l", stream_id=0, stream_ended=False), DataReceived(data=b"", stream_id=0, stream_ended=True), HeadersReceived( headers=[(b":status", b"200"), (b"content-type", b"text/plain")], stream_id=15, stream_ended=False, push_id=0, ), DataReceived(data=b"t", stream_id=15, stream_ended=False, push_id=0), DataReceived(data=b"e", stream_id=15, stream_ended=False, push_id=0), DataReceived(data=b"x", stream_id=15, stream_ended=False, push_id=0), DataReceived(data=b"t", stream_id=15, stream_ended=False, push_id=0), DataReceived(data=b"", stream_id=15, stream_ended=True, push_id=0), ], ) def test_request_with_server_push(self): with h3_client_and_server() as (quic_client, quic_server): h3_client = H3Connection(quic_client) h3_server = H3Connection(quic_server) # send request stream_id = quic_client.get_next_available_stream_id() h3_client.send_headers( stream_id=stream_id, headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/"), ], end_stream=True, ) # receive request events = h3_transfer(quic_client, h3_server) self.assertEqual( events, [ HeadersReceived( headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/"), ], stream_id=stream_id, stream_ended=True, ) ], ) # send push promises push_stream_id_css = h3_server.send_push_promise( stream_id=stream_id, headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/app.css"), ], ) self.assertEqual(push_stream_id_css, 15) push_stream_id_js = h3_server.send_push_promise( stream_id=stream_id, headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/app.js"), ], ) self.assertEqual(push_stream_id_js, 19) # send response h3_server.send_headers( stream_id=stream_id, headers=[ (b":status", b"200"), (b"content-type", b"text/html; charset=utf-8"), ], end_stream=False, ) h3_server.send_data( stream_id=stream_id, data=b"<html><body>hello</body></html>", end_stream=True, ) #  fulfill push promises h3_server.send_headers( stream_id=push_stream_id_css, headers=[(b":status", b"200"), (b"content-type", b"text/css")], end_stream=False, ) h3_server.send_data( stream_id=push_stream_id_css, data=b"body { color: pink }", end_stream=True, ) h3_server.send_headers( stream_id=push_stream_id_js, headers=[ (b":status", b"200"), (b"content-type", b"application/javascript"), ], end_stream=False, ) h3_server.send_data( stream_id=push_stream_id_js, data=b"alert('howdee');", end_stream=True ) # receive push promises, response and push responses events = h3_transfer(quic_server, h3_client) self.assertEqual( events, [ PushPromiseReceived( headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/app.css"), ], push_id=0, stream_id=stream_id, ), PushPromiseReceived( headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/app.js"), ], push_id=1, stream_id=stream_id, ), HeadersReceived( headers=[ (b":status", b"200"), (b"content-type", b"text/html; charset=utf-8"), ], stream_id=stream_id, stream_ended=False, ), DataReceived( data=b"<html><body>hello</body></html>", stream_id=stream_id, stream_ended=True, ), HeadersReceived( headers=[(b":status", b"200"), (b"content-type", b"text/css")], push_id=0, stream_id=push_stream_id_css, stream_ended=False, ), DataReceived( data=b"body { color: pink }", push_id=0, stream_id=push_stream_id_css, stream_ended=True, ), HeadersReceived( headers=[ (b":status", b"200"), (b"content-type", b"application/javascript"), ], push_id=1, stream_id=push_stream_id_js, stream_ended=False, ), DataReceived( data=b"alert('howdee');", push_id=1, stream_id=push_stream_id_js, stream_ended=True, ), ], ) def test_request_with_server_push_max_push_id(self): with h3_client_and_server() as (quic_client, quic_server): h3_client = H3Connection(quic_client) h3_server = H3Connection(quic_server) # send request stream_id = quic_client.get_next_available_stream_id() h3_client.send_headers( stream_id=stream_id, headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/"), ], end_stream=True, ) # receive request events = h3_transfer(quic_client, h3_server) self.assertEqual( events, [ HeadersReceived( headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/"), ], stream_id=stream_id, stream_ended=True, ) ], ) # send push promises for i in range(0, 8): h3_server.send_push_promise( stream_id=stream_id, headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", "/{}.css".format(i).encode("ascii")), ], ) # send one too many with self.assertRaises(NoAvailablePushIDError): h3_server.send_push_promise( stream_id=stream_id, headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/8.css"), ], ) def test_send_data_after_trailers(self): """ We should not send DATA after trailers. """ quic_client = FakeQuicConnection( configuration=QuicConfiguration(is_client=True) ) h3_client = H3Connection(quic_client) stream_id = quic_client.get_next_available_stream_id() h3_client.send_headers( stream_id=stream_id, headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/"), ], ) h3_client.send_headers( stream_id=stream_id, headers=[(b"x-some-trailer", b"foo")], end_stream=False ) with self.assertRaises(FrameUnexpected): h3_client.send_data(stream_id=stream_id, data=b"hello", end_stream=False) def test_send_data_before_headers(self): """ We should not send DATA before headers. """ quic_client = FakeQuicConnection( configuration=QuicConfiguration(is_client=True) ) h3_client = H3Connection(quic_client) stream_id = quic_client.get_next_available_stream_id() with self.assertRaises(FrameUnexpected): h3_client.send_data(stream_id=stream_id, data=b"hello", end_stream=False) def test_send_headers_after_trailers(self): """ We should not send HEADERS after trailers. """ quic_client = FakeQuicConnection( configuration=QuicConfiguration(is_client=True) ) h3_client = H3Connection(quic_client) stream_id = quic_client.get_next_available_stream_id() h3_client.send_headers( stream_id=stream_id, headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/"), ], ) h3_client.send_headers( stream_id=stream_id, headers=[(b"x-some-trailer", b"foo")], end_stream=False ) with self.assertRaises(FrameUnexpected): h3_client.send_headers( stream_id=stream_id, headers=[(b"x-other-trailer", b"foo")], end_stream=False, ) def test_blocked_stream(self): quic_client = FakeQuicConnection( configuration=QuicConfiguration(is_client=True) ) h3_client = H3Connection(quic_client) h3_client.handle_event( StreamDataReceived( stream_id=3, data=binascii.unhexlify( "0004170150000680020000074064091040bcc0000000faceb00c" ), end_stream=False, ) ) h3_client.handle_event( StreamDataReceived(stream_id=7, data=b"\x02", end_stream=False) ) h3_client.handle_event( StreamDataReceived(stream_id=11, data=b"\x03", end_stream=False) ) h3_client.handle_event( StreamDataReceived( stream_id=0, data=binascii.unhexlify("01040280d910"), end_stream=False ) ) h3_client.handle_event( StreamDataReceived( stream_id=0, data=binascii.unhexlify( "00408d796f752072656163686564206d766673742e6e65742c20726561636820" "746865202f6563686f20656e64706f696e7420666f7220616e206563686f2072" "6573706f6e7365207175657279202f3c6e756d6265723e20656e64706f696e74" "7320666f722061207661726961626c652073697a6520726573706f6e73652077" "6974682072616e646f6d206279746573" ), end_stream=True, ) ) self.assertEqual( h3_client.handle_event( StreamDataReceived( stream_id=7, data=binascii.unhexlify( "3fe101c696d07abe941094cb6d0a08017d403971966e32ca98b46f" ), end_stream=False, ) ), [ HeadersReceived( headers=[ (b":status", b"200"), (b"date", b"Mon, 22 Jul 2019 06:33:33 GMT"), ], stream_id=0, stream_ended=False, ), DataReceived( data=( b"you reached mvfst.net, reach the /echo endpoint for an " b"echo response query /<number> endpoints for a variable " b"size response with random bytes" ), stream_id=0, stream_ended=True, ), ], ) def test_blocked_stream_trailer(self): quic_client = FakeQuicConnection( configuration=QuicConfiguration(is_client=True) ) h3_client = H3Connection(quic_client) h3_client.handle_event( StreamDataReceived( stream_id=3, data=binascii.unhexlify( "0004170150000680020000074064091040bcc0000000faceb00c" ), end_stream=False, ) ) h3_client.handle_event( StreamDataReceived(stream_id=7, data=b"\x02", end_stream=False) ) h3_client.handle_event( StreamDataReceived(stream_id=11, data=b"\x03", end_stream=False) ) self.assertEqual( h3_client.handle_event( StreamDataReceived( stream_id=0, data=binascii.unhexlify( "011b0000d95696d07abe941094cb6d0a08017d403971966e32ca98b46f" ), end_stream=False, ) ), [ HeadersReceived( headers=[ (b":status", b"200"), (b"date", b"Mon, 22 Jul 2019 06:33:33 GMT"), ], stream_id=0, stream_ended=False, ) ], ) self.assertEqual( h3_client.handle_event( StreamDataReceived( stream_id=0, data=binascii.unhexlify( "00408d796f752072656163686564206d766673742e6e65742c20726561636820" "746865202f6563686f20656e64706f696e7420666f7220616e206563686f2072" "6573706f6e7365207175657279202f3c6e756d6265723e20656e64706f696e74" "7320666f722061207661726961626c652073697a6520726573706f6e73652077" "6974682072616e646f6d206279746573" ), end_stream=False, ) ), [ DataReceived( data=( b"you reached mvfst.net, reach the /echo endpoint for an " b"echo response query /<number> endpoints for a variable " b"size response with random bytes" ), stream_id=0, stream_ended=False, ) ], ) self.assertEqual( h3_client.handle_event( StreamDataReceived( stream_id=0, data=binascii.unhexlify("0103028010"), end_stream=True ) ), [], ) self.assertEqual( h3_client.handle_event( StreamDataReceived( stream_id=7, data=binascii.unhexlify("6af2b20f49564d833505b38294e7"), end_stream=False, ) ), [ HeadersReceived( headers=[(b"x-some-trailer", b"foo")], stream_id=0, stream_ended=True, push_id=None, ) ], ) def test_uni_stream_grease(self): with h3_client_and_server() as (quic_client, quic_server): h3_server = H3Connection(quic_server) quic_client.send_stream_data( 14, b"\xff\xff\xff\xff\xff\xff\xff\xfeGREASE is the word" ) self.assertEqual(h3_transfer(quic_client, h3_server), []) def test_request_with_trailers(self): with h3_client_and_server() as (quic_client, quic_server): h3_client = H3Connection(quic_client) h3_server = H3Connection(quic_server) # send request with trailers stream_id = quic_client.get_next_available_stream_id() h3_client.send_headers( stream_id=stream_id, headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/"), ], end_stream=False, ) h3_client.send_headers( stream_id=stream_id, headers=[(b"x-some-trailer", b"foo")], end_stream=True, ) # receive request events = h3_transfer(quic_client, h3_server) self.assertEqual( events, [ HeadersReceived( headers=[ (b":method", b"GET"), (b":scheme", b"https"), (b":authority", b"localhost"), (b":path", b"/"), ], stream_id=stream_id, stream_ended=False, ), HeadersReceived( headers=[(b"x-some-trailer", b"foo")], stream_id=stream_id, stream_ended=True, ), ], ) # send response h3_server.send_headers( stream_id=stream_id, headers=[ (b":status", b"200"), (b"content-type", b"text/html; charset=utf-8"), ], end_stream=False, ) h3_server.send_data( stream_id=stream_id, data=b"<html><body>hello</body></html>", end_stream=False, ) h3_server.send_headers( stream_id=stream_id, headers=[(b"x-some-trailer", b"bar")], end_stream=True, ) # receive response events = h3_transfer(quic_server, h3_client) self.assertEqual( events, [ HeadersReceived( headers=[ (b":status", b"200"), (b"content-type", b"text/html; charset=utf-8"), ], stream_id=stream_id, stream_ended=False, ), DataReceived( data=b"<html><body>hello</body></html>", stream_id=stream_id, stream_ended=False, ), HeadersReceived( headers=[(b"x-some-trailer", b"bar")], stream_id=stream_id, stream_ended=True, ), ], ) def test_uni_stream_type(self): with h3_client_and_server() as (quic_client, quic_server): h3_server = H3Connection(quic_server) # unknown stream type 9 stream_id = quic_client.get_next_available_stream_id(is_unidirectional=True) self.assertEqual(stream_id, 2) quic_client.send_stream_data(stream_id, b"\x09") self.assertEqual(h3_transfer(quic_client, h3_server), []) self.assertEqual(list(h3_server._stream.keys()), [2]) self.assertEqual(h3_server._stream[2].buffer, b"") self.assertEqual(h3_server._stream[2].stream_type, 9) # unknown stream type 64, one byte at a time stream_id = quic_client.get_next_available_stream_id(is_unidirectional=True) self.assertEqual(stream_id, 6) quic_client.send_stream_data(stream_id, b"\x40") self.assertEqual(h3_transfer(quic_client, h3_server), []) self.assertEqual(list(h3_server._stream.keys()), [2, 6]) self.assertEqual(h3_server._stream[2].buffer, b"") self.assertEqual(h3_server._stream[2].stream_type, 9) self.assertEqual(h3_server._stream[6].buffer, b"\x40") self.assertEqual(h3_server._stream[6].stream_type, None) quic_client.send_stream_data(stream_id, b"\x40") self.assertEqual(h3_transfer(quic_client, h3_server), []) self.assertEqual(list(h3_server._stream.keys()), [2, 6]) self.assertEqual(h3_server._stream[2].buffer, b"") self.assertEqual(h3_server._stream[2].stream_type, 9) self.assertEqual(h3_server._stream[6].buffer, b"") self.assertEqual(h3_server._stream[6].stream_type, 64) class H3ParserTest(TestCase): def test_parse_settings_duplicate_identifier(self): buf = Buffer(capacity=1024) buf.push_uint_var(1) buf.push_uint_var(123) buf.push_uint_var(1) buf.push_uint_var(456) with self.assertRaises(SettingsError) as cm: parse_settings(buf.data) self.assertEqual( cm.exception.reason_phrase, "Setting identifier 0x1 is included twice" ) def test_parse_settings_reserved_identifier(self): buf = Buffer(capacity=1024) buf.push_uint_var(0) buf.push_uint_var(123) with self.assertRaises(SettingsError) as cm: parse_settings(buf.data) self.assertEqual( cm.exception.reason_phrase, "Setting identifier 0x0 is reserved" ) def test_validate_push_promise_headers(self): # OK validate_push_promise_headers( [ (b":method", b"GET"), (b":scheme", b"https"), (b":path", b"/"), (b":authority", b"localhost"), ] ) validate_push_promise_headers( [ (b":method", b"GET"), (b":scheme", b"https"), (b":path", b"/"), (b":authority", b"localhost"), (b"x-foo", b"bar"), ] ) # invalid pseudo-header with self.assertRaises(MessageError) as cm: validate_push_promise_headers([(b":status", b"foo")]) self.assertEqual( cm.exception.reason_phrase, "Pseudo-header b':status' is not valid" ) # duplicate pseudo-header with self.assertRaises(MessageError) as cm: validate_push_promise_headers( [ (b":method", b"GET"), (b":method", b"POST"), ] ) self.assertEqual( cm.exception.reason_phrase, "Pseudo-header b':method' is included twice" ) # pseudo-header after regular headers with self.assertRaises(MessageError) as cm: validate_push_promise_headers( [ (b":method", b"GET"), (b":scheme", b"https"), (b":path", b"/"), (b"x-foo", b"bar"), (b":authority", b"foo"), ] ) self.assertEqual( cm.exception.reason_phrase, "Pseudo-header b':authority' is not allowed after regular headers", ) # missing pseudo-headers with self.assertRaises(MessageError) as cm: validate_push_promise_headers( [ (b":method", b"GET"), (b":scheme", b"https"), (b":path", b"/"), ] ) self.assertEqual( cm.exception.reason_phrase, "Pseudo-headers [b':authority'] are missing", ) def test_validate_request_headers(self): # OK validate_request_headers( [ (b":method", b"GET"), (b":scheme", b"https"), (b":path", b"/"), (b":authority", b"localhost"), ] ) validate_request_headers( [ (b":method", b"GET"), (b":scheme", b"https"), (b":path", b"/"), (b":authority", b"localhost"), (b"x-foo", b"bar"), ] ) # uppercase header with self.assertRaises(MessageError) as cm: validate_request_headers([(b"X-Foo", b"foo")]) self.assertEqual( cm.exception.reason_phrase, "Header b'X-Foo' contains uppercase letters" ) # invalid pseudo-header with self.assertRaises(MessageError) as cm: validate_request_headers([(b":status", b"foo")]) self.assertEqual( cm.exception.reason_phrase, "Pseudo-header b':status' is not valid" ) # duplicate pseudo-header with self.assertRaises(MessageError) as cm: validate_request_headers( [ (b":method", b"GET"), (b":method", b"POST"), ] ) self.assertEqual( cm.exception.reason_phrase, "Pseudo-header b':method' is included twice" ) # pseudo-header after regular headers with self.assertRaises(MessageError) as cm: validate_request_headers( [ (b":method", b"GET"), (b":scheme", b"https"), (b":path", b"/"), (b"x-foo", b"bar"), (b":authority", b"foo"), ] ) self.assertEqual( cm.exception.reason_phrase, "Pseudo-header b':authority' is not allowed after regular headers", ) # missing pseudo-headers with self.assertRaises(MessageError) as cm: validate_request_headers([(b":method", b"GET")]) self.assertEqual( cm.exception.reason_phrase, "Pseudo-headers [b':path', b':scheme'] are missing", ) # empty :authority pseudo-header for http/https for scheme in [b"http", b"https"]: with self.assertRaises(MessageError) as cm: validate_request_headers( [ (b":method", b"GET"), (b":scheme", scheme), (b":authority", b""), (b":path", b"/"), ] ) self.assertEqual( cm.exception.reason_phrase, "Pseudo-header b':authority' cannot be empty", ) # empty :path pseudo-header for http/https for scheme in [b"http", b"https"]: with self.assertRaises(MessageError) as cm: validate_request_headers( [ (b":method", b"GET"), (b":scheme", scheme), (b":authority", b"localhost"), (b":path", b""), ] ) self.assertEqual( cm.exception.reason_phrase, "Pseudo-header b':path' cannot be empty" ) def test_validate_response_headers(self): # OK validate_response_headers([(b":status", b"200")]) validate_response_headers( [ (b":status", b"200"), (b"x-foo", b"bar"), ] ) # invalid pseudo-header with self.assertRaises(MessageError) as cm: validate_response_headers([(b":method", b"GET")]) self.assertEqual( cm.exception.reason_phrase, "Pseudo-header b':method' is not valid" ) # duplicate pseudo-header with self.assertRaises(MessageError) as cm: validate_response_headers( [ (b":status", b"200"), (b":status", b"501"), ] ) self.assertEqual( cm.exception.reason_phrase, "Pseudo-header b':status' is included twice" ) def test_validate_trailers(self): # OK validate_trailers([(b"x-foo", b"bar")]) # invalid pseudo-header with self.assertRaises(MessageError) as cm: validate_trailers([(b":status", b"foo")]) self.assertEqual( cm.exception.reason_phrase, "Pseudo-header b':status' is not valid" ) # pseudo-header after regular headers with self.assertRaises(MessageError) as cm: validate_trailers( [ (b"x-foo", b"bar"), (b":authority", b"foo"), ] ) self.assertEqual( cm.exception.reason_phrase, "Pseudo-header b':authority' is not allowed after regular headers", )
34.327928
90
0.496151
5,270
57,156
5.129791
0.059203
0.067175
0.036251
0.03196
0.872605
0.837686
0.815714
0.797884
0.783532
0.755419
0
0.036518
0.407831
57,156
1,664
91
34.348558
0.762217
0.04367
0
0.672155
0
0
0.101539
0.020083
0
0
0.000111
0
0.068719
1
0.03078
false
0
0.007158
0.000716
0.044381
0
0
0
0
null
0
0
0
1
1
1
1
1
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
6
2979c55b3c459f9d5967bc8549f6e865008a1332
16,532
py
Python
src/loss/discriminator.py
Aitical/ECL-SISR
6dc4bdbb115cac65b9083cd974d5882be0bba746
[ "MIT" ]
3
2022-03-08T14:53:36.000Z
2022-03-23T06:56:17.000Z
src/loss/discriminator.py
Aitical/ECL-SISR
6dc4bdbb115cac65b9083cd974d5882be0bba746
[ "MIT" ]
null
null
null
src/loss/discriminator.py
Aitical/ECL-SISR
6dc4bdbb115cac65b9083cd974d5882be0bba746
[ "MIT" ]
null
null
null
from model import common from pytorch_wavelets import DWTForward import torch.nn as nn import torch import random import torch.nn.functional as F from collections import OrderedDict class Discriminator(nn.Module): ''' output is not normalized ''' def __init__(self, args): super(Discriminator, self).__init__() self.args = args in_channels = 9 if args.use_wavelet else args.n_colors out_channels = 64 depth = 7 def _block(_in_channels, _out_channels, stride=1): return nn.Sequential( nn.Conv2d( _in_channels, _out_channels, 3, padding=1, stride=stride, bias=False ), nn.BatchNorm2d(_out_channels), ) m_features = [_block(in_channels, out_channels), nn.LeakyReLU(negative_slope=0.2, inplace=True)] for i in range(depth): in_channels = out_channels if i % 2 == 1: stride = 1 out_channels *= 2 else: stride = 2 m_features.append(_block(in_channels, out_channels, stride=stride)) m_features.append(nn.LeakyReLU(negative_slope=0.2, inplace=True)) self.features = nn.Sequential(*m_features) patch_size = args.patch_size // (2**((depth + 1) // 2)) if args.use_wavelet: patch_size = patch_size // 2 if not 'patchD' in args.loss: m_classifier = [ nn.Flatten(), nn.Linear(out_channels * patch_size**2, 1024), nn.LeakyReLU(negative_slope=0.2, inplace=True), nn.Linear(1024, 1) ] self.classifier = nn.Sequential(*m_classifier) else: m_classifier = [ nn.AdaptiveAvgPool2d(4), nn.Conv2d(out_channels, 1, kernel_size=(1, 1)) ] self.classifier = nn.Sequential(*m_classifier) if args.use_wavelet: self.DWT2 = DWTForward(J=1, wave='haar', mode='reflect') self.filter = self.filter_wavelet self.cs = 'cat' def forward(self, x, return_features=False): if self.args.use_wavelet: x = self.filter(x) if return_features: all_feature = [] x_in = x for layer in self.features: if self.args.vgg_like_relu: if isinstance(layer, nn.LeakyReLU): continue x_in = layer(x_in) if self.args.before_relu and not isinstance(layer, nn.LeakyReLU): all_feature.append(x_in) elif not self.args.before_relu and isinstance(layer, nn.LeakyReLU): all_feature.append(x_in) output = self.classifier(x_in) return output, all_feature else: features = self.features(x) output = self.classifier(features) return output def filter_wavelet(self, x, norm=True): LL, Hc = self.DWT2(x) LH, HL, HH = Hc[0][:, :, 0, :, :], Hc[0][:, :, 1, :, :], Hc[0][:, :, 2, :, :] if norm: LH, HL, HH = LH * 0.5 + 0.5, HL * 0.5 + 0.5, HH * 0.5 + 0.5 if self.cs.lower() == 'sum': return (LH + HL + HH) / 3. elif self.cs.lower() == 'cat': return torch.cat((LH, HL, HH), 1) else: raise NotImplementedError('Wavelet format [{:s}] not recognized'.format(self.cs)) class WaveDLoss(nn.Module): ''' output is not normalized ''' def __init__(self, args): super(WaveDLoss, self).__init__() self.args = args in_channels = 9 out_channels = 64 depth = 7 def _block(_in_channels, _out_channels, stride=1): return nn.Sequential( nn.Conv2d( _in_channels, _out_channels, 3, padding=1, stride=stride, bias=False ), nn.BatchNorm2d(_out_channels), ) m_features = [_block(in_channels, out_channels), nn.LeakyReLU(negative_slope=0.2, inplace=True)] for i in range(depth): in_channels = out_channels if i % 2 == 1: stride = 1 out_channels *= 2 else: stride = 2 m_features.append(_block(in_channels, out_channels, stride=stride)) m_features.append(nn.LeakyReLU(negative_slope=0.2, inplace=True)) patch_size = args.patch_size // (2 ** ((depth + 1) // 2)) if args.use_wavelet: patch_size = patch_size // 2 m_classifier = [ nn.Linear(out_channels * patch_size ** 2, 1024), nn.LeakyReLU(negative_slope=0.2, inplace=True), nn.Linear(1024, 1) ] self.features = nn.Sequential(*m_features) self.classifier = nn.Sequential(*m_classifier) if args.use_wavelet: self.DWT2 = DWTForward(J=1, wave='haar', mode='reflect') self.filter = self.filter_wavelet self.cs = 'cat' self.load() for p in self.parameters(): p.requires_grad = False def infer(self, x): x = self.filter(x) all_feature = [] x_in = x for layer in self.features: x_in = layer(x_in) if not isinstance(layer, nn.LeakyReLU): all_feature.append(x_in) return all_feature def forward(self, sr, hr, lr): sr_features = self.infer(sr) if not isinstance(hr, list): hr = [hr, ] if not isinstance(lr, list): lr = [lr, ] pos_loss = 0 for s_hr in hr: s_hr_features = self.infer(s_hr) pos_diff = self.cl_pos(sr_features, s_hr_features) pos_loss += pos_diff pos_loss /= len(hr) neg_loss = 0 for s_lr in lr: s_lr_features = self.infer(s_lr) neg_diff = self.cl_neg(sr_features, s_lr_features) neg_loss += neg_diff neg_loss /= len(lr) cl_loss = neg_loss - pos_loss return cl_loss def cl_pos(self, sr_layers, hr_layers): """ sr_layers: feature map list hr_layers: feature map list """ pos_loss = 0 for l, idx in enumerate(self.cl_layer): pos_diff = torch.sum( F.normalize(sr_layers[idx], dim=1) * F.normalize(hr_layers[idx], dim=1), dim=1).mean() if self.use_weights: pos_diff /= 2 ** l pos_loss += pos_diff return pos_loss def cl_neg(self, sr_layers, lr_layers): neg_loss = 0 for l, idx in enumerate(self.cl_layer): sr_feature = F.normalize(sr_layers[idx], dim=1) lr_feature = F.normalize(lr_layers[idx], dim=1) neg_diff = torch.sum( sr_feature * lr_feature, dim=1).mean() if self.args.multi_neg_D: batch_list = list(range(lr_layers[idx].shape[0])) for _ in range(self.args.mcl_neg): random.shuffle(batch_list) neg_shuffle = torch.sum(sr_feature * lr_feature[batch_list, :, :, :], dim=1).mean() neg_diff += neg_shuffle neg_diff /= (self.args.mcl_neg+1) if self.use_weights: neg_diff /= 2**l neg_loss += neg_diff return neg_loss def filter_wavelet(self, x, norm=True): LL, Hc = self.DWT2(x) LH, HL, HH = Hc[0][:, :, 0, :, :], Hc[0][:, :, 1, :, :], Hc[0][:, :, 2, :, :] if norm: LH, HL, HH = LH * 0.5 + 0.5, HL * 0.5 + 0.5, HH * 0.5 + 0.5 if self.cs.lower() == 'sum': return (LH + HL + HH) / 3. elif self.cs.lower() == 'cat': return torch.cat((LH, HL, HH), 1) else: raise NotImplementedError('Wavelet format [{:s}] not recognized'.format(self.cs)) def load(self,): loss_dict = torch.load(self.args.WaveD_path, map_location='cpu') dis_dict = OrderedDict() for k, v in loss_dict.items(): if k.startswith('loss_module.1.'): dis_dict[k.replace('loss_module.1.', '')] = v miss = self.load_state_dict(dis_dict) print(f'Load from {self.args.WaveD_path}', miss) class CLDLoss(nn.Module): ''' output is not normalized ''' def __init__(self, args): super(CLDLoss, self).__init__() self.args = args in_channels = 3 out_channels = 64 depth = 7 def _block(_in_channels, _out_channels, stride=1): return nn.Sequential( nn.Conv2d( _in_channels, _out_channels, 3, padding=1, stride=stride, bias=False ), nn.BatchNorm2d(_out_channels), ) self.pos_id = int(self.args.pos_id) m_features = [_block(in_channels, out_channels), nn.LeakyReLU(negative_slope=0.2, inplace=True)] for i in range(depth): in_channels = out_channels if i % 2 == 1: stride = 1 out_channels *= 2 else: stride = 2 m_features.append(_block(in_channels, out_channels, stride=stride)) m_features.append(nn.LeakyReLU(negative_slope=0.2, inplace=True)) patch_size = args.patch_size // (2 ** ((depth + 1) // 2)) #m_classifier = [ # nn.Linear(out_channels * patch_size ** 2, 1024), # nn.LeakyReLU(negative_slope=0.2, inplace=True), # nn.Linear(1024, 1) #] self.features = nn.Sequential(*m_features) #self.classifier = nn.Sequential(*m_classifier) self.load() for p in self.parameters(): p.requires_grad = False self.cl_layer = [int(i.strip()) for i in args.cl_layer.split(',')] self.args = args self.use_weights = args.layer_weight def infer(self, x): all_feature = [] x_in = x for layer in self.features: x_in = layer(x_in) if not isinstance(layer, nn.LeakyReLU): all_feature.append(x_in) return all_feature def forward(self, sr, hr, lr): # sr_features = self.infer(sr) if not isinstance(hr, list): hr = [hr, ] if not isinstance(lr, list): lr = [lr, ] if self.pos_id != -1: hr = [hr[self.pos_id], ] if not self.args.cl_loss_type in ['InfoNCE', 'LMCL']: loss = self.cl_loss(sr, hr, lr) else: loss = self.cl_infoNCE(sr, hr, lr) return loss def cl_loss(self, sr, hr, lr): sr_features = self.infer(sr) pos_loss = 0 for s_hr in hr: s_hr_features = self.infer(s_hr) pos_diff = self.cl_pos(sr_features, s_hr_features) pos_loss += pos_diff pos_loss /= len(hr) neg_loss = 0 b, c, h, w = sr.shape for s_lr in lr: b_, c_, h_, w_ = s_lr.shape if h_ != h or w_ != w: s_lr = F.interpolate(s_lr, size=(h, w), align_corners=True, mode='bicubic').clamp(0, 1) s_lr_features = self.infer(s_lr) neg_diff = self.cl_neg(sr_features, s_lr_features) neg_loss += neg_diff neg_loss /= len(lr) cl_loss = neg_loss - pos_loss return cl_loss def cl_infoNCE(self, sr, hr, lr): sr_features = self.infer(sr) n_hr_features = [] n_lr_features = [] for s_hr in hr: n_hr_features.append(self.infer(s_hr)) b, c, h, w = s_hr.shape for s_lr in lr: b_, c_, h_, w_ = s_lr.shape if h_ != h or w_ != w: s_lr = F.interpolate(s_lr, size=(h, w), align_corners=True, mode='bicubic').clamp(0, 1) n_lr_features.append(self.infer(s_lr)) nce_loss = 0 for l, idx in enumerate(self.cl_layer): lr_layers = [] for n_lr in n_lr_features: lr_layers.append(n_lr[idx]) # TODO: infoNCE uses one postive only? hr_layers = [] for n_hr in n_hr_features: hr_layers.append(n_hr[idx]) loss = self.cl_exp(sr_features[idx], hr_layers, lr_layers) nce_loss += loss return nce_loss / len(self.cl_layer) def cl_exp(self, sr_layer, hr_layers, lr_layers): loss = 0 b, c, h, w = sr_layer.shape neg_logits = [] for f_lr in lr_layers: neg_diff = torch.sum( F.normalize(sr_layer, dim=1) * F.normalize(f_lr, dim=1), dim=1).mean(dim=[-1, -2]).unsqueeze(1) neg_logits.append(neg_diff) if self.args.shuffle_neg: batch_list = list(range(b)) for f_lr in lr_layers: random.shuffle(batch_list) neg_diff = torch.sum( F.normalize(sr_layer, dim=1) * F.normalize(f_lr[batch_list, :, :, :], dim=1), dim=1).mean( dim=[-1, -2]).unsqueeze(1) neg_logits.append(neg_diff) for f_hr in hr_layers: pos_logits = [] pos_diff = torch.sum( F.normalize(sr_layer, dim=1) * F.normalize(f_hr, dim=1), dim=1).mean(dim=[-1, -2]).unsqueeze(1) pos_logits.append(pos_diff) if self.args.cl_loss_type == 'InfoNCE': logits = torch.cat(pos_logits + neg_logits, dim=1) cl_loss = F.cross_entropy(logits, torch.zeros(b, device=logits.device, dtype=torch.long)) # self.ce_loss(logits) elif self.args.cl_loss_type == 'LMCL': cl_loss = self.lmcl_loss(pos_logits + neg_logits) else: raise TypeError(f'{self.args.cl_loss_type} is not found in loss/discriminator.py') loss += cl_loss return loss / len(hr_layers) def lmcl_loss(self, logits): """ logits: BXK, the first column is the positive similarity """ pos_sim = logits[0] neg_sim = torch.cat(logits[1:], dim=1) pos_logits = pos_sim.exp() # Bx1 neg_logits = torch.sum(neg_sim.exp(), dim=1, keepdim=True) # Bx1 loss = -torch.log(pos_logits / neg_logits).mean() return loss def cl_pos(self, sr_layers, hr_layers): """ sr_layers: feature map list hr_layers: feature map list """ pos_loss = 0 for l, idx in enumerate(self.cl_layer): pos_diff = torch.sum( F.normalize(sr_layers[idx], dim=1) * F.normalize(hr_layers[idx], dim=1), dim=1).mean() if self.use_weights: pos_diff /= 2 ** l pos_loss += pos_diff return pos_loss def cl_neg(self, sr_layers, lr_layers): neg_loss = 0 for l, idx in enumerate(self.cl_layer): sr_feature = F.normalize(sr_layers[idx], dim=1) lr_feature = F.normalize(lr_layers[idx], dim=1) neg_diff = torch.sum( sr_feature * lr_feature, dim=1).mean() if self.args.shuffle_neg: batch_list = list(range(lr_layers[idx].shape[0])) for _ in range(self.args.mcl_neg): random.shuffle(batch_list) neg_shuffle = torch.sum(sr_feature * lr_feature[batch_list, :, :, :], dim=1).mean() neg_diff += neg_shuffle neg_diff /= (self.args.mcl_neg+1) if self.use_weights: neg_diff /= 2**l neg_loss += neg_diff return neg_loss def load(self,): loss_dict = torch.load(self.args.CLD_path, map_location='cpu') dis_dict = OrderedDict() for k, v in loss_dict.items(): if k.find('classifier')>=0: continue if k.startswith('loss_module.1.'): dis_dict[k.replace('loss_module.1.', '')] = v miss = self.load_state_dict(dis_dict) print(f'Load from {self.args.CLD_path}', miss)
33.946612
128
0.523954
2,140
16,532
3.819626
0.096262
0.014191
0.023856
0.038537
0.784316
0.758747
0.749205
0.738928
0.731343
0.703939
0
0.020865
0.362207
16,532
486
129
34.016461
0.754363
0.031878
0
0.751295
0
0
0.022142
0.004227
0
0
0
0.002058
0
1
0.059585
false
0
0.018135
0.007772
0.139896
0.005181
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
2985b9c498a6d978e045c04c0b8035a07919dc19
40
py
Python
fastapi_dream_core/pagination/__init__.py
yurihartmann/fastapi_dream_core
7c3667e5350b7000d2329b8888bf9a00400939aa
[ "MIT" ]
4
2021-10-01T18:33:44.000Z
2022-01-11T21:33:25.000Z
fastapi_dream_core/pagination/__init__.py
yurihartmann/fastapi_dream_core
7c3667e5350b7000d2329b8888bf9a00400939aa
[ "MIT" ]
null
null
null
fastapi_dream_core/pagination/__init__.py
yurihartmann/fastapi_dream_core
7c3667e5350b7000d2329b8888bf9a00400939aa
[ "MIT" ]
null
null
null
from .pagination import Page, PageQuery
20
39
0.825
5
40
6.6
1
0
0
0
0
0
0
0
0
0
0
0
0.125
40
1
40
40
0.942857
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
465689d968285b263b73721d693e5c8ed311b362
8,992
py
Python
pytissueoptics/scalars.py
DCC-Lab/PyTissueOptics
2e1920a970d62c1e2aeca25749ba88969c300325
[ "MIT" ]
3
2021-02-01T19:30:35.000Z
2021-06-14T20:08:10.000Z
pytissueoptics/scalars.py
DCC-Lab/PyTissueOptics
2e1920a970d62c1e2aeca25749ba88969c300325
[ "MIT" ]
25
2021-02-03T15:53:18.000Z
2022-03-30T22:53:29.000Z
pytissueoptics/scalars.py
DCC-Lab/PyTissueOptics
2e1920a970d62c1e2aeca25749ba88969c300325
[ "MIT" ]
2
2022-02-12T03:51:53.000Z
2022-02-14T04:52:28.000Z
import numpy as np try: import cupy as cp except: cp = np #CupyScalars = NumpyScalars import pytissueoptics.vectors as vc class NativeScalars: """ An array of scalars that is compatible with operations on Vectors There is a reason for not using numpy.array directly: we want to add new functions that will be specific to our problem here, and Python does not allow us to extend system classes. The class works with float, int and bool. With boolean values, True is 1. """ def __init__(self, array=None, N=None): """ @rtype: object """ if array is not None: self.v = np.array(array) elif N is not None: self.v = np.array([0] * N) else: raise ValueError("You must provide an array or N") self.selected = [True]*len(self.v) self._iteration = 0 @classmethod def random(cls, N): return Scalars([np.random.random() for i in range(N)]) def __iter__(self): self._iteration = 0 return self def __next__(self): if self._iteration < len(self): result = self.v[self._iteration] self._iteration += 1 return result else: raise StopIteration def __len__(self) -> int: return len(self.v) def __mul__(self, scale) -> 'Scalars': return Scalars(self.v * scale) def __rmul__(self, scale) -> 'Scalars': return Scalars(self.v * scale) def __truediv__(self, scale) -> 'Scalars': return Scalars(self.v / scale) def __add__(self, rhs) -> 'Scalars': return Scalars([v1 + v2 for (v1, v2) in list(zip(self.v, rhs.v))]) def __neg__(self) -> 'Scalars': return Scalars([-v1 for v1 in self.v]) def __sub__(self, rhs) -> 'Scalars': return Scalars([v1 - v2 for (v1, v2) in list(zip(self.v, rhs.v))]) def __getitem__(self, index): return self.v[index] def __setitem__(self, index, newvalue): self.v[index] = newvalue def __eq__(self, rhs) -> bool: if isinstance(rhs, Scalars): each = [v1 == v2 for (v1, v2) in list(zip(self.v, rhs.v))] else: each = [v1 == v2 for (v1, v2) in list(zip(self.v, rhs))] return np.array(each).all() def logicalNot(self) -> 'Scalars': return Scalars([not bool(v1) for v1 in self.v]) def logicalAnd(self, rhs) -> 'Scalars': return Scalars([bool(v1) and bool(v2) for v1, v2 in list(zip(self.v, rhs))]) def logicalOr(self, rhs) -> 'Scalars': return Scalars([bool(v1) or bool(v2) for v1, v2 in list(zip(self.v, rhs))]) def all(self) -> bool: return self.v.all() def any(self) -> bool: return self.v.any() def none(self) -> bool: return not self.v.any() class NumpyScalars: def __init__(self, array=None, N=None): if array is not None: if type(array) == np.ndarray: self.v = array.astype('float64') elif type(array) == cp.ndarray: self.v = array.astype(np.float64) else: self.v = np.asarray(array, dtype=np.float64) elif N is not None: self.v = np.zeros((1, N), dtype=np.float64) self._iteration = 0 def __len__(self): return self.v.shape[1] def __add__(self, other): if isinstance(other, NumpyScalars): return NumpyScalars(np.add(self.v, other.v)) else: return NumpyScalars(np.add(self.v, other)) def __sub__(self, other): if isinstance(other, NumpyScalars): return NumpyScalars(np.subtract(self.v, other.v)) else: return NumpyScalars(np.subtract(self.v, other)) def __mul__(self, other): if isinstance(other, NumpyScalars): return NumpyScalars(np.multiply(self.v, other.v)) elif isinstance(other, vc.NumpyVectors): return NumpyScalars(np.multiply(self.v[:, None], other.v)) else: return NumpyScalars(np.multiply(self.v, other)) def __truediv__(self, other): if isinstance(other, NumpyScalars): return NumpyScalars(np.true_divide(self.v, other.v)) elif isinstance(other, vc.NumpyVectors): return NumpyScalars(np.multiply(self.v[:, None], other.v)) else: return NumpyScalars(np.true_divide(self.v, other)) def __neg__(self): return NumpyScalars(np.negative(self.v)) def __getitem__(self, item): return self.v[item] def __setitem__(self, key, value: np.float32): self.v[key] = value def __eq__(self, other): if isinstance(other, NumpyScalars): return np.equal(self.v, other.v) else: return np.equal(self.v, other) def __iter__(self): self._iteration = 0 return self def __next__(self): if self._iteration < len(self): result = self.v[:, self._iteration] self._iteration += 1 return result else: raise StopIteration def __contains__(self, item): if item in self.v: return True else: return False @classmethod def setAll(cls, value, N): return NumpyScalars(np.full((N), value)) @classmethod def random(cls, N: int): """Random number between [0, 1]""" return NumpyScalars(np.random.rand(N)) @classmethod def random2(cls, N: int): """Random number between [-1, 1]""" return NumpyScalars((np.random.rand(N) * 2) - 1) def isEqualTo(self, other): if isinstance(other, NumpyScalars): return NumpyScalars(np.less_equal(np.abs(np.subtract(self.v, other.v)), 1e-9)) else: return NumpyScalars(np.less_equal(np.abs(np.subtract(self.v, other)), 1e-9)) class CupyScalars: def __init__(self, array=None, N=None): if array is not None: if type(array) == cp.ndarray: self.v = array.astype('float64') elif type(array) == cp.ndarray: self.v = array.astype(cp.float64) else: self.v = cp.asarray(array, dtype=cp.float64) elif N is not None: self.v = cp.zeros((1, N), dtype=cp.float64) self._iteration = 0 def __len__(self): return self.v.shape[1] def __add__(self, other): if isinstance(other, CupyScalars): return CupyScalars(cp.add(self.v, other.v)) else: return CupyScalars(cp.add(self.v, other)) def __sub__(self, other): if isinstance(other, CupyScalars): return CupyScalars(cp.subtract(self.v, other.v)) else: return CupyScalars(cp.subtract(self.v, other)) def __mul__(self, other): if isinstance(other, CupyScalars): return CupyScalars(cp.multiply(self.v, other.v)) elif isinstance(other, vc.CupyVectors): return CupyScalars(cp.multiply(self.v[:, None], other.v)) else: return CupyScalars(cp.multiply(self.v, other)) def __truediv__(self, other): if isinstance(other, CupyScalars): return CupyScalars(cp.true_divide(self.v, other.v)) elif isinstance(other, vc.CupyVectors): return CupyScalars(cp.multiply(self.v[:, None], other.v)) else: return CupyScalars(cp.true_divide(self.v, other)) def __neg__(self): return CupyScalars(cp.negative(self.v)) def __getitem__(self, item): return self.v[item] def __setitem__(self, key, value: cp.float32): self.v[key] = value def __eq__(self, other): if isinstance(other, CupyScalars): return cp.equal(self.v, other.v) else: return cp.equal(self.v, other) def __iter__(self): self._iteration = 0 return self def __next__(self): if self._iteration < len(self): result = self.v[:, self._iteration] self._iteration += 1 return result else: raise StopIteration def __contains__(self, item): if item in self.v: return True else: return False @classmethod def setAll(cls, value, N): return CupyScalars(cp.full((N), value)) @classmethod def random(cls, N: int): """Random number between [0, 1]""" return CupyScalars(cp.random.rand(N)) @classmethod def random2(cls, N: int): """Random number between [-1, 1]""" return CupyScalars((cp.random.rand(N) * 2) - 1) def isEqualTo(self, other): if isinstance(other, CupyScalars): return CupyScalars(cp.less_equal(cp.abs(cp.subtract(self.v, other.v)), 1e-9)) else: return CupyScalars(cp.less_equal(cp.abs(cp.subtract(self.v, other)), 1e-9)) Scalars = NativeScalars
29.873754
90
0.578737
1,149
8,992
4.373368
0.130548
0.068657
0.047761
0.050149
0.789851
0.776119
0.773333
0.710846
0.66806
0.568358
0
0.013479
0.29871
8,992
300
91
29.973333
0.783381
0.053714
0
0.585586
0
0
0.012682
0
0
0
0
0
0
1
0.243243
false
0
0.013514
0.103604
0.567568
0
0
0
0
null
0
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
6
465b213303f62d399c6a2932daf01cf18c75106b
26
py
Python
Python_Day9/flask/sampleA/sampleA.py
dchaurangi/pro1
0c0c9f53749fb9857f69f5d564718fd3acbec7b0
[ "MIT" ]
1
2020-01-16T08:54:52.000Z
2020-01-16T08:54:52.000Z
Python_Day9/flask/sampleA/sampleA.py
dchaurangi/pro1
0c0c9f53749fb9857f69f5d564718fd3acbec7b0
[ "MIT" ]
null
null
null
Python_Day9/flask/sampleA/sampleA.py
dchaurangi/pro1
0c0c9f53749fb9857f69f5d564718fd3acbec7b0
[ "MIT" ]
null
null
null
from hbdRahul import app
13
25
0.807692
4
26
5.25
1
0
0
0
0
0
0
0
0
0
0
0
0.192308
26
1
26
26
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
465b6be3da2ce8c8e0cb7c3b9091cf47afb51fc7
189
py
Python
discordmenu/emoji/emoji.py
RheingoldRiver/discord-menu
cde194b3ec86c15a975b34fd815cc5999cc6f8de
[ "Apache-2.0" ]
null
null
null
discordmenu/emoji/emoji.py
RheingoldRiver/discord-menu
cde194b3ec86c15a975b34fd815cc5999cc6f8de
[ "Apache-2.0" ]
null
null
null
discordmenu/emoji/emoji.py
RheingoldRiver/discord-menu
cde194b3ec86c15a975b34fd815cc5999cc6f8de
[ "Apache-2.0" ]
null
null
null
from typing import Union from discord import Emoji def discord_emoji_to_emoji_name(emoji_obj: Union[str, Emoji]): return emoji_obj if isinstance(emoji_obj, str) else emoji_obj.name
21
70
0.798942
31
189
4.612903
0.483871
0.223776
0
0
0
0
0
0
0
0
0
0
0.142857
189
8
71
23.625
0.882716
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.5
0.25
1
0
0
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
1
0
0
1
1
1
0
0
6
d3b89bc31256e2d9b508dfbb8ba61a9bbd87167d
10,731
py
Python
test/test_md037.py
jackdewinter/pymarkdown
7ae408ba0b24506fa07552ffe520750bbff38c53
[ "MIT" ]
20
2021-01-14T17:39:09.000Z
2022-03-14T08:35:22.000Z
test/test_md037.py
jackdewinter/pymarkdown
7ae408ba0b24506fa07552ffe520750bbff38c53
[ "MIT" ]
304
2020-08-15T23:24:00.000Z
2022-03-31T23:34:03.000Z
test/test_md037.py
jackdewinter/pymarkdown
7ae408ba0b24506fa07552ffe520750bbff38c53
[ "MIT" ]
3
2021-08-11T10:26:26.000Z
2021-11-02T20:41:27.000Z
""" Module to provide tests related to the MD037 rule. """ from test.markdown_scanner import MarkdownScanner import pytest @pytest.mark.rules def test_md037_good_valid_emphasis(): """ Test to make sure this rule does not trigger with a document that contains one or more valid emphasis sequences. """ # Arrange scanner = MarkdownScanner() supplied_arguments = [ "scan", "test/resources/rules/md037/good_valid_emphasis.md", ] expected_return_code = 0 expected_output = "" expected_error = "" # Act execute_results = scanner.invoke_main(arguments=supplied_arguments) # Assert execute_results.assert_results( expected_output, expected_error, expected_return_code ) @pytest.mark.rules def test_md037_bad_surrounding_emphasis(): """ Test to make sure this rule does trigger with a document that contains one or two valid emphasis characters surrounded by spaces. """ # Arrange scanner = MarkdownScanner() supplied_arguments = [ "scan", "test/resources/rules/md037/bad_surrounding_emphasis.md", ] expected_return_code = 1 expected_output = ( "test/resources/rules/md037/bad_surrounding_emphasis.md:1:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)\n" + "test/resources/rules/md037/bad_surrounding_emphasis.md:3:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)\n" + "test/resources/rules/md037/bad_surrounding_emphasis.md:5:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)\n" + "test/resources/rules/md037/bad_surrounding_emphasis.md:7:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)" ) expected_error = "" # Act execute_results = scanner.invoke_main(arguments=supplied_arguments) # Assert execute_results.assert_results( expected_output, expected_error, expected_return_code ) @pytest.mark.rules def test_md037_bad_leading_emphasis(): """ Test to make sure this rule does trigger with a document that contains one or two valid emphasis characters with leading spaces. """ # Arrange scanner = MarkdownScanner() supplied_arguments = [ "scan", "test/resources/rules/md037/bad_leading_emphasis.md", ] expected_return_code = 1 expected_output = ( "test/resources/rules/md037/bad_leading_emphasis.md:1:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)\n" + "test/resources/rules/md037/bad_leading_emphasis.md:3:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)\n" + "test/resources/rules/md037/bad_leading_emphasis.md:5:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)\n" + "test/resources/rules/md037/bad_leading_emphasis.md:7:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)" ) expected_error = "" # Act execute_results = scanner.invoke_main(arguments=supplied_arguments) # Assert execute_results.assert_results( expected_output, expected_error, expected_return_code ) @pytest.mark.rules def test_md037_bad_trailing_emphasis(): """ Test to make sure this rule does trigger with a document that contains one or two valid emphasis characters followed by spaces. """ # Arrange scanner = MarkdownScanner() supplied_arguments = [ "scan", "test/resources/rules/md037/bad_trailing_emphasis.md", ] expected_return_code = 1 expected_output = ( "test/resources/rules/md037/bad_trailing_emphasis.md:1:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)\n" + "test/resources/rules/md037/bad_trailing_emphasis.md:3:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)\n" + "test/resources/rules/md037/bad_trailing_emphasis.md:5:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)\n" + "test/resources/rules/md037/bad_trailing_emphasis.md:7:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)" ) expected_error = "" # Act execute_results = scanner.invoke_main(arguments=supplied_arguments) # Assert execute_results.assert_results( expected_output, expected_error, expected_return_code ) @pytest.mark.rules def test_md037_bad_surrounding_emphasis_multiline(): """ Test to make sure this rule does trigger with a document that contains one or two valid emphasis characters surrounded by spaces, and the emphasis spans lines. """ # Arrange scanner = MarkdownScanner() supplied_arguments = [ "scan", "test/resources/rules/md037/bad_surrounding_emphasis_multiline.md", ] expected_return_code = 1 expected_output = ( "test/resources/rules/md037/bad_surrounding_emphasis_multiline.md:1:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)\n" + "test/resources/rules/md037/bad_surrounding_emphasis_multiline.md:4:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)\n" + "test/resources/rules/md037/bad_surrounding_emphasis_multiline.md:7:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)\n" + "test/resources/rules/md037/bad_surrounding_emphasis_multiline.md:10:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)" ) expected_error = "" # Act execute_results = scanner.invoke_main(arguments=supplied_arguments) # Assert execute_results.assert_results( expected_output, expected_error, expected_return_code ) @pytest.mark.rules def test_md037_bad_surrounding_empahsis_setext(): """ Test to make sure this rule does trigger with a document that contains one or two valid emphasis characters surrounded by spaces, within an SetExt heading. """ # Arrange scanner = MarkdownScanner() supplied_arguments = [ "scan", "test/resources/rules/md037/bad_surrounding_empahsis_setext.md", ] expected_return_code = 1 expected_output = ( "test/resources/rules/md037/bad_surrounding_empahsis_setext.md:1:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)\n" + "test/resources/rules/md037/bad_surrounding_empahsis_setext.md:4:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)\n" + "test/resources/rules/md037/bad_surrounding_empahsis_setext.md:7:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)\n" + "test/resources/rules/md037/bad_surrounding_empahsis_setext.md:10:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)" ) expected_error = "" # Act execute_results = scanner.invoke_main(arguments=supplied_arguments) # Assert execute_results.assert_results( expected_output, expected_error, expected_return_code ) @pytest.mark.rules def test_md037_bad_surrounding_empahsis_atx(): """ Test to make sure this rule does trigger with a document that contains one or two valid emphasis characters surrounded by spaces, within an Atx Heading element. """ # Arrange scanner = MarkdownScanner() supplied_arguments = [ "scan", "test/resources/rules/md037/bad_surrounding_empahsis_atx.md", ] expected_return_code = 1 expected_output = ( "test/resources/rules/md037/bad_surrounding_empahsis_atx.md:1:13: MD037: Spaces inside emphasis markers (no-space-in-emphasis)\n" + "test/resources/rules/md037/bad_surrounding_empahsis_atx.md:3:14: MD037: Spaces inside emphasis markers (no-space-in-emphasis)\n" + "test/resources/rules/md037/bad_surrounding_empahsis_atx.md:5:14: MD037: Spaces inside emphasis markers (no-space-in-emphasis)\n" + "test/resources/rules/md037/bad_surrounding_empahsis_atx.md:7:14: MD037: Spaces inside emphasis markers (no-space-in-emphasis)" ) expected_error = "" # Act execute_results = scanner.invoke_main(arguments=supplied_arguments) # Assert execute_results.assert_results( expected_output, expected_error, expected_return_code ) @pytest.mark.rules def test_md037_bad_surrounding_emphasis_containers(): """ Test to make sure this rule does trigger with a document that contains one or two valid emphasis characters surrounded by spaces, within a single line within a container element. """ # Arrange scanner = MarkdownScanner() supplied_arguments = [ "scan", "test/resources/rules/md037/bad_surrounding_emphasis_containers.md", ] expected_return_code = 1 expected_output = ( "test/resources/rules/md037/bad_surrounding_emphasis_containers.md:1:12: MD037: Spaces inside emphasis markers (no-space-in-emphasis)\n" + "test/resources/rules/md037/bad_surrounding_emphasis_containers.md:3:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)\n" + "test/resources/rules/md037/bad_surrounding_emphasis_containers.md:5:11: MD037: Spaces inside emphasis markers (no-space-in-emphasis)" ) expected_error = "" # Act execute_results = scanner.invoke_main(arguments=supplied_arguments) # Assert execute_results.assert_results( expected_output, expected_error, expected_return_code ) @pytest.mark.rules def test_md037_good_emphasis_with_code_span(): """ Test to make sure this rule does not trigger with a document that contains one or two valid emphasis characters surrounded by spaces, within a code span. """ # Arrange scanner = MarkdownScanner() supplied_arguments = [ "scan", "test/resources/rules/md037/good_emphasis_with_code_span.md", ] expected_return_code = 0 expected_output = "" expected_error = "" # Act execute_results = scanner.invoke_main(arguments=supplied_arguments) # Assert execute_results.assert_results( expected_output, expected_error, expected_return_code ) @pytest.mark.rules def test_md037_good_no_emphasis_but_stars(): """ Test to make sure this rule does not trigger with a document that contains one or two valid emphasis characters as part of other parts of a paragraph. """ # Arrange scanner = MarkdownScanner() supplied_arguments = [ "scan", "test/resources/rules/md037/good_no_emphasis_but_stars.md", ] expected_return_code = 0 expected_output = "" expected_error = "" # Act execute_results = scanner.invoke_main(arguments=supplied_arguments) # Assert execute_results.assert_results( expected_output, expected_error, expected_return_code )
33.851735
146
0.715963
1,352
10,731
5.471154
0.076923
0.044342
0.090037
0.115047
0.9612
0.956334
0.946059
0.941868
0.936731
0.92862
0
0.036687
0.192247
10,731
316
147
33.958861
0.816682
0.158606
0
0.568182
0
0.153409
0.45614
0.331625
0
0
0
0
0.056818
1
0.056818
false
0
0.011364
0
0.068182
0
0
0
0
null
0
0
0
1
1
1
1
1
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
6
310a0974b9540fbc4c8cc23bd99919d6c7c88156
83
py
Python
ox/target/python/__init__.py
fabiommendes/ox
40265441e0ce84feda71e7a5f6b1d6f3e9e152cb
[ "MIT" ]
10
2017-08-18T02:01:33.000Z
2020-08-15T00:52:43.000Z
ox/target/python/__init__.py
fabiommendes/ox
40265441e0ce84feda71e7a5f6b1d6f3e9e152cb
[ "MIT" ]
2
2019-04-17T23:36:42.000Z
2019-10-15T08:09:29.000Z
ox/target/python/__init__.py
fabiommendes/ox
40265441e0ce84feda71e7a5f6b1d6f3e9e152cb
[ "MIT" ]
6
2017-09-21T13:26:43.000Z
2021-01-12T02:41:27.000Z
from .wrapper import py, unwrap, S from .expr_ast import * from .stmt_ast import *
20.75
34
0.746988
14
83
4.285714
0.642857
0.3
0
0
0
0
0
0
0
0
0
0
0.168675
83
3
35
27.666667
0.869565
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
311fa87e528ff9f62458939f611de1d5a9c0519f
407
py
Python
snakemake/configs/gallus_gallus_SRP007412_single.py
saketkc/EE-546-project
fb7eacd90f6c0a2cb3061837ec5427a14f521aa5
[ "BSD-2-Clause" ]
1
2020-11-02T07:05:09.000Z
2020-11-02T07:05:09.000Z
snakemake/configs/gallus_gallus_SRP007412_single.py
saketkc/EE-546-project
fb7eacd90f6c0a2cb3061837ec5427a14f521aa5
[ "BSD-2-Clause" ]
null
null
null
snakemake/configs/gallus_gallus_SRP007412_single.py
saketkc/EE-546-project
fb7eacd90f6c0a2cb3061837ec5427a14f521aa5
[ "BSD-2-Clause" ]
null
null
null
RAWDATA_DIR = '/staging/as/skchoudh/rna-seq-datasets/single/gallus_gallus/SRP007412' OUT_DIR = '/staging/as/skchoudh/rna-seq-output/gallus_gallus/SRP007412' CDNA_FA_GZ = '/home/cmb-panasas2/skchoudh/genomes/gallus_gallus/cdna/Gallus_gallus.Gallus_gallus-5.0.cdna.all.fa.gz' CDNA_IDX = '/home/cmb-panasas2/skchoudh/genomes/gallus_gallus/cdna/Gallus_gallus.Gallus_gallus-5.0.cdna.all.kallisto.index'
67.833333
127
0.80344
64
407
4.90625
0.40625
0.382166
0.229299
0.127389
0.66879
0.66879
0.503185
0.503185
0.503185
0.503185
0
0.046632
0.051597
407
5
128
81.4
0.766839
0
0
0
0
0.5
0.832512
0.832512
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
1
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
3120898bf7ae01732572b13ce892078ef7ce99c7
17,776
py
Python
pirates/leveleditor/worldData/interior_spanish_store.py
Willy5s/Pirates-Online-Rewritten
7434cf98d9b7c837d57c181e5dabd02ddf98acb7
[ "BSD-3-Clause" ]
81
2018-04-08T18:14:24.000Z
2022-01-11T07:22:15.000Z
pirates/leveleditor/worldData/interior_spanish_store.py
Willy5s/Pirates-Online-Rewritten
7434cf98d9b7c837d57c181e5dabd02ddf98acb7
[ "BSD-3-Clause" ]
4
2018-09-13T20:41:22.000Z
2022-01-08T06:57:00.000Z
pirates/leveleditor/worldData/interior_spanish_store.py
Willy5s/Pirates-Online-Rewritten
7434cf98d9b7c837d57c181e5dabd02ddf98acb7
[ "BSD-3-Clause" ]
26
2018-05-26T12:49:27.000Z
2021-09-11T09:11:59.000Z
from pandac.PandaModules import Point3, VBase3, Vec4, Vec3 objectStruct = {'Objects': {'1156268617.43dzlu0m': {'Type': 'Building Interior','Name': '','Instanced': True,'Objects': {'1178149803.79kmuller': {'Type': 'Furniture','DisableCollision': False,'Hpr': VBase3(-1.039, 0.0, 0.0),'Pos': Point3(-1.554, -6.614, 0.0),'Scale': VBase3(1.0, 1.0, 1.0),'Visual': {'Model': 'models/props/counter_spanish'}},'1178149855.14kmuller': {'Type': 'Furniture','DisableCollision': True,'Hpr': VBase3(179.961, 0.0, 0.0),'Pos': Point3(-11.844, -22.594, 0.0),'Scale': VBase3(1.0, 1.0, 1.0),'Visual': {'Model': 'models/props/cabinet_spanish'}},'1178149893.21kmuller': {'Type': 'Furniture','DisableCollision': True,'Hpr': VBase3(179.961, 0.0, 0.0),'Pos': Point3(8.381, -22.641, 0.0),'Scale': VBase3(1.0, 1.0, 1.0),'Visual': {'Model': 'models/props/cabinet_spanish'}},'1178149936.92kmuller': {'Type': 'Furniture','DisableCollision': True,'Hpr': VBase3(-179.776, 0.0, 0.0),'Pos': Point3(5.864, 26.449, 5.265),'Scale': VBase3(1.0, 1.0, 1.0),'Visual': {'Model': 'models/props/cabinet_spanish_low'}},'1178149961.78kmuller': {'Type': 'Furniture','DisableCollision': True,'Hpr': VBase3(-179.776, 0.0, 0.0),'Pos': Point3(0.173, 26.471, 5.265),'Scale': VBase3(1.0, 1.0, 1.0),'Visual': {'Model': 'models/props/cabinet_spanish_low'}},'1178150017.54kmuller': {'Type': 'Furniture','DisableCollision': False,'Hpr': VBase3(179.791, 0.0, 0.0),'Pos': Point3(-6.748, 26.551, 5.265),'Scale': VBase3(1.0, 1.0, 1.0),'Visual': {'Model': 'models/props/bench_bank'}},'1178150057.45kmuller': {'Type': 'Prop_Groups','DisableCollision': True,'Hpr': VBase3(-175.757, 0.0, 0.0),'Pos': Point3(3.446, 21.742, 0.0),'Scale': VBase3(1.0, 0.953, 1.0),'Visual': {'Model': 'models/props/prop_group_G'}},'1178150105.5kmuller': {'Type': 'Prop_Groups','DisableCollision': False,'Hpr': VBase3(-81.625, 0.0, 0.0),'Pos': Point3(15.911, -21.849, 0.0),'Scale': VBase3(0.7, 0.7, 0.7),'Visual': {'Model': 'models/props/prop_group_C'}},'1178150203.06kmuller': {'Type': 'Interior_furnishings','DisableCollision': False,'Hpr': VBase3(178.974, 0.0, 0.0),'Pos': Point3(-1.738, -21.121, 0.0),'Scale': VBase3(1.0, 1.0, 1.0),'Visual': {'Model': 'models/props/fireplace_stucco'}},'1178150282.9kmuller': {'Type': 'Crate','DisableCollision': True,'Hpr': VBase3(-39.946, 0.0, 0.0),'Pos': Point3(-6.86, 21.166, 0.0),'Scale': VBase3(1.0, 1.0, 1.0),'Visual': {'Color': (0.6200000047683716, 0.6600000262260437, 0.6200000047683716, 1.0),'Model': 'models/props/crates_group_1'}},'1178150311.78kmuller': {'Type': 'Crate','DisableCollision': True,'Hpr': VBase3(-22.262, 0.0, 0.0),'Pos': Point3(-4.605, 18.261, 0.0),'Scale': VBase3(1.0, 1.0, 1.0),'Visual': {'Model': 'models/props/crate_04'}},'1178150390.28kmuller': {'Type': 'Furniture','DisableCollision': True,'Hpr': VBase3(179.961, 0.0, 0.0),'Pos': Point3(-17.216, -22.657, 0.0),'Scale': VBase3(1.0, 1.0, 1.0),'Visual': {'Model': 'models/props/cabinet_spanish'}},'1178150436.43kmuller': {'Type': 'Prop_Groups','DisableCollision': True,'Hpr': VBase3(154.734, 0.0, 0.0),'Pos': Point3(17.241, 49.828, 5.265),'Scale': VBase3(1.0, 1.0, 1.0),'Visual': {'Color': (0.5799999833106995, 0.5699999928474426, 0.47999998927116394, 1.0),'Model': 'models/props/prop_group_A'}},'1179175703.42dzlu': {'Type': 'Light - Dynamic','Attenuation': '0.005','ConeAngle': '60.0000','DropOff': '0.0000','FlickRate': 0.5,'Flickering': False,'Hpr': VBase3(0.0, 0.0, 0.0),'Intensity': '0.4848','LightType': 'AMBIENT','Pos': Point3(7.421, 37.752, 18.172),'Scale': VBase3(1.0, 1.0, 1.0),'Visual': {'Color': (1, 1, 1, 1),'Model': 'models/props/light_tool_bulb'}},'1179175718.7dzlu': {'Type': 'Light - Dynamic','Attenuation': '0.005','ConeAngle': '120.0000','DropOff': '15.0000','FlickRate': 0.5,'Flickering': False,'Hpr': VBase3(-54.13, -52.753, -23.378),'Intensity': '1.1818','LightType': 'SPOT','Pos': Point3(-13.63, -11.742, 38.377),'Scale': VBase3(1.0, 1.0, 1.0),'Visual': {'Color': (1, 1, 1, 1),'Model': 'models/props/light_tool_bulb'}},'1179175858.03dzlu': {'Type': 'Light - Dynamic','Attenuation': '0.005','ConeAngle': '120.0000','DropOff': '34.0909','FlickRate': 0.5,'Flickering': False,'Hpr': VBase3(-18.15, -58.009, 82.571),'Intensity': '1.1818','LightType': 'SPOT','Pos': Point3(-7.171, 15.899, 44.165),'Scale': VBase3(1.0, 1.0, 1.0),'Visual': {'Color': (1, 1, 1, 1),'Model': 'models/props/light_tool_bulb'}},'1185496853.06kmuller': {'Type': 'Collision Barrier','DisableCollision': False,'Hpr': Point3(0.0, 0.0, 0.0),'Pos': Point3(3.049, 26.837, 5.008),'Scale': VBase3(2.331, 0.546, 1.0),'Visual': {'Model': 'models/misc/pir_m_prp_lev_cambarrier_cube'}},'1185496912.86kmuller': {'Type': 'Collision Barrier','DisableCollision': False,'Hpr': VBase3(-2.219, 0.0, 0.0),'Pos': Point3(0.26, 15.469, -0.822),'Scale': VBase3(2.178, 1.0, 1.916),'Visual': {'Model': 'models/misc/pir_m_prp_lev_cambarrier_plane'}},'1185496977.9kmuller': {'Type': 'Collision Barrier','DisableCollision': False,'Hpr': VBase3(179.653, 0.0, 0.0),'Pos': Point3(-14.669, -21.113, -0.551),'Scale': VBase3(1.161, 1.0, 1.94),'Visual': {'Model': 'models/misc/pir_m_prp_lev_cambarrier_plane'}},'1185497007.42kmuller': {'Type': 'Collision Barrier','DisableCollision': False,'Hpr': VBase3(-179.456, 0.0, 0.0),'Pos': Point3(7.528, -20.205, -0.734),'Scale': VBase3(1.0, 1.0, 2.141),'Visual': {'Model': 'models/misc/pir_m_prp_lev_cambarrier_plane'}},'1185497041.12kmuller': {'Type': 'Collision Barrier','DisableCollision': False,'Hpr': Point3(0.0, 0.0, 0.0),'Pos': Point3(16.131, 43.339, 4.562),'Scale': VBase3(1.769, 1.847, 1.376),'Visual': {'Model': 'models/misc/pir_m_prp_lev_cambarrier_cube'}},'1192813363.33akelts': {'Type': 'Effect Node','EffectName': 'torch_effect','Hpr': Point3(0.0, 0.0, 0.0),'Pos': Point3(-1.807, -22.132, 0.889),'Scale': VBase3(1.0, 1.0, 1.0),'Visual': {'Color': (0, 0, 0.65, 1),'Model': 'models/misc/smiley'}},'1257901787.33caoconno': {'Type': 'Door Locator Node','Name': 'door_locator','Hpr': VBase3(-180.0, 0.0, 0.0),'Pos': Point3(-13.419, 47.56, 5.309),'Scale': VBase3(1.0, 1.0, 1.0)},'1257901853.63caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(178.815, 13.364, -1.089),'Pos': Point3(13.885, 17.371, 21.416),'Scale': VBase3(1.717, 1.717, 1.717),'VisSize': '','Visual': {'Model': 'models/props/pir_m_prp_hol_decoRibbon_winter08'}},'1257901957.11caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(176.488, 13.396, -0.551),'Pos': Point3(-14.308, 17.915, 21.612),'Scale': VBase3(1.717, 1.717, 1.717),'VisSize': '','Visual': {'Model': 'models/props/pir_m_prp_hol_decoBow_winter08'}},'1257901981.61caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(176.488, 13.396, -0.551),'Pos': Point3(13.885, 17.371, 21.416),'Scale': VBase3(1.717, 1.717, 1.717),'VisSize': '','Visual': {'Model': 'models/props/pir_m_prp_hol_decoBow_winter08'}},'1257902048.72caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(176.488, 13.396, -0.551),'Pos': Point3(-0.161, 17.44, 21.379),'Scale': VBase3(1.717, 1.717, 1.717),'VisSize': '','Visual': {'Model': 'models/props/pir_m_prp_hol_decoBow_winter08'}},'1257902048.75caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(177.411, 13.386, -0.764),'Pos': Point3(-0.161, 17.44, 21.379),'Scale': VBase3(1.717, 1.717, 1.717),'VisSize': '','Visual': {'Model': 'models/props/pir_m_prp_hol_decoRibbon_winter08'}},'1257902114.02caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(176.488, 13.396, -0.535),'Pos': Point3(-15.311, -3.822, 21.736),'Scale': VBase3(1.717, 1.717, 1.717),'VisSize': '','Visual': {'Model': 'models/props/pir_m_prp_hol_decoBow_winter08'}},'1257902114.13caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(176.488, 13.396, -0.535),'Pos': Point3(12.881, -4.364, 21.546),'Scale': VBase3(1.717, 1.717, 1.717),'VisSize': '','Visual': {'Model': 'models/props/pir_m_prp_hol_decoBow_winter08'}},'1257902114.16caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(176.488, 13.396, -0.535),'Pos': Point3(-1.165, -4.296, 21.506),'Scale': VBase3(1.717, 1.717, 1.717),'VisSize': '','Visual': {'Model': 'models/props/pir_m_prp_hol_decoBow_winter08'}},'1257902114.19caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(178.815, 13.364, -1.074),'Pos': Point3(12.881, -4.364, 21.546),'Scale': VBase3(1.717, 1.717, 1.717),'VisSize': '','Visual': {'Model': 'models/props/pir_m_prp_hol_decoRibbon_winter08'}},'1257902114.22caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(177.411, 13.386, -0.749),'Pos': Point3(-1.165, -4.296, 21.506),'Scale': VBase3(1.717, 1.717, 1.717),'VisSize': '','Visual': {'Model': 'models/props/pir_m_prp_hol_decoRibbon_winter08'}},'1257902164.09caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(176.488, 13.376, 0.73),'Pos': Point3(-14.821, 6.27, 21.279),'Scale': VBase3(1.717, 1.717, 1.717),'VisSize': '','Visual': {'Model': 'models/props/pir_m_prp_hol_decoBow_winter08'}},'1257902164.13caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(176.488, 13.376, 0.73),'Pos': Point3(13.371, 5.871, 21.695),'Scale': VBase3(1.717, 1.717, 1.717),'VisSize': '','Visual': {'Model': 'models/props/pir_m_prp_hol_decoBow_winter08'}},'1257902164.14caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(176.488, 13.376, 0.73),'Pos': Point3(-0.671, 5.867, 21.354),'Scale': VBase3(1.717, 1.717, 1.717),'VisSize': '','Visual': {'Model': 'models/props/pir_m_prp_hol_decoBow_winter08'}},'1257902164.17caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(178.816, 13.394, 0.191),'Pos': Point3(13.371, 5.871, 21.695),'Scale': VBase3(1.717, 1.717, 1.717),'VisSize': '','Visual': {'Model': 'models/props/pir_m_prp_hol_decoRibbon_winter08'}},'1257902164.28caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(177.411, 13.386, 0.516),'Pos': Point3(-0.671, 5.867, 21.354),'Scale': VBase3(1.717, 1.717, 1.717),'VisSize': '','Visual': {'Model': 'models/props/pir_m_prp_hol_decoRibbon_winter08'}},'1257902236.38caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': Point3(0.0, 0.0, 0.0),'Pos': Point3(-13.409, 46.752, 19.037),'Scale': VBase3(1.116, 1.116, 1.116),'VisSize': '','Visual': {'Model': 'models/props/pir_m_prp_hol_decoSwag_winter08'}},'1257902369.36caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(-105.288, -0.0, 0.0),'Pos': Point3(7.126, -19.561, -0.06),'Scale': VBase3(1.0, 1.0, 1.0),'VisSize': '','Visual': {'Color': (1.0, 0.75, 0.8399999737739563, 1.0),'Model': 'models/props/pir_m_prp_hol_decoGift03_winter08'}},'1257902390.19caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(-31.31, -0.0, 0.0),'Pos': Point3(-11.063, -19.714, -0.06),'Scale': VBase3(1.628, 1.628, 1.628),'VisSize': '','Visual': {'Color': (0.6000000238418579, 0.7200000286102295, 0.6000000238418579, 1.0),'Model': 'models/props/pir_m_prp_hol_decoGift03_winter08'}},'1257902392.5caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(-66.705, -0.0, 0.0),'Pos': Point3(-9.84, -17.505, -0.06),'Scale': VBase3(1.0, 1.0, 1.0),'VisSize': '','Visual': {'Color': (1.0, 0.800000011920929, 0.800000011920929, 1.0),'Model': 'models/props/pir_m_prp_hol_decoGift01_winter08'}},'1257902394.88caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(34.921, 0.0, 0.0),'Pos': Point3(-12.465, -17.94, -0.06),'Scale': VBase3(0.926, 0.926, 0.926),'VisSize': '','Visual': {'Color': (0.6000000238418579, 0.800000011920929, 1.0, 1.0),'Model': 'models/props/pir_m_prp_hol_decoGift04_winter08'}},'1257902402.75caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(-31.31, 0.0, 0.0),'Pos': Point3(-14.202, -19.59, -0.06),'Scale': VBase3(1.216, 1.216, 1.216),'VisSize': '','Visual': {'Color': (1.0, 0.33, 0.49, 1.0),'Model': 'models/props/pir_m_prp_hol_decoGift01_winter08'}},'1257902405.22caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(-31.31, -0.0, 0.0),'Pos': Point3(9.114, -19.762, -0.06),'Scale': VBase3(1.0, 1.0, 1.0),'VisSize': '','Visual': {'Model': 'models/props/pir_m_prp_hol_decoGift01_winter08'}},'1257902407.14caoconno': {'Type': 'Holiday','DisableCollision': False,'Holiday': 'WinterFestival','Hpr': VBase3(6.202, -0.0, 0.0),'Pos': Point3(10.237, -18.503, -0.06),'Scale': VBase3(0.724, 0.724, 0.724),'VisSize': '','Visual': {'Color': (0.75, 1.0, 0.8500000238418579, 1.0),'Model': 'models/props/pir_m_prp_hol_decoGift01_winter08'}}},'Visual': {'Model': 'models/buildings/interior_spanish_store'}}},'Node Links': [],'Layers': {},'ObjectIds': {'1156268617.43dzlu0m': '["Objects"]["1156268617.43dzlu0m"]','1178149803.79kmuller': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1178149803.79kmuller"]','1178149855.14kmuller': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1178149855.14kmuller"]','1178149893.21kmuller': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1178149893.21kmuller"]','1178149936.92kmuller': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1178149936.92kmuller"]','1178149961.78kmuller': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1178149961.78kmuller"]','1178150017.54kmuller': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1178150017.54kmuller"]','1178150057.45kmuller': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1178150057.45kmuller"]','1178150105.5kmuller': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1178150105.5kmuller"]','1178150203.06kmuller': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1178150203.06kmuller"]','1178150282.9kmuller': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1178150282.9kmuller"]','1178150311.78kmuller': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1178150311.78kmuller"]','1178150390.28kmuller': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1178150390.28kmuller"]','1178150436.43kmuller': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1178150436.43kmuller"]','1179175703.42dzlu': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1179175703.42dzlu"]','1179175718.7dzlu': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1179175718.7dzlu"]','1179175858.03dzlu': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1179175858.03dzlu"]','1185496853.06kmuller': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1185496853.06kmuller"]','1185496912.86kmuller': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1185496912.86kmuller"]','1185496977.9kmuller': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1185496977.9kmuller"]','1185497007.42kmuller': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1185497007.42kmuller"]','1185497041.12kmuller': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1185497041.12kmuller"]','1192813363.33akelts': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1192813363.33akelts"]','1257901787.33caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257901787.33caoconno"]','1257901853.63caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257901853.63caoconno"]','1257901957.11caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257901957.11caoconno"]','1257901981.61caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257901981.61caoconno"]','1257902048.72caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257902048.72caoconno"]','1257902048.75caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257902048.75caoconno"]','1257902114.02caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257902114.02caoconno"]','1257902114.13caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257902114.13caoconno"]','1257902114.16caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257902114.16caoconno"]','1257902114.19caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257902114.19caoconno"]','1257902114.22caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257902114.22caoconno"]','1257902164.09caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257902164.09caoconno"]','1257902164.13caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257902164.13caoconno"]','1257902164.14caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257902164.14caoconno"]','1257902164.17caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257902164.17caoconno"]','1257902164.28caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257902164.28caoconno"]','1257902236.38caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257902236.38caoconno"]','1257902369.36caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257902369.36caoconno"]','1257902390.19caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257902390.19caoconno"]','1257902392.5caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257902392.5caoconno"]','1257902394.88caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257902394.88caoconno"]','1257902402.75caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257902402.75caoconno"]','1257902405.22caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257902405.22caoconno"]','1257902407.14caoconno': '["Objects"]["1156268617.43dzlu0m"]["Objects"]["1257902407.14caoconno"]'}} extraInfo = {'camPos': Point3(0, -14, 0),'camHpr': VBase3(0, 0, 0),'focalLength': 0.7921423316,'skyState': -1,'fog': 0}
5,925.333333
17,597
0.685587
2,421
17,776
4.962412
0.158612
0.019311
0.017729
0.122524
0.625936
0.535542
0.501665
0.459714
0.426003
0.399534
0
0.259644
0.047761
17,776
3
17,598
5,925.333333
0.450109
0
0
0
0
0
0.577769
0.331552
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
6
313f1dded3512f7b35f595eea2252ae0b4f7e243
125
py
Python
code/st_gcn/feeder/__init__.py
nvski/ST-TR
75aa9fb872af217f8616c01cee7ca6548846260b
[ "MIT" ]
null
null
null
code/st_gcn/feeder/__init__.py
nvski/ST-TR
75aa9fb872af217f8616c01cee7ca6548846260b
[ "MIT" ]
null
null
null
code/st_gcn/feeder/__init__.py
nvski/ST-TR
75aa9fb872af217f8616c01cee7ca6548846260b
[ "MIT" ]
null
null
null
from .feeder import Feeder from .feeder_kinetics import Feeder_kinetics from .feeder_hdm import Feeder_hdm05, hdm_collate_fn
31.25
52
0.864
19
125
5.368421
0.421053
0.294118
0
0
0
0
0
0
0
0
0
0.017857
0.104
125
3
53
41.666667
0.892857
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
3150fb41fd2487706b837a7cad76b5de39db7370
121
py
Python
run.py
kwilson21/PS5Tracker
d3a8fb8638838fe99fb3a3b4e3ddb6973816d75b
[ "MIT" ]
null
null
null
run.py
kwilson21/PS5Tracker
d3a8fb8638838fe99fb3a3b4e3ddb6973816d75b
[ "MIT" ]
null
null
null
run.py
kwilson21/PS5Tracker
d3a8fb8638838fe99fb3a3b4e3ddb6973816d75b
[ "MIT" ]
null
null
null
from gevent import monkey # isort:skip # noqa monkey.patch_all() # isort:skip # noqa from app.app import app # noqa
20.166667
46
0.710744
19
121
4.473684
0.526316
0.211765
0.305882
0
0
0
0
0
0
0
0
0
0.198347
121
5
47
24.2
0.876289
0.31405
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
6
317f5213efe86a8c5cebfdde7754ea407841915b
76
py
Python
src/main.py
Anne-and-Walter/ship-it
17878ad00b82e3fe57dd8be738036450c5bd6d91
[ "MIT" ]
null
null
null
src/main.py
Anne-and-Walter/ship-it
17878ad00b82e3fe57dd8be738036450c5bd6d91
[ "MIT" ]
null
null
null
src/main.py
Anne-and-Walter/ship-it
17878ad00b82e3fe57dd8be738036450c5bd6d91
[ "MIT" ]
null
null
null
def return_true(): return True if __name__ == "__main__": print("shipit")
15.2
26
0.697368
10
76
4.4
0.8
0.454545
0
0
0
0
0
0
0
0
0
0
0.144737
76
5
27
15.2
0.676923
0
0
0
0
0
0.181818
0
0
0
0
0
0
1
0.25
true
0
0
0.25
0.5
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
1
1
0
0
1
0
0
0
6
31882ddd87e53f22e9c43b45bedcf1d8962f45e2
150
py
Python
kth_timeoutdecorator/__init__.py
Angel-Hair/th-timeoutdecorator
4b86a010d2eadb076eddfd661863b597c3e56014
[ "MIT" ]
2
2020-05-19T13:09:44.000Z
2021-02-03T06:39:13.000Z
kth_timeoutdecorator/__init__.py
Angel-Hair/th-timeoutdecorator
4b86a010d2eadb076eddfd661863b597c3e56014
[ "MIT" ]
null
null
null
kth_timeoutdecorator/__init__.py
Angel-Hair/th-timeoutdecorator
4b86a010d2eadb076eddfd661863b597c3e56014
[ "MIT" ]
1
2021-11-13T11:14:16.000Z
2021-11-13T11:14:16.000Z
from .kth_timeoutdecorator import timeout from .kth_timeoutdecorator import TimeoutException __title__ = 'kth_timeoutdecorator' __version__ = '0.0.5'
30
50
0.84
17
150
6.764706
0.588235
0.495652
0.4
0.504348
0
0
0
0
0
0
0
0.022059
0.093333
150
5
51
30
0.823529
0
0
0
0
0
0.165563
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
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
1
0
0
0
0
6
31b74565af7daffcb59af8e42a76bf8f6d7b895c
16,744
py
Python
APiLexer.py
AILab-FOI/APi
2571c52edf6f296c883d94e2f67fb18b42860b91
[ "MIT" ]
null
null
null
APiLexer.py
AILab-FOI/APi
2571c52edf6f296c883d94e2f67fb18b42860b91
[ "MIT" ]
27
2021-03-30T15:19:43.000Z
2021-04-26T09:29:41.000Z
APiLexer.py
AILab-FOI/APi
2571c52edf6f296c883d94e2f67fb18b42860b91
[ "MIT" ]
null
null
null
# Generated from APi.g4 by ANTLR 4.9 from antlr4 import * from io import StringIO from typing.io import TextIO import sys def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\63") buf.write("\u018f\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") buf.write("\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r") buf.write("\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23") buf.write("\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30") buf.write("\4\31\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36") buf.write("\t\36\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%") buf.write("\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4,\t,\4-\t-\4.") buf.write("\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64") buf.write("\t\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:") buf.write("\4;\t;\4<\t<\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\6\3\6\3") buf.write("\7\3\7\3\b\3\b\3\t\3\t\3\n\3\n\3\13\3\13\3\13\3\13\3\13") buf.write("\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\16\3\16") buf.write("\3\17\3\17\3\20\3\20\3\21\3\21\3\21\3\22\3\22\3\23\3\23") buf.write("\3\23\3\23\3\23\3\23\3\24\3\24\3\24\3\24\3\24\3\24\3\24") buf.write("\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\26\3\26\3\26\3\26") buf.write("\3\26\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\30\3\30\3\30") buf.write("\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\31\3\31") buf.write("\3\32\3\32\3\33\3\33\3\34\3\34\3\35\3\35\3\35\3\35\3\35") buf.write("\3\35\3\36\3\36\3\36\3\36\3\36\3\37\3\37\3\37\3\37\3\37") buf.write("\3\37\3 \3 \3 \3 \3 \3 \3 \3 \3!\3!\3!\3!\3!\3!\3\"\3") buf.write("\"\3\"\3\"\3\"\3#\3#\3#\3#\3$\3$\3$\3%\3%\3%\3&\3&\3&") buf.write("\3\'\3\'\3(\3(\5(\u0110\n(\3)\3)\3)\3)\7)\u0116\n)\f)") buf.write("\16)\u0119\13)\3*\3*\3*\3*\7*\u011f\n*\f*\16*\u0122\13") buf.write("*\3*\3*\3*\3+\3+\3,\3,\3-\3-\3.\3.\3.\3/\3/\7/\u0132\n") buf.write("/\f/\16/\u0135\13/\3\60\3\60\3\60\3\60\5\60\u013b\n\60") buf.write("\3\61\5\61\u013e\n\61\3\62\3\62\3\62\7\62\u0143\n\62\f") buf.write("\62\16\62\u0146\13\62\3\62\3\62\3\62\3\62\7\62\u014c\n") buf.write("\62\f\62\16\62\u014f\13\62\3\62\5\62\u0152\n\62\3\63\3") buf.write("\63\3\63\5\63\u0157\n\63\3\64\3\64\3\64\5\64\u015c\n\64") buf.write("\3\65\3\65\3\65\3\65\3\65\3\65\3\66\3\66\3\67\3\67\38") buf.write("\38\39\59\u016b\n9\39\39\39\69\u0170\n9\r9\169\u0171\5") buf.write("9\u0174\n9\39\59\u0177\n9\3:\3:\3:\7:\u017c\n:\f:\16:") buf.write("\u017f\13:\5:\u0181\n:\3;\3;\5;\u0185\n;\3;\3;\3<\6<\u018a") buf.write("\n<\r<\16<\u018b\3<\3<\3\u0120\2=\3\3\5\4\7\5\t\6\13\7") buf.write("\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21") buf.write("!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67") buf.write("\359\36;\37= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.[/]\60_\2a") buf.write("\2c\61e\2g\2i\2k\2m\2o\2q\62s\2u\2w\63\3\2\22\3\2\f\f") buf.write("\3\2\13\13\b\2\"\"/<>>@@C\\c|\4\2//aa\5\2\u00b9\u00b9") buf.write("\u0302\u0371\u2041\u2042\t\2C\\c|\u2072\u2191\u2c02\u2ff1") buf.write("\u3003\ud801\uf902\ufdd1\ufdf2\uffff\n\2$$\61\61^^ddh") buf.write("hppttvv\n\2))\61\61^^ddhhppttvv\5\2\62;CHch\5\2\2!$$^") buf.write("^\5\2\2!))^^\3\2\62;\3\2\63;\4\2GGgg\4\2--//\4\2\17\17") buf.write("\"\"\2\u019a\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3") buf.write("\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2") buf.write("\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2") buf.write("\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2") buf.write("#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2") buf.write("\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65") buf.write("\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2") buf.write("\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2") buf.write("\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q\3\2") buf.write("\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\2[\3") buf.write("\2\2\2\2]\3\2\2\2\2c\3\2\2\2\2q\3\2\2\2\2w\3\2\2\2\3y") buf.write("\3\2\2\2\5{\3\2\2\2\7}\3\2\2\2\t\177\3\2\2\2\13\u0081") buf.write("\3\2\2\2\r\u0083\3\2\2\2\17\u0085\3\2\2\2\21\u0087\3\2") buf.write("\2\2\23\u0089\3\2\2\2\25\u008b\3\2\2\2\27\u0090\3\2\2") buf.write("\2\31\u0096\3\2\2\2\33\u009b\3\2\2\2\35\u009d\3\2\2\2") buf.write("\37\u009f\3\2\2\2!\u00a1\3\2\2\2#\u00a4\3\2\2\2%\u00a6") buf.write("\3\2\2\2\'\u00ac\3\2\2\2)\u00b3\3\2\2\2+\u00ba\3\2\2\2") buf.write("-\u00bf\3\2\2\2/\u00c6\3\2\2\2\61\u00d2\3\2\2\2\63\u00d4") buf.write("\3\2\2\2\65\u00d6\3\2\2\2\67\u00d8\3\2\2\29\u00da\3\2") buf.write("\2\2;\u00e0\3\2\2\2=\u00e5\3\2\2\2?\u00eb\3\2\2\2A\u00f3") buf.write("\3\2\2\2C\u00f9\3\2\2\2E\u00fe\3\2\2\2G\u0102\3\2\2\2") buf.write("I\u0105\3\2\2\2K\u0108\3\2\2\2M\u010b\3\2\2\2O\u010f\3") buf.write("\2\2\2Q\u0111\3\2\2\2S\u011a\3\2\2\2U\u0126\3\2\2\2W\u0128") buf.write("\3\2\2\2Y\u012a\3\2\2\2[\u012c\3\2\2\2]\u012f\3\2\2\2") buf.write("_\u013a\3\2\2\2a\u013d\3\2\2\2c\u0151\3\2\2\2e\u0153\3") buf.write("\2\2\2g\u0158\3\2\2\2i\u015d\3\2\2\2k\u0163\3\2\2\2m\u0165") buf.write("\3\2\2\2o\u0167\3\2\2\2q\u016a\3\2\2\2s\u0180\3\2\2\2") buf.write("u\u0182\3\2\2\2w\u0189\3\2\2\2yz\7<\2\2z\4\3\2\2\2{|\7") buf.write("*\2\2|\6\3\2\2\2}~\7+\2\2~\b\3\2\2\2\177\u0080\7\60\2") buf.write("\2\u0080\n\3\2\2\2\u0081\u0082\7}\2\2\u0082\f\3\2\2\2") buf.write("\u0083\u0084\7.\2\2\u0084\16\3\2\2\2\u0085\u0086\7\177") buf.write("\2\2\u0086\20\3\2\2\2\u0087\u0088\7]\2\2\u0088\22\3\2") buf.write("\2\2\u0089\u008a\7_\2\2\u008a\24\3\2\2\2\u008b\u008c\7") buf.write("v\2\2\u008c\u008d\7t\2\2\u008d\u008e\7w\2\2\u008e\u008f") buf.write("\7g\2\2\u008f\26\3\2\2\2\u0090\u0091\7h\2\2\u0091\u0092") buf.write("\7c\2\2\u0092\u0093\7n\2\2\u0093\u0094\7u\2\2\u0094\u0095") buf.write("\7g\2\2\u0095\30\3\2\2\2\u0096\u0097\7p\2\2\u0097\u0098") buf.write("\7w\2\2\u0098\u0099\7n\2\2\u0099\u009a\7n\2\2\u009a\32") buf.write("\3\2\2\2\u009b\u009c\7>\2\2\u009c\34\3\2\2\2\u009d\u009e") buf.write("\7@\2\2\u009e\36\3\2\2\2\u009f\u00a0\7\61\2\2\u00a0 \3") buf.write("\2\2\2\u00a1\u00a2\7\61\2\2\u00a2\u00a3\7@\2\2\u00a3\"") buf.write("\3\2\2\2\u00a4\u00a5\7?\2\2\u00a5$\3\2\2\2\u00a6\u00a7") buf.write("\7u\2\2\u00a7\u00a8\7v\2\2\u00a8\u00a9\7f\2\2\u00a9\u00aa") buf.write("\7k\2\2\u00aa\u00ab\7p\2\2\u00ab&\3\2\2\2\u00ac\u00ad") buf.write("\7u\2\2\u00ad\u00ae\7v\2\2\u00ae\u00af\7f\2\2\u00af\u00b0") buf.write("\7q\2\2\u00b0\u00b1\7w\2\2\u00b1\u00b2\7v\2\2\u00b2(\3") buf.write("\2\2\2\u00b3\u00b4\7u\2\2\u00b4\u00b5\7v\2\2\u00b5\u00b6") buf.write("\7f\2\2\u00b6\u00b7\7g\2\2\u00b7\u00b8\7t\2\2\u00b8\u00b9") buf.write("\7t\2\2\u00b9*\3\2\2\2\u00ba\u00bb\7x\2\2\u00bb\u00bc") buf.write("\7q\2\2\u00bc\u00bd\7k\2\2\u00bd\u00be\7f\2\2\u00be,\3") buf.write("\2\2\2\u00bf\u00c0\7k\2\2\u00c0\u00c1\7o\2\2\u00c1\u00c2") buf.write("\7r\2\2\u00c2\u00c3\7q\2\2\u00c3\u00c4\7t\2\2\u00c4\u00c5") buf.write("\7v\2\2\u00c5.\3\2\2\2\u00c6\u00c7\7g\2\2\u00c7\u00c8") buf.write("\7p\2\2\u00c8\u00c9\7x\2\2\u00c9\u00ca\7k\2\2\u00ca\u00cb") buf.write("\7t\2\2\u00cb\u00cc\7q\2\2\u00cc\u00cd\7p\2\2\u00cd\u00ce") buf.write("\7o\2\2\u00ce\u00cf\7g\2\2\u00cf\u00d0\7p\2\2\u00d0\u00d1") buf.write("\7v\2\2\u00d1\60\3\2\2\2\u00d2\u00d3\7(\2\2\u00d3\62\3") buf.write("\2\2\2\u00d4\u00d5\7#\2\2\u00d5\64\3\2\2\2\u00d6\u00d7") buf.write("\7-\2\2\u00d7\66\3\2\2\2\u00d8\u00d9\7~\2\2\u00d98\3\2") buf.write("\2\2\u00da\u00db\7u\2\2\u00db\u00dc\7v\2\2\u00dc\u00dd") buf.write("\7c\2\2\u00dd\u00de\7t\2\2\u00de\u00df\7v\2\2\u00df:\3") buf.write("\2\2\2\u00e0\u00e1\7u\2\2\u00e1\u00e2\7g\2\2\u00e2\u00e3") buf.write("\7n\2\2\u00e3\u00e4\7h\2\2\u00e4<\3\2\2\2\u00e5\u00e6") buf.write("\7c\2\2\u00e6\u00e7\7i\2\2\u00e7\u00e8\7g\2\2\u00e8\u00e9") buf.write("\7p\2\2\u00e9\u00ea\7v\2\2\u00ea>\3\2\2\2\u00eb\u00ec") buf.write("\7e\2\2\u00ec\u00ed\7j\2\2\u00ed\u00ee\7c\2\2\u00ee\u00ef") buf.write("\7p\2\2\u00ef\u00f0\7p\2\2\u00f0\u00f1\7g\2\2\u00f1\u00f2") buf.write("\7n\2\2\u00f2@\3\2\2\2\u00f3\u00f4\7t\2\2\u00f4\u00f5") buf.write("\7g\2\2\u00f5\u00f6\7i\2\2\u00f6\u00f7\7g\2\2\u00f7\u00f8") buf.write("\7z\2\2\u00f8B\3\2\2\2\u00f9\u00fa\7l\2\2\u00fa\u00fb") buf.write("\7u\2\2\u00fb\u00fc\7q\2\2\u00fc\u00fd\7p\2\2\u00fdD\3") buf.write("\2\2\2\u00fe\u00ff\7z\2\2\u00ff\u0100\7o\2\2\u0100\u0101") buf.write("\7n\2\2\u0101F\3\2\2\2\u0102\u0103\7?\2\2\u0103\u0104") buf.write("\7@\2\2\u0104H\3\2\2\2\u0105\u0106\7>\2\2\u0106\u0107") buf.write("\7?\2\2\u0107J\3\2\2\2\u0108\u0109\7/\2\2\u0109\u010a") buf.write("\7@\2\2\u010aL\3\2\2\2\u010b\u010c\7\62\2\2\u010cN\3\2") buf.write("\2\2\u010d\u0110\5Q)\2\u010e\u0110\5S*\2\u010f\u010d\3") buf.write("\2\2\2\u010f\u010e\3\2\2\2\u0110P\3\2\2\2\u0111\u0112") buf.write("\7\61\2\2\u0112\u0113\7\61\2\2\u0113\u0117\3\2\2\2\u0114") buf.write("\u0116\n\2\2\2\u0115\u0114\3\2\2\2\u0116\u0119\3\2\2\2") buf.write("\u0117\u0115\3\2\2\2\u0117\u0118\3\2\2\2\u0118R\3\2\2") buf.write("\2\u0119\u0117\3\2\2\2\u011a\u011b\7\61\2\2\u011b\u011c") buf.write("\7,\2\2\u011c\u0120\3\2\2\2\u011d\u011f\13\2\2\2\u011e") buf.write("\u011d\3\2\2\2\u011f\u0122\3\2\2\2\u0120\u0121\3\2\2\2") buf.write("\u0120\u011e\3\2\2\2\u0121\u0123\3\2\2\2\u0122\u0120\3") buf.write("\2\2\2\u0123\u0124\7,\2\2\u0124\u0125\7\61\2\2\u0125T") buf.write("\3\2\2\2\u0126\u0127\t\2\2\2\u0127V\3\2\2\2\u0128\u0129") buf.write("\t\3\2\2\u0129X\3\2\2\2\u012a\u012b\n\4\2\2\u012bZ\3\2") buf.write("\2\2\u012c\u012d\7A\2\2\u012d\u012e\5]/\2\u012e\\\3\2") buf.write("\2\2\u012f\u0133\5a\61\2\u0130\u0132\5_\60\2\u0131\u0130") buf.write("\3\2\2\2\u0132\u0135\3\2\2\2\u0133\u0131\3\2\2\2\u0133") buf.write("\u0134\3\2\2\2\u0134^\3\2\2\2\u0135\u0133\3\2\2\2\u0136") buf.write("\u013b\5a\61\2\u0137\u013b\t\5\2\2\u0138\u013b\5s:\2\u0139") buf.write("\u013b\t\6\2\2\u013a\u0136\3\2\2\2\u013a\u0137\3\2\2\2") buf.write("\u013a\u0138\3\2\2\2\u013a\u0139\3\2\2\2\u013b`\3\2\2") buf.write("\2\u013c\u013e\t\7\2\2\u013d\u013c\3\2\2\2\u013eb\3\2") buf.write("\2\2\u013f\u0144\7$\2\2\u0140\u0143\5e\63\2\u0141\u0143") buf.write("\5m\67\2\u0142\u0140\3\2\2\2\u0142\u0141\3\2\2\2\u0143") buf.write("\u0146\3\2\2\2\u0144\u0142\3\2\2\2\u0144\u0145\3\2\2\2") buf.write("\u0145\u0147\3\2\2\2\u0146\u0144\3\2\2\2\u0147\u0152\7") buf.write("$\2\2\u0148\u014d\7)\2\2\u0149\u014c\5g\64\2\u014a\u014c") buf.write("\5o8\2\u014b\u0149\3\2\2\2\u014b\u014a\3\2\2\2\u014c\u014f") buf.write("\3\2\2\2\u014d\u014b\3\2\2\2\u014d\u014e\3\2\2\2\u014e") buf.write("\u0150\3\2\2\2\u014f\u014d\3\2\2\2\u0150\u0152\7)\2\2") buf.write("\u0151\u013f\3\2\2\2\u0151\u0148\3\2\2\2\u0152d\3\2\2") buf.write("\2\u0153\u0156\7^\2\2\u0154\u0157\t\b\2\2\u0155\u0157") buf.write("\5i\65\2\u0156\u0154\3\2\2\2\u0156\u0155\3\2\2\2\u0157") buf.write("f\3\2\2\2\u0158\u015b\7^\2\2\u0159\u015c\t\t\2\2\u015a") buf.write("\u015c\5i\65\2\u015b\u0159\3\2\2\2\u015b\u015a\3\2\2\2") buf.write("\u015ch\3\2\2\2\u015d\u015e\7w\2\2\u015e\u015f\5k\66\2") buf.write("\u015f\u0160\5k\66\2\u0160\u0161\5k\66\2\u0161\u0162\5") buf.write("k\66\2\u0162j\3\2\2\2\u0163\u0164\t\n\2\2\u0164l\3\2\2") buf.write("\2\u0165\u0166\n\13\2\2\u0166n\3\2\2\2\u0167\u0168\n\f") buf.write("\2\2\u0168p\3\2\2\2\u0169\u016b\7/\2\2\u016a\u0169\3\2") buf.write("\2\2\u016a\u016b\3\2\2\2\u016b\u016c\3\2\2\2\u016c\u0173") buf.write("\5s:\2\u016d\u016f\7\60\2\2\u016e\u0170\t\r\2\2\u016f") buf.write("\u016e\3\2\2\2\u0170\u0171\3\2\2\2\u0171\u016f\3\2\2\2") buf.write("\u0171\u0172\3\2\2\2\u0172\u0174\3\2\2\2\u0173\u016d\3") buf.write("\2\2\2\u0173\u0174\3\2\2\2\u0174\u0176\3\2\2\2\u0175\u0177") buf.write("\5u;\2\u0176\u0175\3\2\2\2\u0176\u0177\3\2\2\2\u0177r") buf.write("\3\2\2\2\u0178\u0181\7\62\2\2\u0179\u017d\t\16\2\2\u017a") buf.write("\u017c\t\r\2\2\u017b\u017a\3\2\2\2\u017c\u017f\3\2\2\2") buf.write("\u017d\u017b\3\2\2\2\u017d\u017e\3\2\2\2\u017e\u0181\3") buf.write("\2\2\2\u017f\u017d\3\2\2\2\u0180\u0178\3\2\2\2\u0180\u0179") buf.write("\3\2\2\2\u0181t\3\2\2\2\u0182\u0184\t\17\2\2\u0183\u0185") buf.write("\t\20\2\2\u0184\u0183\3\2\2\2\u0184\u0185\3\2\2\2\u0185") buf.write("\u0186\3\2\2\2\u0186\u0187\5s:\2\u0187v\3\2\2\2\u0188") buf.write("\u018a\t\21\2\2\u0189\u0188\3\2\2\2\u018a\u018b\3\2\2") buf.write("\2\u018b\u0189\3\2\2\2\u018b\u018c\3\2\2\2\u018c\u018d") buf.write("\3\2\2\2\u018d\u018e\b<\2\2\u018ex\3\2\2\2\30\2\u010f") buf.write("\u0117\u0120\u0133\u013a\u013d\u0142\u0144\u014b\u014d") buf.write("\u0151\u0156\u015b\u016a\u0171\u0173\u0176\u017d\u0180") buf.write("\u0184\u018b\3\b\2\2") return buf.getvalue() class APiLexer(Lexer): atn = ATNDeserializer().deserialize(serializedATN()) decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ] T__0 = 1 T__1 = 2 T__2 = 3 T__3 = 4 T__4 = 5 T__5 = 6 T__6 = 7 T__7 = 8 T__8 = 9 T__9 = 10 T__10 = 11 T__11 = 12 T__12 = 13 T__13 = 14 T__14 = 15 T__15 = 16 T__16 = 17 STDIN = 18 STDOUT = 19 STDERR = 20 VOID = 21 IMPORT = 22 ENVIRONMENT = 23 ONSUCCESS = 24 ONFAIL = 25 RESTART = 26 PARALLEL = 27 START = 28 SELF = 29 AGENT = 30 CHANNEL = 31 REGEX = 32 JSON = 33 XML = 34 INPUT_FORMAT = 35 OUTPUT_FORMAT = 36 SENDS = 37 NIL = 38 COMMENT = 39 COMMENT1 = 40 COMMENT2 = 41 NEWLINE = 42 TAB = 43 SPEC_CHAR = 44 VARIABLE = 45 IDENT = 46 STRING = 47 NUMBER = 48 SPACE = 49 channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ] modeNames = [ "DEFAULT_MODE" ] literalNames = [ "<INVALID>", "':'", "'('", "')'", "'.'", "'{'", "','", "'}'", "'['", "']'", "'true'", "'false'", "'null'", "'<'", "'>'", "'/'", "'/>'", "'='", "'stdin'", "'stdout'", "'stderr'", "'void'", "'import'", "'environment'", "'&'", "'!'", "'+'", "'|'", "'start'", "'self'", "'agent'", "'channel'", "'regex'", "'json'", "'xml'", "'=>'", "'<='", "'->'", "'0'" ] symbolicNames = [ "<INVALID>", "STDIN", "STDOUT", "STDERR", "VOID", "IMPORT", "ENVIRONMENT", "ONSUCCESS", "ONFAIL", "RESTART", "PARALLEL", "START", "SELF", "AGENT", "CHANNEL", "REGEX", "JSON", "XML", "INPUT_FORMAT", "OUTPUT_FORMAT", "SENDS", "NIL", "COMMENT", "COMMENT1", "COMMENT2", "NEWLINE", "TAB", "SPEC_CHAR", "VARIABLE", "IDENT", "STRING", "NUMBER", "SPACE" ] ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16", "STDIN", "STDOUT", "STDERR", "VOID", "IMPORT", "ENVIRONMENT", "ONSUCCESS", "ONFAIL", "RESTART", "PARALLEL", "START", "SELF", "AGENT", "CHANNEL", "REGEX", "JSON", "XML", "INPUT_FORMAT", "OUTPUT_FORMAT", "SENDS", "NIL", "COMMENT", "COMMENT1", "COMMENT2", "NEWLINE", "TAB", "SPEC_CHAR", "VARIABLE", "IDENT", "NameChar1", "NameStartChar1", "STRING", "ESC1", "ESC2", "UNICODE", "HEX", "SAFECODEPOINT1", "SAFECODEPOINT2", "NUMBER", "INT", "EXP", "SPACE" ] grammarFileName = "APi.g4" def __init__(self, input=None, output:TextIO = sys.stdout): super().__init__(input, output) self.checkVersion("4.9") self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache()) self._actions = None self._predicates = None
57.937716
103
0.553989
3,745
16,744
2.451535
0.1498
0.134626
0.074502
0.080601
0.26642
0.184838
0.109356
0.094434
0.081255
0.074066
0
0.346148
0.156474
16,744
288
104
58.138889
0.30388
0.002031
0
0
1
0.459259
0.61882
0.563151
0
0
0
0
0
1
0.007407
false
0
0.02963
0
0.255556
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
1
1
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
9ec4275ee16cebb952fae4317b678b14551a986e
55
py
Python
chopperhack19/mock_obs/tests/__init__.py
ArgonneCPAC/bnlhack19
d399b2e200ec7dbd733c754b06c4bd368eb00e67
[ "BSD-3-Clause" ]
null
null
null
chopperhack19/mock_obs/tests/__init__.py
ArgonneCPAC/bnlhack19
d399b2e200ec7dbd733c754b06c4bd368eb00e67
[ "BSD-3-Clause" ]
4
2019-09-23T18:56:16.000Z
2019-10-06T03:33:09.000Z
chopperhack19/mock_obs/tests/__init__.py
ArgonneCPAC/bnlhack19
d399b2e200ec7dbd733c754b06c4bd368eb00e67
[ "BSD-3-Clause" ]
1
2019-09-25T19:13:30.000Z
2019-09-25T19:13:30.000Z
from .generate_test_data import random_weighted_points
27.5
54
0.909091
8
55
5.75
1
0
0
0
0
0
0
0
0
0
0
0
0.072727
55
1
55
55
0.901961
0
0
0
1
0
0
0
0
0
0
0
0
1
0
true
0
1
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
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
73001002efc809f70983029cdc3d32e7e80a716f
38
py
Python
odss/http/__init__.py
odss/py-odss
b35838bba89f4dffc0dadd0b3821d8b38c0ca497
[ "MIT" ]
null
null
null
odss/http/__init__.py
odss/py-odss
b35838bba89f4dffc0dadd0b3821d8b38c0ca497
[ "MIT" ]
null
null
null
odss/http/__init__.py
odss/py-odss
b35838bba89f4dffc0dadd0b3821d8b38c0ca497
[ "MIT" ]
null
null
null
from .decorators import route # noqa
19
37
0.763158
5
38
5.8
1
0
0
0
0
0
0
0
0
0
0
0
0.184211
38
1
38
38
0.935484
0.105263
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
731c250173288664701c1d9b3cb1cc1facb1659d
16,681
py
Python
tests/test_01_users.py
Fastex007/api_yamdb
93fd2054111b86d392f5d5769dbe125c16b06126
[ "BSD-3-Clause" ]
null
null
null
tests/test_01_users.py
Fastex007/api_yamdb
93fd2054111b86d392f5d5769dbe125c16b06126
[ "BSD-3-Clause" ]
null
null
null
tests/test_01_users.py
Fastex007/api_yamdb
93fd2054111b86d392f5d5769dbe125c16b06126
[ "BSD-3-Clause" ]
null
null
null
import pytest from django.contrib.auth import get_user_model from .common import auth_client, create_users_api class Test01UserAPI: @pytest.mark.django_db(transaction=True) def test_01_users_not_auth(self, client): response = client.get('/api/v1/users/') assert response.status_code != 404, ( 'Страница `/api/v1/users/` не найдена, проверьте этот адрес в *urls.py*' ) assert response.status_code == 401, ( 'Проверьте, что при GET запросе `/api/v1/users/` без токена авторизации возвращается статус 401' ) @pytest.mark.django_db(transaction=True) def test_02_users_username_not_auth(self, client, admin): response = client.get(f'/api/v1/users/{admin.username}/') assert response.status_code != 404, ( 'Страница `/api/v1/users/{username}/` не найдена, проверьте этот адрес в *urls.py*' ) assert response.status_code == 401, ( 'Проверьте, что при GET запросе `/api/v1/users/{username}/` без токена авторизации возвращается статус 401' ) @pytest.mark.django_db(transaction=True) def test_03_users_me_not_auth(self, client): response = client.get('/api/v1/users/me/') assert response.status_code != 404, ( 'Страница `/api/v1/users/me/` не найдена, проверьте этот адрес в *urls.py*' ) assert response.status_code == 401, ( 'Проверьте, что при GET запросе `/api/v1/users/me/` без токена авторизации возвращается статус 401' ) @pytest.mark.django_db(transaction=True) def test_04_users_get_auth(self, user_client, admin): response = user_client.get('/api/v1/users/') assert response.status_code != 404, ( 'Страница `/api/v1/users/` не найдена, проверьте этот адрес в *urls.py*' ) assert response.status_code == 200, ( 'Проверьте, что при GET запросе `/api/v1/users/` с токеном авторизации возвращается статус 200' ) data = response.json() assert 'count' in data, ( 'Проверьте, что при GET запросе `/api/v1/users/` возвращаете данные с пагинацией. ' 'Не найден параметр `count`' ) assert 'next' in data, ( 'Проверьте, что при GET запросе `/api/v1/users/` возвращаете данные с пагинацией. ' 'Не найден параметр `next`' ) assert 'previous' in data, ( 'Проверьте, что при GET запросе `/api/v1/users/` возвращаете данные с пагинацией. ' 'Не найден параметр `previous`' ) assert 'results' in data, ( 'Проверьте, что при GET запросе `/api/v1/users/` возвращаете данные с пагинацией. ' 'Не найден параметр `results`' ) assert data['count'] == 1, ( 'Проверьте, что при GET запросе `/api/v1/users/` возвращаете данные с пагинацией. ' 'Значение параметра `count` не правильное' ) assert type(data['results']) == list, ( 'Проверьте, что при GET запросе `/api/v1/users/` возвращаете данные с пагинацией. ' 'Тип параметра `results` должен быть список' ) assert len(data['results']) == 1 and data['results'][0].get('username') == admin.username \ and data['results'][0].get('email') == admin.email, ( 'Проверьте, что при GET запросе `/api/v1/users/` возвращаете данные с пагинацией. ' 'Значение параметра `results` не правильное' ) @pytest.mark.django_db(transaction=True) def test_05_users_post_auth(self, user_client, admin): data = {} response = user_client.post('/api/v1/users/', data=data) assert response.status_code == 400, ( 'Проверьте, что при POST запросе `/api/v1/users/` с не правильными данными возвращает 400' ) data = { 'username': 'TestUser1231231', 'role': 'user' } response = user_client.post('/api/v1/users/', data=data) assert response.status_code == 400, ( 'Проверьте, что при POST запросе `/api/v1/users/` с не правильными данными возвращает 400' ) data = { 'username': 'TestUser1231231', 'role': 'user', 'email': admin.email } response = user_client.post('/api/v1/users/', data=data) assert response.status_code == 400, ( 'Проверьте, что при POST запросе `/api/v1/users/` с не правильными данными возвращает 400. ' '`Email` должен быть уникальный у каждого прользователя' ) data = { 'username': admin.username, 'role': 'user', 'email': 'testuser@yamdb.fake' } response = user_client.post('/api/v1/users/', data=data) assert response.status_code == 400, ( 'Проверьте, что при POST запросе `/api/v1/users/` с не правильными данными возвращает 400. ' '`Username` должен быть уникальный у каждого прользователя' ) data = { 'username': 'TestUser1231231', 'role': 'user', 'email': 'testuser@yamdb.fake' } response = user_client.post('/api/v1/users/', data=data) assert response.status_code == 201, ( 'Проверьте, что при POST запросе `/api/v1/users/` с правильными данными возвращает 201.' ) data = { 'first_name': 'fsdfsdf', 'last_name': 'dsgdsfg', 'username': 'TestUser4534', 'bio': 'Jdlkjd', 'role': 'moderator', 'email': 'testuser2342@yamdb.fake' } response = user_client.post('/api/v1/users/', data=data) assert response.status_code == 201, ( 'Проверьте, что при POST запросе `/api/v1/users/` с правильными данными возвращает 201.' ) response_data = response.json() assert response_data.get('first_name') == data['first_name'], ( 'Проверьте, что при POST запросе `/api/v1/users/` с правильными данными возвращаете `first_name`.' ) assert response_data.get('last_name') == data['last_name'], ( 'Проверьте, что при POST запросе `/api/v1/users/` с правильными данными возвращаете `last_name`.' ) assert response_data.get('username') == data['username'], ( 'Проверьте, что при POST запросе `/api/v1/users/` с правильными данными возвращаете `username`.' ) assert response_data.get('bio') == data['bio'], ( 'Проверьте, что при POST запросе `/api/v1/users/` с правильными данными возвращаете `bio`.' ) assert response_data.get('role') == data['role'], ( 'Проверьте, что при POST запросе `/api/v1/users/` с правильными данными возвращаете `role`.' ) assert response_data.get('email') == data['email'], ( 'Проверьте, что при POST запросе `/api/v1/users/` с правильными данными возвращаете `email`.' ) assert get_user_model().objects.count() == 3, ( 'Проверьте, что при POST запросе `/api/v1/users/` вы создаёте пользователей.' ) response = user_client.get('/api/v1/users/') data = response.json() assert len(data['results']) == 3, ( 'Проверьте, что при GET запросе `/api/v1/users/` возвращаете данные с пагинацией. ' 'Значение параметра `results` не правильное' ) @pytest.mark.django_db(transaction=True) def test_06_users_username_get_auth(self, user_client, admin): user, moderator = create_users_api(user_client) response = user_client.get(f'/api/v1/users/{admin.username}/') assert response.status_code != 404, ( 'Страница `/api/v1/users/{username}/` не найдена, проверьте этот адрес в *urls.py*' ) assert response.status_code == 200, ( 'Проверьте, что при GET запросе `/api/v1/users/{username}/` с токеном авторизации возвращается статус 200' ) response_data = response.json() assert response_data.get('username') == admin.username, ( 'Проверьте, что при GET запросе `/api/v1/users/{username}/` возвращаете `username`.' ) assert response_data.get('email') == admin.email, ( 'Проверьте, что при GET запросе `/api/v1/users/{username}/` возвращаете `email`.' ) response = user_client.get(f'/api/v1/users/{moderator.username}/') assert response.status_code == 200, ( 'Проверьте, что при GET запросе `/api/v1/users/{username}/` с токеном авторизации возвращается статус 200' ) response_data = response.json() assert response_data.get('username') == moderator.username, ( 'Проверьте, что при GET запросе `/api/v1/users/{username}/` возвращаете `username`.' ) assert response_data.get('email') == moderator.email, ( 'Проверьте, что при GET запросе `/api/v1/users/{username}/` возвращаете `email`.' ) assert response_data.get('first_name') == moderator.first_name, ( 'Проверьте, что при GET запросе `/api/v1/users/` возвращаете `first_name`.' ) assert response_data.get('last_name') == moderator.last_name, ( 'Проверьте, что при GET запросе `/api/v1/users/` возвращаете `last_name`.' ) assert response_data.get('bio') == moderator.bio, ( 'Проверьте, что при GET запросе `/api/v1/users/` возвращаете `bio`.' ) assert response_data.get('role') == moderator.role, ( 'Проверьте, что при GET запросе `/api/v1/users/` возвращаете `role`.' ) @pytest.mark.django_db(transaction=True) def test_07_users_username_patch_auth(self, user_client, admin): user, moderator = create_users_api(user_client) data = { 'first_name': 'Admin', 'last_name': 'Test', 'bio': 'description' } response = user_client.patch(f'/api/v1/users/{admin.username}/', data=data) assert response.status_code == 200, ( 'Проверьте, что при PATCH запросе `/api/v1/users/{username}/` ' 'с токеном авторизации возвращается статус 200' ) test_admin = get_user_model().objects.get(username=admin.username) assert test_admin.first_name == data['first_name'], ( 'Проверьте, что при PATCH запросе `/api/v1/users/{username}/` изменяете данные.' ) assert test_admin.last_name == data['last_name'], ( 'Проверьте, что при PATCH запросе `/api/v1/users/{username}/` изменяете данные.' ) response = user_client.patch(f'/api/v1/users/{user.username}/', data={'role': 'admin'}) assert response.status_code == 200, ( 'Проверьте, что при PATCH запросе `/api/v1/users/{username}/` ' 'с токеном авторизации возвращается статус 200' ) client_user = auth_client(user) response = client_user.get(f'/api/v1/users/{admin.username}/') assert response.status_code == 200, ( 'Проверьте, что при PATCH запросе `/api/v1/users/{username}/` можно изменить роль пользователя' ) @pytest.mark.django_db(transaction=True) def test_08_users_username_delete_auth(self, user_client): user, moderator = create_users_api(user_client) response = user_client.delete(f'/api/v1/users/{user.username}/') assert response.status_code == 204, ( 'Проверьте, что при DELETE запросе `/api/v1/users/{username}/` возвращаете статус 204' ) assert get_user_model().objects.count() == 2, ( 'Проверьте, что при DELETE запросе `/api/v1/users/{username}/` удаляете пользователя' ) def check_permissions(self, user, user_name, admin): client_user = auth_client(user) response = client_user.get('/api/v1/users/') assert response.status_code == 403, ( f'Проверьте, что при GET запросе `/api/v1/users/` ' f'с токеном авторизации {user_name} возвращается статус 403' ) data = { 'username': 'TestUser9876', 'role': 'user', 'email': 'testuser9876@yamdb.fake' } response = client_user.post('/api/v1/users/', data=data) assert response.status_code == 403, ( f'Проверьте, что при POST запросе `/api/v1/users/` ' f'с токеном авторизации {user_name} возвращается статус 403' ) response = client_user.get(f'/api/v1/users/{admin.username}/') assert response.status_code == 403, ( f'Проверьте, что при GET запросе `/api/v1/users/{{username}}/` ' f'с токеном авторизации {user_name} возвращается статус 403' ) data = { 'first_name': 'Admin', 'last_name': 'Test', 'bio': 'description' } response = client_user.patch(f'/api/v1/users/{admin.username}/', data=data) assert response.status_code == 403, ( f'Проверьте, что при PATCH запросе `/api/v1/users/{{username}}/` ' f'с токеном авторизации {user_name} возвращается статус 403' ) response = client_user.delete(f'/api/v1/users/{admin.username}/') assert response.status_code == 403, ( f'Проверьте, что при DELETE запросе `/api/v1/users/{{username}}/` ' f'с токеном авторизации {user_name} возвращается статус 403' ) @pytest.mark.django_db(transaction=True) def test_09_users_check_permissions(self, user_client, admin): user, moderator = create_users_api(user_client) self.check_permissions(user, 'обычного пользователя', admin) self.check_permissions(moderator, 'модератора', admin) @pytest.mark.django_db(transaction=True) def test_10_users_me_get(self, user_client, admin): user, moderator = create_users_api(user_client) response = user_client.get('/api/v1/users/me/') assert response.status_code == 200, ( 'Проверьте, что при GET запросе `/api/v1/users/me/` с токеном авторизации возвращается статус 200' ) response_data = response.json() assert response_data.get('username') == admin.username, ( 'Проверьте, что при GET запросе `/api/v1/users/me/` возвращаете данные пользователя' ) client_user = auth_client(moderator) response = client_user.get('/api/v1/users/me/') assert response.status_code == 200, ( 'Проверьте, что при GET запросе `/api/v1/users/me/` с токеном авторизации возвращается статус 200' ) response_data = response.json() assert response_data.get('username') == moderator.username, ( 'Проверьте, что при GET запросе `/api/v1/users/me/` возвращаете данные пользователя' ) assert response_data.get('role') == 'moderator', ( 'Проверьте, что при GET запросе `/api/v1/users/me/` возвращаете данные пользователя' ) assert response_data.get('email') == moderator.email, ( 'Проверьте, что при GET запросе `/api/v1/users/me/` возвращаете данные пользователя' ) response = client_user.delete('/api/v1/users/me/') assert response.status_code == 405, ( 'Проверьте, что при DELETE запросе `/api/v1/users/me/` возвращается статус 405' ) @pytest.mark.django_db(transaction=True) def test_11_users_me_patch(self, user_client): user, moderator = create_users_api(user_client) data = { 'first_name': 'Admin', 'last_name': 'Test', 'bio': 'description' } response = user_client.patch('/api/v1/users/me/', data=data) assert response.status_code == 200, ( 'Проверьте, что при PATCH запросе `/api/v1/users/me/` с токеном авторизации возвращается статус 200' ) response_data = response.json() assert response_data.get('bio') == 'description', ( 'Проверьте, что при PATCH запросе `/api/v1/users/me/` изменяете данные' ) client_user = auth_client(moderator) response = client_user.patch('/api/v1/users/me/', data={'first_name': 'NewTest'}) test_moderator = get_user_model().objects.get(username=moderator.username) assert response.status_code == 200, ( 'Проверьте, что при PATCH запросе `/api/v1/users/me/` с токеном авторизации возвращается статус 200' ) assert test_moderator.first_name == 'NewTest', ( 'Проверьте, что при PATCH запросе `/api/v1/users/me/` изменяете данные' )
46.988732
119
0.607877
1,923
16,681
5.154966
0.073323
0.045395
0.09079
0.099465
0.87239
0.857662
0.820438
0.8046
0.730455
0.693029
0
0.026595
0.265152
16,681
354
120
47.121469
0.782101
0
0
0.44713
0
0.033233
0.434326
0.052575
0
0
0
0
0.190332
1
0.036254
false
0
0.009063
0
0.048338
0
0
0
0
null
0
0
0
1
1
1
1
1
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
6
7359d4a476740dc1005410090ee2113da28c6a7b
179
py
Python
pyplottr/__init__.py
toaarnio/pyplottr
6bc811ff5851ae8b6274b2d062449b8cb543356d
[ "Apache-2.0" ]
null
null
null
pyplottr/__init__.py
toaarnio/pyplottr
6bc811ff5851ae8b6274b2d062449b8cb543356d
[ "Apache-2.0" ]
null
null
null
pyplottr/__init__.py
toaarnio/pyplottr
6bc811ff5851ae8b6274b2d062449b8cb543356d
[ "Apache-2.0" ]
null
null
null
""" https://github.com/toaarnio/pyplottr """ from .pyplottr import Figure, DummyFigure, plot, plot3d __version__ = "0.2.4" __all__ = ["Figure", "DummyFigure", "plot", "plot3d"]
19.888889
55
0.687151
21
179
5.47619
0.761905
0.295652
0.365217
0.469565
0
0
0
0
0
0
0
0.031646
0.117318
179
8
56
22.375
0.696203
0.201117
0
0
0
0
0.237037
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
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
1
0
0
0
0
6
b40fddf8569982281a73a857b38bf2b06dcf7b09
190
py
Python
lib/pymedphys/trf.py
ethanio12345/pymedphys
cb34c992de8d442eced3385018a194364060092d
[ "Apache-2.0" ]
207
2019-01-29T09:53:04.000Z
2022-03-26T10:34:03.000Z
lib/pymedphys/trf.py
ethanio12345/pymedphys
cb34c992de8d442eced3385018a194364060092d
[ "Apache-2.0" ]
1,209
2019-01-29T07:52:27.000Z
2022-03-31T20:11:24.000Z
lib/pymedphys/trf.py
ethanio12345/pymedphys
cb34c992de8d442eced3385018a194364060092d
[ "Apache-2.0" ]
58
2019-03-29T09:06:18.000Z
2022-03-24T07:44:22.000Z
# pylint: disable = unused-import, missing-docstring from pymedphys._trf.decode.trf2pandas import trf2pandas as read from pymedphys._trf.manage.identify import identify_logfile as identify
38
71
0.836842
25
190
6.24
0.64
0.166667
0.205128
0
0
0
0
0
0
0
0
0.011696
0.1
190
4
72
47.5
0.900585
0.263158
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
b4852865debfe5ad46a3216d1c9329ca99b558df
1,860
py
Python
app.py
Abdifatah135/New
588841ae6548a3101184e13cf6b84fde02e1afcd
[ "Unlicense" ]
null
null
null
app.py
Abdifatah135/New
588841ae6548a3101184e13cf6b84fde02e1afcd
[ "Unlicense" ]
1
2021-06-02T00:53:50.000Z
2021-06-02T00:53:50.000Z
app.py
Abdifatah135/New
588841ae6548a3101184e13cf6b84fde02e1afcd
[ "Unlicense" ]
null
null
null
from flask import Flask, render_template from newsapi import NewsApiClient app = Flask(__name__) @app.route('/') def Index(): newsapi = NewsApiClient(api_key="6788abcbf60f48dc9cee181b96f275d3") topheadlines = newsapi.get_top_headlines(sources="al-jazeera-english") articles = topheadlines['articles'] desc = [] news = [] img = [] for i in range(len(articles)): myarticles = articles[i] news.append(myarticles['title']) desc.append(myarticles['description']) img.append(myarticles['urlToImage']) mylist = zip(news, desc, img) return render_template('index.htm', context = mylist) @app.route('/bbc') def bbc(): newsapi = NewsApiClient(api_key="6788abcbf60f48dc9cee181b96f275d3") topheadlines = newsapi.get_top_headlines(sources="bbc-news") articles = topheadlines['articles'] desc = [] news = [] img = [] for i in range(len(articles)): myarticles = articles[i] news.append(myarticles['title']) desc.append(myarticles['description']) img.append(myarticles['urlToImage']) mylist = zip(news, desc, img) return render_template('bbc.htm', context=mylist) @app.route('/Aljzeera') def Aljzeera(): newsapi = NewsApiClient(api_key="6788abcbf60f48dc9cee181b96f275d3") topheadlines = newsapi.get_top_headlines(sources="abc-news") articles = topheadlines['articles'] desc = [] news = [] img = [] for i in range(len(articles)): myarticles = articles[i] news.append(myarticles['title']) desc.append(myarticles['description']) img.append(myarticles['urlToImage']) mylist = zip(news, desc, img) return render_template('Aljzeera.htm', context=mylist) if __name__ == "__main__": app.run(debug=True)
21.37931
74
0.64086
191
1,860
6.109948
0.26178
0.123393
0.059126
0.066838
0.829477
0.788346
0.788346
0.788346
0.788346
0.788346
0
0.037422
0.224194
1,860
87
75
21.37931
0.77131
0
0
0.66
0
0
0.151531
0.051585
0
0
0
0
0
1
0.06
false
0
0.04
0
0.16
0
0
0
0
null
0
0
0
1
1
1
1
1
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
6
81ef953dc4a4920d41aaaccc13b5f11fb975e48c
1,213
py
Python
test/test_unit_construct_hostname.py
Saad-K/snowflake-connector-python
38d123700313690ef65103368007f1cff06d4318
[ "Apache-2.0" ]
1
2020-08-04T08:30:42.000Z
2020-08-04T08:30:42.000Z
test/test_unit_construct_hostname.py
Saad-K/snowflake-connector-python
38d123700313690ef65103368007f1cff06d4318
[ "Apache-2.0" ]
null
null
null
test/test_unit_construct_hostname.py
Saad-K/snowflake-connector-python
38d123700313690ef65103368007f1cff06d4318
[ "Apache-2.0" ]
1
2021-02-09T17:52:35.000Z
2021-02-09T17:52:35.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2012-2019 Snowflake Computing Inc. All right reserved. # from snowflake.connector.util_text import construct_hostname def test_construct_hostname_basic(): assert construct_hostname('eu-central-1', 'account1') == \ 'account1.eu-central-1.snowflakecomputing.com' assert construct_hostname('', 'account1') == \ 'account1.snowflakecomputing.com' assert construct_hostname(None, 'account1') == \ 'account1.snowflakecomputing.com' assert construct_hostname('as-east-3', 'account1') == \ 'account1.as-east-3.snowflakecomputing.com' assert construct_hostname('as-east-3', 'account1.eu-central-1') == \ 'account1.as-east-3.snowflakecomputing.com' assert construct_hostname('', 'account1.eu-central-1') == \ 'account1.eu-central-1.snowflakecomputing.com' assert construct_hostname(None, 'account1.eu-central-1') == \ 'account1.eu-central-1.snowflakecomputing.com' assert construct_hostname(None, 'account1-jkabfvdjisoa778wqfgeruishafeuw89q.global') == \ 'account1-jkabfvdjisoa778wqfgeruishafeuw89q.global.snowflakecomputing.com'
35.676471
93
0.694971
126
1,213
6.587302
0.31746
0.204819
0.221687
0.303614
0.626506
0.614458
0.614458
0.518072
0.518072
0.212048
0
0.045545
0.167354
1,213
33
94
36.757576
0.776238
0.091509
0
0.388889
0
0
0.475843
0.419325
0
0
0
0
0.444444
1
0.055556
true
0
0.055556
0
0.111111
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
1
null
0
0
0
1
0
0
1
0
0
0
0
0
0
6
c306e6b4df050d36627ce3fee7183e2ac27e09e1
47
py
Python
es_stats_zabbix/__init__.py
jameskirsop/es_stats_zabbix
3e56282377332023dbbde4c4df5835acaf603acc
[ "Apache-2.0" ]
13
2015-11-17T17:17:25.000Z
2019-10-11T06:34:42.000Z
es_stats_zabbix/__init__.py
jameskirsop/es_stats_zabbix
3e56282377332023dbbde4c4df5835acaf603acc
[ "Apache-2.0" ]
5
2016-05-03T19:56:13.000Z
2018-10-23T14:03:08.000Z
es_stats_zabbix/__init__.py
jameskirsop/es_stats_zabbix
3e56282377332023dbbde4c4df5835acaf603acc
[ "Apache-2.0" ]
9
2015-11-19T09:05:50.000Z
2019-08-29T11:43:10.000Z
from es_stats_zabbix.version import __version__
47
47
0.914894
7
47
5.285714
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.06383
47
1
47
47
0.840909
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
c3307df2c1d9d0b3b639afb57423b9c3d7c3eb82
104
py
Python
src/datepicker/views.py
uakora/webplugins-bydjango
63d2d6e2a71dd88330fb30dd43df7298c1c8b04b
[ "MIT" ]
null
null
null
src/datepicker/views.py
uakora/webplugins-bydjango
63d2d6e2a71dd88330fb30dd43df7298c1c8b04b
[ "MIT" ]
null
null
null
src/datepicker/views.py
uakora/webplugins-bydjango
63d2d6e2a71dd88330fb30dd43df7298c1c8b04b
[ "MIT" ]
null
null
null
from django.shortcuts import render def learn_my97(request): return render(request, 'my97.html')
14.857143
39
0.75
14
104
5.5
0.785714
0
0
0
0
0
0
0
0
0
0
0.045455
0.153846
104
6
40
17.333333
0.829545
0
0
0
0
0
0.088235
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
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
1
0
0
1
1
1
0
0
6
c3389a7a1b384d46d0eee457b25fd9e526d0a270
8,046
py
Python
mumbleroni/tests/test_settings_datastructure.py
Peter-Morawski/MumbleRoni
b1c6119a91b720f1a04b51d65b337ee94df3a6ac
[ "MIT" ]
1
2021-03-28T17:21:53.000Z
2021-03-28T17:21:53.000Z
mumbleroni/tests/test_settings_datastructure.py
Peter-Morawski/MumbleRoni
b1c6119a91b720f1a04b51d65b337ee94df3a6ac
[ "MIT" ]
null
null
null
mumbleroni/tests/test_settings_datastructure.py
Peter-Morawski/MumbleRoni
b1c6119a91b720f1a04b51d65b337ee94df3a6ac
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import os import unittest from ..settings.datastructure import Settings class SettingsDataStructureTests(unittest.TestCase): def setUp(self): self._host = "example.domain.com" self._port = 1337 self._user = "MumbleRoni" self._password = "123456" self._default_channel_str = "In - Game" self._default_channel_int = 1 self._certificate_path = os.path.curdir def test_parse_from_none(self): with self.assertRaises(ValueError): Settings.from_dict(None) def test_parse_from_empty_dict(self): with self.assertRaises(ValueError): Settings.from_dict({}) def test_parse_from_dict_missing_host(self): settings = { "server": { "username": self._host, } } with self.assertRaises(ValueError): Settings.from_dict(settings) def test_parse_from_dict_empty_host(self): settings = { "server": { "host": "", } } with self.assertRaises(ValueError): Settings.from_dict(settings) def test_parse_from_dict_host_wrong_type(self): settings = { "server": { "host": 123, } } with self.assertRaises(ValueError): Settings.from_dict(settings) def test_parse_from_dict_missing_username(self): settings = { "server": { "host": self._host, } } with self.assertRaises(ValueError): Settings.from_dict(settings) def test_parse_from_dict_empty_username(self): settings = { "server": { "host": self._host, "username": "", } } with self.assertRaises(ValueError): Settings.from_dict(settings) def test_parse_from_dict_username_wrong_type(self): settings = { "server": { "host": self._host, "username": 123, } } with self.assertRaises(ValueError): Settings.from_dict(settings) def test_parse_from_dict_empty_password(self): settings = { "server": { "host": self._host, "username": self._user, "password": "" } } expected = Settings() expected.server.host = self._host expected.server.username = self._user expected.server.password = "" actual = Settings.from_dict(settings) assert expected.server.host == actual.server.host assert expected.server.username == actual.server.username assert expected.server.password == actual.server.password def test_parse_from_dict_password_wrong_type(self): settings = { "server": { "host": self._host, "username": self._user, "password": 123 } } with self.assertRaises(ValueError): Settings.from_dict(settings) def test_parse_from_dict_default_channel_wrong_type(self): settings = { "server": { "host": self._host, "username": self._user, "default_channel": False, } } with self.assertRaises(ValueError): Settings.from_dict(settings) def test_parse_from_dict_default_channel_str(self): settings = { "server": { "host": self._host, "username": self._user, "default_channel": self._default_channel_str, } } expected = Settings() expected.server.host = self._host expected.server.username = self._user expected.server.default_channel = self._default_channel_str actual = Settings.from_dict(settings) assert expected.server.host == actual.server.host assert expected.server.username == actual.server.username assert expected.server.default_channel == actual.server.default_channel def test_parse_from_dict_default_channel_int(self): settings = { "server": { "host": self._host, "username": self._user, "default_channel": self._default_channel_int, } } expected = Settings() expected.server.host = self._host expected.server.username = self._user expected.server.default_channel = self._default_channel_int actual = Settings.from_dict(settings) assert expected.server.host == actual.server.host assert expected.server.username == actual.server.username assert expected.server.default_channel == actual.server.default_channel def test_parse_from_dict_port_wrong_type(self): settings = { "server": { "host": self._host, "username": self._user, "port": "some_port", } } with self.assertRaises(ValueError): Settings.from_dict(settings) def test_parse_from_dict_port_is_none(self): settings = { "server": { "host": self._host, "username": self._user, "port": None, } } with self.assertRaises(ValueError): Settings.from_dict(settings) def test_parse_from_dict_port(self): settings = { "server": { "host": self._host, "username": self._user, "port": self._port, } } expected = Settings() expected.server.host = self._host expected.server.username = self._user expected.server.port = self._port actual = Settings.from_dict(settings) assert expected.server.host == actual.server.host assert expected.server.username == actual.server.username assert expected.server.port == actual.server.port def test_parse_from_dict_certificate_path_wrong_type(self): settings = { "server": { "host": self._host, "username": self._user, "certificate_path": 123, } } with self.assertRaises(ValueError): Settings.from_dict(settings) def test_parse_from_dict_certificate_path_invalid_path(self): settings = { "server": { "host": self._host, "username": self._user, "certificate_path": "invalid", } } with self.assertRaises(ValueError): Settings.from_dict(settings) def test_parse_from_dict_certificate_path_cur_dir(self): settings = { "server": { "host": self._host, "username": self._user, "certificate_path": self._certificate_path, } } expected = Settings() expected.server.host = self._host expected.server.username = self._user expected.server.certificate_path = self._certificate_path actual = Settings.from_dict(settings) assert expected.server.host == actual.server.host assert expected.server.username == actual.server.username assert expected.server.certificate_path == actual.server.certificate_path def test_parse_from_valid_dict_1(self): settings = { "server": { "host": self._host, "username": self._user, } } expected = Settings() expected.server.host = self._host expected.server.username = self._user actual = Settings.from_dict(settings) assert actual.server.host is expected.server.host assert actual.server.username is expected.server.username if __name__ == '__main__': unittest.main()
28.83871
81
0.561646
760
8,046
5.65
0.081579
0.068933
0.068468
0.08803
0.833256
0.816255
0.789008
0.759898
0.736609
0.714951
0
0.004719
0.341536
8,046
278
82
28.942446
0.805776
0.00261
0
0.560538
0
0
0.060327
0
0
0
0
0
0.139013
1
0.09417
false
0.03139
0.013453
0
0.112108
0
0
0
0
null
0
0
0
1
1
1
1
1
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
6
6f07b1e6dd52db107d74ed2e6da84f7edff620de
167
py
Python
entrypoint.py
uosorio/heroku_face
7d6465e71dba17a15d8edaef520adb2fcd09d91e
[ "Apache-2.0" ]
null
null
null
entrypoint.py
uosorio/heroku_face
7d6465e71dba17a15d8edaef520adb2fcd09d91e
[ "Apache-2.0" ]
null
null
null
entrypoint.py
uosorio/heroku_face
7d6465e71dba17a15d8edaef520adb2fcd09d91e
[ "Apache-2.0" ]
null
null
null
import os from flask import send_from_directory from app import create_app settings_module = os.getenv('APP_SETTINGS_MODULE') app = create_app(settings_module)
12.846154
50
0.808383
25
167
5.08
0.44
0.259843
0.401575
0.362205
0
0
0
0
0
0
0
0
0.137725
167
12
51
13.916667
0.881944
0
0
0
0
0
0.115854
0
0
0
0
0
0
1
0
false
0
0.6
0
0.6
0
1
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
1
0
1
0
0
6
6f2fb186d50bbb17dc58de68aad0edd4909659ba
76
py
Python
app/controllers/controller.py
anujaku/is601finalproject
705bf2dbf4ab005079027ca6de5d07af74e9bec3
[ "MIT" ]
null
null
null
app/controllers/controller.py
anujaku/is601finalproject
705bf2dbf4ab005079027ca6de5d07af74e9bec3
[ "MIT" ]
null
null
null
app/controllers/controller.py
anujaku/is601finalproject
705bf2dbf4ab005079027ca6de5d07af74e9bec3
[ "MIT" ]
1
2021-12-12T03:42:23.000Z
2021-12-12T03:42:23.000Z
class ControllerBase: @staticmethod def base(): return True
15.2
21
0.631579
7
76
6.857143
1
0
0
0
0
0
0
0
0
0
0
0
0.302632
76
4
22
19
0.90566
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
true
0
0
0.25
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
1
0
0
1
1
0
0
6
6f69afd5a92c53a2d8157a8bd6b0d7096089bb76
37
py
Python
pywren_ibm_cloud/storage/__init__.py
class-euproject/lithops
acf381817673c29db0e9e143001029357890a39b
[ "Apache-2.0" ]
1
2020-08-04T08:16:31.000Z
2020-08-04T08:16:31.000Z
pywren_ibm_cloud/storage/__init__.py
class-euproject/lithops
acf381817673c29db0e9e143001029357890a39b
[ "Apache-2.0" ]
null
null
null
pywren_ibm_cloud/storage/__init__.py
class-euproject/lithops
acf381817673c29db0e9e143001029357890a39b
[ "Apache-2.0" ]
null
null
null
from .storage import InternalStorage
18.5
36
0.864865
4
37
8
1
0
0
0
0
0
0
0
0
0
0
0
0.108108
37
1
37
37
0.969697
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
48933de2e7aeeb2629f6727e321c749ca7a62c09
1,893
py
Python
utils/data_manager.py
stu1130/deeplearning-benchmark
cdf816f92c9425ef1928f3149eaa544077a0c1b2
[ "Apache-2.0" ]
131
2016-11-30T05:34:28.000Z
2022-01-13T20:33:03.000Z
utils/data_manager.py
stu1130/deeplearning-benchmark
cdf816f92c9425ef1928f3149eaa544077a0c1b2
[ "Apache-2.0" ]
35
2017-04-02T02:12:00.000Z
2020-04-21T22:59:45.000Z
utils/data_manager.py
stu1130/deeplearning-benchmark
cdf816f92c9425ef1928f3149eaa544077a0c1b2
[ "Apache-2.0" ]
102
2016-11-30T05:34:46.000Z
2022-03-10T11:00:00.000Z
import os def getImagenetData(dataset): if dataset == 'imagenet' or dataset == 'imagenet-256px-q90': os.system('mkdir -p data') if not os.path.exists('./data/imagenet1k-train.rec'): os.system("aws s3 cp s3://imagenet-rec/imagenet1k-train.rec data/") if not os.path.exists('./data/imagenet1k-val.rec'): os.system("aws s3 cp s3://imagenet-rec/imagenet1k-val.rec data/") elif dataset == 'imagenet-480px-q95': if not os.path.exists(os.path.expanduser('~/data/train-480px-q95.rec')): os.system("wget -q https://s3.amazonaws.com/aws-ml-platform-datasets/imagenet/480px-q95/train-480px-q95.rec -P ~/data/") if not os.path.exists(os.path.expanduser('~/data/val-256px-q95.rec')): os.system("wget -q https://s3.amazonaws.com/aws-ml-platform-datasets/imagenet/256px-q95/val-256px-q95.rec -P ~/data/") elif dataset == 'imagenet-480px-256px-q95': if not os.path.exists(os.path.expanduser('~/data/train-480px-q95.rec')): os.system("wget -q https://s3.amazonaws.com/aws-ml-platform-datasets/imagenet/480px-q95/train-480px-q95.rec -P ~/data/") if not os.path.exists(os.path.expanduser('~/data/val-256px-q95.rec')): os.system("wget -q https://s3.amazonaws.com/aws-ml-platform-datasets/imagenet/256px-q95/val-256px-q95.rec -P ~/data/") if not os.path.exists(os.path.expanduser('~/data/train-256px-q95.rec')): os.system("wget -q https://s3.amazonaws.com/aws-ml-platform-datasets/imagenet/256px-q95/train-256px-q95.rec -P ~/data/") elif dataset == 'imagenet-ebs': if not os.path.exists(os.path.expanduser('~/data/')): os.system('mkdir -p ~/data/') os.system("aws s3 sync s3://aws-ml-platform-datasets/imagenet/pass-through/ ~/data/ --exclude \"train*\"") else: raise ValueError('Unknown dataset')
65.275862
132
0.643423
280
1,893
4.35
0.160714
0.068966
0.045977
0.07225
0.844828
0.768473
0.768473
0.767652
0.665846
0.635468
0
0.068484
0.166931
1,893
28
133
67.607143
0.703868
0
0
0.307692
0
0.230769
0.545166
0.17327
0
0
0
0
0
1
0.038462
false
0.038462
0.038462
0
0.076923
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
489c483137af9974722b611792d1c872adf443ba
26
py
Python
backend/app/app/api/api_v1/router/home/__init__.py
PY-GZKY/Tplan
9f5335f9a9a28afce608744bebed1d9827068e6d
[ "MIT" ]
121
2021-10-29T20:21:37.000Z
2022-03-21T03:33:52.000Z
backend/app/app/api/api_v1/router/home/__init__.py
GZKY-PY/Tplan
425ca8a497cdb3438bdbf6c72ed8dc234479dd00
[ "MIT" ]
null
null
null
backend/app/app/api/api_v1/router/home/__init__.py
GZKY-PY/Tplan
425ca8a497cdb3438bdbf6c72ed8dc234479dd00
[ "MIT" ]
8
2021-11-06T07:02:11.000Z
2022-02-28T11:53:23.000Z
from .index import router
13
25
0.807692
4
26
5.25
1
0
0
0
0
0
0
0
0
0
0
0
0.153846
26
1
26
26
0.954545
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
48a5d9ae9540d9303d5f469b49fa44fdde50cd0f
18
py
Python
ipa/gui/__init__.py
liepa-project/liepa_ipa
f53e6895df97e8965f59b0a4e0e62704189f1993
[ "BSD-2-Clause" ]
null
null
null
ipa/gui/__init__.py
liepa-project/liepa_ipa
f53e6895df97e8965f59b0a4e0e62704189f1993
[ "BSD-2-Clause" ]
null
null
null
ipa/gui/__init__.py
liepa-project/liepa_ipa
f53e6895df97e8965f59b0a4e0e62704189f1993
[ "BSD-2-Clause" ]
null
null
null
from .ipa import *
18
18
0.722222
3
18
4.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.166667
18
1
18
18
0.866667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
48b09a0e5d57676a5304c1ee9b091d9b884e97f9
330,962
py
Python
steam/protobufs/rendermessages_pb2.py
ivicel/steamkit-python
0a3f250e432cf890965db5e7245841aa512bca22
[ "Apache-2.0" ]
5
2018-11-16T08:59:41.000Z
2021-04-03T05:32:18.000Z
steam/protobufs/rendermessages_pb2.py
ivicel/steamkit-python
0a3f250e432cf890965db5e7245841aa512bca22
[ "Apache-2.0" ]
null
null
null
steam/protobufs/rendermessages_pb2.py
ivicel/steamkit-python
0a3f250e432cf890965db5e7245841aa512bca22
[ "Apache-2.0" ]
null
null
null
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: steam/protobufs/rendermessages.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor.FileDescriptor( name='steam/protobufs/rendermessages.proto', package='', syntax='proto2', serialized_options=_b('H\001\200\001\000'), serialized_pb=_b('\n$steam/protobufs/rendermessages.proto\"\xc8\x01\n\x0e\x43MsgBeginFrame\x12\x18\n\x10\x66rame_paint_time\x18\x01 \x01(\x01\x12\x15\n\rsurface_width\x18\x02 \x01(\r\x12\x16\n\x0esurface_height\x18\x03 \x01(\r\x12\x15\n\rrender_target\x18\x04 \x01(\r\x12\x17\n\x0fui_scale_factor\x18\x05 \x01(\x01\x12\x13\n\x0b\x65mpty_frame\x18\x06 \x01(\x08\x12(\n clear_gpu_resources_before_frame\x18\x07 \x01(\x08\"o\n\x0c\x43MsgEndFrame\x12\x1f\n\x17mouse_cursor_texture_id\x18\x01 \x01(\r\x12\x1e\n\x16mouse_cursor_hotspot_x\x18\x02 \x01(\x02\x12\x1e\n\x16mouse_cursor_hotspot_y\x18\x03 \x01(\x02\"/\n\x13\x43MsgClearBackbuffer\x12\x18\n\x10\x63lear_color_rgba\x18\x01 \x01(\r\",\n\x11\x43MsgDeleteTexture\x12\x17\n\x0ftexture_pointer\x18\x01 \x01(\x04\"%\n\x0f\x43MsgDeletePanel\x12\x12\n\ncontext_id\x18\x01 \x01(\x04\"E\n\x18\x43MsgDeleteParticleSystem\x12\x14\n\x0cpanel_handle\x18\x01 \x01(\x04\x12\x13\n\x0b\x62rush_index\x18\x02 \x01(\r\",\n\tCMsgPoint\x12\t\n\x01x\x18\x01 \x01(\x01\x12\t\n\x01y\x18\x02 \x01(\x01\x12\t\n\x01z\x18\x03 \x01(\x01\"\xdf\x01\n\rCMsgMatrix4x4\x12\x0b\n\x03m00\x18\x01 \x01(\x01\x12\x0b\n\x03m01\x18\x02 \x01(\x01\x12\x0b\n\x03m02\x18\x03 \x01(\x01\x12\x0b\n\x03m03\x18\x04 \x01(\x01\x12\x0b\n\x03m10\x18\x05 \x01(\x01\x12\x0b\n\x03m11\x18\x06 \x01(\x01\x12\x0b\n\x03m12\x18\x07 \x01(\x01\x12\x0b\n\x03m13\x18\x08 \x01(\x01\x12\x0b\n\x03m20\x18\t \x01(\x01\x12\x0b\n\x03m21\x18\n \x01(\x01\x12\x0b\n\x03m22\x18\x0b \x01(\x01\x12\x0b\n\x03m23\x18\x0c \x01(\x01\x12\x0b\n\x03m30\x18\r \x01(\x01\x12\x0b\n\x03m31\x18\x0e \x01(\x01\x12\x0b\n\x03m32\x18\x0f \x01(\x01\x12\x0b\n\x03m33\x18\x10 \x01(\x01\"\x84\x02\n\x0b\x43RadiusData\x12,\n\x08top_left\x18\x01 \x01(\x0b\x32\x1a.CRadiusData.CCornerRadius\x12-\n\ttop_right\x18\x02 \x01(\x0b\x32\x1a.CRadiusData.CCornerRadius\x12\x30\n\x0c\x62ottom_right\x18\x03 \x01(\x0b\x32\x1a.CRadiusData.CCornerRadius\x12/\n\x0b\x62ottom_left\x18\x04 \x01(\x0b\x32\x1a.CRadiusData.CCornerRadius\x1a\x35\n\rCCornerRadius\x12\x12\n\nhorizontal\x18\x01 \x01(\x01\x12\x10\n\x08vertical\x18\x02 \x01(\x01\"\xeb\x01\n\x0b\x43\x42orderData\x12%\n\x03top\x18\x01 \x01(\x0b\x32\x18.CBorderData.CBorderSide\x12\'\n\x05right\x18\x02 \x01(\x0b\x32\x18.CBorderData.CBorderSide\x12(\n\x06\x62ottom\x18\x03 \x01(\x0b\x32\x18.CBorderData.CBorderSide\x12&\n\x04left\x18\x04 \x01(\x0b\x32\x18.CBorderData.CBorderSide\x1a:\n\x0b\x43\x42orderSide\x12\r\n\x05style\x18\x01 \x01(\r\x12\r\n\x05width\x18\x02 \x01(\x01\x12\r\n\x05\x63olor\x18\x03 \x01(\r\"\xb1\x01\n\x0e\x43\x42oxShadowData\x12\r\n\x05inset\x18\x01 \x01(\x08\x12\x19\n\x11horizontal_offset\x18\x02 \x01(\x01\x12\x17\n\x0fvertical_offset\x18\x03 \x01(\x01\x12\x13\n\x0b\x62lur_radius\x18\x04 \x01(\x01\x12\x17\n\x0fspread_distance\x18\x05 \x01(\x01\x12\r\n\x05\x63olor\x18\x06 \x01(\r\x12\x0c\n\x04\x66ill\x18\x07 \x01(\x08\x12\x11\n\tanimating\x18\x08 \x01(\x08\"\x8e\x01\n\x0f\x43TextShadowData\x12\x19\n\x11horizontal_offset\x18\x02 \x01(\x01\x12\x17\n\x0fvertical_offset\x18\x03 \x01(\x01\x12\x13\n\x0b\x62lur_radius\x18\x04 \x01(\x01\x12\r\n\x05\x63olor\x18\x06 \x01(\r\x12\x11\n\tanimating\x18\x08 \x01(\x08\x12\x10\n\x08strength\x18\t \x01(\x01\"`\n\x0f\x43RadialClipData\x12\x10\n\x08\x63\x65nter_x\x18\x01 \x01(\x01\x12\x10\n\x08\x63\x65nter_y\x18\x02 \x01(\x01\x12\x13\n\x0bstart_angle\x18\x03 \x01(\x01\x12\x14\n\x0csector_angle\x18\x04 \x01(\x01\"\x82\x01\n\x0c\x43MsgClipData\x12\x11\n\trect_clip\x18\x01 \x01(\x08\x12\x0c\n\x04left\x18\x02 \x01(\x01\x12\x0b\n\x03top\x18\x03 \x01(\x01\x12\r\n\x05right\x18\x04 \x01(\x01\x12\x0e\n\x06\x62ottom\x18\x05 \x01(\x01\x12%\n\x0bradial_clip\x18\x06 \x01(\x0b\x32\x10.CRadialClipData\"\xe9\r\n\x18\x43MsgPushCompositingLayer\x12\x10\n\x08layer_id\x18\x01 \x01(\x04\x12\r\n\x05width\x18\x02 \x01(\x01\x12\x0e\n\x06height\x18\x03 \x01(\x01\x12\x1d\n\x15layer_quad_top_left_x\x18\x04 \x01(\x01\x12\x1d\n\x15layer_quad_top_left_y\x18\x05 \x01(\x01\x12\x1d\n\x15layer_quad_top_left_z\x18\x06 \x01(\x01\x12\x1e\n\x16layer_quad_top_right_x\x18\x07 \x01(\x01\x12\x1e\n\x16layer_quad_top_right_y\x18\x08 \x01(\x01\x12\x1e\n\x16layer_quad_top_right_z\x18\t \x01(\x01\x12 \n\x18layer_quad_bottom_left_x\x18\n \x01(\x01\x12 \n\x18layer_quad_bottom_left_y\x18\x0b \x01(\x01\x12 \n\x18layer_quad_bottom_left_z\x18\x0c \x01(\x01\x12!\n\x19layer_quad_bottom_right_x\x18\r \x01(\x01\x12!\n\x19layer_quad_bottom_right_y\x18\x0e \x01(\x01\x12!\n\x19layer_quad_bottom_right_z\x18\x0f \x01(\x01\x12\x15\n\rtransform_m00\x18\x10 \x01(\x01\x12\x15\n\rtransform_m01\x18\x11 \x01(\x01\x12\x15\n\rtransform_m02\x18\x12 \x01(\x01\x12\x15\n\rtransform_m03\x18\x13 \x01(\x01\x12\x15\n\rtransform_m10\x18\x14 \x01(\x01\x12\x15\n\rtransform_m11\x18\x15 \x01(\x01\x12\x15\n\rtransform_m12\x18\x16 \x01(\x01\x12\x15\n\rtransform_m13\x18\x17 \x01(\x01\x12\x15\n\rtransform_m20\x18\x18 \x01(\x01\x12\x15\n\rtransform_m21\x18\x19 \x01(\x01\x12\x15\n\rtransform_m22\x18\x1a \x01(\x01\x12\x15\n\rtransform_m23\x18\x1b \x01(\x01\x12\x15\n\rtransform_m30\x18\x1c \x01(\x01\x12\x15\n\rtransform_m31\x18\x1d \x01(\x01\x12\x15\n\rtransform_m32\x18\x1e \x01(\x01\x12\x15\n\rtransform_m33\x18\x1f \x01(\x01\x12\x19\n\x11perspective_depth\x18 \x01(\x01\x12\x0f\n\x07opacity\x18! \x01(\x01\x12\x19\n\x11\x63omposition_color\x18\" \x01(\r\x12\x12\n\nsaturation\x18# \x01(\x01\x12\x11\n\thue_shift\x18$ \x01(\x01\x12\x12\n\nbrightness\x18% \x01(\x01\x12\x10\n\x08\x63ontrast\x18& \x01(\x01\x12\x1f\n\x17opacity_mask_texture_id\x18\' \x01(\r\x12\x1c\n\x14opacity_mask_opacity\x18( \x01(\x01\x12\x1c\n\x06\x62order\x18) \x01(\x0b\x32\x0c.CBorderData\x12#\n\rborder_radius\x18* \x01(\x0b\x32\x0c.CRadiusData\x12#\n\nbox_shadow\x18+ \x01(\x0b\x32\x0f.CBoxShadowData\x12\x1b\n\x13gaussianblur_passes\x18, \x01(\x01\x12\x1e\n\x16gaussianblur_stddevhor\x18- \x01(\x01\x12\x1e\n\x16gaussianblur_stddevver\x18. \x01(\x01\x12\x1a\n\x12scale_2d_factors_x\x18/ \x01(\x01\x12\x1a\n\x12scale_2d_factors_y\x18\x30 \x01(\x01\x12\x11\n\trotate_2d\x18\x31 \x01(\x01\x12\x13\n\x0bneeds_clear\x18\x32 \x01(\x08\x12\x13\n\x0bneeds_depth\x18\x33 \x01(\x08\x12\"\n\x1aneeds_intermediate_texture\x18\x34 \x01(\x08\x12 \n\x18needs_redraw_every_frame\x18\x35 \x01(\x08\x12%\n\x0btext_shadow\x18\x36 \x01(\x0b\x32\x10.CTextShadowData\x12\x16\n\x0emix_blend_mode\x18\x37 \x01(\r\x12\x1a\n\x12occluded_left_edge\x18\x38 \x01(\x01\x12\x19\n\x11occluded_top_edge\x18\x39 \x01(\x01\x12\x1b\n\x13occluded_right_edge\x18: \x01(\x01\x12\x1c\n\x14occluded_bottom_edge\x18; \x01(\x01\x12%\n\x0bradial_clip\x18< \x01(\x0b\x32\x10.CRadialClipData\x12\x1b\n\x13motionblur_velocity\x18= \x01(\x01\x12\x17\n\x0fmotionblur_dirx\x18> \x01(\x01\x12\x17\n\x0fmotionblur_diry\x18? \x01(\x01\x12&\n\x1e\x63omposition_layer_texture_name\x18@ \x01(\t\"\x19\n\x17\x43MsgPopCompositingLayer\",\n\x18\x43MsgFreeCompositingLayer\x12\x10\n\x08layer_id\x18\x01 \x01(\x04\"\xd1\x01\n\x12\x43MsgTransitionData\x12\x12\n\nstart_time\x18\x01 \x01(\x01\x12\x15\n\rdelay_seconds\x18\x02 \x01(\x01\x12\x18\n\x10\x64uration_seconds\x18\x03 \x01(\x01\x12\x16\n\x0btiming_func\x18\x04 \x01(\r:\x01\x30\x12\x16\n\x0e\x63ubic_bezier_0\x18\x05 \x01(\x02\x12\x16\n\x0e\x63ubic_bezier_1\x18\x06 \x01(\x02\x12\x16\n\x0e\x63ubic_bezier_2\x18\x07 \x01(\x02\x12\x16\n\x0e\x63ubic_bezier_3\x18\x08 \x01(\x02\"\x9c\x02\n\x11\x43MsgAnimationData\x12\x12\n\nstart_time\x18\x01 \x01(\x01\x12\x15\n\rdelay_seconds\x18\x02 \x01(\x01\x12\x18\n\x10\x64uration_seconds\x18\x03 \x01(\x01\x12\x13\n\x0btiming_func\x18\x04 \x01(\r\x12\x16\n\x0e\x63ubic_bezier_0\x18\x05 \x01(\x02\x12\x16\n\x0e\x63ubic_bezier_1\x18\x06 \x01(\x02\x12\x16\n\x0e\x63ubic_bezier_2\x18\x07 \x01(\x02\x12\x16\n\x0e\x63ubic_bezier_3\x18\x08 \x01(\x02\x12\x11\n\tdirection\x18\t \x01(\r\x12\x11\n\titeration\x18\n \x01(\x02\x12\'\n\x06\x66rames\x18\x0b \x03(\x0b\x32\x17.CMsgAnimationFrameData\"\xac\x01\n\x16\x43MsgAnimationFrameData\x12\x0f\n\x07percent\x18\x01 \x01(\x02\x12\x16\n\x0btiming_func\x18\x02 \x01(\r:\x01\x30\x12\x16\n\x0e\x63ubic_bezier_0\x18\x03 \x01(\x02\x12\x16\n\x0e\x63ubic_bezier_1\x18\x04 \x01(\x02\x12\x16\n\x0e\x63ubic_bezier_2\x18\x05 \x01(\x02\x12\x16\n\x0e\x63ubic_bezier_3\x18\x06 \x01(\x02*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xd4\x02\n\x17\x43MsgPointWithTransition\x12\x18\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\n.CMsgPoint\x12\x1e\n\ntransition\x18\x02 \x01(\x0b\x32\n.CMsgPoint\x12,\n\x0ftransition_data\x18\x03 \x01(\x0b\x32\x13.CMsgTransitionData\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x1a.\n\x12\x41nimationFrameData\x12\x18\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\n.CMsgPoint2c\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xf4\x07 \x01(\x0b\x32+.CMsgPointWithTransition.AnimationFrameData\"\x94\x02\n\tCMsgColor\x12\x0c\n\x04\x62\x61se\x18\x01 \x01(\r\x12\x12\n\ntransition\x18\x02 \x01(\r\x12,\n\x0ftransition_data\x18\x03 \x01(\x0b\x32\x13.CMsgTransitionData\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x1a\"\n\x12\x41nimationFrameData\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\r2U\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xe9\x07 \x01(\x0b\x32\x1d.CMsgColor.AnimationFrameData\"5\n\rCMsgColorStop\x12\x10\n\x08position\x18\x01 \x01(\x01\x12\x12\n\ncolor_rgba\x18\x02 \x01(\r\"~\n\x12\x43MsgLinearGradient\x12\"\n\x0estart_position\x18\x01 \x01(\x0b\x32\n.CMsgPoint\x12 \n\x0c\x65nd_position\x18\x02 \x01(\x0b\x32\n.CMsgPoint\x12\"\n\ncolor_stop\x18\x03 \x03(\x0b\x32\x0e.CMsgColorStop\"\x9d\x01\n\x12\x43MsgRadialGradient\x12#\n\x0f\x63\x65nter_position\x18\x01 \x01(\x0b\x32\n.CMsgPoint\x12#\n\x0foffset_distance\x18\x02 \x01(\x0b\x32\n.CMsgPoint\x12\x19\n\x05radii\x18\x03 \x01(\x0b\x32\n.CMsgPoint\x12\"\n\ncolor_stop\x18\x04 \x03(\x0b\x32\x0e.CMsgColorStop\"|\n\x0c\x43MsgParticle\x12%\n\x11particle_position\x18\x01 \x01(\x0b\x32\n.CMsgPoint\x12\x15\n\rparticle_size\x18\x02 \x01(\x02\x12\x1a\n\x12particle_sharpness\x18\x03 \x01(\x02\x12\x12\n\ncolor_rgba\x18\x04 \x01(\r\"\xa0\x07\n\x12\x43MsgParticleSystem\x12!\n\rbase_position\x18\x01 \x01(\x0b\x32\n.CMsgPoint\x12*\n\x16\x62\x61se_position_variance\x18\x02 \x01(\x0b\x32\n.CMsgPoint\x12\x15\n\rparticle_size\x18\x03 \x01(\x01\x12\x1e\n\x16particle_size_variance\x18\x04 \x01(\x01\x12\x1c\n\x14particles_per_second\x18\x05 \x01(\x01\x12%\n\x1dparticles_per_second_variance\x18\x06 \x01(\x01\x12!\n\x19particle_lifespan_seconds\x18\x07 \x01(\x01\x12*\n\"particle_lifespan_seconds_variance\x18\x08 \x01(\x01\x12-\n\x19particle_initial_velocity\x18\t \x01(\x0b\x32\n.CMsgPoint\x12\x36\n\"particle_initial_velocity_variance\x18\n \x01(\x0b\x32\n.CMsgPoint\x12(\n\x14gravity_acceleration\x18\x0b \x01(\x0b\x32\n.CMsgPoint\x12:\n&gravity_acceleration_particle_variance\x18\x0c \x01(\x0b\x32\n.CMsgPoint\x12\x18\n\x10\x63olor_start_rgba\x18\r \x01(\r\x12!\n\x19\x63olor_start_rgba_variance\x18\x0e \x01(\r\x12\x16\n\x0e\x63olor_end_rgba\x18\x0f \x01(\r\x12\x1f\n\x17\x63olor_end_rgba_variance\x18\x10 \x01(\r\x12\x1b\n\x13parent_panel_handle\x18\x11 \x01(\x04\x12\x1a\n\x12parent_brush_index\x18\x12 \x01(\r\x12\x1a\n\x12particle_sharpness\x18\x13 \x01(\x02\x12#\n\x1bparticle_sharpness_variance\x18\x14 \x01(\x02\x12\x18\n\x10particle_flicker\x18\x15 \x01(\x02\x12!\n\x19particle_flicker_variance\x18\x16 \x01(\x02\x12)\n\x15particle_velocity_min\x18\x17 \x01(\x0b\x32\n.CMsgPoint\x12)\n\x15particle_velocity_max\x18\x18 \x01(\x0b\x32\n.CMsgPoint\x12 \n\tparticles\x18\x32 \x03(\x0b\x32\r.CMsgParticle\"\xbe\x01\n\rCMsgFillBrush\x12\x0f\n\x07opacity\x18\x01 \x01(\x01\x12\x12\n\ncolor_rgba\x18\x02 \x01(\r\x12,\n\x0flinear_gradient\x18\x03 \x01(\x0b\x32\x13.CMsgLinearGradient\x12,\n\x0fradial_gradient\x18\x04 \x01(\x0b\x32\x13.CMsgRadialGradient\x12,\n\x0fparticle_system\x18\x05 \x01(\x0b\x32\x13.CMsgParticleSystem\"\xe0\x02\n\x17\x43MsgFillBrushCollection\x12\x1c\n\x04\x62\x61se\x18\x01 \x03(\x0b\x32\x0e.CMsgFillBrush\x12\"\n\ntransition\x18\x02 \x03(\x0b\x32\x0e.CMsgFillBrush\x12,\n\x0ftransition_data\x18\x03 \x01(\x0b\x32\x13.CMsgTransitionData\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x1a\x32\n\x12\x41nimationFrameData\x12\x1c\n\x04\x64\x61ta\x18\x01 \x03(\x0b\x32\x0e.CMsgFillBrush2c\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xef\x07 \x01(\x0b\x32+.CMsgFillBrushCollection.AnimationFrameData\"C\n\x1d\x43MsgRenderFillBrushCollection\x12\"\n\nfill_brush\x18\x01 \x03(\x0b\x32\x0e.CMsgFillBrush\"\xf9\x03\n\x11\x43MsgPanelPosition\x12\x18\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\n.CMsgPoint\x12\x1e\n\ntransition\x18\x02 \x01(\x0b\x32\n.CMsgPoint\x12,\n\x0ftransition_data\x18\x03 \x01(\x0b\x32\x13.CMsgTransitionData\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x12!\n\rscroll_offset\x18\x06 \x01(\x0b\x32\n.CMsgPoint\x12(\n\x14scroll_offset_target\x18\x07 \x01(\x0b\x32\n.CMsgPoint\x12\x30\n\x13scroll_transition_x\x18\x08 \x01(\x0b\x32\x13.CMsgTransitionData\x12\x30\n\x13scroll_transition_y\x18\t \x01(\x0b\x32\x13.CMsgTransitionData\x1a.\n\x12\x41nimationFrameData\x12\x18\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\n.CMsgPoint2]\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xf3\x07 \x01(\x0b\x32%.CMsgPanelPosition.AnimationFrameData\"\x98\x02\n\x0b\x43MsgOpacity\x12\x0c\n\x04\x62\x61se\x18\x01 \x01(\x01\x12\x12\n\ntransition\x18\x02 \x01(\x01\x12,\n\x0ftransition_data\x18\x03 \x01(\x0b\x32\x13.CMsgTransitionData\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x1a\"\n\x12\x41nimationFrameData\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x01\x32W\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xec\x07 \x01(\x0b\x32\x1f.CMsgOpacity.AnimationFrameData\"\x9a\x02\n\x0c\x43MsgRotate2D\x12\x0c\n\x04\x62\x61se\x18\x01 \x01(\x01\x12\x12\n\ntransition\x18\x02 \x01(\x01\x12,\n\x0ftransition_data\x18\x03 \x01(\x0b\x32\x13.CMsgTransitionData\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x1a\"\n\x12\x41nimationFrameData\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x01\x32X\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xf6\x07 \x01(\x0b\x32 .CMsgRotate2D.AnimationFrameData\"T\n\x13\x43MsgOpacityMaskData\x12\x1f\n\x17opacity_mask_texture_id\x18\x01 \x01(\r\x12\x1c\n\x14opacity_mask_opacity\x18\x02 \x01(\x01\"\xe2\x02\n\x0f\x43MsgOpacityMask\x12\"\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\x14.CMsgOpacityMaskData\x12(\n\ntransition\x18\x02 \x01(\x0b\x32\x14.CMsgOpacityMaskData\x12,\n\x0ftransition_data\x18\x03 \x01(\x0b\x32\x13.CMsgTransitionData\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x1a\x38\n\x12\x41nimationFrameData\x12\"\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x14.CMsgOpacityMaskData2[\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xf5\x07 \x01(\x0b\x32#.CMsgOpacityMask.AnimationFrameData\"\x9a\x02\n\x0c\x43MsgHueShift\x12\x0c\n\x04\x62\x61se\x18\x01 \x01(\x01\x12\x12\n\ntransition\x18\x02 \x01(\x01\x12,\n\x0ftransition_data\x18\x03 \x01(\x0b\x32\x13.CMsgTransitionData\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x1a\"\n\x12\x41nimationFrameData\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x01\x32X\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xfb\x07 \x01(\x0b\x32 .CMsgHueShift.AnimationFrameData\"\x9e\x02\n\x0e\x43MsgSaturation\x12\x0c\n\x04\x62\x61se\x18\x01 \x01(\x01\x12\x12\n\ntransition\x18\x02 \x01(\x01\x12,\n\x0ftransition_data\x18\x03 \x01(\x0b\x32\x13.CMsgTransitionData\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x1a\"\n\x12\x41nimationFrameData\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x01\x32Z\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xed\x07 \x01(\x0b\x32\".CMsgSaturation.AnimationFrameData\"\x9e\x02\n\x0e\x43MsgBrightness\x12\x0c\n\x04\x62\x61se\x18\x01 \x01(\x01\x12\x12\n\ntransition\x18\x02 \x01(\x01\x12,\n\x0ftransition_data\x18\x03 \x01(\x0b\x32\x13.CMsgTransitionData\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x1a\"\n\x12\x41nimationFrameData\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x01\x32Z\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xfc\x07 \x01(\x0b\x32\".CMsgBrightness.AnimationFrameData\"\x9a\x02\n\x0c\x43MsgContrast\x12\x0c\n\x04\x62\x61se\x18\x01 \x01(\x01\x12\x12\n\ntransition\x18\x02 \x01(\x01\x12,\n\x0ftransition_data\x18\x03 \x01(\x0b\x32\x13.CMsgTransitionData\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x1a\"\n\x12\x41nimationFrameData\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x01\x32X\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xfd\x07 \x01(\x0b\x32 .CMsgContrast.AnimationFrameData\"L\n\x12\x43MsgGaussianValues\x12\x0e\n\x06passes\x18\x01 \x01(\x01\x12\x12\n\nstddev_hor\x18\x02 \x01(\x01\x12\x12\n\nstddev_ver\x18\x03 \x01(\x01\"\xe1\x02\n\x10\x43MsgGaussianBlur\x12!\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\x13.CMsgGaussianValues\x12\'\n\ntransition\x18\x02 \x01(\x0b\x32\x13.CMsgGaussianValues\x12,\n\x0ftransition_data\x18\x03 \x01(\x0b\x32\x13.CMsgTransitionData\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x1a\x37\n\x12\x41nimationFrameData\x12!\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x13.CMsgGaussianValues2\\\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xf0\x07 \x01(\x0b\x32$.CMsgGaussianBlur.AnimationFrameData\"D\n\x14\x43MsgMotionBlurValues\x12\x10\n\x08velocity\x18\x01 \x01(\x01\x12\x0c\n\x04\x64irx\x18\x02 \x01(\x01\x12\x0c\n\x04\x64iry\x18\x03 \x01(\x01\"\xe3\x02\n\x0e\x43MsgMotionBlur\x12#\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\x15.CMsgMotionBlurValues\x12)\n\ntransition\x18\x02 \x01(\x0b\x32\x15.CMsgMotionBlurValues\x12,\n\x0ftransition_data\x18\x03 \x01(\x0b\x32\x13.CMsgTransitionData\x12&\n\nanimations\x18\x04 \x03(\x0b\x32\x12.CMsgAnimationData\x12\x14\n\x0cstyle_symbol\x18\x05 \x01(\r\x1a\x39\n\x12\x41nimationFrameData\x12#\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x15.CMsgMotionBlurValues2Z\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xfe\x07 \x01(\x0b\x32\".CMsgMotionBlur.AnimationFrameData\"\xb6\x02\n\x1a\x43Msg3DTransformPerspective\x12\x0c\n\x04\x62\x61se\x18\x01 \x01(\x01\x12\x12\n\ntransition\x18\x02 \x01(\x01\x12,\n\x0ftransition_data\x18\x03 \x01(\x0b\x32\x13.CMsgTransitionData\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x1a\"\n\x12\x41nimationFrameData\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x01\x32\x66\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xeb\x07 \x01(\x0b\x32..CMsg3DTransformPerspective.AnimationFrameData\"\xe6\x02\n CMsg3DTransformPerspectiveOrigin\x12\x18\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\n.CMsgPoint\x12\x1e\n\ntransition\x18\x02 \x01(\x0b\x32\n.CMsgPoint\x12,\n\x0ftransition_data\x18\x03 \x01(\x0b\x32\x13.CMsgTransitionData\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x1a.\n\x12\x41nimationFrameData\x12\x18\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\n.CMsgPoint2l\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xea\x07 \x01(\x0b\x32\x34.CMsg3DTransformPerspectiveOrigin.AnimationFrameData\"w\n\x17\x43MsgTransformOriginData\x12\t\n\x01x\x18\x01 \x01(\x01\x12\t\n\x01y\x18\x02 \x01(\x01\x12\x14\n\x0cx_is_percent\x18\x03 \x01(\x08\x12\x14\n\x0cy_is_percent\x18\x04 \x01(\x08\x12\x1a\n\x12is_parent_relative\x18\x05 \x01(\x08\"\xfa\x02\n\x15\x43Msg3DTransformOrigin\x12&\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\x18.CMsgTransformOriginData\x12,\n\ntransition\x18\x02 \x01(\x0b\x32\x18.CMsgTransformOriginData\x12,\n\x0ftransition_data\x18\x03 \x01(\x0b\x32\x13.CMsgTransitionData\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x1a<\n\x12\x41nimationFrameData\x12&\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x18.CMsgTransformOriginData2a\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xf7\x07 \x01(\x0b\x32).CMsg3DTransformOrigin.AnimationFrameData\"\xdc\x02\n\x15\x43Msg3DTransformMatrix\x12\x1c\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\x0e.CMsgMatrix4x4\x12,\n\x0ftransition_data\x18\x02 \x01(\x0b\x32\x13.CMsgTransitionData\x12\"\n\ntransition\x18\x03 \x01(\x0b\x32\x0e.CMsgMatrix4x4\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x1a\x32\n\x12\x41nimationFrameData\x12\x1c\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x0e.CMsgMatrix4x42a\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xe8\x07 \x01(\x0b\x32).CMsg3DTransformMatrix.AnimationFrameData\"\xcc\x02\n\x10\x43MsgBorderRadius\x12\x1a\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\x0c.CRadiusData\x12,\n\x0ftransition_data\x18\x02 \x01(\x0b\x32\x13.CMsgTransitionData\x12 \n\ntransition\x18\x03 \x01(\x0b\x32\x0c.CRadiusData\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x1a\x30\n\x12\x41nimationFrameData\x12\x1a\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x0c.CRadiusData2\\\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xee\x07 \x01(\x0b\x32$.CMsgBorderRadius.AnimationFrameData\"\xc0\x02\n\nCMsgBorder\x12\x1a\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\x0c.CBorderData\x12,\n\x0ftransition_data\x18\x02 \x01(\x0b\x32\x13.CMsgTransitionData\x12 \n\ntransition\x18\x03 \x01(\x0b\x32\x0c.CBorderData\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x1a\x30\n\x12\x41nimationFrameData\x12\x1a\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x0c.CBorderData2V\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xf1\x07 \x01(\x0b\x32\x1e.CMsgBorder.AnimationFrameData\"\xcf\x02\n\rCMsgBoxShadow\x12\x1d\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\x0f.CBoxShadowData\x12,\n\x0ftransition_data\x18\x02 \x01(\x0b\x32\x13.CMsgTransitionData\x12#\n\ntransition\x18\x03 \x01(\x0b\x32\x0f.CBoxShadowData\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x1a\x33\n\x12\x41nimationFrameData\x12\x1d\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x0f.CBoxShadowData2Y\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xf2\x07 \x01(\x0b\x32!.CMsgBoxShadow.AnimationFrameData\"\xd4\x02\n\x0e\x43MsgTextShadow\x12\x1e\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\x10.CTextShadowData\x12,\n\x0ftransition_data\x18\x02 \x01(\x0b\x32\x13.CMsgTransitionData\x12$\n\ntransition\x18\x03 \x01(\x0b\x32\x10.CTextShadowData\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x1a\x34\n\x12\x41nimationFrameData\x12\x1e\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x10.CTextShadowData2Z\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xf9\x07 \x01(\x0b\x32\".CMsgTextShadow.AnimationFrameData\"\xbf\x02\n\x08\x43MsgClip\x12\x1b\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\r.CMsgClipData\x12,\n\x0ftransition_data\x18\x02 \x01(\x0b\x32\x13.CMsgTransitionData\x12!\n\ntransition\x18\x03 \x01(\x0b\x32\r.CMsgClipData\x12\x14\n\x0cstyle_symbol\x18\x04 \x01(\r\x12&\n\nanimations\x18\x05 \x03(\x0b\x32\x12.CMsgAnimationData\x1a\x31\n\x12\x41nimationFrameData\x12\x1b\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\r.CMsgClipData2T\n\x14\x61nimation_frame_data\x12\x17.CMsgAnimationFrameData\x18\xfa\x07 \x01(\x0b\x32\x1c.CMsgClip.AnimationFrameData\"x\n\x11\x43MsgPushClipLayer\x12\x1c\n\x08top_left\x18\x01 \x01(\x0b\x32\n.CMsgPoint\x12 \n\x0c\x62ottom_right\x18\x02 \x01(\x0b\x32\n.CMsgPoint\x12#\n\rborder_radius\x18\x03 \x01(\x0b\x32\x0c.CRadiusData\"\x12\n\x10\x43MsgPopClipLayer\"\xcf\x04\n\x1b\x43MsgPushPanelContextInLayer\x12\x15\n\rtransform_m00\x18\x01 \x01(\x01\x12\x15\n\rtransform_m01\x18\x02 \x01(\x01\x12\x15\n\rtransform_m02\x18\x03 \x01(\x01\x12\x15\n\rtransform_m03\x18\x04 \x01(\x01\x12\x15\n\rtransform_m10\x18\x05 \x01(\x01\x12\x15\n\rtransform_m11\x18\x06 \x01(\x01\x12\x15\n\rtransform_m12\x18\x07 \x01(\x01\x12\x15\n\rtransform_m13\x18\x08 \x01(\x01\x12\x15\n\rtransform_m20\x18\t \x01(\x01\x12\x15\n\rtransform_m21\x18\n \x01(\x01\x12\x15\n\rtransform_m22\x18\x0b \x01(\x01\x12\x15\n\rtransform_m23\x18\x0c \x01(\x01\x12\x15\n\rtransform_m30\x18\r \x01(\x01\x12\x15\n\rtransform_m31\x18\x0e \x01(\x01\x12\x15\n\rtransform_m32\x18\x0f \x01(\x01\x12\x15\n\rtransform_m33\x18\x10 \x01(\x01\x12#\n\nbox_shadow\x18\x11 \x01(\x0b\x32\x0f.CBoxShadowData\x12\r\n\x05width\x18\x12 \x01(\x01\x12\x0e\n\x06height\x18\x13 \x01(\x01\x12\x12\n\nposition_x\x18\x14 \x01(\x01\x12\x12\n\nposition_y\x18\x15 \x01(\x01\x12\x12\n\nposition_z\x18\x16 \x01(\x01\x12\x1c\n\x06\x62order\x18\x17 \x01(\x0b\x32\x0c.CBorderData\x12\x10\n\x08scroll_x\x18\x18 \x01(\x01\x12\x10\n\x08scroll_y\x18\x19 \x01(\x01\"\x1c\n\x1a\x43MsgPopPanelContextInLayer\"\xb4\n\n\x14\x43MsgPushAAndTContext\x12\x12\n\ncontext_id\x18\x01 \x01(\x04\x12\r\n\x05width\x18\x03 \x01(\x01\x12\x0e\n\x06height\x18\x04 \x01(\x01\x12!\n\x19\x63hilren_have_3dtransforms\x18\x05 \x01(\x08\x12\x0e\n\x06zindex\x18\x06 \x01(\x02\x12*\n\x0epanel_position\x18\x07 \x01(\x0b\x32\x12.CMsgPanelPosition\x12\x30\n\x10transform_matrix\x18\x08 \x01(\x0b\x32\x16.CMsg3DTransformMatrix\x12\x30\n\x10transform_origin\x18\t \x01(\x0b\x32\x16.CMsg3DTransformOrigin\x12:\n\x15transform_perspective\x18\n \x01(\x0b\x32\x1b.CMsg3DTransformPerspective\x12G\n\x1ctransform_perspective_origin\x18\x0b \x01(\x0b\x32!.CMsg3DTransformPerspectiveOrigin\x12\x1d\n\x07opacity\x18\x0c \x01(\x0b\x32\x0c.CMsgOpacity\x12\x1e\n\nwash_color\x18\r \x01(\x0b\x32\n.CMsgColor\x12 \n\thue_shift\x18\x0e \x01(\x0b\x32\r.CMsgHueShift\x12#\n\nsaturation\x18\x0f \x01(\x0b\x32\x0f.CMsgSaturation\x12#\n\nbrightness\x18\x10 \x01(\x0b\x32\x0f.CMsgBrightness\x12\x1f\n\x08\x63ontrast\x18\x11 \x01(\x0b\x32\r.CMsgContrast\x12&\n\x0copacity_mask\x18\x12 \x01(\x0b\x32\x10.CMsgOpacityMask\x12(\n\rborder_radius\x18\x13 \x01(\x0b\x32\x11.CMsgBorderRadius\x12(\n\rgaussian_blur\x18\x14 \x01(\x0b\x32\x11.CMsgGaussianBlur\x12\x1b\n\x06\x62order\x18\x15 \x01(\x0b\x32\x0b.CMsgBorder\x12\"\n\nbox_shadow\x18\x16 \x01(\x0b\x32\x0e.CMsgBoxShadow\x12\x33\n\x11scale_2d_centered\x18\x17 \x01(\x0b\x32\x18.CMsgPointWithTransition\x12)\n\x12rotate_2d_centered\x18\x18 \x01(\x0b\x32\r.CMsgRotate2D\x12$\n\x0btext_shadow\x18\x19 \x01(\x0b\x32\x0f.CMsgTextShadow\x12\x17\n\x04\x63lip\x18\x1a \x01(\x0b\x32\t.CMsgClip\x12\x1f\n\x17suppress_clip_to_bounds\x18\x1b \x01(\x08\x12\x1a\n\x12needs_full_repaint\x18\x1c \x01(\x05\x12\"\n\x1aneeds_intermediate_texture\x18\x1d \x01(\x08\x12\x1c\n\x14\x63lip_after_transform\x18\x1e \x01(\x08\x12\x16\n\x0ewants_hit_test\x18\x1f \x01(\x08\x12\x1f\n\x17wants_hit_test_children\x18 \x01(\x08\x12\x16\n\x0emix_blend_mode\x18! \x01(\r\x12\x19\n\x11opaque_background\x18\" \x01(\x08\x12\x19\n\x11\x63hild_panel_count\x18# \x01(\r\x12%\n\x1dwants_screenspace_quad_output\x18$ \x01(\x08\x12$\n\x0bmotion_blur\x18% \x01(\x0b\x32\x0f.CMsgMotionBlur\x12&\n\x1e\x63omposition_layer_texture_name\x18& \x01(\t\")\n\x13\x43MsgPopAAndTContext\x12\x12\n\ncontext_id\x18\x01 \x01(\x04\"\x1a\n\x18\x43MsgBeginPaintBackground\"\x18\n\x16\x43MsgEndPaintBackground\"\x14\n\x12\x43MsgBeginPaintLast\"\x12\n\x10\x43MsgEndPaintLast\"\xa3\x01\n\x12\x43MsgDrawFilledRect\x12\x1c\n\x08top_left\x18\x01 \x01(\x0b\x32\n.CMsgPoint\x12 \n\x0c\x62ottom_right\x18\x02 \x01(\x0b\x32\n.CMsgPoint\x12\x37\n\x15\x66ill_brush_collection\x18\x03 \x01(\x0b\x32\x18.CMsgFillBrushCollection\x12\x14\n\x0c\x61ntialiasing\x18\x04 \x01(\r\"\xab\x01\n\x14\x43MsgRenderFilledRect\x12\x1c\n\x08top_left\x18\x01 \x01(\x0b\x32\n.CMsgPoint\x12 \n\x0c\x62ottom_right\x18\x02 \x01(\x0b\x32\n.CMsgPoint\x12=\n\x15\x66ill_brush_collection\x18\x03 \x01(\x0b\x32\x1e.CMsgRenderFillBrushCollection\x12\x14\n\x0c\x61ntialiasing\x18\x04 \x01(\r\"\x9c\x02\n\x14\x43MsgDrawTexturedRect\x12\x1c\n\x08top_left\x18\x01 \x01(\x0b\x32\n.CMsgPoint\x12 \n\x0c\x62ottom_right\x18\x02 \x01(\x0b\x32\n.CMsgPoint\x12\x12\n\ntexture_id\x18\x03 \x01(\r\x12$\n\x10texture_top_left\x18\x04 \x01(\x0b\x32\n.CMsgPoint\x12(\n\x14texture_bottom_right\x18\x05 \x01(\x0b\x32\n.CMsgPoint\x12\x19\n\x0etexture_serial\x18\x06 \x01(\x05:\x01\x30\x12\x1e\n\x13texture_sample_mode\x18\x07 \x01(\r:\x01\x30\x12%\n\x0ftexture_opacity\x18\x08 \x01(\x0b\x32\x0c.CMsgOpacity\"\x93\x02\n\x16\x43MsgRenderTexturedRect\x12\x1c\n\x08top_left\x18\x01 \x01(\x0b\x32\n.CMsgPoint\x12 \n\x0c\x62ottom_right\x18\x02 \x01(\x0b\x32\n.CMsgPoint\x12\x12\n\ntexture_id\x18\x03 \x01(\r\x12$\n\x10texture_top_left\x18\x04 \x01(\x0b\x32\n.CMsgPoint\x12(\n\x14texture_bottom_right\x18\x05 \x01(\x0b\x32\n.CMsgPoint\x12\x19\n\x0etexture_serial\x18\x06 \x01(\x05:\x01\x30\x12\x1e\n\x13texture_sample_mode\x18\x07 \x01(\r:\x01\x30\x12\x1a\n\x0ftexture_opacity\x18\x08 \x01(\x02:\x01\x31\"@\n\x0f\x43MsgLockTexture\x12\x12\n\ntexture_id\x18\x01 \x01(\r\x12\x19\n\x0etexture_serial\x18\x02 \x01(\x05:\x01\x30\"5\n\x14\x43MsgTextInlineObject\x12\r\n\x05width\x18\x01 \x01(\x02\x12\x0e\n\x06height\x18\x02 \x01(\x02\"\x93\x02\n\x0e\x43MsgTextFormat\x12\x11\n\tfont_name\x18\x01 \x01(\t\x12\x11\n\tfont_size\x18\x02 \x01(\x01\x12\x17\n\x0b\x66ont_weight\x18\x03 \x01(\x05:\x02-1\x12\x16\n\nfont_style\x18\x04 \x01(\x05:\x02-1\x12\x11\n\tunderline\x18\x05 \x01(\x08\x12\x15\n\rstrikethrough\x18\x06 \x01(\x08\x12\x37\n\x15\x66ill_brush_collection\x18\x07 \x01(\x0b\x32\x18.CMsgFillBrushCollection\x12\x19\n\x0eletter_spacing\x18\x08 \x01(\x05:\x01\x30\x12,\n\rinline_object\x18\t \x01(\x0b\x32\x15.CMsgTextInlineObject\"^\n\x13\x43MsgTextRangeFormat\x12\x13\n\x0bstart_index\x18\x01 \x01(\r\x12\x11\n\tend_index\x18\x02 \x01(\r\x12\x1f\n\x06\x66ormat\x18\x03 \x01(\x0b\x32\x0f.CMsgTextFormat\"\x9f\x02\n\x14\x43MsgRenderTextFormat\x12\x11\n\tfont_name\x18\x01 \x01(\t\x12\x11\n\tfont_size\x18\x02 \x01(\x01\x12\x17\n\x0b\x66ont_weight\x18\x03 \x01(\x05:\x02-1\x12\x16\n\nfont_style\x18\x04 \x01(\x05:\x02-1\x12\x11\n\tunderline\x18\x05 \x01(\x08\x12\x15\n\rstrikethrough\x18\x06 \x01(\x08\x12=\n\x15\x66ill_brush_collection\x18\x07 \x01(\x0b\x32\x1e.CMsgRenderFillBrushCollection\x12\x19\n\x0eletter_spacing\x18\x08 \x01(\x05:\x01\x30\x12,\n\rinline_object\x18\t \x01(\x0b\x32\x15.CMsgTextInlineObject\"j\n\x19\x43MsgRenderTextRangeFormat\x12\x13\n\x0bstart_index\x18\x01 \x01(\r\x12\x11\n\tend_index\x18\x02 \x01(\r\x12%\n\x06\x66ormat\x18\x03 \x01(\x0b\x32\x15.CMsgRenderTextFormat\"\xb4\x02\n\x12\x43MsgDrawTextRegion\x12\x10\n\x08raw_text\x18\x0b \x01(\x0c\x12\x12\n\ntext_chars\x18\x0c \x01(\x05\x12\x15\n\rtext_encoding\x18\r \x01(\x05\x12\'\n\x0e\x64\x65\x66\x61ult_format\x18\x03 \x01(\x0b\x32\x0f.CMsgTextFormat\x12\x12\n\ntext_align\x18\x04 \x01(\r\x12\x13\n\x0bline_height\x18\x05 \x01(\r\x12\x1c\n\x08top_left\x18\x06 \x01(\x0b\x32\n.CMsgPoint\x12 \n\x0c\x62ottom_right\x18\x07 \x01(\x0b\x32\n.CMsgPoint\x12\x10\n\x08wrapping\x18\x08 \x01(\x08\x12\x10\n\x08\x65llipsis\x18\t \x01(\x08\x12+\n\rrange_formats\x18\n \x03(\x0b\x32\x14.CMsgTextRangeFormat\"\xe9\x02\n\x14\x43MsgRenderTextRegion\x12\x10\n\x08raw_text\x18\x0c \x01(\x0c\x12\x12\n\ntext_chars\x18\r \x01(\x05\x12\x15\n\rtext_encoding\x18\x0e \x01(\x05\x12-\n\x0e\x64\x65\x66\x61ult_format\x18\x03 \x01(\x0b\x32\x15.CMsgRenderTextFormat\x12\x12\n\ntext_align\x18\x04 \x01(\r\x12\x13\n\x0bline_height\x18\x05 \x01(\r\x12\x1c\n\x08top_left\x18\x06 \x01(\x0b\x32\n.CMsgPoint\x12 \n\x0c\x62ottom_right\x18\x07 \x01(\x0b\x32\n.CMsgPoint\x12\x10\n\x08wrapping\x18\x08 \x01(\x08\x12\x10\n\x08\x65llipsis\x18\t \x01(\x08\x12\x31\n\rrange_formats\x18\n \x03(\x0b\x32\x1a.CMsgRenderTextRangeFormat\x12%\n\x0btext_shadow\x18\x0b \x01(\x0b\x32\x10.CTextShadowData\"\xe3\x01\n\x19\x43MsgRequestRenderCallback\x12\x14\n\x0c\x63\x61llback_obj\x18\x01 \x01(\x0c\x12\x1c\n\x08top_left\x18\x02 \x01(\x0b\x32\n.CMsgPoint\x12 \n\x0c\x62ottom_right\x18\x03 \x01(\x0b\x32\n.CMsgPoint\x12$\n\x10top_left_padding\x18\x04 \x01(\x0b\x32\n.CMsgPoint\x12(\n\x14\x62ottom_right_padding\x18\x05 \x01(\x0b\x32\n.CMsgPoint\x12 \n\x18needs_redraw_every_frame\x18\x06 \x01(\x08\x42\x05H\x01\x80\x01\x00') ) _CMSGBEGINFRAME = _descriptor.Descriptor( name='CMsgBeginFrame', full_name='CMsgBeginFrame', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='frame_paint_time', full_name='CMsgBeginFrame.frame_paint_time', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='surface_width', full_name='CMsgBeginFrame.surface_width', index=1, number=2, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='surface_height', full_name='CMsgBeginFrame.surface_height', index=2, number=3, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='render_target', full_name='CMsgBeginFrame.render_target', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ui_scale_factor', full_name='CMsgBeginFrame.ui_scale_factor', index=4, number=5, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='empty_frame', full_name='CMsgBeginFrame.empty_frame', index=5, number=6, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='clear_gpu_resources_before_frame', full_name='CMsgBeginFrame.clear_gpu_resources_before_frame', index=6, number=7, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=41, serialized_end=241, ) _CMSGENDFRAME = _descriptor.Descriptor( name='CMsgEndFrame', full_name='CMsgEndFrame', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='mouse_cursor_texture_id', full_name='CMsgEndFrame.mouse_cursor_texture_id', index=0, number=1, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='mouse_cursor_hotspot_x', full_name='CMsgEndFrame.mouse_cursor_hotspot_x', index=1, number=2, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='mouse_cursor_hotspot_y', full_name='CMsgEndFrame.mouse_cursor_hotspot_y', index=2, number=3, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=243, serialized_end=354, ) _CMSGCLEARBACKBUFFER = _descriptor.Descriptor( name='CMsgClearBackbuffer', full_name='CMsgClearBackbuffer', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='clear_color_rgba', full_name='CMsgClearBackbuffer.clear_color_rgba', index=0, number=1, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=356, serialized_end=403, ) _CMSGDELETETEXTURE = _descriptor.Descriptor( name='CMsgDeleteTexture', full_name='CMsgDeleteTexture', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='texture_pointer', full_name='CMsgDeleteTexture.texture_pointer', index=0, number=1, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=405, serialized_end=449, ) _CMSGDELETEPANEL = _descriptor.Descriptor( name='CMsgDeletePanel', full_name='CMsgDeletePanel', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='context_id', full_name='CMsgDeletePanel.context_id', index=0, number=1, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=451, serialized_end=488, ) _CMSGDELETEPARTICLESYSTEM = _descriptor.Descriptor( name='CMsgDeleteParticleSystem', full_name='CMsgDeleteParticleSystem', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='panel_handle', full_name='CMsgDeleteParticleSystem.panel_handle', index=0, number=1, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='brush_index', full_name='CMsgDeleteParticleSystem.brush_index', index=1, number=2, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=490, serialized_end=559, ) _CMSGPOINT = _descriptor.Descriptor( name='CMsgPoint', full_name='CMsgPoint', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='x', full_name='CMsgPoint.x', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='y', full_name='CMsgPoint.y', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='z', full_name='CMsgPoint.z', index=2, number=3, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=561, serialized_end=605, ) _CMSGMATRIX4X4 = _descriptor.Descriptor( name='CMsgMatrix4x4', full_name='CMsgMatrix4x4', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='m00', full_name='CMsgMatrix4x4.m00', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='m01', full_name='CMsgMatrix4x4.m01', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='m02', full_name='CMsgMatrix4x4.m02', index=2, number=3, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='m03', full_name='CMsgMatrix4x4.m03', index=3, number=4, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='m10', full_name='CMsgMatrix4x4.m10', index=4, number=5, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='m11', full_name='CMsgMatrix4x4.m11', index=5, number=6, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='m12', full_name='CMsgMatrix4x4.m12', index=6, number=7, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='m13', full_name='CMsgMatrix4x4.m13', index=7, number=8, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='m20', full_name='CMsgMatrix4x4.m20', index=8, number=9, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='m21', full_name='CMsgMatrix4x4.m21', index=9, number=10, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='m22', full_name='CMsgMatrix4x4.m22', index=10, number=11, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='m23', full_name='CMsgMatrix4x4.m23', index=11, number=12, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='m30', full_name='CMsgMatrix4x4.m30', index=12, number=13, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='m31', full_name='CMsgMatrix4x4.m31', index=13, number=14, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='m32', full_name='CMsgMatrix4x4.m32', index=14, number=15, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='m33', full_name='CMsgMatrix4x4.m33', index=15, number=16, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=608, serialized_end=831, ) _CRADIUSDATA_CCORNERRADIUS = _descriptor.Descriptor( name='CCornerRadius', full_name='CRadiusData.CCornerRadius', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='horizontal', full_name='CRadiusData.CCornerRadius.horizontal', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='vertical', full_name='CRadiusData.CCornerRadius.vertical', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=1041, serialized_end=1094, ) _CRADIUSDATA = _descriptor.Descriptor( name='CRadiusData', full_name='CRadiusData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='top_left', full_name='CRadiusData.top_left', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='top_right', full_name='CRadiusData.top_right', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='bottom_right', full_name='CRadiusData.bottom_right', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='bottom_left', full_name='CRadiusData.bottom_left', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[_CRADIUSDATA_CCORNERRADIUS, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=834, serialized_end=1094, ) _CBORDERDATA_CBORDERSIDE = _descriptor.Descriptor( name='CBorderSide', full_name='CBorderData.CBorderSide', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='style', full_name='CBorderData.CBorderSide.style', index=0, number=1, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='width', full_name='CBorderData.CBorderSide.width', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='color', full_name='CBorderData.CBorderSide.color', index=2, number=3, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=1274, serialized_end=1332, ) _CBORDERDATA = _descriptor.Descriptor( name='CBorderData', full_name='CBorderData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='top', full_name='CBorderData.top', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='right', full_name='CBorderData.right', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='bottom', full_name='CBorderData.bottom', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='left', full_name='CBorderData.left', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[_CBORDERDATA_CBORDERSIDE, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=1097, serialized_end=1332, ) _CBOXSHADOWDATA = _descriptor.Descriptor( name='CBoxShadowData', full_name='CBoxShadowData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='inset', full_name='CBoxShadowData.inset', index=0, number=1, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='horizontal_offset', full_name='CBoxShadowData.horizontal_offset', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='vertical_offset', full_name='CBoxShadowData.vertical_offset', index=2, number=3, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='blur_radius', full_name='CBoxShadowData.blur_radius', index=3, number=4, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='spread_distance', full_name='CBoxShadowData.spread_distance', index=4, number=5, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='color', full_name='CBoxShadowData.color', index=5, number=6, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='fill', full_name='CBoxShadowData.fill', index=6, number=7, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animating', full_name='CBoxShadowData.animating', index=7, number=8, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=1335, serialized_end=1512, ) _CTEXTSHADOWDATA = _descriptor.Descriptor( name='CTextShadowData', full_name='CTextShadowData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='horizontal_offset', full_name='CTextShadowData.horizontal_offset', index=0, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='vertical_offset', full_name='CTextShadowData.vertical_offset', index=1, number=3, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='blur_radius', full_name='CTextShadowData.blur_radius', index=2, number=4, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='color', full_name='CTextShadowData.color', index=3, number=6, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animating', full_name='CTextShadowData.animating', index=4, number=8, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='strength', full_name='CTextShadowData.strength', index=5, number=9, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=1515, serialized_end=1657, ) _CRADIALCLIPDATA = _descriptor.Descriptor( name='CRadialClipData', full_name='CRadialClipData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='center_x', full_name='CRadialClipData.center_x', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='center_y', full_name='CRadialClipData.center_y', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='start_angle', full_name='CRadialClipData.start_angle', index=2, number=3, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='sector_angle', full_name='CRadialClipData.sector_angle', index=3, number=4, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=1659, serialized_end=1755, ) _CMSGCLIPDATA = _descriptor.Descriptor( name='CMsgClipData', full_name='CMsgClipData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='rect_clip', full_name='CMsgClipData.rect_clip', index=0, number=1, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='left', full_name='CMsgClipData.left', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='top', full_name='CMsgClipData.top', index=2, number=3, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='right', full_name='CMsgClipData.right', index=3, number=4, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='bottom', full_name='CMsgClipData.bottom', index=4, number=5, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='radial_clip', full_name='CMsgClipData.radial_clip', index=5, number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=1758, serialized_end=1888, ) _CMSGPUSHCOMPOSITINGLAYER = _descriptor.Descriptor( name='CMsgPushCompositingLayer', full_name='CMsgPushCompositingLayer', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='layer_id', full_name='CMsgPushCompositingLayer.layer_id', index=0, number=1, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='width', full_name='CMsgPushCompositingLayer.width', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='height', full_name='CMsgPushCompositingLayer.height', index=2, number=3, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='layer_quad_top_left_x', full_name='CMsgPushCompositingLayer.layer_quad_top_left_x', index=3, number=4, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='layer_quad_top_left_y', full_name='CMsgPushCompositingLayer.layer_quad_top_left_y', index=4, number=5, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='layer_quad_top_left_z', full_name='CMsgPushCompositingLayer.layer_quad_top_left_z', index=5, number=6, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='layer_quad_top_right_x', full_name='CMsgPushCompositingLayer.layer_quad_top_right_x', index=6, number=7, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='layer_quad_top_right_y', full_name='CMsgPushCompositingLayer.layer_quad_top_right_y', index=7, number=8, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='layer_quad_top_right_z', full_name='CMsgPushCompositingLayer.layer_quad_top_right_z', index=8, number=9, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='layer_quad_bottom_left_x', full_name='CMsgPushCompositingLayer.layer_quad_bottom_left_x', index=9, number=10, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='layer_quad_bottom_left_y', full_name='CMsgPushCompositingLayer.layer_quad_bottom_left_y', index=10, number=11, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='layer_quad_bottom_left_z', full_name='CMsgPushCompositingLayer.layer_quad_bottom_left_z', index=11, number=12, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='layer_quad_bottom_right_x', full_name='CMsgPushCompositingLayer.layer_quad_bottom_right_x', index=12, number=13, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='layer_quad_bottom_right_y', full_name='CMsgPushCompositingLayer.layer_quad_bottom_right_y', index=13, number=14, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='layer_quad_bottom_right_z', full_name='CMsgPushCompositingLayer.layer_quad_bottom_right_z', index=14, number=15, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m00', full_name='CMsgPushCompositingLayer.transform_m00', index=15, number=16, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m01', full_name='CMsgPushCompositingLayer.transform_m01', index=16, number=17, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m02', full_name='CMsgPushCompositingLayer.transform_m02', index=17, number=18, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m03', full_name='CMsgPushCompositingLayer.transform_m03', index=18, number=19, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m10', full_name='CMsgPushCompositingLayer.transform_m10', index=19, number=20, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m11', full_name='CMsgPushCompositingLayer.transform_m11', index=20, number=21, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m12', full_name='CMsgPushCompositingLayer.transform_m12', index=21, number=22, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m13', full_name='CMsgPushCompositingLayer.transform_m13', index=22, number=23, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m20', full_name='CMsgPushCompositingLayer.transform_m20', index=23, number=24, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m21', full_name='CMsgPushCompositingLayer.transform_m21', index=24, number=25, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m22', full_name='CMsgPushCompositingLayer.transform_m22', index=25, number=26, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m23', full_name='CMsgPushCompositingLayer.transform_m23', index=26, number=27, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m30', full_name='CMsgPushCompositingLayer.transform_m30', index=27, number=28, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m31', full_name='CMsgPushCompositingLayer.transform_m31', index=28, number=29, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m32', full_name='CMsgPushCompositingLayer.transform_m32', index=29, number=30, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m33', full_name='CMsgPushCompositingLayer.transform_m33', index=30, number=31, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='perspective_depth', full_name='CMsgPushCompositingLayer.perspective_depth', index=31, number=32, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='opacity', full_name='CMsgPushCompositingLayer.opacity', index=32, number=33, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='composition_color', full_name='CMsgPushCompositingLayer.composition_color', index=33, number=34, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='saturation', full_name='CMsgPushCompositingLayer.saturation', index=34, number=35, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='hue_shift', full_name='CMsgPushCompositingLayer.hue_shift', index=35, number=36, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='brightness', full_name='CMsgPushCompositingLayer.brightness', index=36, number=37, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='contrast', full_name='CMsgPushCompositingLayer.contrast', index=37, number=38, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='opacity_mask_texture_id', full_name='CMsgPushCompositingLayer.opacity_mask_texture_id', index=38, number=39, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='opacity_mask_opacity', full_name='CMsgPushCompositingLayer.opacity_mask_opacity', index=39, number=40, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='border', full_name='CMsgPushCompositingLayer.border', index=40, number=41, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='border_radius', full_name='CMsgPushCompositingLayer.border_radius', index=41, number=42, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='box_shadow', full_name='CMsgPushCompositingLayer.box_shadow', index=42, number=43, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='gaussianblur_passes', full_name='CMsgPushCompositingLayer.gaussianblur_passes', index=43, number=44, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='gaussianblur_stddevhor', full_name='CMsgPushCompositingLayer.gaussianblur_stddevhor', index=44, number=45, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='gaussianblur_stddevver', full_name='CMsgPushCompositingLayer.gaussianblur_stddevver', index=45, number=46, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='scale_2d_factors_x', full_name='CMsgPushCompositingLayer.scale_2d_factors_x', index=46, number=47, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='scale_2d_factors_y', full_name='CMsgPushCompositingLayer.scale_2d_factors_y', index=47, number=48, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='rotate_2d', full_name='CMsgPushCompositingLayer.rotate_2d', index=48, number=49, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='needs_clear', full_name='CMsgPushCompositingLayer.needs_clear', index=49, number=50, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='needs_depth', full_name='CMsgPushCompositingLayer.needs_depth', index=50, number=51, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='needs_intermediate_texture', full_name='CMsgPushCompositingLayer.needs_intermediate_texture', index=51, number=52, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='needs_redraw_every_frame', full_name='CMsgPushCompositingLayer.needs_redraw_every_frame', index=52, number=53, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='text_shadow', full_name='CMsgPushCompositingLayer.text_shadow', index=53, number=54, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='mix_blend_mode', full_name='CMsgPushCompositingLayer.mix_blend_mode', index=54, number=55, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='occluded_left_edge', full_name='CMsgPushCompositingLayer.occluded_left_edge', index=55, number=56, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='occluded_top_edge', full_name='CMsgPushCompositingLayer.occluded_top_edge', index=56, number=57, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='occluded_right_edge', full_name='CMsgPushCompositingLayer.occluded_right_edge', index=57, number=58, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='occluded_bottom_edge', full_name='CMsgPushCompositingLayer.occluded_bottom_edge', index=58, number=59, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='radial_clip', full_name='CMsgPushCompositingLayer.radial_clip', index=59, number=60, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='motionblur_velocity', full_name='CMsgPushCompositingLayer.motionblur_velocity', index=60, number=61, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='motionblur_dirx', full_name='CMsgPushCompositingLayer.motionblur_dirx', index=61, number=62, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='motionblur_diry', full_name='CMsgPushCompositingLayer.motionblur_diry', index=62, number=63, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='composition_layer_texture_name', full_name='CMsgPushCompositingLayer.composition_layer_texture_name', index=63, number=64, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=1891, serialized_end=3660, ) _CMSGPOPCOMPOSITINGLAYER = _descriptor.Descriptor( name='CMsgPopCompositingLayer', full_name='CMsgPopCompositingLayer', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=3662, serialized_end=3687, ) _CMSGFREECOMPOSITINGLAYER = _descriptor.Descriptor( name='CMsgFreeCompositingLayer', full_name='CMsgFreeCompositingLayer', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='layer_id', full_name='CMsgFreeCompositingLayer.layer_id', index=0, number=1, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=3689, serialized_end=3733, ) _CMSGTRANSITIONDATA = _descriptor.Descriptor( name='CMsgTransitionData', full_name='CMsgTransitionData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='start_time', full_name='CMsgTransitionData.start_time', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='delay_seconds', full_name='CMsgTransitionData.delay_seconds', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='duration_seconds', full_name='CMsgTransitionData.duration_seconds', index=2, number=3, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='timing_func', full_name='CMsgTransitionData.timing_func', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=True, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='cubic_bezier_0', full_name='CMsgTransitionData.cubic_bezier_0', index=4, number=5, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='cubic_bezier_1', full_name='CMsgTransitionData.cubic_bezier_1', index=5, number=6, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='cubic_bezier_2', full_name='CMsgTransitionData.cubic_bezier_2', index=6, number=7, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='cubic_bezier_3', full_name='CMsgTransitionData.cubic_bezier_3', index=7, number=8, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=3736, serialized_end=3945, ) _CMSGANIMATIONDATA = _descriptor.Descriptor( name='CMsgAnimationData', full_name='CMsgAnimationData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='start_time', full_name='CMsgAnimationData.start_time', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='delay_seconds', full_name='CMsgAnimationData.delay_seconds', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='duration_seconds', full_name='CMsgAnimationData.duration_seconds', index=2, number=3, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='timing_func', full_name='CMsgAnimationData.timing_func', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='cubic_bezier_0', full_name='CMsgAnimationData.cubic_bezier_0', index=4, number=5, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='cubic_bezier_1', full_name='CMsgAnimationData.cubic_bezier_1', index=5, number=6, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='cubic_bezier_2', full_name='CMsgAnimationData.cubic_bezier_2', index=6, number=7, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='cubic_bezier_3', full_name='CMsgAnimationData.cubic_bezier_3', index=7, number=8, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='direction', full_name='CMsgAnimationData.direction', index=8, number=9, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='iteration', full_name='CMsgAnimationData.iteration', index=9, number=10, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='frames', full_name='CMsgAnimationData.frames', index=10, number=11, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=3948, serialized_end=4232, ) _CMSGANIMATIONFRAMEDATA = _descriptor.Descriptor( name='CMsgAnimationFrameData', full_name='CMsgAnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='percent', full_name='CMsgAnimationFrameData.percent', index=0, number=1, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='timing_func', full_name='CMsgAnimationFrameData.timing_func', index=1, number=2, type=13, cpp_type=3, label=1, has_default_value=True, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='cubic_bezier_0', full_name='CMsgAnimationFrameData.cubic_bezier_0', index=2, number=3, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='cubic_bezier_1', full_name='CMsgAnimationFrameData.cubic_bezier_1', index=3, number=4, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='cubic_bezier_2', full_name='CMsgAnimationFrameData.cubic_bezier_2', index=4, number=5, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='cubic_bezier_3', full_name='CMsgAnimationFrameData.cubic_bezier_3', index=5, number=6, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=True, syntax='proto2', extension_ranges=[(1000, 536870912), ], oneofs=[ ], serialized_start=4235, serialized_end=4407, ) _CMSGPOINTWITHTRANSITION_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsgPointWithTransition.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsgPointWithTransition.AnimationFrameData.data', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=4603, serialized_end=4649, ) _CMSGPOINTWITHTRANSITION = _descriptor.Descriptor( name='CMsgPointWithTransition', full_name='CMsgPointWithTransition', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsgPointWithTransition.base', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsgPointWithTransition.transition', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsgPointWithTransition.transition_data', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsgPointWithTransition.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsgPointWithTransition.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsgPointWithTransition.animation_frame_data', index=0, number=1012, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSGPOINTWITHTRANSITION_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=4410, serialized_end=4750, ) _CMSGCOLOR_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsgColor.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsgColor.AnimationFrameData.data', index=0, number=1, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=4908, serialized_end=4942, ) _CMSGCOLOR = _descriptor.Descriptor( name='CMsgColor', full_name='CMsgColor', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsgColor.base', index=0, number=1, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsgColor.transition', index=1, number=2, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsgColor.transition_data', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsgColor.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsgColor.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsgColor.animation_frame_data', index=0, number=1001, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSGCOLOR_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=4753, serialized_end=5029, ) _CMSGCOLORSTOP = _descriptor.Descriptor( name='CMsgColorStop', full_name='CMsgColorStop', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='position', full_name='CMsgColorStop.position', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='color_rgba', full_name='CMsgColorStop.color_rgba', index=1, number=2, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=5031, serialized_end=5084, ) _CMSGLINEARGRADIENT = _descriptor.Descriptor( name='CMsgLinearGradient', full_name='CMsgLinearGradient', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='start_position', full_name='CMsgLinearGradient.start_position', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='end_position', full_name='CMsgLinearGradient.end_position', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='color_stop', full_name='CMsgLinearGradient.color_stop', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=5086, serialized_end=5212, ) _CMSGRADIALGRADIENT = _descriptor.Descriptor( name='CMsgRadialGradient', full_name='CMsgRadialGradient', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='center_position', full_name='CMsgRadialGradient.center_position', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='offset_distance', full_name='CMsgRadialGradient.offset_distance', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='radii', full_name='CMsgRadialGradient.radii', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='color_stop', full_name='CMsgRadialGradient.color_stop', index=3, number=4, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=5215, serialized_end=5372, ) _CMSGPARTICLE = _descriptor.Descriptor( name='CMsgParticle', full_name='CMsgParticle', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='particle_position', full_name='CMsgParticle.particle_position', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='particle_size', full_name='CMsgParticle.particle_size', index=1, number=2, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='particle_sharpness', full_name='CMsgParticle.particle_sharpness', index=2, number=3, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='color_rgba', full_name='CMsgParticle.color_rgba', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=5374, serialized_end=5498, ) _CMSGPARTICLESYSTEM = _descriptor.Descriptor( name='CMsgParticleSystem', full_name='CMsgParticleSystem', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base_position', full_name='CMsgParticleSystem.base_position', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='base_position_variance', full_name='CMsgParticleSystem.base_position_variance', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='particle_size', full_name='CMsgParticleSystem.particle_size', index=2, number=3, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='particle_size_variance', full_name='CMsgParticleSystem.particle_size_variance', index=3, number=4, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='particles_per_second', full_name='CMsgParticleSystem.particles_per_second', index=4, number=5, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='particles_per_second_variance', full_name='CMsgParticleSystem.particles_per_second_variance', index=5, number=6, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='particle_lifespan_seconds', full_name='CMsgParticleSystem.particle_lifespan_seconds', index=6, number=7, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='particle_lifespan_seconds_variance', full_name='CMsgParticleSystem.particle_lifespan_seconds_variance', index=7, number=8, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='particle_initial_velocity', full_name='CMsgParticleSystem.particle_initial_velocity', index=8, number=9, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='particle_initial_velocity_variance', full_name='CMsgParticleSystem.particle_initial_velocity_variance', index=9, number=10, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='gravity_acceleration', full_name='CMsgParticleSystem.gravity_acceleration', index=10, number=11, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='gravity_acceleration_particle_variance', full_name='CMsgParticleSystem.gravity_acceleration_particle_variance', index=11, number=12, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='color_start_rgba', full_name='CMsgParticleSystem.color_start_rgba', index=12, number=13, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='color_start_rgba_variance', full_name='CMsgParticleSystem.color_start_rgba_variance', index=13, number=14, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='color_end_rgba', full_name='CMsgParticleSystem.color_end_rgba', index=14, number=15, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='color_end_rgba_variance', full_name='CMsgParticleSystem.color_end_rgba_variance', index=15, number=16, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='parent_panel_handle', full_name='CMsgParticleSystem.parent_panel_handle', index=16, number=17, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='parent_brush_index', full_name='CMsgParticleSystem.parent_brush_index', index=17, number=18, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='particle_sharpness', full_name='CMsgParticleSystem.particle_sharpness', index=18, number=19, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='particle_sharpness_variance', full_name='CMsgParticleSystem.particle_sharpness_variance', index=19, number=20, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='particle_flicker', full_name='CMsgParticleSystem.particle_flicker', index=20, number=21, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='particle_flicker_variance', full_name='CMsgParticleSystem.particle_flicker_variance', index=21, number=22, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='particle_velocity_min', full_name='CMsgParticleSystem.particle_velocity_min', index=22, number=23, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='particle_velocity_max', full_name='CMsgParticleSystem.particle_velocity_max', index=23, number=24, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='particles', full_name='CMsgParticleSystem.particles', index=24, number=50, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=5501, serialized_end=6429, ) _CMSGFILLBRUSH = _descriptor.Descriptor( name='CMsgFillBrush', full_name='CMsgFillBrush', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='opacity', full_name='CMsgFillBrush.opacity', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='color_rgba', full_name='CMsgFillBrush.color_rgba', index=1, number=2, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='linear_gradient', full_name='CMsgFillBrush.linear_gradient', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='radial_gradient', full_name='CMsgFillBrush.radial_gradient', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='particle_system', full_name='CMsgFillBrush.particle_system', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=6432, serialized_end=6622, ) _CMSGFILLBRUSHCOLLECTION_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsgFillBrushCollection.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsgFillBrushCollection.AnimationFrameData.data', index=0, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=6826, serialized_end=6876, ) _CMSGFILLBRUSHCOLLECTION = _descriptor.Descriptor( name='CMsgFillBrushCollection', full_name='CMsgFillBrushCollection', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsgFillBrushCollection.base', index=0, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsgFillBrushCollection.transition', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsgFillBrushCollection.transition_data', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsgFillBrushCollection.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsgFillBrushCollection.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsgFillBrushCollection.animation_frame_data', index=0, number=1007, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSGFILLBRUSHCOLLECTION_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=6625, serialized_end=6977, ) _CMSGRENDERFILLBRUSHCOLLECTION = _descriptor.Descriptor( name='CMsgRenderFillBrushCollection', full_name='CMsgRenderFillBrushCollection', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='fill_brush', full_name='CMsgRenderFillBrushCollection.fill_brush', index=0, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=6979, serialized_end=7046, ) _CMSGPANELPOSITION_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsgPanelPosition.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsgPanelPosition.AnimationFrameData.data', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=4603, serialized_end=4649, ) _CMSGPANELPOSITION = _descriptor.Descriptor( name='CMsgPanelPosition', full_name='CMsgPanelPosition', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsgPanelPosition.base', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsgPanelPosition.transition', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsgPanelPosition.transition_data', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsgPanelPosition.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsgPanelPosition.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='scroll_offset', full_name='CMsgPanelPosition.scroll_offset', index=5, number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='scroll_offset_target', full_name='CMsgPanelPosition.scroll_offset_target', index=6, number=7, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='scroll_transition_x', full_name='CMsgPanelPosition.scroll_transition_x', index=7, number=8, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='scroll_transition_y', full_name='CMsgPanelPosition.scroll_transition_y', index=8, number=9, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsgPanelPosition.animation_frame_data', index=0, number=1011, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSGPANELPOSITION_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=7049, serialized_end=7554, ) _CMSGOPACITY_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsgOpacity.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsgOpacity.AnimationFrameData.data', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=7714, serialized_end=7748, ) _CMSGOPACITY = _descriptor.Descriptor( name='CMsgOpacity', full_name='CMsgOpacity', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsgOpacity.base', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsgOpacity.transition', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsgOpacity.transition_data', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsgOpacity.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsgOpacity.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsgOpacity.animation_frame_data', index=0, number=1004, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSGOPACITY_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=7557, serialized_end=7837, ) _CMSGROTATE2D_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsgRotate2D.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsgRotate2D.AnimationFrameData.data', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=7714, serialized_end=7748, ) _CMSGROTATE2D = _descriptor.Descriptor( name='CMsgRotate2D', full_name='CMsgRotate2D', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsgRotate2D.base', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsgRotate2D.transition', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsgRotate2D.transition_data', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsgRotate2D.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsgRotate2D.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsgRotate2D.animation_frame_data', index=0, number=1014, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSGROTATE2D_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=7840, serialized_end=8122, ) _CMSGOPACITYMASKDATA = _descriptor.Descriptor( name='CMsgOpacityMaskData', full_name='CMsgOpacityMaskData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='opacity_mask_texture_id', full_name='CMsgOpacityMaskData.opacity_mask_texture_id', index=0, number=1, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='opacity_mask_opacity', full_name='CMsgOpacityMaskData.opacity_mask_opacity', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=8124, serialized_end=8208, ) _CMSGOPACITYMASK_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsgOpacityMask.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsgOpacityMask.AnimationFrameData.data', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=8416, serialized_end=8472, ) _CMSGOPACITYMASK = _descriptor.Descriptor( name='CMsgOpacityMask', full_name='CMsgOpacityMask', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsgOpacityMask.base', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsgOpacityMask.transition', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsgOpacityMask.transition_data', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsgOpacityMask.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsgOpacityMask.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsgOpacityMask.animation_frame_data', index=0, number=1013, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSGOPACITYMASK_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=8211, serialized_end=8565, ) _CMSGHUESHIFT_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsgHueShift.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsgHueShift.AnimationFrameData.data', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=7714, serialized_end=7748, ) _CMSGHUESHIFT = _descriptor.Descriptor( name='CMsgHueShift', full_name='CMsgHueShift', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsgHueShift.base', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsgHueShift.transition', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsgHueShift.transition_data', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsgHueShift.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsgHueShift.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsgHueShift.animation_frame_data', index=0, number=1019, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSGHUESHIFT_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=8568, serialized_end=8850, ) _CMSGSATURATION_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsgSaturation.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsgSaturation.AnimationFrameData.data', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=7714, serialized_end=7748, ) _CMSGSATURATION = _descriptor.Descriptor( name='CMsgSaturation', full_name='CMsgSaturation', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsgSaturation.base', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsgSaturation.transition', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsgSaturation.transition_data', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsgSaturation.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsgSaturation.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsgSaturation.animation_frame_data', index=0, number=1005, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSGSATURATION_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=8853, serialized_end=9139, ) _CMSGBRIGHTNESS_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsgBrightness.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsgBrightness.AnimationFrameData.data', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=7714, serialized_end=7748, ) _CMSGBRIGHTNESS = _descriptor.Descriptor( name='CMsgBrightness', full_name='CMsgBrightness', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsgBrightness.base', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsgBrightness.transition', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsgBrightness.transition_data', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsgBrightness.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsgBrightness.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsgBrightness.animation_frame_data', index=0, number=1020, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSGBRIGHTNESS_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=9142, serialized_end=9428, ) _CMSGCONTRAST_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsgContrast.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsgContrast.AnimationFrameData.data', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=7714, serialized_end=7748, ) _CMSGCONTRAST = _descriptor.Descriptor( name='CMsgContrast', full_name='CMsgContrast', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsgContrast.base', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsgContrast.transition', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsgContrast.transition_data', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsgContrast.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsgContrast.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsgContrast.animation_frame_data', index=0, number=1021, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSGCONTRAST_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=9431, serialized_end=9713, ) _CMSGGAUSSIANVALUES = _descriptor.Descriptor( name='CMsgGaussianValues', full_name='CMsgGaussianValues', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='passes', full_name='CMsgGaussianValues.passes', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='stddev_hor', full_name='CMsgGaussianValues.stddev_hor', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='stddev_ver', full_name='CMsgGaussianValues.stddev_ver', index=2, number=3, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=9715, serialized_end=9791, ) _CMSGGAUSSIANBLUR_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsgGaussianBlur.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsgGaussianBlur.AnimationFrameData.data', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=9998, serialized_end=10053, ) _CMSGGAUSSIANBLUR = _descriptor.Descriptor( name='CMsgGaussianBlur', full_name='CMsgGaussianBlur', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsgGaussianBlur.base', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsgGaussianBlur.transition', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsgGaussianBlur.transition_data', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsgGaussianBlur.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsgGaussianBlur.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsgGaussianBlur.animation_frame_data', index=0, number=1008, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSGGAUSSIANBLUR_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=9794, serialized_end=10147, ) _CMSGMOTIONBLURVALUES = _descriptor.Descriptor( name='CMsgMotionBlurValues', full_name='CMsgMotionBlurValues', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='velocity', full_name='CMsgMotionBlurValues.velocity', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='dirx', full_name='CMsgMotionBlurValues.dirx', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='diry', full_name='CMsgMotionBlurValues.diry', index=2, number=3, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=10149, serialized_end=10217, ) _CMSGMOTIONBLUR_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsgMotionBlur.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsgMotionBlur.AnimationFrameData.data', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=10426, serialized_end=10483, ) _CMSGMOTIONBLUR = _descriptor.Descriptor( name='CMsgMotionBlur', full_name='CMsgMotionBlur', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsgMotionBlur.base', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsgMotionBlur.transition', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsgMotionBlur.transition_data', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsgMotionBlur.animations', index=3, number=4, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsgMotionBlur.style_symbol', index=4, number=5, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsgMotionBlur.animation_frame_data', index=0, number=1022, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSGMOTIONBLUR_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=10220, serialized_end=10575, ) _CMSG3DTRANSFORMPERSPECTIVE_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsg3DTransformPerspective.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsg3DTransformPerspective.AnimationFrameData.data', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=7714, serialized_end=7748, ) _CMSG3DTRANSFORMPERSPECTIVE = _descriptor.Descriptor( name='CMsg3DTransformPerspective', full_name='CMsg3DTransformPerspective', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsg3DTransformPerspective.base', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsg3DTransformPerspective.transition', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsg3DTransformPerspective.transition_data', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsg3DTransformPerspective.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsg3DTransformPerspective.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsg3DTransformPerspective.animation_frame_data', index=0, number=1003, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSG3DTRANSFORMPERSPECTIVE_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=10578, serialized_end=10888, ) _CMSG3DTRANSFORMPERSPECTIVEORIGIN_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsg3DTransformPerspectiveOrigin.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsg3DTransformPerspectiveOrigin.AnimationFrameData.data', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=4603, serialized_end=4649, ) _CMSG3DTRANSFORMPERSPECTIVEORIGIN = _descriptor.Descriptor( name='CMsg3DTransformPerspectiveOrigin', full_name='CMsg3DTransformPerspectiveOrigin', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsg3DTransformPerspectiveOrigin.base', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsg3DTransformPerspectiveOrigin.transition', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsg3DTransformPerspectiveOrigin.transition_data', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsg3DTransformPerspectiveOrigin.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsg3DTransformPerspectiveOrigin.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsg3DTransformPerspectiveOrigin.animation_frame_data', index=0, number=1002, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSG3DTRANSFORMPERSPECTIVEORIGIN_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=10891, serialized_end=11249, ) _CMSGTRANSFORMORIGINDATA = _descriptor.Descriptor( name='CMsgTransformOriginData', full_name='CMsgTransformOriginData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='x', full_name='CMsgTransformOriginData.x', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='y', full_name='CMsgTransformOriginData.y', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='x_is_percent', full_name='CMsgTransformOriginData.x_is_percent', index=2, number=3, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='y_is_percent', full_name='CMsgTransformOriginData.y_is_percent', index=3, number=4, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='is_parent_relative', full_name='CMsgTransformOriginData.is_parent_relative', index=4, number=5, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=11251, serialized_end=11370, ) _CMSG3DTRANSFORMORIGIN_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsg3DTransformOrigin.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsg3DTransformOrigin.AnimationFrameData.data', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=11592, serialized_end=11652, ) _CMSG3DTRANSFORMORIGIN = _descriptor.Descriptor( name='CMsg3DTransformOrigin', full_name='CMsg3DTransformOrigin', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsg3DTransformOrigin.base', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsg3DTransformOrigin.transition', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsg3DTransformOrigin.transition_data', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsg3DTransformOrigin.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsg3DTransformOrigin.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsg3DTransformOrigin.animation_frame_data', index=0, number=1015, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSG3DTRANSFORMORIGIN_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=11373, serialized_end=11751, ) _CMSG3DTRANSFORMMATRIX_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsg3DTransformMatrix.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsg3DTransformMatrix.AnimationFrameData.data', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=11953, serialized_end=12003, ) _CMSG3DTRANSFORMMATRIX = _descriptor.Descriptor( name='CMsg3DTransformMatrix', full_name='CMsg3DTransformMatrix', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsg3DTransformMatrix.base', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsg3DTransformMatrix.transition_data', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsg3DTransformMatrix.transition', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsg3DTransformMatrix.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsg3DTransformMatrix.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsg3DTransformMatrix.animation_frame_data', index=0, number=1000, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSG3DTRANSFORMMATRIX_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=11754, serialized_end=12102, ) _CMSGBORDERRADIUS_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsgBorderRadius.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsgBorderRadius.AnimationFrameData.data', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=12295, serialized_end=12343, ) _CMSGBORDERRADIUS = _descriptor.Descriptor( name='CMsgBorderRadius', full_name='CMsgBorderRadius', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsgBorderRadius.base', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsgBorderRadius.transition_data', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsgBorderRadius.transition', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsgBorderRadius.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsgBorderRadius.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsgBorderRadius.animation_frame_data', index=0, number=1006, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSGBORDERRADIUS_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=12105, serialized_end=12437, ) _CMSGBORDER_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsgBorder.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsgBorder.AnimationFrameData.data', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=12624, serialized_end=12672, ) _CMSGBORDER = _descriptor.Descriptor( name='CMsgBorder', full_name='CMsgBorder', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsgBorder.base', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsgBorder.transition_data', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsgBorder.transition', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsgBorder.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsgBorder.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsgBorder.animation_frame_data', index=0, number=1009, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSGBORDER_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=12440, serialized_end=12760, ) _CMSGBOXSHADOW_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsgBoxShadow.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsgBoxShadow.AnimationFrameData.data', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=12956, serialized_end=13007, ) _CMSGBOXSHADOW = _descriptor.Descriptor( name='CMsgBoxShadow', full_name='CMsgBoxShadow', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsgBoxShadow.base', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsgBoxShadow.transition_data', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsgBoxShadow.transition', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsgBoxShadow.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsgBoxShadow.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsgBoxShadow.animation_frame_data', index=0, number=1010, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSGBOXSHADOW_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=12763, serialized_end=13098, ) _CMSGTEXTSHADOW_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsgTextShadow.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsgTextShadow.AnimationFrameData.data', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=13297, serialized_end=13349, ) _CMSGTEXTSHADOW = _descriptor.Descriptor( name='CMsgTextShadow', full_name='CMsgTextShadow', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsgTextShadow.base', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsgTextShadow.transition_data', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsgTextShadow.transition', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsgTextShadow.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsgTextShadow.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsgTextShadow.animation_frame_data', index=0, number=1017, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSGTEXTSHADOW_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=13101, serialized_end=13441, ) _CMSGCLIP_ANIMATIONFRAMEDATA = _descriptor.Descriptor( name='AnimationFrameData', full_name='CMsgClip.AnimationFrameData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='data', full_name='CMsgClip.AnimationFrameData.data', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=13628, serialized_end=13677, ) _CMSGCLIP = _descriptor.Descriptor( name='CMsgClip', full_name='CMsgClip', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='base', full_name='CMsgClip.base', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition_data', full_name='CMsgClip.transition_data', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transition', full_name='CMsgClip.transition', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='style_symbol', full_name='CMsgClip.style_symbol', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='animations', full_name='CMsgClip.animations', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ _descriptor.FieldDescriptor( name='animation_frame_data', full_name='CMsgClip.animation_frame_data', index=0, number=1018, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], nested_types=[_CMSGCLIP_ANIMATIONFRAMEDATA, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=13444, serialized_end=13763, ) _CMSGPUSHCLIPLAYER = _descriptor.Descriptor( name='CMsgPushClipLayer', full_name='CMsgPushClipLayer', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='top_left', full_name='CMsgPushClipLayer.top_left', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='bottom_right', full_name='CMsgPushClipLayer.bottom_right', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='border_radius', full_name='CMsgPushClipLayer.border_radius', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=13765, serialized_end=13885, ) _CMSGPOPCLIPLAYER = _descriptor.Descriptor( name='CMsgPopClipLayer', full_name='CMsgPopClipLayer', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=13887, serialized_end=13905, ) _CMSGPUSHPANELCONTEXTINLAYER = _descriptor.Descriptor( name='CMsgPushPanelContextInLayer', full_name='CMsgPushPanelContextInLayer', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='transform_m00', full_name='CMsgPushPanelContextInLayer.transform_m00', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m01', full_name='CMsgPushPanelContextInLayer.transform_m01', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m02', full_name='CMsgPushPanelContextInLayer.transform_m02', index=2, number=3, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m03', full_name='CMsgPushPanelContextInLayer.transform_m03', index=3, number=4, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m10', full_name='CMsgPushPanelContextInLayer.transform_m10', index=4, number=5, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m11', full_name='CMsgPushPanelContextInLayer.transform_m11', index=5, number=6, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m12', full_name='CMsgPushPanelContextInLayer.transform_m12', index=6, number=7, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m13', full_name='CMsgPushPanelContextInLayer.transform_m13', index=7, number=8, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m20', full_name='CMsgPushPanelContextInLayer.transform_m20', index=8, number=9, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m21', full_name='CMsgPushPanelContextInLayer.transform_m21', index=9, number=10, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m22', full_name='CMsgPushPanelContextInLayer.transform_m22', index=10, number=11, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m23', full_name='CMsgPushPanelContextInLayer.transform_m23', index=11, number=12, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m30', full_name='CMsgPushPanelContextInLayer.transform_m30', index=12, number=13, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m31', full_name='CMsgPushPanelContextInLayer.transform_m31', index=13, number=14, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m32', full_name='CMsgPushPanelContextInLayer.transform_m32', index=14, number=15, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_m33', full_name='CMsgPushPanelContextInLayer.transform_m33', index=15, number=16, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='box_shadow', full_name='CMsgPushPanelContextInLayer.box_shadow', index=16, number=17, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='width', full_name='CMsgPushPanelContextInLayer.width', index=17, number=18, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='height', full_name='CMsgPushPanelContextInLayer.height', index=18, number=19, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='position_x', full_name='CMsgPushPanelContextInLayer.position_x', index=19, number=20, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='position_y', full_name='CMsgPushPanelContextInLayer.position_y', index=20, number=21, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='position_z', full_name='CMsgPushPanelContextInLayer.position_z', index=21, number=22, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='border', full_name='CMsgPushPanelContextInLayer.border', index=22, number=23, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='scroll_x', full_name='CMsgPushPanelContextInLayer.scroll_x', index=23, number=24, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='scroll_y', full_name='CMsgPushPanelContextInLayer.scroll_y', index=24, number=25, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=13908, serialized_end=14499, ) _CMSGPOPPANELCONTEXTINLAYER = _descriptor.Descriptor( name='CMsgPopPanelContextInLayer', full_name='CMsgPopPanelContextInLayer', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=14501, serialized_end=14529, ) _CMSGPUSHAANDTCONTEXT = _descriptor.Descriptor( name='CMsgPushAAndTContext', full_name='CMsgPushAAndTContext', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='context_id', full_name='CMsgPushAAndTContext.context_id', index=0, number=1, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='width', full_name='CMsgPushAAndTContext.width', index=1, number=3, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='height', full_name='CMsgPushAAndTContext.height', index=2, number=4, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='chilren_have_3dtransforms', full_name='CMsgPushAAndTContext.chilren_have_3dtransforms', index=3, number=5, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='zindex', full_name='CMsgPushAAndTContext.zindex', index=4, number=6, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='panel_position', full_name='CMsgPushAAndTContext.panel_position', index=5, number=7, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_matrix', full_name='CMsgPushAAndTContext.transform_matrix', index=6, number=8, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_origin', full_name='CMsgPushAAndTContext.transform_origin', index=7, number=9, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_perspective', full_name='CMsgPushAAndTContext.transform_perspective', index=8, number=10, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='transform_perspective_origin', full_name='CMsgPushAAndTContext.transform_perspective_origin', index=9, number=11, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='opacity', full_name='CMsgPushAAndTContext.opacity', index=10, number=12, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='wash_color', full_name='CMsgPushAAndTContext.wash_color', index=11, number=13, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='hue_shift', full_name='CMsgPushAAndTContext.hue_shift', index=12, number=14, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='saturation', full_name='CMsgPushAAndTContext.saturation', index=13, number=15, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='brightness', full_name='CMsgPushAAndTContext.brightness', index=14, number=16, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='contrast', full_name='CMsgPushAAndTContext.contrast', index=15, number=17, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='opacity_mask', full_name='CMsgPushAAndTContext.opacity_mask', index=16, number=18, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='border_radius', full_name='CMsgPushAAndTContext.border_radius', index=17, number=19, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='gaussian_blur', full_name='CMsgPushAAndTContext.gaussian_blur', index=18, number=20, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='border', full_name='CMsgPushAAndTContext.border', index=19, number=21, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='box_shadow', full_name='CMsgPushAAndTContext.box_shadow', index=20, number=22, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='scale_2d_centered', full_name='CMsgPushAAndTContext.scale_2d_centered', index=21, number=23, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='rotate_2d_centered', full_name='CMsgPushAAndTContext.rotate_2d_centered', index=22, number=24, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='text_shadow', full_name='CMsgPushAAndTContext.text_shadow', index=23, number=25, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='clip', full_name='CMsgPushAAndTContext.clip', index=24, number=26, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='suppress_clip_to_bounds', full_name='CMsgPushAAndTContext.suppress_clip_to_bounds', index=25, number=27, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='needs_full_repaint', full_name='CMsgPushAAndTContext.needs_full_repaint', index=26, number=28, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='needs_intermediate_texture', full_name='CMsgPushAAndTContext.needs_intermediate_texture', index=27, number=29, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='clip_after_transform', full_name='CMsgPushAAndTContext.clip_after_transform', index=28, number=30, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='wants_hit_test', full_name='CMsgPushAAndTContext.wants_hit_test', index=29, number=31, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='wants_hit_test_children', full_name='CMsgPushAAndTContext.wants_hit_test_children', index=30, number=32, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='mix_blend_mode', full_name='CMsgPushAAndTContext.mix_blend_mode', index=31, number=33, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='opaque_background', full_name='CMsgPushAAndTContext.opaque_background', index=32, number=34, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='child_panel_count', full_name='CMsgPushAAndTContext.child_panel_count', index=33, number=35, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='wants_screenspace_quad_output', full_name='CMsgPushAAndTContext.wants_screenspace_quad_output', index=34, number=36, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='motion_blur', full_name='CMsgPushAAndTContext.motion_blur', index=35, number=37, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='composition_layer_texture_name', full_name='CMsgPushAAndTContext.composition_layer_texture_name', index=36, number=38, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=14532, serialized_end=15864, ) _CMSGPOPAANDTCONTEXT = _descriptor.Descriptor( name='CMsgPopAAndTContext', full_name='CMsgPopAAndTContext', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='context_id', full_name='CMsgPopAAndTContext.context_id', index=0, number=1, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=15866, serialized_end=15907, ) _CMSGBEGINPAINTBACKGROUND = _descriptor.Descriptor( name='CMsgBeginPaintBackground', full_name='CMsgBeginPaintBackground', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=15909, serialized_end=15935, ) _CMSGENDPAINTBACKGROUND = _descriptor.Descriptor( name='CMsgEndPaintBackground', full_name='CMsgEndPaintBackground', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=15937, serialized_end=15961, ) _CMSGBEGINPAINTLAST = _descriptor.Descriptor( name='CMsgBeginPaintLast', full_name='CMsgBeginPaintLast', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=15963, serialized_end=15983, ) _CMSGENDPAINTLAST = _descriptor.Descriptor( name='CMsgEndPaintLast', full_name='CMsgEndPaintLast', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=15985, serialized_end=16003, ) _CMSGDRAWFILLEDRECT = _descriptor.Descriptor( name='CMsgDrawFilledRect', full_name='CMsgDrawFilledRect', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='top_left', full_name='CMsgDrawFilledRect.top_left', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='bottom_right', full_name='CMsgDrawFilledRect.bottom_right', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='fill_brush_collection', full_name='CMsgDrawFilledRect.fill_brush_collection', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='antialiasing', full_name='CMsgDrawFilledRect.antialiasing', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=16006, serialized_end=16169, ) _CMSGRENDERFILLEDRECT = _descriptor.Descriptor( name='CMsgRenderFilledRect', full_name='CMsgRenderFilledRect', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='top_left', full_name='CMsgRenderFilledRect.top_left', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='bottom_right', full_name='CMsgRenderFilledRect.bottom_right', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='fill_brush_collection', full_name='CMsgRenderFilledRect.fill_brush_collection', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='antialiasing', full_name='CMsgRenderFilledRect.antialiasing', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=16172, serialized_end=16343, ) _CMSGDRAWTEXTUREDRECT = _descriptor.Descriptor( name='CMsgDrawTexturedRect', full_name='CMsgDrawTexturedRect', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='top_left', full_name='CMsgDrawTexturedRect.top_left', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='bottom_right', full_name='CMsgDrawTexturedRect.bottom_right', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='texture_id', full_name='CMsgDrawTexturedRect.texture_id', index=2, number=3, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='texture_top_left', full_name='CMsgDrawTexturedRect.texture_top_left', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='texture_bottom_right', full_name='CMsgDrawTexturedRect.texture_bottom_right', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='texture_serial', full_name='CMsgDrawTexturedRect.texture_serial', index=5, number=6, type=5, cpp_type=1, label=1, has_default_value=True, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='texture_sample_mode', full_name='CMsgDrawTexturedRect.texture_sample_mode', index=6, number=7, type=13, cpp_type=3, label=1, has_default_value=True, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='texture_opacity', full_name='CMsgDrawTexturedRect.texture_opacity', index=7, number=8, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=16346, serialized_end=16630, ) _CMSGRENDERTEXTUREDRECT = _descriptor.Descriptor( name='CMsgRenderTexturedRect', full_name='CMsgRenderTexturedRect', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='top_left', full_name='CMsgRenderTexturedRect.top_left', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='bottom_right', full_name='CMsgRenderTexturedRect.bottom_right', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='texture_id', full_name='CMsgRenderTexturedRect.texture_id', index=2, number=3, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='texture_top_left', full_name='CMsgRenderTexturedRect.texture_top_left', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='texture_bottom_right', full_name='CMsgRenderTexturedRect.texture_bottom_right', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='texture_serial', full_name='CMsgRenderTexturedRect.texture_serial', index=5, number=6, type=5, cpp_type=1, label=1, has_default_value=True, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='texture_sample_mode', full_name='CMsgRenderTexturedRect.texture_sample_mode', index=6, number=7, type=13, cpp_type=3, label=1, has_default_value=True, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='texture_opacity', full_name='CMsgRenderTexturedRect.texture_opacity', index=7, number=8, type=2, cpp_type=6, label=1, has_default_value=True, default_value=float(1), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=16633, serialized_end=16908, ) _CMSGLOCKTEXTURE = _descriptor.Descriptor( name='CMsgLockTexture', full_name='CMsgLockTexture', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='texture_id', full_name='CMsgLockTexture.texture_id', index=0, number=1, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='texture_serial', full_name='CMsgLockTexture.texture_serial', index=1, number=2, type=5, cpp_type=1, label=1, has_default_value=True, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=16910, serialized_end=16974, ) _CMSGTEXTINLINEOBJECT = _descriptor.Descriptor( name='CMsgTextInlineObject', full_name='CMsgTextInlineObject', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='width', full_name='CMsgTextInlineObject.width', index=0, number=1, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='height', full_name='CMsgTextInlineObject.height', index=1, number=2, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=16976, serialized_end=17029, ) _CMSGTEXTFORMAT = _descriptor.Descriptor( name='CMsgTextFormat', full_name='CMsgTextFormat', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='font_name', full_name='CMsgTextFormat.font_name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='font_size', full_name='CMsgTextFormat.font_size', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='font_weight', full_name='CMsgTextFormat.font_weight', index=2, number=3, type=5, cpp_type=1, label=1, has_default_value=True, default_value=-1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='font_style', full_name='CMsgTextFormat.font_style', index=3, number=4, type=5, cpp_type=1, label=1, has_default_value=True, default_value=-1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='underline', full_name='CMsgTextFormat.underline', index=4, number=5, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='strikethrough', full_name='CMsgTextFormat.strikethrough', index=5, number=6, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='fill_brush_collection', full_name='CMsgTextFormat.fill_brush_collection', index=6, number=7, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='letter_spacing', full_name='CMsgTextFormat.letter_spacing', index=7, number=8, type=5, cpp_type=1, label=1, has_default_value=True, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='inline_object', full_name='CMsgTextFormat.inline_object', index=8, number=9, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=17032, serialized_end=17307, ) _CMSGTEXTRANGEFORMAT = _descriptor.Descriptor( name='CMsgTextRangeFormat', full_name='CMsgTextRangeFormat', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='start_index', full_name='CMsgTextRangeFormat.start_index', index=0, number=1, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='end_index', full_name='CMsgTextRangeFormat.end_index', index=1, number=2, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='format', full_name='CMsgTextRangeFormat.format', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=17309, serialized_end=17403, ) _CMSGRENDERTEXTFORMAT = _descriptor.Descriptor( name='CMsgRenderTextFormat', full_name='CMsgRenderTextFormat', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='font_name', full_name='CMsgRenderTextFormat.font_name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='font_size', full_name='CMsgRenderTextFormat.font_size', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='font_weight', full_name='CMsgRenderTextFormat.font_weight', index=2, number=3, type=5, cpp_type=1, label=1, has_default_value=True, default_value=-1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='font_style', full_name='CMsgRenderTextFormat.font_style', index=3, number=4, type=5, cpp_type=1, label=1, has_default_value=True, default_value=-1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='underline', full_name='CMsgRenderTextFormat.underline', index=4, number=5, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='strikethrough', full_name='CMsgRenderTextFormat.strikethrough', index=5, number=6, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='fill_brush_collection', full_name='CMsgRenderTextFormat.fill_brush_collection', index=6, number=7, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='letter_spacing', full_name='CMsgRenderTextFormat.letter_spacing', index=7, number=8, type=5, cpp_type=1, label=1, has_default_value=True, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='inline_object', full_name='CMsgRenderTextFormat.inline_object', index=8, number=9, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=17406, serialized_end=17693, ) _CMSGRENDERTEXTRANGEFORMAT = _descriptor.Descriptor( name='CMsgRenderTextRangeFormat', full_name='CMsgRenderTextRangeFormat', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='start_index', full_name='CMsgRenderTextRangeFormat.start_index', index=0, number=1, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='end_index', full_name='CMsgRenderTextRangeFormat.end_index', index=1, number=2, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='format', full_name='CMsgRenderTextRangeFormat.format', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=17695, serialized_end=17801, ) _CMSGDRAWTEXTREGION = _descriptor.Descriptor( name='CMsgDrawTextRegion', full_name='CMsgDrawTextRegion', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='raw_text', full_name='CMsgDrawTextRegion.raw_text', index=0, number=11, type=12, cpp_type=9, label=1, has_default_value=False, default_value=_b(""), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='text_chars', full_name='CMsgDrawTextRegion.text_chars', index=1, number=12, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='text_encoding', full_name='CMsgDrawTextRegion.text_encoding', index=2, number=13, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='default_format', full_name='CMsgDrawTextRegion.default_format', index=3, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='text_align', full_name='CMsgDrawTextRegion.text_align', index=4, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='line_height', full_name='CMsgDrawTextRegion.line_height', index=5, number=5, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='top_left', full_name='CMsgDrawTextRegion.top_left', index=6, number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='bottom_right', full_name='CMsgDrawTextRegion.bottom_right', index=7, number=7, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='wrapping', full_name='CMsgDrawTextRegion.wrapping', index=8, number=8, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ellipsis', full_name='CMsgDrawTextRegion.ellipsis', index=9, number=9, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='range_formats', full_name='CMsgDrawTextRegion.range_formats', index=10, number=10, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=17804, serialized_end=18112, ) _CMSGRENDERTEXTREGION = _descriptor.Descriptor( name='CMsgRenderTextRegion', full_name='CMsgRenderTextRegion', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='raw_text', full_name='CMsgRenderTextRegion.raw_text', index=0, number=12, type=12, cpp_type=9, label=1, has_default_value=False, default_value=_b(""), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='text_chars', full_name='CMsgRenderTextRegion.text_chars', index=1, number=13, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='text_encoding', full_name='CMsgRenderTextRegion.text_encoding', index=2, number=14, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='default_format', full_name='CMsgRenderTextRegion.default_format', index=3, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='text_align', full_name='CMsgRenderTextRegion.text_align', index=4, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='line_height', full_name='CMsgRenderTextRegion.line_height', index=5, number=5, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='top_left', full_name='CMsgRenderTextRegion.top_left', index=6, number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='bottom_right', full_name='CMsgRenderTextRegion.bottom_right', index=7, number=7, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='wrapping', full_name='CMsgRenderTextRegion.wrapping', index=8, number=8, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ellipsis', full_name='CMsgRenderTextRegion.ellipsis', index=9, number=9, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='range_formats', full_name='CMsgRenderTextRegion.range_formats', index=10, number=10, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='text_shadow', full_name='CMsgRenderTextRegion.text_shadow', index=11, number=11, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=18115, serialized_end=18476, ) _CMSGREQUESTRENDERCALLBACK = _descriptor.Descriptor( name='CMsgRequestRenderCallback', full_name='CMsgRequestRenderCallback', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='callback_obj', full_name='CMsgRequestRenderCallback.callback_obj', index=0, number=1, type=12, cpp_type=9, label=1, has_default_value=False, default_value=_b(""), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='top_left', full_name='CMsgRequestRenderCallback.top_left', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='bottom_right', full_name='CMsgRequestRenderCallback.bottom_right', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='top_left_padding', full_name='CMsgRequestRenderCallback.top_left_padding', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='bottom_right_padding', full_name='CMsgRequestRenderCallback.bottom_right_padding', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='needs_redraw_every_frame', full_name='CMsgRequestRenderCallback.needs_redraw_every_frame', index=5, number=6, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=18479, serialized_end=18706, ) _CRADIUSDATA_CCORNERRADIUS.containing_type = _CRADIUSDATA _CRADIUSDATA.fields_by_name['top_left'].message_type = _CRADIUSDATA_CCORNERRADIUS _CRADIUSDATA.fields_by_name['top_right'].message_type = _CRADIUSDATA_CCORNERRADIUS _CRADIUSDATA.fields_by_name['bottom_right'].message_type = _CRADIUSDATA_CCORNERRADIUS _CRADIUSDATA.fields_by_name['bottom_left'].message_type = _CRADIUSDATA_CCORNERRADIUS _CBORDERDATA_CBORDERSIDE.containing_type = _CBORDERDATA _CBORDERDATA.fields_by_name['top'].message_type = _CBORDERDATA_CBORDERSIDE _CBORDERDATA.fields_by_name['right'].message_type = _CBORDERDATA_CBORDERSIDE _CBORDERDATA.fields_by_name['bottom'].message_type = _CBORDERDATA_CBORDERSIDE _CBORDERDATA.fields_by_name['left'].message_type = _CBORDERDATA_CBORDERSIDE _CMSGCLIPDATA.fields_by_name['radial_clip'].message_type = _CRADIALCLIPDATA _CMSGPUSHCOMPOSITINGLAYER.fields_by_name['border'].message_type = _CBORDERDATA _CMSGPUSHCOMPOSITINGLAYER.fields_by_name['border_radius'].message_type = _CRADIUSDATA _CMSGPUSHCOMPOSITINGLAYER.fields_by_name['box_shadow'].message_type = _CBOXSHADOWDATA _CMSGPUSHCOMPOSITINGLAYER.fields_by_name['text_shadow'].message_type = _CTEXTSHADOWDATA _CMSGPUSHCOMPOSITINGLAYER.fields_by_name['radial_clip'].message_type = _CRADIALCLIPDATA _CMSGANIMATIONDATA.fields_by_name['frames'].message_type = _CMSGANIMATIONFRAMEDATA _CMSGPOINTWITHTRANSITION_ANIMATIONFRAMEDATA.fields_by_name['data'].message_type = _CMSGPOINT _CMSGPOINTWITHTRANSITION_ANIMATIONFRAMEDATA.containing_type = _CMSGPOINTWITHTRANSITION _CMSGPOINTWITHTRANSITION.fields_by_name['base'].message_type = _CMSGPOINT _CMSGPOINTWITHTRANSITION.fields_by_name['transition'].message_type = _CMSGPOINT _CMSGPOINTWITHTRANSITION.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSGPOINTWITHTRANSITION.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSGCOLOR_ANIMATIONFRAMEDATA.containing_type = _CMSGCOLOR _CMSGCOLOR.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSGCOLOR.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSGLINEARGRADIENT.fields_by_name['start_position'].message_type = _CMSGPOINT _CMSGLINEARGRADIENT.fields_by_name['end_position'].message_type = _CMSGPOINT _CMSGLINEARGRADIENT.fields_by_name['color_stop'].message_type = _CMSGCOLORSTOP _CMSGRADIALGRADIENT.fields_by_name['center_position'].message_type = _CMSGPOINT _CMSGRADIALGRADIENT.fields_by_name['offset_distance'].message_type = _CMSGPOINT _CMSGRADIALGRADIENT.fields_by_name['radii'].message_type = _CMSGPOINT _CMSGRADIALGRADIENT.fields_by_name['color_stop'].message_type = _CMSGCOLORSTOP _CMSGPARTICLE.fields_by_name['particle_position'].message_type = _CMSGPOINT _CMSGPARTICLESYSTEM.fields_by_name['base_position'].message_type = _CMSGPOINT _CMSGPARTICLESYSTEM.fields_by_name['base_position_variance'].message_type = _CMSGPOINT _CMSGPARTICLESYSTEM.fields_by_name['particle_initial_velocity'].message_type = _CMSGPOINT _CMSGPARTICLESYSTEM.fields_by_name['particle_initial_velocity_variance'].message_type = _CMSGPOINT _CMSGPARTICLESYSTEM.fields_by_name['gravity_acceleration'].message_type = _CMSGPOINT _CMSGPARTICLESYSTEM.fields_by_name['gravity_acceleration_particle_variance'].message_type = _CMSGPOINT _CMSGPARTICLESYSTEM.fields_by_name['particle_velocity_min'].message_type = _CMSGPOINT _CMSGPARTICLESYSTEM.fields_by_name['particle_velocity_max'].message_type = _CMSGPOINT _CMSGPARTICLESYSTEM.fields_by_name['particles'].message_type = _CMSGPARTICLE _CMSGFILLBRUSH.fields_by_name['linear_gradient'].message_type = _CMSGLINEARGRADIENT _CMSGFILLBRUSH.fields_by_name['radial_gradient'].message_type = _CMSGRADIALGRADIENT _CMSGFILLBRUSH.fields_by_name['particle_system'].message_type = _CMSGPARTICLESYSTEM _CMSGFILLBRUSHCOLLECTION_ANIMATIONFRAMEDATA.fields_by_name['data'].message_type = _CMSGFILLBRUSH _CMSGFILLBRUSHCOLLECTION_ANIMATIONFRAMEDATA.containing_type = _CMSGFILLBRUSHCOLLECTION _CMSGFILLBRUSHCOLLECTION.fields_by_name['base'].message_type = _CMSGFILLBRUSH _CMSGFILLBRUSHCOLLECTION.fields_by_name['transition'].message_type = _CMSGFILLBRUSH _CMSGFILLBRUSHCOLLECTION.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSGFILLBRUSHCOLLECTION.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSGRENDERFILLBRUSHCOLLECTION.fields_by_name['fill_brush'].message_type = _CMSGFILLBRUSH _CMSGPANELPOSITION_ANIMATIONFRAMEDATA.fields_by_name['data'].message_type = _CMSGPOINT _CMSGPANELPOSITION_ANIMATIONFRAMEDATA.containing_type = _CMSGPANELPOSITION _CMSGPANELPOSITION.fields_by_name['base'].message_type = _CMSGPOINT _CMSGPANELPOSITION.fields_by_name['transition'].message_type = _CMSGPOINT _CMSGPANELPOSITION.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSGPANELPOSITION.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSGPANELPOSITION.fields_by_name['scroll_offset'].message_type = _CMSGPOINT _CMSGPANELPOSITION.fields_by_name['scroll_offset_target'].message_type = _CMSGPOINT _CMSGPANELPOSITION.fields_by_name['scroll_transition_x'].message_type = _CMSGTRANSITIONDATA _CMSGPANELPOSITION.fields_by_name['scroll_transition_y'].message_type = _CMSGTRANSITIONDATA _CMSGOPACITY_ANIMATIONFRAMEDATA.containing_type = _CMSGOPACITY _CMSGOPACITY.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSGOPACITY.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSGROTATE2D_ANIMATIONFRAMEDATA.containing_type = _CMSGROTATE2D _CMSGROTATE2D.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSGROTATE2D.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSGOPACITYMASK_ANIMATIONFRAMEDATA.fields_by_name['data'].message_type = _CMSGOPACITYMASKDATA _CMSGOPACITYMASK_ANIMATIONFRAMEDATA.containing_type = _CMSGOPACITYMASK _CMSGOPACITYMASK.fields_by_name['base'].message_type = _CMSGOPACITYMASKDATA _CMSGOPACITYMASK.fields_by_name['transition'].message_type = _CMSGOPACITYMASKDATA _CMSGOPACITYMASK.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSGOPACITYMASK.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSGHUESHIFT_ANIMATIONFRAMEDATA.containing_type = _CMSGHUESHIFT _CMSGHUESHIFT.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSGHUESHIFT.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSGSATURATION_ANIMATIONFRAMEDATA.containing_type = _CMSGSATURATION _CMSGSATURATION.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSGSATURATION.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSGBRIGHTNESS_ANIMATIONFRAMEDATA.containing_type = _CMSGBRIGHTNESS _CMSGBRIGHTNESS.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSGBRIGHTNESS.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSGCONTRAST_ANIMATIONFRAMEDATA.containing_type = _CMSGCONTRAST _CMSGCONTRAST.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSGCONTRAST.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSGGAUSSIANBLUR_ANIMATIONFRAMEDATA.fields_by_name['data'].message_type = _CMSGGAUSSIANVALUES _CMSGGAUSSIANBLUR_ANIMATIONFRAMEDATA.containing_type = _CMSGGAUSSIANBLUR _CMSGGAUSSIANBLUR.fields_by_name['base'].message_type = _CMSGGAUSSIANVALUES _CMSGGAUSSIANBLUR.fields_by_name['transition'].message_type = _CMSGGAUSSIANVALUES _CMSGGAUSSIANBLUR.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSGGAUSSIANBLUR.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSGMOTIONBLUR_ANIMATIONFRAMEDATA.fields_by_name['data'].message_type = _CMSGMOTIONBLURVALUES _CMSGMOTIONBLUR_ANIMATIONFRAMEDATA.containing_type = _CMSGMOTIONBLUR _CMSGMOTIONBLUR.fields_by_name['base'].message_type = _CMSGMOTIONBLURVALUES _CMSGMOTIONBLUR.fields_by_name['transition'].message_type = _CMSGMOTIONBLURVALUES _CMSGMOTIONBLUR.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSGMOTIONBLUR.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSG3DTRANSFORMPERSPECTIVE_ANIMATIONFRAMEDATA.containing_type = _CMSG3DTRANSFORMPERSPECTIVE _CMSG3DTRANSFORMPERSPECTIVE.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSG3DTRANSFORMPERSPECTIVE.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSG3DTRANSFORMPERSPECTIVEORIGIN_ANIMATIONFRAMEDATA.fields_by_name['data'].message_type = _CMSGPOINT _CMSG3DTRANSFORMPERSPECTIVEORIGIN_ANIMATIONFRAMEDATA.containing_type = _CMSG3DTRANSFORMPERSPECTIVEORIGIN _CMSG3DTRANSFORMPERSPECTIVEORIGIN.fields_by_name['base'].message_type = _CMSGPOINT _CMSG3DTRANSFORMPERSPECTIVEORIGIN.fields_by_name['transition'].message_type = _CMSGPOINT _CMSG3DTRANSFORMPERSPECTIVEORIGIN.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSG3DTRANSFORMPERSPECTIVEORIGIN.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSG3DTRANSFORMORIGIN_ANIMATIONFRAMEDATA.fields_by_name['data'].message_type = _CMSGTRANSFORMORIGINDATA _CMSG3DTRANSFORMORIGIN_ANIMATIONFRAMEDATA.containing_type = _CMSG3DTRANSFORMORIGIN _CMSG3DTRANSFORMORIGIN.fields_by_name['base'].message_type = _CMSGTRANSFORMORIGINDATA _CMSG3DTRANSFORMORIGIN.fields_by_name['transition'].message_type = _CMSGTRANSFORMORIGINDATA _CMSG3DTRANSFORMORIGIN.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSG3DTRANSFORMORIGIN.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSG3DTRANSFORMMATRIX_ANIMATIONFRAMEDATA.fields_by_name['data'].message_type = _CMSGMATRIX4X4 _CMSG3DTRANSFORMMATRIX_ANIMATIONFRAMEDATA.containing_type = _CMSG3DTRANSFORMMATRIX _CMSG3DTRANSFORMMATRIX.fields_by_name['base'].message_type = _CMSGMATRIX4X4 _CMSG3DTRANSFORMMATRIX.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSG3DTRANSFORMMATRIX.fields_by_name['transition'].message_type = _CMSGMATRIX4X4 _CMSG3DTRANSFORMMATRIX.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSGBORDERRADIUS_ANIMATIONFRAMEDATA.fields_by_name['data'].message_type = _CRADIUSDATA _CMSGBORDERRADIUS_ANIMATIONFRAMEDATA.containing_type = _CMSGBORDERRADIUS _CMSGBORDERRADIUS.fields_by_name['base'].message_type = _CRADIUSDATA _CMSGBORDERRADIUS.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSGBORDERRADIUS.fields_by_name['transition'].message_type = _CRADIUSDATA _CMSGBORDERRADIUS.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSGBORDER_ANIMATIONFRAMEDATA.fields_by_name['data'].message_type = _CBORDERDATA _CMSGBORDER_ANIMATIONFRAMEDATA.containing_type = _CMSGBORDER _CMSGBORDER.fields_by_name['base'].message_type = _CBORDERDATA _CMSGBORDER.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSGBORDER.fields_by_name['transition'].message_type = _CBORDERDATA _CMSGBORDER.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSGBOXSHADOW_ANIMATIONFRAMEDATA.fields_by_name['data'].message_type = _CBOXSHADOWDATA _CMSGBOXSHADOW_ANIMATIONFRAMEDATA.containing_type = _CMSGBOXSHADOW _CMSGBOXSHADOW.fields_by_name['base'].message_type = _CBOXSHADOWDATA _CMSGBOXSHADOW.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSGBOXSHADOW.fields_by_name['transition'].message_type = _CBOXSHADOWDATA _CMSGBOXSHADOW.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSGTEXTSHADOW_ANIMATIONFRAMEDATA.fields_by_name['data'].message_type = _CTEXTSHADOWDATA _CMSGTEXTSHADOW_ANIMATIONFRAMEDATA.containing_type = _CMSGTEXTSHADOW _CMSGTEXTSHADOW.fields_by_name['base'].message_type = _CTEXTSHADOWDATA _CMSGTEXTSHADOW.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSGTEXTSHADOW.fields_by_name['transition'].message_type = _CTEXTSHADOWDATA _CMSGTEXTSHADOW.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSGCLIP_ANIMATIONFRAMEDATA.fields_by_name['data'].message_type = _CMSGCLIPDATA _CMSGCLIP_ANIMATIONFRAMEDATA.containing_type = _CMSGCLIP _CMSGCLIP.fields_by_name['base'].message_type = _CMSGCLIPDATA _CMSGCLIP.fields_by_name['transition_data'].message_type = _CMSGTRANSITIONDATA _CMSGCLIP.fields_by_name['transition'].message_type = _CMSGCLIPDATA _CMSGCLIP.fields_by_name['animations'].message_type = _CMSGANIMATIONDATA _CMSGPUSHCLIPLAYER.fields_by_name['top_left'].message_type = _CMSGPOINT _CMSGPUSHCLIPLAYER.fields_by_name['bottom_right'].message_type = _CMSGPOINT _CMSGPUSHCLIPLAYER.fields_by_name['border_radius'].message_type = _CRADIUSDATA _CMSGPUSHPANELCONTEXTINLAYER.fields_by_name['box_shadow'].message_type = _CBOXSHADOWDATA _CMSGPUSHPANELCONTEXTINLAYER.fields_by_name['border'].message_type = _CBORDERDATA _CMSGPUSHAANDTCONTEXT.fields_by_name['panel_position'].message_type = _CMSGPANELPOSITION _CMSGPUSHAANDTCONTEXT.fields_by_name['transform_matrix'].message_type = _CMSG3DTRANSFORMMATRIX _CMSGPUSHAANDTCONTEXT.fields_by_name['transform_origin'].message_type = _CMSG3DTRANSFORMORIGIN _CMSGPUSHAANDTCONTEXT.fields_by_name['transform_perspective'].message_type = _CMSG3DTRANSFORMPERSPECTIVE _CMSGPUSHAANDTCONTEXT.fields_by_name['transform_perspective_origin'].message_type = _CMSG3DTRANSFORMPERSPECTIVEORIGIN _CMSGPUSHAANDTCONTEXT.fields_by_name['opacity'].message_type = _CMSGOPACITY _CMSGPUSHAANDTCONTEXT.fields_by_name['wash_color'].message_type = _CMSGCOLOR _CMSGPUSHAANDTCONTEXT.fields_by_name['hue_shift'].message_type = _CMSGHUESHIFT _CMSGPUSHAANDTCONTEXT.fields_by_name['saturation'].message_type = _CMSGSATURATION _CMSGPUSHAANDTCONTEXT.fields_by_name['brightness'].message_type = _CMSGBRIGHTNESS _CMSGPUSHAANDTCONTEXT.fields_by_name['contrast'].message_type = _CMSGCONTRAST _CMSGPUSHAANDTCONTEXT.fields_by_name['opacity_mask'].message_type = _CMSGOPACITYMASK _CMSGPUSHAANDTCONTEXT.fields_by_name['border_radius'].message_type = _CMSGBORDERRADIUS _CMSGPUSHAANDTCONTEXT.fields_by_name['gaussian_blur'].message_type = _CMSGGAUSSIANBLUR _CMSGPUSHAANDTCONTEXT.fields_by_name['border'].message_type = _CMSGBORDER _CMSGPUSHAANDTCONTEXT.fields_by_name['box_shadow'].message_type = _CMSGBOXSHADOW _CMSGPUSHAANDTCONTEXT.fields_by_name['scale_2d_centered'].message_type = _CMSGPOINTWITHTRANSITION _CMSGPUSHAANDTCONTEXT.fields_by_name['rotate_2d_centered'].message_type = _CMSGROTATE2D _CMSGPUSHAANDTCONTEXT.fields_by_name['text_shadow'].message_type = _CMSGTEXTSHADOW _CMSGPUSHAANDTCONTEXT.fields_by_name['clip'].message_type = _CMSGCLIP _CMSGPUSHAANDTCONTEXT.fields_by_name['motion_blur'].message_type = _CMSGMOTIONBLUR _CMSGDRAWFILLEDRECT.fields_by_name['top_left'].message_type = _CMSGPOINT _CMSGDRAWFILLEDRECT.fields_by_name['bottom_right'].message_type = _CMSGPOINT _CMSGDRAWFILLEDRECT.fields_by_name['fill_brush_collection'].message_type = _CMSGFILLBRUSHCOLLECTION _CMSGRENDERFILLEDRECT.fields_by_name['top_left'].message_type = _CMSGPOINT _CMSGRENDERFILLEDRECT.fields_by_name['bottom_right'].message_type = _CMSGPOINT _CMSGRENDERFILLEDRECT.fields_by_name['fill_brush_collection'].message_type = _CMSGRENDERFILLBRUSHCOLLECTION _CMSGDRAWTEXTUREDRECT.fields_by_name['top_left'].message_type = _CMSGPOINT _CMSGDRAWTEXTUREDRECT.fields_by_name['bottom_right'].message_type = _CMSGPOINT _CMSGDRAWTEXTUREDRECT.fields_by_name['texture_top_left'].message_type = _CMSGPOINT _CMSGDRAWTEXTUREDRECT.fields_by_name['texture_bottom_right'].message_type = _CMSGPOINT _CMSGDRAWTEXTUREDRECT.fields_by_name['texture_opacity'].message_type = _CMSGOPACITY _CMSGRENDERTEXTUREDRECT.fields_by_name['top_left'].message_type = _CMSGPOINT _CMSGRENDERTEXTUREDRECT.fields_by_name['bottom_right'].message_type = _CMSGPOINT _CMSGRENDERTEXTUREDRECT.fields_by_name['texture_top_left'].message_type = _CMSGPOINT _CMSGRENDERTEXTUREDRECT.fields_by_name['texture_bottom_right'].message_type = _CMSGPOINT _CMSGTEXTFORMAT.fields_by_name['fill_brush_collection'].message_type = _CMSGFILLBRUSHCOLLECTION _CMSGTEXTFORMAT.fields_by_name['inline_object'].message_type = _CMSGTEXTINLINEOBJECT _CMSGTEXTRANGEFORMAT.fields_by_name['format'].message_type = _CMSGTEXTFORMAT _CMSGRENDERTEXTFORMAT.fields_by_name['fill_brush_collection'].message_type = _CMSGRENDERFILLBRUSHCOLLECTION _CMSGRENDERTEXTFORMAT.fields_by_name['inline_object'].message_type = _CMSGTEXTINLINEOBJECT _CMSGRENDERTEXTRANGEFORMAT.fields_by_name['format'].message_type = _CMSGRENDERTEXTFORMAT _CMSGDRAWTEXTREGION.fields_by_name['default_format'].message_type = _CMSGTEXTFORMAT _CMSGDRAWTEXTREGION.fields_by_name['top_left'].message_type = _CMSGPOINT _CMSGDRAWTEXTREGION.fields_by_name['bottom_right'].message_type = _CMSGPOINT _CMSGDRAWTEXTREGION.fields_by_name['range_formats'].message_type = _CMSGTEXTRANGEFORMAT _CMSGRENDERTEXTREGION.fields_by_name['default_format'].message_type = _CMSGRENDERTEXTFORMAT _CMSGRENDERTEXTREGION.fields_by_name['top_left'].message_type = _CMSGPOINT _CMSGRENDERTEXTREGION.fields_by_name['bottom_right'].message_type = _CMSGPOINT _CMSGRENDERTEXTREGION.fields_by_name['range_formats'].message_type = _CMSGRENDERTEXTRANGEFORMAT _CMSGRENDERTEXTREGION.fields_by_name['text_shadow'].message_type = _CTEXTSHADOWDATA _CMSGREQUESTRENDERCALLBACK.fields_by_name['top_left'].message_type = _CMSGPOINT _CMSGREQUESTRENDERCALLBACK.fields_by_name['bottom_right'].message_type = _CMSGPOINT _CMSGREQUESTRENDERCALLBACK.fields_by_name['top_left_padding'].message_type = _CMSGPOINT _CMSGREQUESTRENDERCALLBACK.fields_by_name['bottom_right_padding'].message_type = _CMSGPOINT DESCRIPTOR.message_types_by_name['CMsgBeginFrame'] = _CMSGBEGINFRAME DESCRIPTOR.message_types_by_name['CMsgEndFrame'] = _CMSGENDFRAME DESCRIPTOR.message_types_by_name['CMsgClearBackbuffer'] = _CMSGCLEARBACKBUFFER DESCRIPTOR.message_types_by_name['CMsgDeleteTexture'] = _CMSGDELETETEXTURE DESCRIPTOR.message_types_by_name['CMsgDeletePanel'] = _CMSGDELETEPANEL DESCRIPTOR.message_types_by_name['CMsgDeleteParticleSystem'] = _CMSGDELETEPARTICLESYSTEM DESCRIPTOR.message_types_by_name['CMsgPoint'] = _CMSGPOINT DESCRIPTOR.message_types_by_name['CMsgMatrix4x4'] = _CMSGMATRIX4X4 DESCRIPTOR.message_types_by_name['CRadiusData'] = _CRADIUSDATA DESCRIPTOR.message_types_by_name['CBorderData'] = _CBORDERDATA DESCRIPTOR.message_types_by_name['CBoxShadowData'] = _CBOXSHADOWDATA DESCRIPTOR.message_types_by_name['CTextShadowData'] = _CTEXTSHADOWDATA DESCRIPTOR.message_types_by_name['CRadialClipData'] = _CRADIALCLIPDATA DESCRIPTOR.message_types_by_name['CMsgClipData'] = _CMSGCLIPDATA DESCRIPTOR.message_types_by_name['CMsgPushCompositingLayer'] = _CMSGPUSHCOMPOSITINGLAYER DESCRIPTOR.message_types_by_name['CMsgPopCompositingLayer'] = _CMSGPOPCOMPOSITINGLAYER DESCRIPTOR.message_types_by_name['CMsgFreeCompositingLayer'] = _CMSGFREECOMPOSITINGLAYER DESCRIPTOR.message_types_by_name['CMsgTransitionData'] = _CMSGTRANSITIONDATA DESCRIPTOR.message_types_by_name['CMsgAnimationData'] = _CMSGANIMATIONDATA DESCRIPTOR.message_types_by_name['CMsgAnimationFrameData'] = _CMSGANIMATIONFRAMEDATA DESCRIPTOR.message_types_by_name['CMsgPointWithTransition'] = _CMSGPOINTWITHTRANSITION DESCRIPTOR.message_types_by_name['CMsgColor'] = _CMSGCOLOR DESCRIPTOR.message_types_by_name['CMsgColorStop'] = _CMSGCOLORSTOP DESCRIPTOR.message_types_by_name['CMsgLinearGradient'] = _CMSGLINEARGRADIENT DESCRIPTOR.message_types_by_name['CMsgRadialGradient'] = _CMSGRADIALGRADIENT DESCRIPTOR.message_types_by_name['CMsgParticle'] = _CMSGPARTICLE DESCRIPTOR.message_types_by_name['CMsgParticleSystem'] = _CMSGPARTICLESYSTEM DESCRIPTOR.message_types_by_name['CMsgFillBrush'] = _CMSGFILLBRUSH DESCRIPTOR.message_types_by_name['CMsgFillBrushCollection'] = _CMSGFILLBRUSHCOLLECTION DESCRIPTOR.message_types_by_name['CMsgRenderFillBrushCollection'] = _CMSGRENDERFILLBRUSHCOLLECTION DESCRIPTOR.message_types_by_name['CMsgPanelPosition'] = _CMSGPANELPOSITION DESCRIPTOR.message_types_by_name['CMsgOpacity'] = _CMSGOPACITY DESCRIPTOR.message_types_by_name['CMsgRotate2D'] = _CMSGROTATE2D DESCRIPTOR.message_types_by_name['CMsgOpacityMaskData'] = _CMSGOPACITYMASKDATA DESCRIPTOR.message_types_by_name['CMsgOpacityMask'] = _CMSGOPACITYMASK DESCRIPTOR.message_types_by_name['CMsgHueShift'] = _CMSGHUESHIFT DESCRIPTOR.message_types_by_name['CMsgSaturation'] = _CMSGSATURATION DESCRIPTOR.message_types_by_name['CMsgBrightness'] = _CMSGBRIGHTNESS DESCRIPTOR.message_types_by_name['CMsgContrast'] = _CMSGCONTRAST DESCRIPTOR.message_types_by_name['CMsgGaussianValues'] = _CMSGGAUSSIANVALUES DESCRIPTOR.message_types_by_name['CMsgGaussianBlur'] = _CMSGGAUSSIANBLUR DESCRIPTOR.message_types_by_name['CMsgMotionBlurValues'] = _CMSGMOTIONBLURVALUES DESCRIPTOR.message_types_by_name['CMsgMotionBlur'] = _CMSGMOTIONBLUR DESCRIPTOR.message_types_by_name['CMsg3DTransformPerspective'] = _CMSG3DTRANSFORMPERSPECTIVE DESCRIPTOR.message_types_by_name['CMsg3DTransformPerspectiveOrigin'] = _CMSG3DTRANSFORMPERSPECTIVEORIGIN DESCRIPTOR.message_types_by_name['CMsgTransformOriginData'] = _CMSGTRANSFORMORIGINDATA DESCRIPTOR.message_types_by_name['CMsg3DTransformOrigin'] = _CMSG3DTRANSFORMORIGIN DESCRIPTOR.message_types_by_name['CMsg3DTransformMatrix'] = _CMSG3DTRANSFORMMATRIX DESCRIPTOR.message_types_by_name['CMsgBorderRadius'] = _CMSGBORDERRADIUS DESCRIPTOR.message_types_by_name['CMsgBorder'] = _CMSGBORDER DESCRIPTOR.message_types_by_name['CMsgBoxShadow'] = _CMSGBOXSHADOW DESCRIPTOR.message_types_by_name['CMsgTextShadow'] = _CMSGTEXTSHADOW DESCRIPTOR.message_types_by_name['CMsgClip'] = _CMSGCLIP DESCRIPTOR.message_types_by_name['CMsgPushClipLayer'] = _CMSGPUSHCLIPLAYER DESCRIPTOR.message_types_by_name['CMsgPopClipLayer'] = _CMSGPOPCLIPLAYER DESCRIPTOR.message_types_by_name['CMsgPushPanelContextInLayer'] = _CMSGPUSHPANELCONTEXTINLAYER DESCRIPTOR.message_types_by_name['CMsgPopPanelContextInLayer'] = _CMSGPOPPANELCONTEXTINLAYER DESCRIPTOR.message_types_by_name['CMsgPushAAndTContext'] = _CMSGPUSHAANDTCONTEXT DESCRIPTOR.message_types_by_name['CMsgPopAAndTContext'] = _CMSGPOPAANDTCONTEXT DESCRIPTOR.message_types_by_name['CMsgBeginPaintBackground'] = _CMSGBEGINPAINTBACKGROUND DESCRIPTOR.message_types_by_name['CMsgEndPaintBackground'] = _CMSGENDPAINTBACKGROUND DESCRIPTOR.message_types_by_name['CMsgBeginPaintLast'] = _CMSGBEGINPAINTLAST DESCRIPTOR.message_types_by_name['CMsgEndPaintLast'] = _CMSGENDPAINTLAST DESCRIPTOR.message_types_by_name['CMsgDrawFilledRect'] = _CMSGDRAWFILLEDRECT DESCRIPTOR.message_types_by_name['CMsgRenderFilledRect'] = _CMSGRENDERFILLEDRECT DESCRIPTOR.message_types_by_name['CMsgDrawTexturedRect'] = _CMSGDRAWTEXTUREDRECT DESCRIPTOR.message_types_by_name['CMsgRenderTexturedRect'] = _CMSGRENDERTEXTUREDRECT DESCRIPTOR.message_types_by_name['CMsgLockTexture'] = _CMSGLOCKTEXTURE DESCRIPTOR.message_types_by_name['CMsgTextInlineObject'] = _CMSGTEXTINLINEOBJECT DESCRIPTOR.message_types_by_name['CMsgTextFormat'] = _CMSGTEXTFORMAT DESCRIPTOR.message_types_by_name['CMsgTextRangeFormat'] = _CMSGTEXTRANGEFORMAT DESCRIPTOR.message_types_by_name['CMsgRenderTextFormat'] = _CMSGRENDERTEXTFORMAT DESCRIPTOR.message_types_by_name['CMsgRenderTextRangeFormat'] = _CMSGRENDERTEXTRANGEFORMAT DESCRIPTOR.message_types_by_name['CMsgDrawTextRegion'] = _CMSGDRAWTEXTREGION DESCRIPTOR.message_types_by_name['CMsgRenderTextRegion'] = _CMSGRENDERTEXTREGION DESCRIPTOR.message_types_by_name['CMsgRequestRenderCallback'] = _CMSGREQUESTRENDERCALLBACK _sym_db.RegisterFileDescriptor(DESCRIPTOR) CMsgBeginFrame = _reflection.GeneratedProtocolMessageType('CMsgBeginFrame', (_message.Message,), dict( DESCRIPTOR = _CMSGBEGINFRAME, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgBeginFrame) )) _sym_db.RegisterMessage(CMsgBeginFrame) CMsgEndFrame = _reflection.GeneratedProtocolMessageType('CMsgEndFrame', (_message.Message,), dict( DESCRIPTOR = _CMSGENDFRAME, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgEndFrame) )) _sym_db.RegisterMessage(CMsgEndFrame) CMsgClearBackbuffer = _reflection.GeneratedProtocolMessageType('CMsgClearBackbuffer', (_message.Message,), dict( DESCRIPTOR = _CMSGCLEARBACKBUFFER, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgClearBackbuffer) )) _sym_db.RegisterMessage(CMsgClearBackbuffer) CMsgDeleteTexture = _reflection.GeneratedProtocolMessageType('CMsgDeleteTexture', (_message.Message,), dict( DESCRIPTOR = _CMSGDELETETEXTURE, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgDeleteTexture) )) _sym_db.RegisterMessage(CMsgDeleteTexture) CMsgDeletePanel = _reflection.GeneratedProtocolMessageType('CMsgDeletePanel', (_message.Message,), dict( DESCRIPTOR = _CMSGDELETEPANEL, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgDeletePanel) )) _sym_db.RegisterMessage(CMsgDeletePanel) CMsgDeleteParticleSystem = _reflection.GeneratedProtocolMessageType('CMsgDeleteParticleSystem', (_message.Message,), dict( DESCRIPTOR = _CMSGDELETEPARTICLESYSTEM, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgDeleteParticleSystem) )) _sym_db.RegisterMessage(CMsgDeleteParticleSystem) CMsgPoint = _reflection.GeneratedProtocolMessageType('CMsgPoint', (_message.Message,), dict( DESCRIPTOR = _CMSGPOINT, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgPoint) )) _sym_db.RegisterMessage(CMsgPoint) CMsgMatrix4x4 = _reflection.GeneratedProtocolMessageType('CMsgMatrix4x4', (_message.Message,), dict( DESCRIPTOR = _CMSGMATRIX4X4, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgMatrix4x4) )) _sym_db.RegisterMessage(CMsgMatrix4x4) CRadiusData = _reflection.GeneratedProtocolMessageType('CRadiusData', (_message.Message,), dict( CCornerRadius = _reflection.GeneratedProtocolMessageType('CCornerRadius', (_message.Message,), dict( DESCRIPTOR = _CRADIUSDATA_CCORNERRADIUS, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CRadiusData.CCornerRadius) )) , DESCRIPTOR = _CRADIUSDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CRadiusData) )) _sym_db.RegisterMessage(CRadiusData) _sym_db.RegisterMessage(CRadiusData.CCornerRadius) CBorderData = _reflection.GeneratedProtocolMessageType('CBorderData', (_message.Message,), dict( CBorderSide = _reflection.GeneratedProtocolMessageType('CBorderSide', (_message.Message,), dict( DESCRIPTOR = _CBORDERDATA_CBORDERSIDE, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CBorderData.CBorderSide) )) , DESCRIPTOR = _CBORDERDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CBorderData) )) _sym_db.RegisterMessage(CBorderData) _sym_db.RegisterMessage(CBorderData.CBorderSide) CBoxShadowData = _reflection.GeneratedProtocolMessageType('CBoxShadowData', (_message.Message,), dict( DESCRIPTOR = _CBOXSHADOWDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CBoxShadowData) )) _sym_db.RegisterMessage(CBoxShadowData) CTextShadowData = _reflection.GeneratedProtocolMessageType('CTextShadowData', (_message.Message,), dict( DESCRIPTOR = _CTEXTSHADOWDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CTextShadowData) )) _sym_db.RegisterMessage(CTextShadowData) CRadialClipData = _reflection.GeneratedProtocolMessageType('CRadialClipData', (_message.Message,), dict( DESCRIPTOR = _CRADIALCLIPDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CRadialClipData) )) _sym_db.RegisterMessage(CRadialClipData) CMsgClipData = _reflection.GeneratedProtocolMessageType('CMsgClipData', (_message.Message,), dict( DESCRIPTOR = _CMSGCLIPDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgClipData) )) _sym_db.RegisterMessage(CMsgClipData) CMsgPushCompositingLayer = _reflection.GeneratedProtocolMessageType('CMsgPushCompositingLayer', (_message.Message,), dict( DESCRIPTOR = _CMSGPUSHCOMPOSITINGLAYER, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgPushCompositingLayer) )) _sym_db.RegisterMessage(CMsgPushCompositingLayer) CMsgPopCompositingLayer = _reflection.GeneratedProtocolMessageType('CMsgPopCompositingLayer', (_message.Message,), dict( DESCRIPTOR = _CMSGPOPCOMPOSITINGLAYER, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgPopCompositingLayer) )) _sym_db.RegisterMessage(CMsgPopCompositingLayer) CMsgFreeCompositingLayer = _reflection.GeneratedProtocolMessageType('CMsgFreeCompositingLayer', (_message.Message,), dict( DESCRIPTOR = _CMSGFREECOMPOSITINGLAYER, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgFreeCompositingLayer) )) _sym_db.RegisterMessage(CMsgFreeCompositingLayer) CMsgTransitionData = _reflection.GeneratedProtocolMessageType('CMsgTransitionData', (_message.Message,), dict( DESCRIPTOR = _CMSGTRANSITIONDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgTransitionData) )) _sym_db.RegisterMessage(CMsgTransitionData) CMsgAnimationData = _reflection.GeneratedProtocolMessageType('CMsgAnimationData', (_message.Message,), dict( DESCRIPTOR = _CMSGANIMATIONDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgAnimationData) )) _sym_db.RegisterMessage(CMsgAnimationData) CMsgAnimationFrameData = _reflection.GeneratedProtocolMessageType('CMsgAnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSGANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgAnimationFrameData) )) _sym_db.RegisterMessage(CMsgAnimationFrameData) CMsgPointWithTransition = _reflection.GeneratedProtocolMessageType('CMsgPointWithTransition', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSGPOINTWITHTRANSITION_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgPointWithTransition.AnimationFrameData) )) , DESCRIPTOR = _CMSGPOINTWITHTRANSITION, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgPointWithTransition) )) _sym_db.RegisterMessage(CMsgPointWithTransition) _sym_db.RegisterMessage(CMsgPointWithTransition.AnimationFrameData) CMsgColor = _reflection.GeneratedProtocolMessageType('CMsgColor', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSGCOLOR_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgColor.AnimationFrameData) )) , DESCRIPTOR = _CMSGCOLOR, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgColor) )) _sym_db.RegisterMessage(CMsgColor) _sym_db.RegisterMessage(CMsgColor.AnimationFrameData) CMsgColorStop = _reflection.GeneratedProtocolMessageType('CMsgColorStop', (_message.Message,), dict( DESCRIPTOR = _CMSGCOLORSTOP, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgColorStop) )) _sym_db.RegisterMessage(CMsgColorStop) CMsgLinearGradient = _reflection.GeneratedProtocolMessageType('CMsgLinearGradient', (_message.Message,), dict( DESCRIPTOR = _CMSGLINEARGRADIENT, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgLinearGradient) )) _sym_db.RegisterMessage(CMsgLinearGradient) CMsgRadialGradient = _reflection.GeneratedProtocolMessageType('CMsgRadialGradient', (_message.Message,), dict( DESCRIPTOR = _CMSGRADIALGRADIENT, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgRadialGradient) )) _sym_db.RegisterMessage(CMsgRadialGradient) CMsgParticle = _reflection.GeneratedProtocolMessageType('CMsgParticle', (_message.Message,), dict( DESCRIPTOR = _CMSGPARTICLE, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgParticle) )) _sym_db.RegisterMessage(CMsgParticle) CMsgParticleSystem = _reflection.GeneratedProtocolMessageType('CMsgParticleSystem', (_message.Message,), dict( DESCRIPTOR = _CMSGPARTICLESYSTEM, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgParticleSystem) )) _sym_db.RegisterMessage(CMsgParticleSystem) CMsgFillBrush = _reflection.GeneratedProtocolMessageType('CMsgFillBrush', (_message.Message,), dict( DESCRIPTOR = _CMSGFILLBRUSH, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgFillBrush) )) _sym_db.RegisterMessage(CMsgFillBrush) CMsgFillBrushCollection = _reflection.GeneratedProtocolMessageType('CMsgFillBrushCollection', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSGFILLBRUSHCOLLECTION_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgFillBrushCollection.AnimationFrameData) )) , DESCRIPTOR = _CMSGFILLBRUSHCOLLECTION, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgFillBrushCollection) )) _sym_db.RegisterMessage(CMsgFillBrushCollection) _sym_db.RegisterMessage(CMsgFillBrushCollection.AnimationFrameData) CMsgRenderFillBrushCollection = _reflection.GeneratedProtocolMessageType('CMsgRenderFillBrushCollection', (_message.Message,), dict( DESCRIPTOR = _CMSGRENDERFILLBRUSHCOLLECTION, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgRenderFillBrushCollection) )) _sym_db.RegisterMessage(CMsgRenderFillBrushCollection) CMsgPanelPosition = _reflection.GeneratedProtocolMessageType('CMsgPanelPosition', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSGPANELPOSITION_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgPanelPosition.AnimationFrameData) )) , DESCRIPTOR = _CMSGPANELPOSITION, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgPanelPosition) )) _sym_db.RegisterMessage(CMsgPanelPosition) _sym_db.RegisterMessage(CMsgPanelPosition.AnimationFrameData) CMsgOpacity = _reflection.GeneratedProtocolMessageType('CMsgOpacity', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSGOPACITY_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgOpacity.AnimationFrameData) )) , DESCRIPTOR = _CMSGOPACITY, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgOpacity) )) _sym_db.RegisterMessage(CMsgOpacity) _sym_db.RegisterMessage(CMsgOpacity.AnimationFrameData) CMsgRotate2D = _reflection.GeneratedProtocolMessageType('CMsgRotate2D', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSGROTATE2D_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgRotate2D.AnimationFrameData) )) , DESCRIPTOR = _CMSGROTATE2D, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgRotate2D) )) _sym_db.RegisterMessage(CMsgRotate2D) _sym_db.RegisterMessage(CMsgRotate2D.AnimationFrameData) CMsgOpacityMaskData = _reflection.GeneratedProtocolMessageType('CMsgOpacityMaskData', (_message.Message,), dict( DESCRIPTOR = _CMSGOPACITYMASKDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgOpacityMaskData) )) _sym_db.RegisterMessage(CMsgOpacityMaskData) CMsgOpacityMask = _reflection.GeneratedProtocolMessageType('CMsgOpacityMask', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSGOPACITYMASK_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgOpacityMask.AnimationFrameData) )) , DESCRIPTOR = _CMSGOPACITYMASK, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgOpacityMask) )) _sym_db.RegisterMessage(CMsgOpacityMask) _sym_db.RegisterMessage(CMsgOpacityMask.AnimationFrameData) CMsgHueShift = _reflection.GeneratedProtocolMessageType('CMsgHueShift', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSGHUESHIFT_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgHueShift.AnimationFrameData) )) , DESCRIPTOR = _CMSGHUESHIFT, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgHueShift) )) _sym_db.RegisterMessage(CMsgHueShift) _sym_db.RegisterMessage(CMsgHueShift.AnimationFrameData) CMsgSaturation = _reflection.GeneratedProtocolMessageType('CMsgSaturation', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSGSATURATION_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgSaturation.AnimationFrameData) )) , DESCRIPTOR = _CMSGSATURATION, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgSaturation) )) _sym_db.RegisterMessage(CMsgSaturation) _sym_db.RegisterMessage(CMsgSaturation.AnimationFrameData) CMsgBrightness = _reflection.GeneratedProtocolMessageType('CMsgBrightness', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSGBRIGHTNESS_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgBrightness.AnimationFrameData) )) , DESCRIPTOR = _CMSGBRIGHTNESS, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgBrightness) )) _sym_db.RegisterMessage(CMsgBrightness) _sym_db.RegisterMessage(CMsgBrightness.AnimationFrameData) CMsgContrast = _reflection.GeneratedProtocolMessageType('CMsgContrast', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSGCONTRAST_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgContrast.AnimationFrameData) )) , DESCRIPTOR = _CMSGCONTRAST, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgContrast) )) _sym_db.RegisterMessage(CMsgContrast) _sym_db.RegisterMessage(CMsgContrast.AnimationFrameData) CMsgGaussianValues = _reflection.GeneratedProtocolMessageType('CMsgGaussianValues', (_message.Message,), dict( DESCRIPTOR = _CMSGGAUSSIANVALUES, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgGaussianValues) )) _sym_db.RegisterMessage(CMsgGaussianValues) CMsgGaussianBlur = _reflection.GeneratedProtocolMessageType('CMsgGaussianBlur', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSGGAUSSIANBLUR_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgGaussianBlur.AnimationFrameData) )) , DESCRIPTOR = _CMSGGAUSSIANBLUR, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgGaussianBlur) )) _sym_db.RegisterMessage(CMsgGaussianBlur) _sym_db.RegisterMessage(CMsgGaussianBlur.AnimationFrameData) CMsgMotionBlurValues = _reflection.GeneratedProtocolMessageType('CMsgMotionBlurValues', (_message.Message,), dict( DESCRIPTOR = _CMSGMOTIONBLURVALUES, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgMotionBlurValues) )) _sym_db.RegisterMessage(CMsgMotionBlurValues) CMsgMotionBlur = _reflection.GeneratedProtocolMessageType('CMsgMotionBlur', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSGMOTIONBLUR_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgMotionBlur.AnimationFrameData) )) , DESCRIPTOR = _CMSGMOTIONBLUR, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgMotionBlur) )) _sym_db.RegisterMessage(CMsgMotionBlur) _sym_db.RegisterMessage(CMsgMotionBlur.AnimationFrameData) CMsg3DTransformPerspective = _reflection.GeneratedProtocolMessageType('CMsg3DTransformPerspective', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSG3DTRANSFORMPERSPECTIVE_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsg3DTransformPerspective.AnimationFrameData) )) , DESCRIPTOR = _CMSG3DTRANSFORMPERSPECTIVE, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsg3DTransformPerspective) )) _sym_db.RegisterMessage(CMsg3DTransformPerspective) _sym_db.RegisterMessage(CMsg3DTransformPerspective.AnimationFrameData) CMsg3DTransformPerspectiveOrigin = _reflection.GeneratedProtocolMessageType('CMsg3DTransformPerspectiveOrigin', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSG3DTRANSFORMPERSPECTIVEORIGIN_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsg3DTransformPerspectiveOrigin.AnimationFrameData) )) , DESCRIPTOR = _CMSG3DTRANSFORMPERSPECTIVEORIGIN, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsg3DTransformPerspectiveOrigin) )) _sym_db.RegisterMessage(CMsg3DTransformPerspectiveOrigin) _sym_db.RegisterMessage(CMsg3DTransformPerspectiveOrigin.AnimationFrameData) CMsgTransformOriginData = _reflection.GeneratedProtocolMessageType('CMsgTransformOriginData', (_message.Message,), dict( DESCRIPTOR = _CMSGTRANSFORMORIGINDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgTransformOriginData) )) _sym_db.RegisterMessage(CMsgTransformOriginData) CMsg3DTransformOrigin = _reflection.GeneratedProtocolMessageType('CMsg3DTransformOrigin', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSG3DTRANSFORMORIGIN_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsg3DTransformOrigin.AnimationFrameData) )) , DESCRIPTOR = _CMSG3DTRANSFORMORIGIN, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsg3DTransformOrigin) )) _sym_db.RegisterMessage(CMsg3DTransformOrigin) _sym_db.RegisterMessage(CMsg3DTransformOrigin.AnimationFrameData) CMsg3DTransformMatrix = _reflection.GeneratedProtocolMessageType('CMsg3DTransformMatrix', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSG3DTRANSFORMMATRIX_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsg3DTransformMatrix.AnimationFrameData) )) , DESCRIPTOR = _CMSG3DTRANSFORMMATRIX, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsg3DTransformMatrix) )) _sym_db.RegisterMessage(CMsg3DTransformMatrix) _sym_db.RegisterMessage(CMsg3DTransformMatrix.AnimationFrameData) CMsgBorderRadius = _reflection.GeneratedProtocolMessageType('CMsgBorderRadius', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSGBORDERRADIUS_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgBorderRadius.AnimationFrameData) )) , DESCRIPTOR = _CMSGBORDERRADIUS, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgBorderRadius) )) _sym_db.RegisterMessage(CMsgBorderRadius) _sym_db.RegisterMessage(CMsgBorderRadius.AnimationFrameData) CMsgBorder = _reflection.GeneratedProtocolMessageType('CMsgBorder', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSGBORDER_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgBorder.AnimationFrameData) )) , DESCRIPTOR = _CMSGBORDER, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgBorder) )) _sym_db.RegisterMessage(CMsgBorder) _sym_db.RegisterMessage(CMsgBorder.AnimationFrameData) CMsgBoxShadow = _reflection.GeneratedProtocolMessageType('CMsgBoxShadow', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSGBOXSHADOW_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgBoxShadow.AnimationFrameData) )) , DESCRIPTOR = _CMSGBOXSHADOW, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgBoxShadow) )) _sym_db.RegisterMessage(CMsgBoxShadow) _sym_db.RegisterMessage(CMsgBoxShadow.AnimationFrameData) CMsgTextShadow = _reflection.GeneratedProtocolMessageType('CMsgTextShadow', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSGTEXTSHADOW_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgTextShadow.AnimationFrameData) )) , DESCRIPTOR = _CMSGTEXTSHADOW, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgTextShadow) )) _sym_db.RegisterMessage(CMsgTextShadow) _sym_db.RegisterMessage(CMsgTextShadow.AnimationFrameData) CMsgClip = _reflection.GeneratedProtocolMessageType('CMsgClip', (_message.Message,), dict( AnimationFrameData = _reflection.GeneratedProtocolMessageType('AnimationFrameData', (_message.Message,), dict( DESCRIPTOR = _CMSGCLIP_ANIMATIONFRAMEDATA, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgClip.AnimationFrameData) )) , DESCRIPTOR = _CMSGCLIP, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgClip) )) _sym_db.RegisterMessage(CMsgClip) _sym_db.RegisterMessage(CMsgClip.AnimationFrameData) CMsgPushClipLayer = _reflection.GeneratedProtocolMessageType('CMsgPushClipLayer', (_message.Message,), dict( DESCRIPTOR = _CMSGPUSHCLIPLAYER, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgPushClipLayer) )) _sym_db.RegisterMessage(CMsgPushClipLayer) CMsgPopClipLayer = _reflection.GeneratedProtocolMessageType('CMsgPopClipLayer', (_message.Message,), dict( DESCRIPTOR = _CMSGPOPCLIPLAYER, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgPopClipLayer) )) _sym_db.RegisterMessage(CMsgPopClipLayer) CMsgPushPanelContextInLayer = _reflection.GeneratedProtocolMessageType('CMsgPushPanelContextInLayer', (_message.Message,), dict( DESCRIPTOR = _CMSGPUSHPANELCONTEXTINLAYER, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgPushPanelContextInLayer) )) _sym_db.RegisterMessage(CMsgPushPanelContextInLayer) CMsgPopPanelContextInLayer = _reflection.GeneratedProtocolMessageType('CMsgPopPanelContextInLayer', (_message.Message,), dict( DESCRIPTOR = _CMSGPOPPANELCONTEXTINLAYER, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgPopPanelContextInLayer) )) _sym_db.RegisterMessage(CMsgPopPanelContextInLayer) CMsgPushAAndTContext = _reflection.GeneratedProtocolMessageType('CMsgPushAAndTContext', (_message.Message,), dict( DESCRIPTOR = _CMSGPUSHAANDTCONTEXT, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgPushAAndTContext) )) _sym_db.RegisterMessage(CMsgPushAAndTContext) CMsgPopAAndTContext = _reflection.GeneratedProtocolMessageType('CMsgPopAAndTContext', (_message.Message,), dict( DESCRIPTOR = _CMSGPOPAANDTCONTEXT, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgPopAAndTContext) )) _sym_db.RegisterMessage(CMsgPopAAndTContext) CMsgBeginPaintBackground = _reflection.GeneratedProtocolMessageType('CMsgBeginPaintBackground', (_message.Message,), dict( DESCRIPTOR = _CMSGBEGINPAINTBACKGROUND, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgBeginPaintBackground) )) _sym_db.RegisterMessage(CMsgBeginPaintBackground) CMsgEndPaintBackground = _reflection.GeneratedProtocolMessageType('CMsgEndPaintBackground', (_message.Message,), dict( DESCRIPTOR = _CMSGENDPAINTBACKGROUND, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgEndPaintBackground) )) _sym_db.RegisterMessage(CMsgEndPaintBackground) CMsgBeginPaintLast = _reflection.GeneratedProtocolMessageType('CMsgBeginPaintLast', (_message.Message,), dict( DESCRIPTOR = _CMSGBEGINPAINTLAST, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgBeginPaintLast) )) _sym_db.RegisterMessage(CMsgBeginPaintLast) CMsgEndPaintLast = _reflection.GeneratedProtocolMessageType('CMsgEndPaintLast', (_message.Message,), dict( DESCRIPTOR = _CMSGENDPAINTLAST, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgEndPaintLast) )) _sym_db.RegisterMessage(CMsgEndPaintLast) CMsgDrawFilledRect = _reflection.GeneratedProtocolMessageType('CMsgDrawFilledRect', (_message.Message,), dict( DESCRIPTOR = _CMSGDRAWFILLEDRECT, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgDrawFilledRect) )) _sym_db.RegisterMessage(CMsgDrawFilledRect) CMsgRenderFilledRect = _reflection.GeneratedProtocolMessageType('CMsgRenderFilledRect', (_message.Message,), dict( DESCRIPTOR = _CMSGRENDERFILLEDRECT, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgRenderFilledRect) )) _sym_db.RegisterMessage(CMsgRenderFilledRect) CMsgDrawTexturedRect = _reflection.GeneratedProtocolMessageType('CMsgDrawTexturedRect', (_message.Message,), dict( DESCRIPTOR = _CMSGDRAWTEXTUREDRECT, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgDrawTexturedRect) )) _sym_db.RegisterMessage(CMsgDrawTexturedRect) CMsgRenderTexturedRect = _reflection.GeneratedProtocolMessageType('CMsgRenderTexturedRect', (_message.Message,), dict( DESCRIPTOR = _CMSGRENDERTEXTUREDRECT, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgRenderTexturedRect) )) _sym_db.RegisterMessage(CMsgRenderTexturedRect) CMsgLockTexture = _reflection.GeneratedProtocolMessageType('CMsgLockTexture', (_message.Message,), dict( DESCRIPTOR = _CMSGLOCKTEXTURE, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgLockTexture) )) _sym_db.RegisterMessage(CMsgLockTexture) CMsgTextInlineObject = _reflection.GeneratedProtocolMessageType('CMsgTextInlineObject', (_message.Message,), dict( DESCRIPTOR = _CMSGTEXTINLINEOBJECT, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgTextInlineObject) )) _sym_db.RegisterMessage(CMsgTextInlineObject) CMsgTextFormat = _reflection.GeneratedProtocolMessageType('CMsgTextFormat', (_message.Message,), dict( DESCRIPTOR = _CMSGTEXTFORMAT, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgTextFormat) )) _sym_db.RegisterMessage(CMsgTextFormat) CMsgTextRangeFormat = _reflection.GeneratedProtocolMessageType('CMsgTextRangeFormat', (_message.Message,), dict( DESCRIPTOR = _CMSGTEXTRANGEFORMAT, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgTextRangeFormat) )) _sym_db.RegisterMessage(CMsgTextRangeFormat) CMsgRenderTextFormat = _reflection.GeneratedProtocolMessageType('CMsgRenderTextFormat', (_message.Message,), dict( DESCRIPTOR = _CMSGRENDERTEXTFORMAT, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgRenderTextFormat) )) _sym_db.RegisterMessage(CMsgRenderTextFormat) CMsgRenderTextRangeFormat = _reflection.GeneratedProtocolMessageType('CMsgRenderTextRangeFormat', (_message.Message,), dict( DESCRIPTOR = _CMSGRENDERTEXTRANGEFORMAT, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgRenderTextRangeFormat) )) _sym_db.RegisterMessage(CMsgRenderTextRangeFormat) CMsgDrawTextRegion = _reflection.GeneratedProtocolMessageType('CMsgDrawTextRegion', (_message.Message,), dict( DESCRIPTOR = _CMSGDRAWTEXTREGION, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgDrawTextRegion) )) _sym_db.RegisterMessage(CMsgDrawTextRegion) CMsgRenderTextRegion = _reflection.GeneratedProtocolMessageType('CMsgRenderTextRegion', (_message.Message,), dict( DESCRIPTOR = _CMSGRENDERTEXTREGION, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgRenderTextRegion) )) _sym_db.RegisterMessage(CMsgRenderTextRegion) CMsgRequestRenderCallback = _reflection.GeneratedProtocolMessageType('CMsgRequestRenderCallback', (_message.Message,), dict( DESCRIPTOR = _CMSGREQUESTRENDERCALLBACK, __module__ = 'steam.protobufs.rendermessages_pb2' # @@protoc_insertion_point(class_scope:CMsgRequestRenderCallback) )) _sym_db.RegisterMessage(CMsgRequestRenderCallback) _CMSGPOINTWITHTRANSITION.extensions_by_name['animation_frame_data'].message_type = _CMSGPOINTWITHTRANSITION_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSGPOINTWITHTRANSITION.extensions_by_name['animation_frame_data']) _CMSGCOLOR.extensions_by_name['animation_frame_data'].message_type = _CMSGCOLOR_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSGCOLOR.extensions_by_name['animation_frame_data']) _CMSGFILLBRUSHCOLLECTION.extensions_by_name['animation_frame_data'].message_type = _CMSGFILLBRUSHCOLLECTION_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSGFILLBRUSHCOLLECTION.extensions_by_name['animation_frame_data']) _CMSGPANELPOSITION.extensions_by_name['animation_frame_data'].message_type = _CMSGPANELPOSITION_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSGPANELPOSITION.extensions_by_name['animation_frame_data']) _CMSGOPACITY.extensions_by_name['animation_frame_data'].message_type = _CMSGOPACITY_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSGOPACITY.extensions_by_name['animation_frame_data']) _CMSGROTATE2D.extensions_by_name['animation_frame_data'].message_type = _CMSGROTATE2D_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSGROTATE2D.extensions_by_name['animation_frame_data']) _CMSGOPACITYMASK.extensions_by_name['animation_frame_data'].message_type = _CMSGOPACITYMASK_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSGOPACITYMASK.extensions_by_name['animation_frame_data']) _CMSGHUESHIFT.extensions_by_name['animation_frame_data'].message_type = _CMSGHUESHIFT_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSGHUESHIFT.extensions_by_name['animation_frame_data']) _CMSGSATURATION.extensions_by_name['animation_frame_data'].message_type = _CMSGSATURATION_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSGSATURATION.extensions_by_name['animation_frame_data']) _CMSGBRIGHTNESS.extensions_by_name['animation_frame_data'].message_type = _CMSGBRIGHTNESS_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSGBRIGHTNESS.extensions_by_name['animation_frame_data']) _CMSGCONTRAST.extensions_by_name['animation_frame_data'].message_type = _CMSGCONTRAST_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSGCONTRAST.extensions_by_name['animation_frame_data']) _CMSGGAUSSIANBLUR.extensions_by_name['animation_frame_data'].message_type = _CMSGGAUSSIANBLUR_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSGGAUSSIANBLUR.extensions_by_name['animation_frame_data']) _CMSGMOTIONBLUR.extensions_by_name['animation_frame_data'].message_type = _CMSGMOTIONBLUR_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSGMOTIONBLUR.extensions_by_name['animation_frame_data']) _CMSG3DTRANSFORMPERSPECTIVE.extensions_by_name['animation_frame_data'].message_type = _CMSG3DTRANSFORMPERSPECTIVE_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSG3DTRANSFORMPERSPECTIVE.extensions_by_name['animation_frame_data']) _CMSG3DTRANSFORMPERSPECTIVEORIGIN.extensions_by_name['animation_frame_data'].message_type = _CMSG3DTRANSFORMPERSPECTIVEORIGIN_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSG3DTRANSFORMPERSPECTIVEORIGIN.extensions_by_name['animation_frame_data']) _CMSG3DTRANSFORMORIGIN.extensions_by_name['animation_frame_data'].message_type = _CMSG3DTRANSFORMORIGIN_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSG3DTRANSFORMORIGIN.extensions_by_name['animation_frame_data']) _CMSG3DTRANSFORMMATRIX.extensions_by_name['animation_frame_data'].message_type = _CMSG3DTRANSFORMMATRIX_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSG3DTRANSFORMMATRIX.extensions_by_name['animation_frame_data']) _CMSGBORDERRADIUS.extensions_by_name['animation_frame_data'].message_type = _CMSGBORDERRADIUS_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSGBORDERRADIUS.extensions_by_name['animation_frame_data']) _CMSGBORDER.extensions_by_name['animation_frame_data'].message_type = _CMSGBORDER_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSGBORDER.extensions_by_name['animation_frame_data']) _CMSGBOXSHADOW.extensions_by_name['animation_frame_data'].message_type = _CMSGBOXSHADOW_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSGBOXSHADOW.extensions_by_name['animation_frame_data']) _CMSGTEXTSHADOW.extensions_by_name['animation_frame_data'].message_type = _CMSGTEXTSHADOW_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSGTEXTSHADOW.extensions_by_name['animation_frame_data']) _CMSGCLIP.extensions_by_name['animation_frame_data'].message_type = _CMSGCLIP_ANIMATIONFRAMEDATA CMsgAnimationFrameData.RegisterExtension(_CMSGCLIP.extensions_by_name['animation_frame_data']) DESCRIPTOR._options = None # @@protoc_insertion_point(module_scope)
46.46385
32,201
0.760755
40,372
330,962
5.936491
0.025661
0.05571
0.04679
0.041462
0.781514
0.744993
0.730435
0.698053
0.669685
0.657297
0
0.044785
0.122996
330,962
7,122
32,202
46.470373
0.780931
0.018845
0
0.723369
1
0.003714
0.193725
0.149855
0
0
0
0
0
1
0
false
0.000446
0.000743
0
0.000743
0
0
0
0
null
0
0
0
0
1
1
0
0
1
0
0
0
0
0
1
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
48bd2d352a29708bf89a7f8397a3545b254ae37d
6,834
py
Python
tests/test_arr_to_mat.py
avilchess/carma
32857b2ab70a0338d15c81fdaf30945ba238a32e
[ "Apache-2.0" ]
null
null
null
tests/test_arr_to_mat.py
avilchess/carma
32857b2ab70a0338d15c81fdaf30945ba238a32e
[ "Apache-2.0" ]
null
null
null
tests/test_arr_to_mat.py
avilchess/carma
32857b2ab70a0338d15c81fdaf30945ba238a32e
[ "Apache-2.0" ]
null
null
null
"""Test numpy array to matrix conversion function.""" import numpy as np import libs.test_carma as carma test_flags = { 1: 'Number of elements between array and matrix are not the same', 2: 'Number of rows between array and matrix are not the same', 3: 'Number of columns between array and matrix are not the same', 4: 'Sum of elements between array and matrix is not aproximately equal', 5: 'Pointer to memory is not as expected', } def test_arr_to_mat_double(): """Test arr_to_mat.""" sample = np.asarray( np.random.normal(size=(10, 2)), dtype=np.float64, order='F' ) flag = carma.arr_to_mat_double(sample, False, False) assert flag == 0, test_flags[flag] def test_arr_to_mat_long(): """Test arr_to_mat.""" sample = np.asarray( np.random.normal(size=(10, 2)), dtype=np.int64, order='F' ) flag = carma.arr_to_mat_long(sample, False, False) assert flag == 0, test_flags[flag] def test_arr_to_mat_double_c_contiguous(): """Test arr_to_mat.""" sample = np.asarray(np.random.normal(size=(10, 2)), dtype=np.float64) flag = carma.arr_to_mat_double(sample, False, False) assert flag == 5, test_flags[flag] def test_arr_to_mat_long_c_contiguous(): """Test arr_to_mat.""" sample = np.asarray(np.random.normal(size=(10, 2)), dtype=np.int64) flag = carma.arr_to_mat_long(sample, False, False) assert flag == 5, test_flags[flag] def test_arr_to_mat_double_copy(): """Test arr_to_mat.""" sample = np.asarray( np.random.normal(size=(10, 2)), dtype=np.float64, order='F' ) flag = carma.arr_to_mat_double_copy(sample) assert flag == 0, test_flags[flag] def test_arr_to_mat_double_copy_c_contiguous(): """Test arr_to_mat.""" sample = np.asarray( np.random.normal(size=(10, 2)), dtype=np.float64, order='C' ) flag = carma.arr_to_mat_double_copy(sample) assert flag == 0, test_flags[flag] # ############################################################################# # N-DIM 1 # # ############################################################################# def test_arr_to_mat_1d(): """Test arr_to_mat.""" sample = np.asarray( np.random.normal(size=(10)), dtype=np.float64, order='F' ) flag = carma.arr_to_mat_1d(sample, False, False) assert flag == 0, test_flags[flag] def test_arr_to_mat_1d_copy(): """Test arr_to_mat.""" sample = np.asarray( np.random.normal(size=(10)), dtype=np.float64, order='F' ) flag = carma.arr_to_mat_1d(sample, True, False) assert flag == 5, test_flags[flag] def test_arr_to_col(): """Test arr_to_col.""" sample = np.asarray(np.random.normal(size=10), dtype=np.float64, order='F') flag = carma.arr_to_col(sample, False, False) assert flag == 0, test_flags[flag] def test_arr_to_col_C(): """Test arr_to_col.""" sample = np.asarray(np.random.normal(size=10), dtype=np.float64, order='C') flag = carma.arr_to_col(sample, False, False) assert flag == 0, test_flags[flag] def test_arr_to_col_writeable(): """Test arr_to_col.""" sample = np.asarray(np.random.normal(size=10), dtype=np.float64, order='C') sample.setflags(write=0) flag = carma.arr_to_col(sample, False, False) assert flag == 5, test_flags[flag] def test_arr_to_col_copy(): """Test arr_to_col.""" sample = np.asarray(np.random.normal(size=10), dtype=np.float64, order='F') flag = carma.arr_to_col(sample, True, False) assert flag == 5, test_flags[flag] def test_arr_to_col_copy_C(): """Test arr_to_col.""" sample = np.asarray(np.random.normal(size=10), dtype=np.float64, order='C') flag = carma.arr_to_col(sample, True, False) assert flag == 5, test_flags[flag] def test_arr_to_row(): """Test arr_to_row.""" sample = np.asarray(np.random.normal(size=10), dtype=np.float64, order='F') flag = carma.arr_to_row(sample, False, False) assert flag == 0, test_flags[flag] def test_arr_to_row_C(): """Test arr_to_row.""" sample = np.asarray(np.random.normal(size=10), dtype=np.float64, order='C') flag = carma.arr_to_row(sample, False, False) assert flag == 0, test_flags[flag] def test_arr_to_row_writeable(): """Test arr_to_row.""" sample = np.asarray(np.random.normal(size=10), dtype=np.float64, order='F') sample.setflags(write=0) flag = carma.arr_to_row(sample, False, False) assert flag == 5, test_flags[flag] def test_arr_to_row_copy(): """Test arr_to_col.""" sample = np.asarray(np.random.normal(size=10), dtype=np.float64, order='F') flag = carma.arr_to_row(sample, True, False) assert flag == 5, test_flags[flag] def test_arr_to_row_copy_C(): """Test arr_to_col.""" sample = np.asarray(np.random.normal(size=10), dtype=np.float64, order='C') flag = carma.arr_to_row(sample, True, False) assert flag == 5, test_flags[flag] def test_arr_to_mat_cube(): """Test arr_to_cube.""" sample = np.asarray( np.random.normal(size=(10, 2, 2)), dtype=np.float64, order='F' ) flag = carma.arr_to_cube(sample, False, False) assert flag == 0, test_flags[flag] def test_arr_to_cube_double_c_contiguous(): """Test arr_to_mat.""" sample = np.asarray(np.random.normal(size=(10, 2, 2)), dtype=np.float64) flag = carma.arr_to_cube(sample, False, False) assert flag == 5, test_flags[flag] def test_arr_to_mat_cube_copy(): """Test arr_to_cube.""" sample = np.asarray( np.random.normal(size=(10, 2, 2)), dtype=np.float64, order='F' ) flag = carma.arr_to_cube(sample, True, False) assert flag == 5, test_flags[flag] def test_to_arma_mat(): """Test private implementation of to_arma for matrix.""" sample = np.asarray( np.random.normal(size=(10, 2)), dtype=np.float64, order='F' ) flag = carma.to_arma_mat(sample, False, False) assert flag == 0, test_flags[flag] def test_to_arma_cube(): """Test private implementation of to_arma for matrix.""" sample = np.asarray( np.random.normal(size=(10, 2, 2)), dtype=np.float64, order='F' ) flag = carma.to_arma_cube(sample, False, False) assert flag == 0, test_flags[flag] def test_to_arma_col(): """Test private implementation of to_arma for matrix.""" sample = np.asarray( np.random.normal(size=10), dtype=np.float64, order='F' ) flag = carma.to_arma_col(sample, False, False) assert flag == 0, test_flags[flag] def test_to_arma_row(): """Test private implementation of to_arma for matrix.""" sample = np.asarray( np.random.normal(size=10), dtype=np.float64, order='F' ) flag = carma.to_arma_row(sample, False, False) assert flag == 0, test_flags[flag]
31.493088
79
0.641206
1,050
6,834
3.94381
0.069524
0.076069
0.091282
0.102632
0.944216
0.944216
0.924656
0.921758
0.887467
0.885293
0
0.027486
0.190811
6,834
216
80
31.638889
0.721338
0.095698
0
0.57037
0
0
0.051059
0
0
0
0
0
0.185185
1
0.185185
false
0
0.014815
0
0.2
0
0
0
0
null
0
0
0
1
1
1
1
1
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
6
48f2abcb11e690d91d9d45faf49f4ae5d187b746
53
py
Python
taxi/ui/tty.py
jeanmonod/taxi
fcfd13a756824bb9657dff3965ac7739487790c4
[ "WTFPL" ]
17
2016-02-02T14:10:49.000Z
2021-11-30T00:04:29.000Z
taxi/ui/tty.py
jeanmonod/taxi
fcfd13a756824bb9657dff3965ac7739487790c4
[ "WTFPL" ]
70
2015-01-08T17:02:42.000Z
2021-09-21T20:08:07.000Z
taxi/ui/tty.py
jeanmonod/taxi
fcfd13a756824bb9657dff3965ac7739487790c4
[ "WTFPL" ]
8
2015-08-23T12:50:36.000Z
2021-11-26T10:33:45.000Z
from . import BaseUi class TtyUi(BaseUi): pass
8.833333
20
0.679245
7
53
5.142857
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.245283
53
5
21
10.6
0.9
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.333333
0.333333
0
0.666667
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
1
1
0
1
0
0
6
48f5165fbc4a2d4f985f7fbd4ef4512748627168
94
py
Python
server/src/shares/__init__.py
sz-piotr/fioletowe-pomarancze
14e748041b8022709999a39f1a70788981f5ef14
[ "MIT" ]
null
null
null
server/src/shares/__init__.py
sz-piotr/fioletowe-pomarancze
14e748041b8022709999a39f1a70788981f5ef14
[ "MIT" ]
null
null
null
server/src/shares/__init__.py
sz-piotr/fioletowe-pomarancze
14e748041b8022709999a39f1a70788981f5ef14
[ "MIT" ]
null
null
null
from flask import Blueprint shares = Blueprint('shares', __name__) from shares import views
15.666667
38
0.787234
12
94
5.833333
0.583333
0.428571
0
0
0
0
0
0
0
0
0
0
0.148936
94
5
39
18.8
0.875
0
0
0
0
0
0.06383
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0.666667
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
1
0
1
1
0
6
5b0400be1ffeda269114d06c81e13ad56f396552
13,491
py
Python
tests/document_service_test.py
GRM-VisualVault/vvPyRest
59c15d3377b9955f575cfdb1362facc48f253442
[ "MIT" ]
1
2019-01-31T10:41:35.000Z
2019-01-31T10:41:35.000Z
tests/document_service_test.py
GRM-VisualVault/vvPyRest
59c15d3377b9955f575cfdb1362facc48f253442
[ "MIT" ]
5
2018-12-30T03:15:20.000Z
2021-06-30T21:49:41.000Z
tests/document_service_test.py
GRM-VisualVault/vvPyRest
59c15d3377b9955f575cfdb1362facc48f253442
[ "MIT" ]
null
null
null
import unittest from vvrest.services.document_service import DocumentService from vvrest.services.file_service import FileService from .settings import test_file_path from .utilities import get_vault_object, generate_random_uuid, get_parameters_json class DocumentServiceTest(unittest.TestCase): vault = None @classmethod def setUpClass(cls): if not cls.vault: cls.vault = get_vault_object() test_parameters = get_parameters_json() cls.folder_path = test_parameters['folder_path'] cls.query_string = test_parameters['query_string'] cls.document_id = test_parameters['document_id'] cls.revision_id = test_parameters['document_revision_id'] cls.index_field_id = test_parameters['index_field_id'] cls.index_field_name = test_parameters['index_field_name'] cls.folder_id = test_parameters['folder_id'] def test_get_documents(self): """ tests DocumentService.get_documents """ document_service = DocumentService(self.vault) resp = document_service.get_documents(self.query_string) self.assertEqual(resp['meta']['status'], 200) documents = resp['data'] self.assertGreater(len(documents), 0) for document in documents: self.assertEqual(document['folderPath'], self.folder_path) def test_get_document(self): """ tests DocumentService.get_document """ document_service = DocumentService(self.vault) resp = document_service.get_document(self.document_id) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(resp['data']['documentId'], self.document_id) def test_get_document_revisions(self): """ tests DocumentService.get_document_revisions """ document_service = DocumentService(self.vault) resp = document_service.get_document_revisions(self.document_id) self.assertEqual(resp['meta']['status'], 200) documents = resp['data'] self.assertGreater(len(documents), 0) for document in documents: self.assertEqual(document['documentId'], self.document_id) def test_get_document_revision(self): """ tests DocumentService.get_document_revision """ document_service = DocumentService(self.vault) resp = document_service.get_document_revision(self.document_id, self.revision_id) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(resp['data']['id'], self.revision_id) self.assertEqual(resp['data']['documentId'], self.document_id) def test_get_document_index_fields(self): """ tests DocumentService.get_document_index_fields """ document_service = DocumentService(self.vault) resp = document_service.get_document_index_fields(self.document_id) self.assertEqual(resp['meta']['status'], 200) index_fields = resp['data'] self.assertGreater(len(index_fields), 0) for index_field in index_fields: self.assertEqual(index_field['dataType'], 'DocumentIndexField') def test_get_document_index_field(self): """ tests DocumentService.get_document_index_field """ document_service = DocumentService(self.vault) resp = document_service.get_document_index_field(self.document_id, self.index_field_id) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(resp['data']['fieldId'], self.index_field_id) def test_get_document_revision_index_fields(self): """ tests DocumentService.get_document_revision_index_fields """ document_service = DocumentService(self.vault) resp = document_service.get_document_revision_index_fields(self.document_id, self.revision_id) self.assertEqual(resp['meta']['status'], 200) index_fields = resp['data'] self.assertGreater(len(index_fields), 0) for index_field in index_fields: self.assertEqual(index_field['fieldId'], self.index_field_id) def test_get_document_revision_index_field(self): """ tests DocumentService.get_document_revision_index_field """ document_service = DocumentService(self.vault) resp = document_service.get_document_revision_index_field(self.document_id, self.revision_id, self.index_field_id) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(resp['data']['fieldId'], self.index_field_id) def test_update_document_index_fields(self): """ tests DocumentService.update_document_index_fields """ document_service = DocumentService(self.vault) expected_value = generate_random_uuid() fields_dict = str({self.index_field_name: expected_value}) resp = document_service.update_document_index_fields(self.document_id, fields_dict) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(len(resp['data']), 1) self.assertEqual(resp['data'][0]['fieldId'], self.index_field_id) # TODO: report issue with UUID label # self.assertEqual(resp['data'][0]['value'], expected_value) # TODO: uncomment when API resolves bug new_value = document_service.get_document_index_field(self.document_id, self.index_field_id)['data']['value'] self.assertEqual(new_value, expected_value) def test_update_document_index_field(self): """ tests DocumentService.update_document_index_field """ document_service = DocumentService(self.vault) expected_value = generate_random_uuid() resp = document_service.update_document_index_field(self.document_id, self.index_field_id, expected_value) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(resp['data']['fieldId'], self.index_field_id) self.assertEqual(resp['data']['value'], expected_value) new_value = document_service.get_document_index_field(self.document_id, self.index_field_id)['data']['value'] self.assertEqual(new_value, expected_value) def test_new_document_and_delete_document(self): """ tests DocumentService.new_document and DocumentService.delete_document """ document_service = DocumentService(self.vault) # new document resp = document_service.new_document(self.folder_id, 1, '_test_doc', '_test_doc description', '0', '_test.txt') self.assertEqual(resp['meta']['status'], 200) document_id = resp['data']['documentId'] revision_id = resp['data']['id'] # validate document exists in VV resp = document_service.get_document(document_id) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(resp['data']['documentId'], document_id) self.assertEqual(resp['data']['archive'], 0) # document not in recycle bin # delete document resp = document_service.delete_document(revision_id) self.assertEqual(resp['meta']['status'], 200) # validate document does not exist in VV resp = document_service.get_document(document_id) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(resp['data']['archive'], 2) # document in recycle bin def test_delete_document_revision(self): """ tests DocumentService.delete_document_revision """ document_service = DocumentService(self.vault) # new document resp = document_service.new_document(self.folder_id, 1, '_test_doc', '_test_doc description', '0', '_test.txt') self.assertEqual(resp['meta']['status'], 200) document_id = resp['data']['documentId'] empty_revision_id = resp['data']['id'] # validate document exists in VV resp = document_service.get_document(document_id) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(resp['data']['documentId'], document_id) self.assertEqual(resp['data']['archive'], 0) # document not in recycle bin # upload first revision file_upload_name = 'test_file.txt' expected_revision = generate_random_uuid() file_service = FileService(self.vault) resp = file_service.file_upload(document_id, 'unittest', expected_revision, 'unittest change reason', 'Released', '', 'unittest.txt', test_file_path + '/' + file_upload_name) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(resp['data']['documentId'], document_id) self.assertEqual(resp['data']['revision'], expected_revision) new_file_id = resp['data']['id'] stream = file_service.get_file_stream(new_file_id) stream_stats = vars(stream) self.assertEqual(stream_stats['status_code'], 200) self.assertEqual(stream_stats['headers']['Content-Type'], 'application/octet-stream') # get new revision resp = document_service.get_document(document_id) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(resp['data']['documentId'], document_id) new_revision = resp['data']['id'] # upload second revision expected_revision = generate_random_uuid() file_service = FileService(self.vault) resp = file_service.file_upload(document_id, 'unittest', expected_revision, 'unittest change reason', 'Released', '', 'unittest.txt', test_file_path + '/' + file_upload_name) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(resp['data']['documentId'], document_id) self.assertEqual(resp['data']['revision'], expected_revision) new_file_id = resp['data']['id'] stream = file_service.get_file_stream(new_file_id) stream_stats = vars(stream) self.assertEqual(stream_stats['status_code'], 200) self.assertEqual(stream_stats['headers']['Content-Type'], 'application/octet-stream') # get new revision resp = document_service.get_document(document_id) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(resp['data']['documentId'], document_id) newest_revision = resp['data']['id'] # validate newest revision has changed self.assertNotEqual(new_revision, newest_revision) # validate document is not deleted resp = document_service.get_document_revision(document_id, new_revision) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(resp['data']['archive'], 0) # document not in recycle bin # validate number of revisions resp = document_service.get_document_revisions(document_id) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(len(resp['data']), 3) revisions = [document['id'] for document in resp['data']] self.assertIn(empty_revision_id, revisions) self.assertIn(new_revision, revisions) self.assertIn(newest_revision, revisions) # delete document resp = document_service.delete_document_revision(new_revision) self.assertEqual(resp['meta']['status'], 200) # validate document is deleted resp = document_service.get_document_revisions(document_id) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(len(resp['data']), 2) revisions = [document['id'] for document in resp['data']] self.assertIn(empty_revision_id, revisions) self.assertNotIn(new_revision, revisions) self.assertIn(newest_revision, revisions) # validate newest document is still newest_revision resp = document_service.get_document(document_id) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(resp['data']['documentId'], document_id) self.assertEqual(resp['data']['id'], newest_revision) # delete document resp = document_service.delete_document(newest_revision) self.assertEqual(resp['meta']['status'], 200) # validate document does not exist in VV resp = document_service.get_document(document_id) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(resp['data']['archive'], 2) # document in recycle bin def test_update_document_check_in_status(self): """ tests DocumentService.update_document_check_in_status """ document_service = DocumentService(self.vault) # validate document checked in resp = document_service.get_document(self.document_id) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(resp['data']['documentId'], self.document_id) self.assertEqual(resp['data']['checkInStatus'], 0) # check out document in VV resp = document_service.update_document_check_in_status(self.document_id, 1) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(resp['data']['documentId'], self.document_id) self.assertEqual(resp['data']['checkInStatus'], 1) # check in document in VV resp = document_service.update_document_check_in_status(self.document_id, 0) self.assertEqual(resp['meta']['status'], 200) self.assertEqual(resp['data']['documentId'], self.document_id) self.assertEqual(resp['data']['checkInStatus'], 0)
45.271812
122
0.673708
1,538
13,491
5.645644
0.080624
0.126108
0.131291
0.079466
0.836001
0.802948
0.76287
0.726938
0.688817
0.671427
0
0.01112
0.206805
13,491
297
123
45.424242
0.800299
0.107924
0
0.645833
0
0
0.105407
0.0041
0
0
0
0.003367
0.432292
1
0.072917
false
0
0.026042
0
0.109375
0
0
0
0
null
0
0
0
1
1
1
1
0
1
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
6
5b0cae180910d5d6bc22d6347143b88e1fea397f
175
py
Python
bpcs/__init__.py
BburnN123/bpcs
f53caede7e202ce07b51890f028b9caf73a22937
[ "MIT" ]
20
2017-04-25T21:07:24.000Z
2022-03-30T11:11:47.000Z
bpcs/__init__.py
BburnN123/bpcs
f53caede7e202ce07b51890f028b9caf73a22937
[ "MIT" ]
4
2016-04-06T01:19:27.000Z
2020-09-26T18:38:29.000Z
bpcs/__init__.py
BburnN123/bpcs
f53caede7e202ce07b51890f028b9caf73a22937
[ "MIT" ]
12
2017-04-02T23:10:46.000Z
2022-03-21T03:43:55.000Z
from .bpcs_steg_decode import decode from .bpcs_steg_encode import encode from .bpcs_steg_capacity import capacity from .bpcs_steg_test import test_all __version__ = '0.0.2'
25
40
0.834286
29
175
4.586207
0.413793
0.240602
0.360902
0
0
0
0
0
0
0
0
0.019355
0.114286
175
6
41
29.166667
0.83871
0
0
0
0
0
0.028571
0
0
0
0
0
0
1
0
false
0
0.8
0
0.8
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
6
d2d98bc9242b2421468d751d1aefc3b671a78266
46
py
Python
OP-GAN/box_generation/seq2seq/loss/__init__.py
ts170/OP-GAN
b9a6227aaa7befa2025ea1f07e62e7a7e9c7ce1e
[ "MIT" ]
1
2021-08-25T02:36:02.000Z
2021-08-25T02:36:02.000Z
OP-GAN/box_generation/seq2seq/loss/__init__.py
ts170/OP-GAN
b9a6227aaa7befa2025ea1f07e62e7a7e9c7ce1e
[ "MIT" ]
null
null
null
OP-GAN/box_generation/seq2seq/loss/__init__.py
ts170/OP-GAN
b9a6227aaa7befa2025ea1f07e62e7a7e9c7ce1e
[ "MIT" ]
null
null
null
from .loss import NLLLoss, Perplexity, BBLoss
23
45
0.804348
6
46
6.166667
1
0
0
0
0
0
0
0
0
0
0
0
0.130435
46
1
46
46
0.925
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
82b349f86ba270454743263a3dc785c4e3019478
41
py
Python
tests/apimodels/__init__.py
j-000/ezresbackend
999e37dace994a50fdcd89724410e8dd77fe4f1b
[ "MIT" ]
null
null
null
tests/apimodels/__init__.py
j-000/ezresbackend
999e37dace994a50fdcd89724410e8dd77fe4f1b
[ "MIT" ]
null
null
null
tests/apimodels/__init__.py
j-000/ezresbackend
999e37dace994a50fdcd89724410e8dd77fe4f1b
[ "MIT" ]
null
null
null
from .. import UserModel, db, DEVELOPMENT
41
41
0.780488
5
41
6.4
1
0
0
0
0
0
0
0
0
0
0
0
0.121951
41
1
41
41
0.888889
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
82c578a502c477220f79c30eaebac734c2436337
4,055
py
Python
build/blocks.py
fourpoints/plusMarkup
0b8ef4b871044c5bf83fa7f867bad953e938d603
[ "MIT" ]
1
2017-07-10T18:26:15.000Z
2017-07-10T18:26:15.000Z
build/blocks.py
fourpoints/plusMarkup
0b8ef4b871044c5bf83fa7f867bad953e938d603
[ "MIT" ]
null
null
null
build/blocks.py
fourpoints/plusMarkup
0b8ef4b871044c5bf83fa7f867bad953e938d603
[ "MIT" ]
null
null
null
""" Blocks TODO: * Avoid newline/indent on certain tags, like Blank/Pre: self.__class__.__name__ != "Pre" (necessary?) * Fixed: () popped len(token) twice """ ## +block def indented_block(self): print(f"Indent-dependent {self.tag} block started") start_O_line = self.O.line_number block_indent = self.I.indent_count + 1 if self.offset: self.O.offset -= block_indent #Opening block self.opening_tag() #Main block loop while 1: loop_line = self.I.line_number index, token = self.next_token() if index > 0: self.O.indents(count = self.I.indent_count) self.O.write(self.I.popto(index)) self.I.popto(len(token)) if token: self.routine(token) #refill line if self.I.line == '': try: self.I.readline() except: break #check if next line is in block if loop_line != self.I.line_number: if block_indent > self.I.indent_count: break else: self.O.newline() #check if preceding line was empty: if self.I.empty_line: self.I.empty_line = False self.O.indents(count = 0) self.O.newline() #Closing block if start_O_line != self.O.line_number: self.O.newline() self.O.indents(count = block_indent - 1) self.closing_tag() if self.offset: self.O.offset += block_indent ## @wrapper: def wrapping_block(self): print(f"Wrapping {self.tag} block started") start_O_line = self.O.line_number block_indent = self.I.indent_count if self.offset: self.O.offset -= block_indent #Opening block self.opening_tag() #Main block loop FIX while 1: loop_line = self.I.line_number index, token = self.next_token() if not token and index: self.O.indents(count = self.I.indent_count) self.O.write(self.I.popto(index)) self.I.popto(len(token)) if token: self.routine(token) #refill line if self.I.line == '': try: self.I.readline() except: break #check if next line is in block if loop_line != self.I.line_number: if block_indent > self.I.indent_count: break else: self.O.newline() #check if preceding line was empty: if self.I.empty_line: self.I.empty_line = False self.O.indents(count = 0) self.O.newline() #Closing block if start_O_line != self.O.line_number and self.__class__.__name__ != "Blank": self.O.newline() self.O.indents(count = block_indent) self.closing_tag() if self.offset: self.O.offset += block_indent ## +block() def bracketed_block(self): print(f"Bracketed {self.tag} block started") start_O_line = self.O.line_number block_indent = self.I.indent_count if self.offset: self.O.offset -= block_indent #Opening block self.opening_tag() #Main block loop FIX level = 0 #number of brackets must match while 1: loop_line = self.I.line_number index, token = self.next_token('(', ')') if not token or token == '(' or token == ')': #indent will be added in the token's routine, if needed self.O.indents(count = self.I.indent_count) self.O.write(self.I.popto(index)) self.I.popto(len(token)) if token == '(': self.O.write('(') level += 1 elif token == ')': if level == 0: break #end of block self.O.write(')') level -= 1 else: if token: self.routine(token) if self.I.line.isspace() or self.I.line == '': self.I.readline() #refill line if self.I.line == '': try: self.I.readline() except: break #check if next line is in block REMOVE?! + indent_count?? if loop_line != self.I.line_number: if block_indent > self.I.indent_count: break else: self.O.newline() #check if preceding line was empty: if self.I.empty_line: self.I.empty_line = False self.O.indents(count = 0) self.O.newline() #Closing block self.closing_tag() if self.offset: self.O.offset += block_indent #Selfclosing pseudo-block def selfclosing_block(self): print(f"Selfclosing {self.tag} tag started") self.opening_tag()
22.527778
102
0.645129
614
4,055
4.118893
0.140065
0.071174
0.039146
0.05694
0.785291
0.765125
0.765125
0.765125
0.765125
0.733492
0
0.00414
0.225647
4,055
179
103
22.653631
0.801274
0.167448
0
0.783333
0
0
0.04902
0
0
0
0
0.005587
0
1
0.033333
false
0
0
0
0.033333
0.033333
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
7d9cfc3ab6417716a502297f4fac7ac368d2e7b2
5,250
py
Python
tests/test_winterbloom_voltageio.py
theacodes/Winterbloom_VoltageIO
91af1043d5c1ac7a2bd863bc71a83779017efb47
[ "MIT" ]
2
2020-01-14T00:09:01.000Z
2020-01-30T02:24:49.000Z
tests/test_winterbloom_voltageio.py
theacodes/Winterbloom_VoltageIO
91af1043d5c1ac7a2bd863bc71a83779017efb47
[ "MIT" ]
null
null
null
tests/test_winterbloom_voltageio.py
theacodes/Winterbloom_VoltageIO
91af1043d5c1ac7a2bd863bc71a83779017efb47
[ "MIT" ]
null
null
null
# Copyright (c) 2019 Alethea Flowers for Winterbloom # Licensed under the MIT License import math import pytest import winterbloom_voltageio @pytest.mark.parametrize( ("target", "expected"), [ (-1, (0, 0)), (0, (0, 1)), (1, (1, 2)), (4, (4, 5)), (5, (5, 5)), (0.2, (0, 1)), (4.5, (4, 5)), (5.1, (5, 5)), ] ) def test__take_nearest_pair_integral(target, expected): assert winterbloom_voltageio._take_nearest_pair( [0, 1, 2, 3, 4, 5], target ) == expected @pytest.mark.parametrize( ("target", "expected"), [ (-6, (-5, -5)), (-5, (-5, -4)), (-1, (-1, 0)), (0, (0, 1)), (1, (1, 2)), (5, (5, 5)), (6, (5, 5)), (-0.2, (-1, 0)), (-4.5, (-5, -4)), (-5.1, (-5, -5)), ] ) def test__take_nearest_pair_integral_bipolar(target, expected): assert winterbloom_voltageio._take_nearest_pair( [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5], target ) == expected @pytest.mark.parametrize( ("target", "expected"), [ (-1, (0, 0)), (0, (0, 0.2)), (0.2, (0.2, 1.8)), (5.3, (5.3, 5.3)), (10, (5.3, 5.3)), (4.5, (4.1, 5.3)), (2.1, (1.8, 2.3)), ] ) def test__take_nearest_pair_fractional(target, expected): assert winterbloom_voltageio._take_nearest_pair( [0, 0.2, 1.8, 2.3, 3.9, 4.1, 5.3], target ) == expected class AnalogOut: def __init__(self): self.value = 0 @pytest.mark.parametrize( ("voltage", "value"), [ (0, 0), (0.25, 16384), (0.5, 32768), (0.75, 49151), (1.0, 65535), (2.0, 65535), ] ) def test_out_linear_calibration_normalized(voltage, value): analog_out = AnalogOut() voltage_out = winterbloom_voltageio.VoltageOut(analog_out) voltage_out.linear_calibration(0.0, 1.0) voltage_out.voltage = voltage assert analog_out.value == value @pytest.mark.parametrize( ("voltage", "value"), [ # 0% (0, 0), # 25% (0.825, 16384), # 50% (1.65, 32768), # 75%, (2.475, 49151), # 100% (3.3, 65535), (4.0, 65535), ] ) def test_out_linear_calibration_real_range(voltage, value): analog_out = AnalogOut() voltage_out = winterbloom_voltageio.VoltageOut(analog_out) voltage_out.linear_calibration(0.0, 3.3) voltage_out.voltage = voltage assert analog_out.value == value @pytest.mark.parametrize( ("voltage", "value"), [ (-1.0, 0), (-0.5, 0), (-0.25, 16384), (0, 32768), (0.25, 49151), (0.5, 65535), (1.0, 65535), ] ) def test_out_linear_calibration_bipolar(voltage, value): analog_out = AnalogOut() voltage_out = winterbloom_voltageio.VoltageOut(analog_out) voltage_out.linear_calibration(-0.5, 0.5) voltage_out.voltage = voltage assert analog_out.value == value @pytest.mark.parametrize( ("voltage", "value"), [ (0, 0), (0.5, 16384), (1.0, 32768), (5.5, 49152), (10, 65535), (11, 65535), ] ) def test_out_direct_calibration(voltage, value): analog_out = AnalogOut() voltage_out = winterbloom_voltageio.VoltageOut(analog_out) # Very non-linear. The first volt takes up half of the range. voltage_out.direct_calibration({ 0: 0, 1.0: 32768, 10: 65535, }) voltage_out.voltage = voltage assert analog_out.value == value class AnalogIn: def __init__(self): self.value = 0 @pytest.mark.parametrize( ("voltage", "value"), [ (0, 0), (0.25, 16384), (0.5, 32768), (0.75, 49151), (1.0, 65535), ] ) def test_in_linear_calibration_normalized(voltage, value): analog_in = AnalogIn() voltage_in = winterbloom_voltageio.VoltageIn(analog_in) voltage_in.linear_calibration(0.0, 1.0) analog_in.value = value assert math.isclose(voltage_in.voltage, voltage, rel_tol=1e-4) @pytest.mark.parametrize( ("voltage", "value"), [ # 0% (0, 0), # 25% (0.825, 16384), # 50% (1.65, 32768), # 75%, (2.475, 49151), # 100% (3.3, 65535), ] ) def test_in_linear_calibration_real_range(voltage, value): analog_in = AnalogIn() voltage_in = winterbloom_voltageio.VoltageIn(analog_in) voltage_in.linear_calibration(0.0, 3.3) analog_in.value = value assert math.isclose(voltage_in.voltage, voltage, rel_tol=1e-4) @pytest.mark.parametrize( ("voltage", "value"), [ (0, 0), (0.5, 16384), (1.0, 32768), (5.5, 49152), (10, 65535), ] ) def test_in_direct_calibration(voltage, value): analog_in = AnalogIn() voltage_in = winterbloom_voltageio.VoltageIn(analog_in) # Very non-linear. The first volt takes up half of the range. voltage_in.direct_calibration({ 0: 0, 32768: 1.0, 65535: 10, }) analog_in.value = value assert math.isclose(voltage_in.voltage, voltage, rel_tol=1e-4)
21.169355
66
0.543048
673
5,250
4.052006
0.121843
0.022736
0.014301
0.071874
0.861386
0.831316
0.808214
0.755042
0.734873
0.676201
0
0.12635
0.294476
5,250
247
67
21.255061
0.609881
0.046286
0
0.550265
0
0
0.02524
0
0
0
0
0
0.05291
1
0.063492
false
0
0.015873
0
0.089947
0
0
0
0
null
0
0
0
1
1
1
1
1
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
6
816ecbe5f5afa761ad15a2740c6d39c914861c24
13,296
py
Python
migration/test/test_migrate_environment_up.py
xypnox/Submitty
6f858e0891e610f9b6ebcb716ee135c7a6b57407
[ "BSD-3-Clause" ]
null
null
null
migration/test/test_migrate_environment_up.py
xypnox/Submitty
6f858e0891e610f9b6ebcb716ee135c7a6b57407
[ "BSD-3-Clause" ]
null
null
null
migration/test/test_migrate_environment_up.py
xypnox/Submitty
6f858e0891e610f9b6ebcb716ee135c7a6b57407
[ "BSD-3-Clause" ]
null
null
null
from argparse import Namespace from io import StringIO from pathlib import Path import shutil import sys import tempfile from types import SimpleNamespace import unittest from .helpers import create_migration import migrator class TestMigrateEnvironmentUp(unittest.TestCase): def setUp(self): self.stdout = sys.stdout sys.stdout = StringIO() self.dir = tempfile.mkdtemp() self.old_migrations_path = migrator.MIGRATIONS_PATH migrator.MIGRATIONS_PATH = Path(self.dir) def tearDown(self): sys.stdout = self.stdout shutil.rmtree(self.dir) migrator.MIGRATIONS_PATH = self.old_migrations_path def setup_test(self, environment): Path(self.dir, environment).mkdir() self.database = migrator.db.Database({'database_driver': 'sqlite'}, environment) self.database.DynamicBase.metadata.create_all(self.database.engine) def test_migrate_system(self): environment = 'system' self.setup_test(environment) args = Namespace() args.direction = 'up' args.initial = False args.single = False args.config = None create_migration(None, self.dir, environment, '01_test1.py', 0) create_migration(None, self.dir, environment, '02_test1.py', 0) migrator.main.migrate_environment(self.database, environment, args) self.assertEqual("""Running up migrations for system... 01_test1 02_test1 DONE """, sys.stdout.getvalue()) rows = self.database.session.query(self.database.migration_table).all() expected_rows = ['01_test1', '02_test1'] self.assertEqual(len(rows), len(expected_rows)) for i in range(len(rows)): row = rows[i] self.assertEqual(expected_rows[i], row.id) self.assertEqual(1, row.status) self.assertIsNotNone(row.commit_time) self.assertTrue(Path(self.dir, expected_rows[i] + '.py.up.txt').exists()) def test_migrate_master(self): environment = 'master' self.setup_test(environment) args = Namespace() args.direction = 'up' args.initial = False args.single = False args.config = None create_migration(self.database, self.dir, environment, '01_test2.py', 0) create_migration(self.database, self.dir, environment, '02_test2.py', 0) migrator.main.migrate_environment(self.database, environment, args) self.assertEqual("""Running up migrations for master... 01_test2 02_test2 DONE """, sys.stdout.getvalue()) rows = self.database.session.query(self.database.migration_table).all() expected_rows = ['01_test2', '02_test2'] self.assertEqual(len(rows), len(expected_rows)) for i in range(len(rows)): row = rows[i] self.assertEqual(expected_rows[i], row.id) self.assertEqual(1, row.status) self.assertIsNotNone(row.commit_time) self.assertTrue(Path(self.dir, expected_rows[i] + '.py.up.txt').exists()) def test_migrate_course(self): environment = 'course' self.setup_test(environment) args = Namespace() args.direction = 'up' args.initial = False args.single = False args.semester = 'f18' args.course = 'csci1100' args.config = None create_migration(self.database, self.dir, environment, '01_test3.py', 0) create_migration(self.database, self.dir, environment, '02_test3.py', 0) migrator.main.migrate_environment(self.database, environment, args) self.assertEqual("""Running up migrations for f18.csci1100... 01_test3 02_test3 DONE """, sys.stdout.getvalue()) rows = self.database.session.query(self.database.migration_table).all() expected_rows = ['01_test3', '02_test3'] self.assertEqual(len(rows), len(expected_rows)) for i in range(len(rows)): row = rows[i] self.assertEqual(expected_rows[i], row.id) self.assertEqual(1, row.status) self.assertIsNotNone(row.commit_time) self.assertTrue(Path(self.dir, expected_rows[i] + '.py.up.txt').exists()) def test_missing_migration(self): environment = 'master' self.setup_test(environment) args = Namespace() args.direction = 'up' args.single = False args.initial = False args.config = SimpleNamespace() install_path = Path(self.dir, 'install') Path(install_path, 'migrations', environment).mkdir(parents=True) args.config.submitty = { 'submitty_install_dir': str(install_path) } missing_migration = Path(install_path, 'migrations', environment, '02_test4.py') with missing_migration.open('w') as open_file: open_file.write(""" from pathlib import Path INSTALL_PATH = "{}" def down(*_): with Path(INSTALL_PATH, 'test.txt').open('w') as open_file: open_file.write('test') """.format(install_path)) create_migration(self.database, self.dir, environment, '01_test4.py', 1) create_migration(self.database, self.dir, environment, '02_test4.py', 1, False) create_migration(self.database, self.dir, environment, '03_test4.py', 0) create_migration(self.database, self.dir, environment, '04_test4.py', 0) migrator.main.migrate_environment(self.database, environment, args) self.assertEqual("""Running up migrations for master... Removing 1 missing migrations: 02_test4 03_test4 04_test4 DONE """, sys.stdout.getvalue()) rows = self.database.session.query(self.database.migration_table).all() expected_rows = ['01_test4', '03_test4', '04_test4'] self.assertEqual(len(rows), len(expected_rows)) for i in range(len(rows)): row = rows[i] self.assertEqual(expected_rows[i], row.id) self.assertEqual(1, row.status) self.assertIsNotNone(row.commit_time) up_file = expected_rows[i] + '.py.up.txt' if i > 0: self.assertTrue(Path(self.dir, up_file).exists()) else: self.assertFalse(Path(self.dir, up_file).exists()) self.assertFalse(missing_migration.exists()) self.assertTrue(Path(install_path, 'test.txt').exists()) def test_missing_migration_no_file(self): environment = 'master' self.setup_test(environment) args = Namespace() args.direction = 'up' args.single = False args.initial = False args.config = SimpleNamespace() install_path = Path(self.dir, 'install') Path(install_path, 'migrations', environment).mkdir(parents=True) args.config.submitty = { 'submitty_install_dir': str(install_path) } create_migration(self.database, self.dir, environment, '01_test5.py', 1) create_migration(self.database, self.dir, environment, '02_test5.py', 1, False) create_migration(self.database, self.dir, environment, '03_test5.py', 0) create_migration(self.database, self.dir, environment, '04_test5.py', 0) migrator.main.migrate_environment(self.database, environment, args) self.assertEqual("""Running up migrations for master... Removing 1 missing migrations: 02_test5 03_test5 04_test5 DONE """, sys.stdout.getvalue()) rows = self.database.session.query(self.database.migration_table).all() expected_rows = ['01_test5', '03_test5', '04_test5'] self.assertEqual(len(rows), len(expected_rows)) for i in range(len(rows)): row = rows[i] self.assertEqual(expected_rows[i], row.id) self.assertEqual(1, row.status) self.assertIsNotNone(row.commit_time) up_file = expected_rows[i] + '.py.up.txt' if i > 0: self.assertTrue(Path(self.dir, up_file).exists()) else: self.assertFalse(Path(self.dir, up_file).exists()) def test_fake_migrations(self): environment = 'master' self.setup_test(environment) args = Namespace() args.direction = 'up' args.set_fake = True args.single = False args.initial = False args.config = None create_migration(self.database, self.dir, environment, '01_test6.py', 1) create_migration(self.database, self.dir, environment, '02_test6.py', 0) create_migration(self.database, self.dir, environment, '03_test6.py', 0) migrator.main.migrate_environment(self.database, environment, args) self.assertEqual("""Running up migrations for master... 02_test6 (FAKE) 03_test6 (FAKE) DONE """, sys.stdout.getvalue()) rows = self.database.session.query(self.database.migration_table).all() expected_rows = ['01_test6', '02_test6', '03_test6'] self.assertEqual(len(rows), len(expected_rows)) for i in range(len(rows)): row = rows[i] self.assertEqual(expected_rows[i], row.id) self.assertEqual(1, row.status) self.assertIsNotNone(row.commit_time) up_file = expected_rows[i] + '.py.up.txt' self.assertFalse(Path(self.dir, up_file).exists()) def test_single_migration(self): environment = 'master' self.setup_test(environment) args = Namespace() args.direction = 'up' args.single = True args.initial = False args.config = None create_migration(self.database, self.dir, environment, '01_test7.py', 1) create_migration(self.database, self.dir, environment, '02_test7.py', 0) create_migration(self.database, self.dir, environment, '03_test7.py', 0) migrator.main.migrate_environment(self.database, environment, args) self.assertEqual("""Running up migrations for master... 02_test7 DONE """, sys.stdout.getvalue()) rows = self.database.session.query(self.database.migration_table).all() expected_rows = ['01_test7', '02_test7', '03_test7'] self.assertEqual(len(rows), len(expected_rows)) for i in range(len(rows)): row = rows[i] self.assertEqual(expected_rows[i], row.id) self.assertEqual(1 if i < 2 else 0, row.status) self.assertIsNotNone(row.commit_time) up_file = expected_rows[i] + '.py.up.txt' if i == 1: self.assertTrue(Path(self.dir, up_file).exists()) else: self.assertFalse(Path(self.dir, up_file).exists()) def test_single_fake_migration(self): environment = 'master' self.setup_test(environment) args = Namespace() args.direction = 'up' args.set_fake = True args.single = True args.initial = False args.config = None create_migration(self.database, self.dir, environment, '01_test8.py', 1) create_migration(self.database, self.dir, environment, '02_test8.py', 0) create_migration(self.database, self.dir, environment, '03_test8.py', 0) migrator.main.migrate_environment(self.database, environment, args) self.assertEqual("""Running up migrations for master... 02_test8 (FAKE) DONE """, sys.stdout.getvalue()) rows = self.database.session.query(self.database.migration_table).all() expected_rows = ['01_test8', '02_test8', '03_test8'] self.assertEqual(len(rows), len(expected_rows)) for i in range(len(rows)): row = rows[i] self.assertEqual(expected_rows[i], row.id) self.assertEqual(1 if i < 2 else 0, row.status) self.assertIsNotNone(row.commit_time) up_file = expected_rows[i] + '.py.up.txt' self.assertFalse(Path(self.dir, up_file).exists()) def test_initial_migration(self): environment = 'master' self.setup_test(environment) args = Namespace() args.direction = 'up' args.single = False args.initial = True args.config = None create_migration(self.database, self.dir, environment, '01_test9.py', 0) create_migration(self.database, self.dir, environment, '02_test9.py', 0) create_migration(self.database, self.dir, environment, '03_test9.py', 0) migrator.main.migrate_environment(self.database, environment, args) self.assertEqual("""Running up migrations for master... 01_test9 02_test9 (FAKE) 03_test9 (FAKE) DONE """, sys.stdout.getvalue()) rows = self.database.session.query(self.database.migration_table).all() expected_rows = ['01_test9', '02_test9', '03_test9'] self.assertEqual(len(rows), len(expected_rows)) for i in range(len(rows)): row = rows[i] self.assertEqual(expected_rows[i], row.id) self.assertEqual(1, row.status) self.assertIsNotNone(row.commit_time) up_file = expected_rows[i] + '.py.up.txt' if i == 0: self.assertTrue(Path(self.dir, up_file).exists()) else: self.assertFalse(Path(self.dir, up_file).exists()) if __name__ == '__main__': unittest.main()
40.048193
88
0.636282
1,613
13,296
5.090515
0.074396
0.078919
0.059189
0.078919
0.847765
0.822068
0.810133
0.810133
0.802704
0.802704
0
0.026438
0.240448
13,296
331
89
40.169184
0.786613
0
0
0.64
0
0
0.121916
0.003309
0
0
0
0
0.2
1
0.04
false
0
0.036667
0
0.08
0
0
0
0
null
0
0
0
1
1
1
1
1
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
6
81abc9407002a109a22755547f97734ff4574488
44
py
Python
Pluto/Libraries/GLM/__init__.py
n8vm/Foton
eacec2de9bf53d8fecff387b60604e6227baea28
[ "MIT" ]
10
2019-12-16T18:04:48.000Z
2021-05-06T00:40:11.000Z
Pluto/Libraries/GLM/__init__.py
natevm/Foton
eacec2de9bf53d8fecff387b60604e6227baea28
[ "MIT" ]
35
2019-01-29T21:57:44.000Z
2019-04-29T02:40:20.000Z
Pluto/Libraries/GLM/__init__.py
natevm/Foton
eacec2de9bf53d8fecff387b60604e6227baea28
[ "MIT" ]
1
2019-01-19T22:34:00.000Z
2019-01-19T22:34:00.000Z
from Pluto.Libraries.Libraries.GLM import *
22
43
0.818182
6
44
6
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.090909
44
1
44
44
0.9
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
c4a070e911c6345d60b07ab969e9daf914b32beb
7,797
py
Python
pi_vision/pi_face_tracker/src/pi_face_tracker/srv/_SetROI.py
openrobotics/openrobotics_thunderbot
b3cee7f29a5e41dd162e72b876d66a10a6e5135b
[ "MIT" ]
1
2015-01-23T21:03:47.000Z
2015-01-23T21:03:47.000Z
pi_vision/pi_face_tracker/src/pi_face_tracker/srv/_SetROI.py
openrobotics/openrobotics_thunderbot
b3cee7f29a5e41dd162e72b876d66a10a6e5135b
[ "MIT" ]
null
null
null
pi_vision/pi_face_tracker/src/pi_face_tracker/srv/_SetROI.py
openrobotics/openrobotics_thunderbot
b3cee7f29a5e41dd162e72b876d66a10a6e5135b
[ "MIT" ]
null
null
null
"""autogenerated by genpy from pi_face_tracker/SetROIRequest.msg. Do not edit.""" import sys python3 = True if sys.hexversion > 0x03000000 else False import genpy import struct import sensor_msgs.msg class SetROIRequest(genpy.Message): _md5sum = "9586986cb2458d45fdbda6087252affd" _type = "pi_face_tracker/SetROIRequest" _has_header = False #flag to mark the presence of a Header object _full_text = """sensor_msgs/RegionOfInterest roi ================================================================================ MSG: sensor_msgs/RegionOfInterest # This message is used to specify a region of interest within an image. # # When used to specify the ROI setting of the camera when the image was # taken, the height and width fields should either match the height and # width fields for the associated image; or height = width = 0 # indicates that the full resolution image was captured. uint32 x_offset # Leftmost pixel of the ROI # (0 if the ROI includes the left edge of the image) uint32 y_offset # Topmost pixel of the ROI # (0 if the ROI includes the top edge of the image) uint32 height # Height of ROI uint32 width # Width of ROI # True if a distinct rectified ROI should be calculated from the "raw" # ROI in this message. Typically this should be False if the full image # is captured (ROI not used), and True if a subwindow is captured (ROI # used). bool do_rectify """ __slots__ = ['roi'] _slot_types = ['sensor_msgs/RegionOfInterest'] def __init__(self, *args, **kwds): """ Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix in-order arguments and keyword arguments. The available fields are: roi :param args: complete set of field values, in .msg order :param kwds: use keyword arguments corresponding to message field names to set specific fields. """ if args or kwds: super(SetROIRequest, self).__init__(*args, **kwds) #message fields cannot be None, assign default values for those that are if self.roi is None: self.roi = sensor_msgs.msg.RegionOfInterest() else: self.roi = sensor_msgs.msg.RegionOfInterest() def _get_types(self): """ internal API method """ return self._slot_types def serialize(self, buff): """ serialize message into buffer :param buff: buffer, ``StringIO`` """ try: _x = self buff.write(_struct_4IB.pack(_x.roi.x_offset, _x.roi.y_offset, _x.roi.height, _x.roi.width, _x.roi.do_rectify)) except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x)))) except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x)))) def deserialize(self, str): """ unpack serialized message in str into this message instance :param str: byte array of serialized message, ``str`` """ try: if self.roi is None: self.roi = sensor_msgs.msg.RegionOfInterest() end = 0 _x = self start = end end += 17 (_x.roi.x_offset, _x.roi.y_offset, _x.roi.height, _x.roi.width, _x.roi.do_rectify,) = _struct_4IB.unpack(str[start:end]) self.roi.do_rectify = bool(self.roi.do_rectify) return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill def serialize_numpy(self, buff, numpy): """ serialize message with numpy array types into buffer :param buff: buffer, ``StringIO`` :param numpy: numpy python module """ try: _x = self buff.write(_struct_4IB.pack(_x.roi.x_offset, _x.roi.y_offset, _x.roi.height, _x.roi.width, _x.roi.do_rectify)) except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x)))) except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x)))) def deserialize_numpy(self, str, numpy): """ unpack serialized message in str into this message instance using numpy for array types :param str: byte array of serialized message, ``str`` :param numpy: numpy python module """ try: if self.roi is None: self.roi = sensor_msgs.msg.RegionOfInterest() end = 0 _x = self start = end end += 17 (_x.roi.x_offset, _x.roi.y_offset, _x.roi.height, _x.roi.width, _x.roi.do_rectify,) = _struct_4IB.unpack(str[start:end]) self.roi.do_rectify = bool(self.roi.do_rectify) return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill _struct_I = genpy.struct_I _struct_4IB = struct.Struct("<4IB") """autogenerated by genpy from pi_face_tracker/SetROIResponse.msg. Do not edit.""" import sys python3 = True if sys.hexversion > 0x03000000 else False import genpy import struct class SetROIResponse(genpy.Message): _md5sum = "d41d8cd98f00b204e9800998ecf8427e" _type = "pi_face_tracker/SetROIResponse" _has_header = False #flag to mark the presence of a Header object _full_text = """ """ __slots__ = [] _slot_types = [] def __init__(self, *args, **kwds): """ Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix in-order arguments and keyword arguments. The available fields are: :param args: complete set of field values, in .msg order :param kwds: use keyword arguments corresponding to message field names to set specific fields. """ if args or kwds: super(SetROIResponse, self).__init__(*args, **kwds) def _get_types(self): """ internal API method """ return self._slot_types def serialize(self, buff): """ serialize message into buffer :param buff: buffer, ``StringIO`` """ try: pass except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x)))) except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x)))) def deserialize(self, str): """ unpack serialized message in str into this message instance :param str: byte array of serialized message, ``str`` """ try: end = 0 return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill def serialize_numpy(self, buff, numpy): """ serialize message with numpy array types into buffer :param buff: buffer, ``StringIO`` :param numpy: numpy python module """ try: pass except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x)))) except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x)))) def deserialize_numpy(self, str, numpy): """ unpack serialized message in str into this message instance using numpy for array types :param str: byte array of serialized message, ``str`` :param numpy: numpy python module """ try: end = 0 return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill _struct_I = genpy.struct_I class SetROI(object): _type = 'pi_face_tracker/SetROI' _md5sum = '9586986cb2458d45fdbda6087252affd' _request_class = SetROIRequest _response_class = SetROIResponse
34.964126
126
0.674747
1,089
7,797
4.685032
0.171717
0.01568
0.01568
0.029792
0.78185
0.764994
0.757938
0.743434
0.743434
0.743434
0
0.017761
0.212902
7,797
222
127
35.121622
0.81359
0.284981
0
0.674603
1
0
0.278281
0.065716
0
0
0.003854
0
0
1
0.095238
false
0.015873
0.055556
0
0.349206
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
c4d8d1b2889ae52acc9b000629e3d6c7c7592c2b
9,556
py
Python
restapi/app/routes/answer.py
ninjadotorg/KPI
430617a1e85304a254cc7364d524d721b8d45b11
[ "MIT" ]
2
2020-06-30T18:03:12.000Z
2021-09-02T11:31:59.000Z
restapi/app/routes/answer.py
ninjadotorg/KPI
430617a1e85304a254cc7364d524d721b8d45b11
[ "MIT" ]
10
2020-09-05T23:29:52.000Z
2022-03-11T23:36:59.000Z
restapi/app/routes/answer.py
ninjadotorg/KPI
430617a1e85304a254cc7364d524d721b8d45b11
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import os import sys import hashlib import json import app.constants as CONST import logging import app.bl.answer as answer_bl import app.bl.people as people_bl from flask import Blueprint, request, g from app import db from datetime import datetime from sqlalchemy import and_, func from app.models import Rating, Comment, User, ReviewType, Question, Team, Company from app.helpers.message import MESSAGE, CODE from app.helpers.decorators import admin_required from app.helpers.response import response_ok, response_error from flask_jwt_extended import jwt_required, get_jwt_identity answer_routes = Blueprint('answer', __name__) logfile = logging.getLogger('file') @answer_routes.route('/submit', methods=['POST']) @jwt_required def submit_answer(): try: current_user = get_jwt_identity() user = db.session.query(User).filter(User.email==func.binary(current_user)).first() if user is None: return response_error(MESSAGE.USER_INVALID_EMAIL, CODE.USER_INVALID_EMAIL) data = request.json if data is None: return response_error(MESSAGE.INVALID_DATA, CODE.INVALID_DATA) review_type = request.args.get('type', '') object_id = request.args.get('id', -1) if len(review_type) == 0 or \ object_id == -1: return response_error(MESSAGE.ANSWER_INVALID_INPUT, CODE.ANSWER_INVALID_INPUT) result = answer_bl.is_valid_object_id(review_type, object_id) if result is None: return response_error(MESSAGE.ANSWER_INVALID_INPUT, CODE.ANSWER_INVALID_INPUT) rt = db.session.query(ReviewType).filter(ReviewType.name==func.binary(review_type)).first() ratings = data['ratings'] if ratings is not None: for r in ratings: if answer_bl.is_answer_question(user.id, review_type, object_id, r['question_id']): return response_error(MESSAGE.ANSWER_QUESTION_ALREADY, CODE.ANSWER_QUESTION_ALREADY) rating = Rating( point=r['rating'], question_id=r['question_id'], object_id=object_id, user_id=user.id ) db.session.add(rating) db.session.flush() comment = r['comment'] if comment is not None: c = Comment( desc=comment, rating_id=rating.id ) db.session.add(c) db.session.flush() else: return response_error(MESSAGE.ANSWER_INVALID_INPUT, CODE.ANSWER_INVALID_INPUT) if review_type == CONST.Type['People']: user = User.find_user_by_id(object_id) if user is not None: user.rating_count = people_bl.count_rating_for_object(user, CONST.Type['People']) user.comment_count = people_bl.count_comments_for_object(user, CONST.Type['People']) db.session.flush() elif review_type == CONST.Type['Team']: team = Team.find_team_by_id(object_id) if team is not None: team.rating_count = people_bl.count_rating_for_object(team, CONST.Type['Team']) team.comment_count = people_bl.count_comments_for_object(team, CONST.Type['Team']) db.session.flush() elif review_type == CONST.Type['Company']: company = Company.find_company_by_id(object_id) if company is not None: company.rating_count = people_bl.count_rating_for_object(company, CONST.Type['Company']) company.comment_count = people_bl.count_comments_for_object(company, CONST.Type['Company']) db.session.flush() db.session.commit() return response_ok() except Exception, ex: db.session.rollback() return response_error(ex.message) @answer_routes.route('/view', methods=['GET']) @jwt_required def view_answer(): try: current_user = get_jwt_identity() user = db.session.query(User).filter(User.email==func.binary(current_user)).first() if user is None: return response_error(MESSAGE.USER_INVALID_EMAIL, CODE.USER_INVALID_EMAIL) review_type = request.args.get('type', '') object_id = request.args.get('id', -1) if len(review_type) == 0 or \ object_id == -1: return response_error(MESSAGE.ANSWER_INVALID_INPUT, CODE.ANSWER_INVALID_INPUT) result = answer_bl.is_valid_object_id(review_type, object_id) if result is None: return response_error(MESSAGE.ANSWER_INVALID_INPUT, CODE.ANSWER_INVALID_INPUT) rt = db.session.query(ReviewType).filter(ReviewType.name==func.binary(review_type)).first() response = {} # get all ratings ratings = db.session.query(Question.name, Question.id, func.avg(Rating.point).label('average'))\ .filter(and_(Rating.object_id==object_id, Rating.question_id.in_(db.session.query(Question.id).filter(Question.type_id==rt.id)))) \ .filter(Question.id==Rating.question_id) \ .group_by(Question.name, Question.id) \ .all() rs = [] for r in ratings: data = { "id": r.id, "name": r.name, "average": r.average } comments = db.session.query(Comment).filter(Comment.rating_id.in_(db.session.query(Rating.id).filter(Rating.question_id==r.id, Rating.object_id==object_id))).limit(5).all() tmp = [] for c in comments: cjson = c.to_json() if c.rating.user is not None: if user.role_id == 1: cjson['user'] = c.rating.user.to_json() else: ujson = { 'name': hashlib.md5('{}{}{}'.format(c.rating.user.email, g.PASSPHASE, object_id)).hexdigest()[:6] } cjson['user'] = ujson else: cjson['user'] = None cjson['point'] = c.rating.point tmp.append(cjson) data['comments'] = tmp rs.append(data) response['ratings'] = rs response['first_review'] = 1 if len(ratings) == 0 else 0 response['reviewed_object'] = result.to_json() return response_ok(response) except Exception, ex: return response_error(ex.message) @answer_routes.route('/view-detail', methods=['GET']) @jwt_required def view_detail(): """ " view all ratings and comments of user with question id """ try: current_user = get_jwt_identity() user = db.session.query(User).filter(User.email==func.binary(current_user)).first() if user is None: return response_error(MESSAGE.USER_INVALID_EMAIL, CODE.USER_INVALID_EMAIL) review_type = request.args.get('type', '') question_id = request.args.get('question_id', -1) object_id = request.args.get('id', -1) if question_id == -1 or \ object_id == -1: return response_error(MESSAGE.ANSWER_INVALID_QUESTION_ID, CODE.ANSWER_INVALID_QUESTION_ID) result = answer_bl.is_valid_object_id(review_type, object_id) if result is None: return response_error(MESSAGE.ANSWER_INVALID_INPUT, CODE.ANSWER_INVALID_INPUT) rt = db.session.query(ReviewType).filter(ReviewType.name==func.binary(review_type)).first() response = {} # get all ratings r = db.session.query(Question.name, Question.id, func.avg(Rating.point).label('average'))\ .filter(and_(Rating.object_id==object_id, Rating.question_id.in_(db.session.query(Question.id).filter(Question.type_id==rt.id)))) \ .filter(Question.id==question_id) \ .filter(Question.id==Rating.question_id) \ .group_by(Question.name, Question.id) \ .first() data = { "id": r.id, "name": r.name, "average": r.average } comments = db.session.query(Comment).filter(Comment.rating_id.in_(db.session.query(Rating.id).filter(Rating.question_id==r.id, Rating.object_id==object_id))).all() tmp = [] for c in comments: cjson = c.to_json() if c.rating.user is not None: if user.role_id == 1: cjson['user'] = c.rating.user.to_json() else: ujson = { 'name': hashlib.md5('{}{}{}'.format(c.rating.user.email, g.PASSPHASE, object_id)).hexdigest()[:6] } cjson['user'] = ujson else: cjson['user'] = None cjson['point'] = c.rating.point tmp.append(cjson) data['comments'] = tmp response['ratings'] = data response['reviewed_object'] = result.to_json() return response_ok(response) except Exception, ex: return response_error(ex.message) @answer_routes.route('/delete-answer', methods=['DELETE']) @admin_required def delete_answer(): try: comment_id = request.args.get('id', -1) if comment_id == -1: return response_error(MESSAGE.ANSWER_INVALID_INPUT, CODE.ANSWER_INVALID_INPUT) review = answer_bl.review_type(comment_id) if review is None: return response_error(MESSAGE.ANSWER_INVALID_INPUT, CODE.ANSWER_INVALID_INPUT) comment = db.session.query(Comment).filter(Comment.id==comment_id).first() rating = db.session.query(Rating).filter(Rating.id.in_(db.session.query(Comment.rating_id).filter(Comment.id==comment_id))).first() db.session.delete(comment) db.session.delete(rating) object_id = rating.object_id review_type = review.name if review_type == CONST.Type['People']: user = User.find_user_by_id(object_id) if user is not None: user.rating_count = people_bl.count_rating_for_object(user, CONST.Type['People']) user.comment_count = people_bl.count_comments_for_object(user, CONST.Type['People']) db.session.flush() elif review_type == CONST.Type['Team']: team = Team.find_team_by_id(object_id) if team is not None: team.rating_count = people_bl.count_rating_for_object(team, CONST.Type['Team']) team.comment_count = people_bl.count_comments_for_object(team, CONST.Type['Team']) db.session.flush() elif review_type == CONST.Type['Company']: company = Company.find_company_by_id(object_id) if company is not None: company.rating_count = people_bl.count_rating_for_object(company, CONST.Type['Company']) company.comment_count = people_bl.count_comments_for_object(company, CONST.Type['Company']) db.session.flush() db.session.commit() return response_ok() except Exception, ex: db.session.rollback() return response_error(ex.message)
33.647887
175
0.717769
1,388
9,556
4.720461
0.09438
0.04533
0.052198
0.055556
0.770452
0.762515
0.733364
0.730159
0.726038
0.722222
0
0.002823
0.147342
9,556
284
176
33.647887
0.801301
0.005546
0
0.66087
0
0
0.04293
0
0
0
0
0
0
0
null
null
0.008696
0.073913
null
null
0.008696
0
0
0
null
0
0
0
0
1
1
1
1
1
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
6
c4e6f066be1a89a704e61116eb309c8611194782
463
py
Python
packages/python/yap_kernel/yap_ipython/utils/tests/test_imports.py
ryandesign/yap
9a50d1a3d985ec559ebfbb8e9f4d4c6b88b30214
[ "Artistic-1.0-Perl", "ClArtistic" ]
90
2015-03-09T01:24:15.000Z
2022-02-24T13:56:25.000Z
packages/python/yap_kernel/yap_ipython/utils/tests/test_imports.py
ryandesign/yap
9a50d1a3d985ec559ebfbb8e9f4d4c6b88b30214
[ "Artistic-1.0-Perl", "ClArtistic" ]
52
2016-02-14T08:59:37.000Z
2022-03-14T16:39:35.000Z
packages/python/yap_kernel/yap_ipython/utils/tests/test_imports.py
ryandesign/yap
9a50d1a3d985ec559ebfbb8e9f4d4c6b88b30214
[ "Artistic-1.0-Perl", "ClArtistic" ]
27
2015-11-19T02:45:49.000Z
2021-11-25T19:47:58.000Z
# encoding: utf-8 def test_import_coloransi(): from yap_ipython.utils import coloransi def test_import_generics(): from yap_ipython.utils import generics def test_import_ipstruct(): from yap_ipython.utils import ipstruct def test_import_PyColorize(): from yap_ipython.utils import PyColorize def test_import_strdispatch(): from yap_ipython.utils import strdispatch def test_import_wildcard(): from yap_ipython.utils import wildcard
22.047619
45
0.790497
63
463
5.52381
0.253968
0.12069
0.224138
0.327586
0.431034
0
0
0
0
0
0
0.002545
0.151188
463
20
46
23.15
0.882952
0.032397
0
0
0
0
0
0
0
0
0
0
0
1
0.5
true
0
1
0
1.5
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
1
1
0
1
0
1
0
0
6
f21635bd98489675f8016ec89583fd8ea2e62090
18,160
py
Python
src/layers.py
AlexHeffner/DropEdge
d981b779be330d5ff4dd557d6db1615391bfc249
[ "MIT" ]
380
2019-10-09T16:18:52.000Z
2022-03-23T11:47:18.000Z
src/layers.py
AlexHeffner/DropEdge
d981b779be330d5ff4dd557d6db1615391bfc249
[ "MIT" ]
16
2019-10-17T16:47:50.000Z
2022-03-04T13:02:32.000Z
src/layers.py
AlexHeffner/DropEdge
d981b779be330d5ff4dd557d6db1615391bfc249
[ "MIT" ]
72
2019-10-13T08:03:37.000Z
2022-03-24T21:42:24.000Z
import math import torch from torch.nn.parameter import Parameter from torch.nn.modules.module import Module from torch import nn import torch.nn.functional as F class GraphConvolutionBS(Module): """ GCN Layer with BN, Self-loop and Res connection. """ def __init__(self, in_features, out_features, activation=lambda x: x, withbn=True, withloop=True, bias=True, res=False): """ Initial function. :param in_features: the input feature dimension. :param out_features: the output feature dimension. :param activation: the activation function. :param withbn: using batch normalization. :param withloop: using self feature modeling. :param bias: enable bias. :param res: enable res connections. """ super(GraphConvolutionBS, self).__init__() self.in_features = in_features self.out_features = out_features self.sigma = activation self.res = res # Parameter setting. self.weight = Parameter(torch.FloatTensor(in_features, out_features)) # Is this the best practice or not? if withloop: self.self_weight = Parameter(torch.FloatTensor(in_features, out_features)) else: self.register_parameter("self_weight", None) if withbn: self.bn = torch.nn.BatchNorm1d(out_features) else: self.register_parameter("bn", None) if bias: self.bias = Parameter(torch.FloatTensor(out_features)) else: self.register_parameter('bias', None) self.reset_parameters() def reset_parameters(self): stdv = 1. / math.sqrt(self.weight.size(1)) self.weight.data.uniform_(-stdv, stdv) if self.self_weight is not None: stdv = 1. / math.sqrt(self.self_weight.size(1)) self.self_weight.data.uniform_(-stdv, stdv) if self.bias is not None: self.bias.data.uniform_(-stdv, stdv) def forward(self, input, adj): support = torch.mm(input, self.weight) output = torch.spmm(adj, support) # Self-loop if self.self_weight is not None: output = output + torch.mm(input, self.self_weight) if self.bias is not None: output = output + self.bias # BN if self.bn is not None: output = self.bn(output) # Res if self.res: return self.sigma(output) + input else: return self.sigma(output) def __repr__(self): return self.__class__.__name__ + ' (' \ + str(self.in_features) + ' -> ' \ + str(self.out_features) + ')' class GraphBaseBlock(Module): """ The base block for Multi-layer GCN / ResGCN / Dense GCN """ def __init__(self, in_features, out_features, nbaselayer, withbn=True, withloop=True, activation=F.relu, dropout=True, aggrmethod="concat", dense=False): """ The base block for constructing DeepGCN model. :param in_features: the input feature dimension. :param out_features: the hidden feature dimension. :param nbaselayer: the number of layers in the base block. :param withbn: using batch normalization in graph convolution. :param withloop: using self feature modeling in graph convolution. :param activation: the activation function, default is ReLu. :param dropout: the dropout ratio. :param aggrmethod: the aggregation function for baseblock, can be "concat" and "add". For "resgcn", the default is "add", for others the default is "concat". :param dense: enable dense connection """ super(GraphBaseBlock, self).__init__() self.in_features = in_features self.hiddendim = out_features self.nhiddenlayer = nbaselayer self.activation = activation self.aggrmethod = aggrmethod self.dense = dense self.dropout = dropout self.withbn = withbn self.withloop = withloop self.hiddenlayers = nn.ModuleList() self.__makehidden() if self.aggrmethod == "concat" and dense == False: self.out_features = in_features + out_features elif self.aggrmethod == "concat" and dense == True: self.out_features = in_features + out_features * nbaselayer elif self.aggrmethod == "add": if in_features != self.hiddendim: raise RuntimeError("The dimension of in_features and hiddendim should be matched in add model.") self.out_features = out_features elif self.aggrmethod == "nores": self.out_features = out_features else: raise NotImplementedError("The aggregation method only support 'concat','add' and 'nores'.") def __makehidden(self): # for i in xrange(self.nhiddenlayer): for i in range(self.nhiddenlayer): if i == 0: layer = GraphConvolutionBS(self.in_features, self.hiddendim, self.activation, self.withbn, self.withloop) else: layer = GraphConvolutionBS(self.hiddendim, self.hiddendim, self.activation, self.withbn, self.withloop) self.hiddenlayers.append(layer) def _doconcat(self, x, subx): if x is None: return subx if self.aggrmethod == "concat": return torch.cat((x, subx), 1) elif self.aggrmethod == "add": return x + subx elif self.aggrmethod == "nores": return x def forward(self, input, adj): x = input denseout = None # Here out is the result in all levels. for gc in self.hiddenlayers: denseout = self._doconcat(denseout, x) x = gc(x, adj) x = F.dropout(x, self.dropout, training=self.training) if not self.dense: return self._doconcat(x, input) return self._doconcat(x, denseout) def get_outdim(self): return self.out_features def __repr__(self): return "%s %s (%d - [%d:%d] > %d)" % (self.__class__.__name__, self.aggrmethod, self.in_features, self.hiddendim, self.nhiddenlayer, self.out_features) class MultiLayerGCNBlock(Module): """ Muti-Layer GCN with same hidden dimension. """ def __init__(self, in_features, out_features, nbaselayer, withbn=True, withloop=True, activation=F.relu, dropout=True, aggrmethod=None, dense=None): """ The multiple layer GCN block. :param in_features: the input feature dimension. :param out_features: the hidden feature dimension. :param nbaselayer: the number of layers in the base block. :param withbn: using batch normalization in graph convolution. :param withloop: using self feature modeling in graph convolution. :param activation: the activation function, default is ReLu. :param dropout: the dropout ratio. :param aggrmethod: not applied. :param dense: not applied. """ super(MultiLayerGCNBlock, self).__init__() self.model = GraphBaseBlock(in_features=in_features, out_features=out_features, nbaselayer=nbaselayer, withbn=withbn, withloop=withloop, activation=activation, dropout=dropout, dense=False, aggrmethod="nores") def forward(self, input, adj): return self.model.forward(input, adj) def get_outdim(self): return self.model.get_outdim() def __repr__(self): return "%s %s (%d - [%d:%d] > %d)" % (self.__class__.__name__, self.aggrmethod, self.model.in_features, self.model.hiddendim, self.model.nhiddenlayer, self.model.out_features) class ResGCNBlock(Module): """ The multiple layer GCN with residual connection block. """ def __init__(self, in_features, out_features, nbaselayer, withbn=True, withloop=True, activation=F.relu, dropout=True, aggrmethod=None, dense=None): """ The multiple layer GCN with residual connection block. :param in_features: the input feature dimension. :param out_features: the hidden feature dimension. :param nbaselayer: the number of layers in the base block. :param withbn: using batch normalization in graph convolution. :param withloop: using self feature modeling in graph convolution. :param activation: the activation function, default is ReLu. :param dropout: the dropout ratio. :param aggrmethod: not applied. :param dense: not applied. """ super(ResGCNBlock, self).__init__() self.model = GraphBaseBlock(in_features=in_features, out_features=out_features, nbaselayer=nbaselayer, withbn=withbn, withloop=withloop, activation=activation, dropout=dropout, dense=False, aggrmethod="add") def forward(self, input, adj): return self.model.forward(input, adj) def get_outdim(self): return self.model.get_outdim() def __repr__(self): return "%s %s (%d - [%d:%d] > %d)" % (self.__class__.__name__, self.aggrmethod, self.model.in_features, self.model.hiddendim, self.model.nhiddenlayer, self.model.out_features) class DenseGCNBlock(Module): """ The multiple layer GCN with dense connection block. """ def __init__(self, in_features, out_features, nbaselayer, withbn=True, withloop=True, activation=F.relu, dropout=True, aggrmethod="concat", dense=True): """ The multiple layer GCN with dense connection block. :param in_features: the input feature dimension. :param out_features: the hidden feature dimension. :param nbaselayer: the number of layers in the base block. :param withbn: using batch normalization in graph convolution. :param withloop: using self feature modeling in graph convolution. :param activation: the activation function, default is ReLu. :param dropout: the dropout ratio. :param aggrmethod: the aggregation function for the output. For denseblock, default is "concat". :param dense: default is True, cannot be changed. """ super(DenseGCNBlock, self).__init__() self.model = GraphBaseBlock(in_features=in_features, out_features=out_features, nbaselayer=nbaselayer, withbn=withbn, withloop=withloop, activation=activation, dropout=dropout, dense=True, aggrmethod=aggrmethod) def forward(self, input, adj): return self.model.forward(input, adj) def get_outdim(self): return self.model.get_outdim() def __repr__(self): return "%s %s (%d - [%d:%d] > %d)" % (self.__class__.__name__, self.aggrmethod, self.model.in_features, self.model.hiddendim, self.model.nhiddenlayer, self.model.out_features) class InecptionGCNBlock(Module): """ The multiple layer GCN with inception connection block. """ def __init__(self, in_features, out_features, nbaselayer, withbn=True, withloop=True, activation=F.relu, dropout=True, aggrmethod="concat", dense=False): """ The multiple layer GCN with inception connection block. :param in_features: the input feature dimension. :param out_features: the hidden feature dimension. :param nbaselayer: the number of layers in the base block. :param withbn: using batch normalization in graph convolution. :param withloop: using self feature modeling in graph convolution. :param activation: the activation function, default is ReLu. :param dropout: the dropout ratio. :param aggrmethod: the aggregation function for baseblock, can be "concat" and "add". For "resgcn", the default is "add", for others the default is "concat". :param dense: not applied. The default is False, cannot be changed. """ super(InecptionGCNBlock, self).__init__() self.in_features = in_features self.out_features = out_features self.hiddendim = out_features self.nbaselayer = nbaselayer self.activation = activation self.aggrmethod = aggrmethod self.dropout = dropout self.withbn = withbn self.withloop = withloop self.midlayers = nn.ModuleList() self.__makehidden() if self.aggrmethod == "concat": self.out_features = in_features + out_features * nbaselayer elif self.aggrmethod == "add": if in_features != self.hiddendim: raise RuntimeError("The dimension of in_features and hiddendim should be matched in 'add' model.") self.out_features = out_features else: raise NotImplementedError("The aggregation method only support 'concat', 'add'.") def __makehidden(self): # for j in xrange(self.nhiddenlayer): for j in range(self.nbaselayer): reslayer = nn.ModuleList() # for i in xrange(j + 1): for i in range(j + 1): if i == 0: layer = GraphConvolutionBS(self.in_features, self.hiddendim, self.activation, self.withbn, self.withloop) else: layer = GraphConvolutionBS(self.hiddendim, self.hiddendim, self.activation, self.withbn, self.withloop) reslayer.append(layer) self.midlayers.append(reslayer) def forward(self, input, adj): x = input for reslayer in self.midlayers: subx = input for gc in reslayer: subx = gc(subx, adj) subx = F.dropout(subx, self.dropout, training=self.training) x = self._doconcat(x, subx) return x def get_outdim(self): return self.out_features def _doconcat(self, x, subx): if self.aggrmethod == "concat": return torch.cat((x, subx), 1) elif self.aggrmethod == "add": return x + subx def __repr__(self): return "%s %s (%d - [%d:%d] > %d)" % (self.__class__.__name__, self.aggrmethod, self.in_features, self.hiddendim, self.nbaselayer, self.out_features) class Dense(Module): """ Simple Dense layer, Do not consider adj. """ def __init__(self, in_features, out_features, activation=lambda x: x, bias=True, res=False): super(Dense, self).__init__() self.in_features = in_features self.out_features = out_features self.sigma = activation self.weight = Parameter(torch.FloatTensor(in_features, out_features)) self.res = res self.bn = nn.BatchNorm1d(out_features) if bias: self.bias = Parameter(torch.FloatTensor(out_features)) else: self.register_parameter('bias', None) self.reset_parameters() def reset_parameters(self): stdv = 1. / math.sqrt(self.weight.size(1)) self.weight.data.uniform_(-stdv, stdv) if self.bias is not None: self.bias.data.uniform_(-stdv, stdv) def forward(self, input, adj): output = torch.mm(input, self.weight) if self.bias is not None: output = output + self.bias output = self.bn(output) return self.sigma(output) def __repr__(self): return self.__class__.__name__ + ' (' \ + str(self.in_features) + ' -> ' \ + str(self.out_features) + ')'
41.272727
120
0.540804
1,819
18,160
5.24354
0.08961
0.06343
0.049801
0.035228
0.809813
0.774481
0.749843
0.735584
0.692388
0.667121
0
0.001238
0.377258
18,160
439
121
41.366743
0.842161
0.206993
0
0.703571
0
0
0.037882
0
0
0
0
0
0
1
0.114286
false
0
0.021429
0.053571
0.257143
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
f21e897b8da4b0595a315adfacf5f43cee540d57
14,586
py
Python
tests.py
OpenReasoning/TruthTables
3a10bce0f94759d31227c7409ce0eccb8b2e6faa
[ "MIT" ]
1
2017-07-20T14:53:55.000Z
2017-07-20T14:53:55.000Z
tests.py
MasterOdin/TruthTables
3a10bce0f94759d31227c7409ce0eccb8b2e6faa
[ "MIT" ]
null
null
null
tests.py
MasterOdin/TruthTables
3a10bce0f94759d31227c7409ce0eccb8b2e6faa
[ "MIT" ]
1
2019-01-16T21:11:55.000Z
2019-01-16T21:11:55.000Z
# -*- coding: utf-8 -*- # pylint: disable=missing-docstring from __future__ import unicode_literals from forseti.formula import Symbol, Not, And, Or, If, Iff, Predicate from nose import runmodule from nose.tools import assert_equal, raises from parameterized import parameterized import sys import truthtables PYTHON_2 = sys.version_info[0] == 2 def test_symbol(): table = truthtables.runner("A") assert_equal([[[True]], [[False]]], table.broken_evaluation) assert_equal([[Symbol("A")]], table.broken_formulas) assert_equal([[True], [False]], table.combinations) assert_equal([[[]], [[]]], table.connective_evaluation) assert_equal([[True], [False]], table.evaluation) assert_equal([Symbol("A")], table.formulas) assert_equal([[]], table.main_connective_index) assert_equal([Symbol("A")], table.symbols) assert_equal(1, len(table.get_table_assessment())) assert_equal("Sentence is TT-Possible", table.get_table_assessment()[0]) def test_not(): table = truthtables.runner("not(A)") assert_equal([[[False, True]], [[True, False]]], table.broken_evaluation) assert_equal([[Not(Symbol("A")), Symbol("A")]], table.broken_formulas) assert_equal([[True], [False]], table.combinations) assert_equal([[[False]], [[True]]], table.connective_evaluation) assert_equal([[False], [True]], table.evaluation) assert_equal([Not(Symbol("A"))], table.formulas) assert_equal([[0, 0]], table.main_connective_index) assert_equal([Symbol("A")], table.symbols) assert_equal(1, len(table.get_table_assessment())) assert_equal("Sentence is TT-Possible", table.get_table_assessment()[0]) def test_and(): table = truthtables.runner("and(A, B)") assert_equal([[[True, True, True]], [[True, False, False]], [[False, False, True]], [[False, False, False]]], table.broken_evaluation) assert_equal([[Symbol("A"), And(Symbol("A"), Symbol("B")), Symbol("B")]], table.broken_formulas) assert_equal([[True, True], [True, False], [False, True], [False, False]], table.combinations) assert_equal([[[True]], [[False]], [[False]], [[False]]], table.connective_evaluation) assert_equal([[True], [False], [False], [False]], table.evaluation) assert_equal([And(Symbol("A"), Symbol("B"))], table.formulas) assert_equal([[1, 0]], table.main_connective_index) assert_equal([Symbol("A"), Symbol("B")], table.symbols) assert_equal(1, len(table.get_table_assessment())) assert_equal("Sentence is TT-Possible", table.get_table_assessment()[0]) def test_or(): table = truthtables.runner(str("or(A, B)")) assert_equal([[[True, True, True]], [[True, True, False]], [[False, True, True]], [[False, False, False]]], table.broken_evaluation) assert_equal([[Symbol("A"), Or(Symbol("A"), Symbol("B")), Symbol("B")]], table.broken_formulas) assert_equal([[True, True], [True, False], [False, True], [False, False]], table.combinations) assert_equal([[[True]], [[True]], [[True]], [[False]]], table.connective_evaluation) assert_equal([[True], [True], [True], [False]], table.evaluation) assert_equal([Or(Symbol("A"), Symbol("B"))], table.formulas) assert_equal([[1, 0]], table.main_connective_index) assert_equal([Symbol("A"), Symbol("B")], table.symbols) assert_equal(1, len(table.get_table_assessment())) assert_equal("Sentence is TT-Possible", table.get_table_assessment()[0]) def test_if(): table = truthtables.runner(str("if(A, B)")) assert_equal([[[True, True, True]], [[True, False, False]], [[False, True, True]], [[False, True, False]]], table.broken_evaluation) assert_equal([[Symbol("A"), If(Symbol("A"), Symbol("B")), Symbol("B")]], table.broken_formulas) assert_equal([[True, True], [True, False], [False, True], [False, False]], table.combinations) assert_equal([[[True]], [[False]], [[True]], [[True]]], table.connective_evaluation) assert_equal([[True], [False], [True], [True]], table.evaluation) assert_equal([If(Symbol("A"), Symbol("B"))], table.formulas) assert_equal([[1, 0]], table.main_connective_index) assert_equal([Symbol("A"), Symbol("B")], table.symbols) assert_equal(1, len(table.get_table_assessment())) assert_equal("Sentence is TT-Possible", table.get_table_assessment()[0]) def test_iff(): table = truthtables.runner(str("iff(A, B)")) assert_equal([[[True, True, True]], [[True, False, False]], [[False, False, True]], [[False, True, False]]], table.broken_evaluation) assert_equal([[Symbol("A"), Iff(Symbol("A"), Symbol("B")), Symbol("B")]], table.broken_formulas) assert_equal([[True, True], [True, False], [False, True], [False, False]], table.combinations) assert_equal([[[True]], [[False]], [[False]], [[True]]], table.connective_evaluation) assert_equal([[True], [False], [False], [True]], table.evaluation) assert_equal([Iff(Symbol("A"), Symbol("B"))], table.formulas) assert_equal([[1, 0]], table.main_connective_index) assert_equal([Symbol("A"), Symbol("B")], table.symbols) assert_equal(1, len(table.get_table_assessment())) assert_equal("Sentence is TT-Possible", table.get_table_assessment()[0]) def test_not_and(): table = truthtables.runner(str("not(and(A, B))")) assert_equal([[[False, True, True, True]], [[True, True, False, False]], [[True, False, False, True]], [[True, False, False, False]]], table.broken_evaluation) assert_equal([[Not(And(Symbol("A"), Symbol("B"))), Symbol("A"), And(Symbol("A"), Symbol("B")), Symbol("B")]], table.broken_formulas) assert_equal([[True, True], [True, False], [False, True], [False, False]], table.combinations) assert_equal([[[False, True]], [[True, False]], [[True, False]], [[True, False]]], table.connective_evaluation) assert_equal([[False], [True], [True], [True]], table.evaluation) assert_equal([Not(And(Symbol("A"), Symbol("B")))], table.formulas) assert_equal([[0, 0]], table.main_connective_index) assert_equal([Symbol("A"), Symbol("B")], table.symbols) assert_equal(1, len(table.get_table_assessment())) assert_equal("Sentence is TT-Possible", table.get_table_assessment()[0]) def test_and_or(): table = truthtables.runner("and(or(A, C), or(B,C))") # A or C and B or C assert_equal([[[True, True, True, True, True, True, True]], [[True, True, False, True, True, True, False]], [[True, True, True, True, False, True, True]], [[True, True, False, False, False, False, False]], [[False, True, True, True, True, True, True]], [[False, False, False, False, True, True, False]], [[False, True, True, True, False, True, True]], [[False, False, False, False, False, False, False]]], table.broken_evaluation) assert_equal([[Symbol("A"), Or(Symbol("A"), Symbol("C")), Symbol("C"), And(Or(Symbol("A"), Symbol("C")), Or(Symbol("B"), Symbol("C"))), Symbol("B"), Or(Symbol("B"), Symbol("C")), Symbol("C")]], table.broken_formulas) assert_equal([[True, True, True], [True, True, False], [True, False, True], [True, False, False], [False, True, True], [False, True, False], [False, False, True], [False, False, False]], table.combinations) assert_equal([[[True, True, True]], [[True, True, True]], [[True, True, True]], [[True, False, False]], [[True, True, True]], [[False, False, True]], [[True, True, True]], [[False, False, False]]], table.connective_evaluation) assert_equal([[True], [True], [True], [False], [True], [False], [True], [False]], table.evaluation) assert_equal([And(Or(Symbol("A"), Symbol("C")), Or(Symbol("B"), Symbol("C")))], table.formulas) assert_equal([[3, 1]], table.main_connective_index) assert_equal([Symbol("A"), Symbol("B"), Symbol("C")], table.symbols) assert_equal(1, len(table.get_table_assessment())) assert_equal("Sentence is TT-Possible", table.get_table_assessment()[0]) if not PYTHON_2: assert_equal("A B C | ((A ∨ C) ∧ (B ∨ C))\n" + "---------------------------\n" + "T T T | T -T T \n" + "T T F | T -T T \n" + "T F T | T -T T \n" + "T F F | T -F F \n" + "F T T | T -T T \n" + "F T F | F -F T \n" + "F F T | T -T T \n" + "F F F | F -F F \n", table.generate_table()) def test_and_not_or(): table = truthtables.runner(str("and(not(or(A, C)), B)"), display_connectives=False) assert_equal([[[False, True, True, True, False, True]], [[False, True, True, False, False, True]], [[False, True, True, True, False, False]], [[False, True, True, False, False, False]], [[False, False, True, True, False, True]], [[True, False, False, False, True, True]], [[False, False, True, True, False, False]], [[True, False, False, False, False, False]]], table.broken_evaluation) assert_equal([[Not(Or(Symbol("A"), Symbol("C"))), Symbol("A"), Or(Symbol("A"), Symbol("C")), Symbol("C"), And(Not(Or(Symbol("A"), Symbol("C"))), Symbol("B")), Symbol("B")]], table.broken_formulas) assert_equal([[True, True, True], [True, True, False], [True, False, True], [True, False, False], [False, True, True], [False, True, False], [False, False, True], [False, False, False]], table.combinations) assert_equal([[[False, True, False]], [[False, True, False]], [[False, True, False]], [[False, True, False]], [[False, True, False]], [[True, False, True]], [[False, True, False]], [[True, False, False]]], table.connective_evaluation) assert_equal([[False], [False], [False], [False], [False], [True], [False], [False]], table.evaluation) assert_equal([And(Not(Or(Symbol("A"), Symbol("C"))), Symbol("B"))], table.formulas) assert_equal([[4, 2]], table.main_connective_index) assert_equal([Symbol("A"), Symbol("B"), Symbol("C")], table.symbols) assert_equal(1, len(table.get_table_assessment())) assert_equal("Sentence is TT-Possible", table.get_table_assessment()[0]) if not PYTHON_2: assert_equal("A B C | (¬(A ∨ C) ∧ B)\n" + "----------------------\n" + "T T T | -F \n" + "T T F | -F \n" + "T F T | -F \n" + "T F F | -F \n" + "F T T | -F \n" + "F T F | -T \n" + "F F T | -F \n" + "F F F | -F \n", table.generate_table()) def test_tautology(): table = truthtables.runner("or(A,not(A))") assert_equal(1, len(table.get_table_assessment())) assert_equal("Sentence is a Tautology", table.get_table_assessment()[0]) def test_contradiction(): table = truthtables.runner("and(A,not(A))") assert_equal(1, len(table.get_table_assessment())) assert_equal("Sentence is a Contradiction", table.get_table_assessment()[0]) def test_empty_statements(): table = truthtables.runner(["A", '']) assert_equal([[[True]], [[False]]], table.broken_evaluation) assert_equal([[Symbol("A")]], table.broken_formulas) assert_equal([[True], [False]], table.combinations) assert_equal([[[]], [[]]], table.connective_evaluation) assert_equal([[True], [False]], table.evaluation) assert_equal([Symbol("A")], table.formulas) assert_equal([[]], table.main_connective_index) assert_equal([Symbol("A")], table.symbols) assert_equal(1, len(table.get_table_assessment())) assert_equal("Sentence is TT-Possible", table.get_table_assessment()[0]) def test_set_1(): table = truthtables.runner(["A", "A"]) assert_equal([[[True], [True]], [[False], [False]]], table.broken_evaluation) assert_equal([[Symbol("A")], [Symbol("A")]], table.broken_formulas) assert_equal([[True], [False]], table.combinations) assert_equal([[[], []], [[], []]], table.connective_evaluation) assert_equal([[True, True], [False, False]], table.evaluation) assert_equal([Symbol("A"), Symbol("A")], table.formulas) assert_equal([[], []], table.main_connective_index) assert_equal([Symbol("A")], table.symbols) assert_equal(4, len(table.get_table_assessment())) def test_set_2(): table = truthtables.runner(["A", "B"]) assert_equal(1, len(table.get_table_assessment())) @raises(TypeError) def test_truthtables_runner_invalid_type(): truthtables.runner(1) @raises(TypeError) def test_truthtables_invalid_type(): truthtables.TruthTable(1) @raises(TypeError) def test_truthtables_invalid_type_list(): truthtables.TruthTable([1]) @parameterized([ (Symbol('a'), 'a'), (Not(Symbol('a')), '¬a'), (And(Symbol('a'), Symbol('b')), '(a ∧ b)'), (Or(Symbol('a'), Symbol('b')), '(a ∨ b)'), (If(Symbol('a'), Symbol('b')), '(a → b)'), (Iff(Symbol('a'), Symbol('b')), '(a ↔ b)'), (Not(And( Symbol('a'), If(Symbol('c'), Iff(Or(Symbol('d'), Symbol('a')), Symbol('c'))) )), '¬(a ∧ (c → ((d ∨ a) ↔ c)))') ]) def test_pretty_print(formula, expected): assert_equal(expected, truthtables.pretty_print(formula)) @raises(TypeError) def test_pretty_print_raises(): class Foo(Predicate): name = "not" arity = 1 truthtables.pretty_print(Foo) @parameterized([ ([[True], [False]], 1), ([[True, True], [True, False], [False, True], [False, False]], 2), ( [ [True, True, True], [True, True, False], [True, False, True], [True, False, False], [False, True, True], [False, True, False], [False, False, True], [False, False, False] ], 3 ) ]) def test_combinations(expected, num): actual = truthtables.get_combinations(num) assert_equal(expected, actual) if __name__ == "__main__": runmodule()
46.900322
113
0.580214
1,801
14,586
4.548584
0.052193
0.15979
0.089355
0.0625
0.857056
0.825317
0.787598
0.734497
0.670166
0.620239
0
0.004996
0.217743
14,586
310
114
47.051613
0.711569
0.005005
0
0.369231
0
0
0.076711
0.003653
0
0
0
0
0.457692
1
0.076923
false
0
0.026923
0
0.115385
0.015385
0
0
0
null
0
0
0
1
1
1
1
0
1
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
6
f22177288dd5c331378b397470b307c6c721844f
74
py
Python
airtable/__init__.py
shikumiya/airtable_client
e6045623178b8fce8961bcd37fa40589d6c1299c
[ "MIT" ]
1
2021-02-26T06:06:12.000Z
2021-02-26T06:06:12.000Z
airtable/__init__.py
shikumiya/airtable_client
e6045623178b8fce8961bcd37fa40589d6c1299c
[ "MIT" ]
null
null
null
airtable/__init__.py
shikumiya/airtable_client
e6045623178b8fce8961bcd37fa40589d6c1299c
[ "MIT" ]
null
null
null
from .airtable import AirtableClientFactory, AirtableSorter, SortDirection
74
74
0.891892
6
74
11
1
0
0
0
0
0
0
0
0
0
0
0
0.067568
74
1
74
74
0.956522
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
4858a90ab7fcb69c462d1e8e6611374fe39f0bce
110,310
py
Python
utils/reinforcement.py
Tiger767/Hackathon-LunarLanderV2
20fb264274b291af5a7e432b574694918d79f055
[ "MIT" ]
null
null
null
utils/reinforcement.py
Tiger767/Hackathon-LunarLanderV2
20fb264274b291af5a7e432b574694918d79f055
[ "MIT" ]
null
null
null
utils/reinforcement.py
Tiger767/Hackathon-LunarLanderV2
20fb264274b291af5a7e432b574694918d79f055
[ "MIT" ]
null
null
null
""" Author: Travis Hammond Version: 1_4_2020-Modified """ import os from datetime import datetime from time import sleep from collections import deque import h5py import numpy as np import tensorflow as tf import tensorflow.keras.backend as K from tensorflow import keras from tensorflow.keras.models import model_from_json try: import keyboard except ModuleNotFoundError: print("Module 'keyboard' not found. " "Explore teaching will not work.") class Environment: """This class handles the environment in which the Agent performs actions in and can get rewards from. """ def __init__(self, state_shape, action_shape): """Initalizes state and action shapes and sets the state. params: state_shape: A tuple of integers, which is the expected state shape for the agent, or an integer of the discrete state space action_shape: A tuple of integers, which is the expected action shape """ if isinstance(state_shape, int): self.discrete_state_space = state_shape state_shape = 1 else: self.discrete_state_space = None self.state_shape = state_shape self.action_shape = action_shape self.reset() def reset(self): """Resets the environment to its initialized state. return: A numpy ndarray, which is the state """ self.state = None return self.state def step(self, action): """Moves the current state one step forward with regard to the action. params: action: An integer or value that determines an action return: A tuple of a ndarray (state), a float/integer (reward), and a boolean (terminal state) """ self.state = None return self.state, 0, False def play_episode(self, agent, max_steps, teach=False, key_action_map=None, random=False, random_bounds=None, render=False, verbose=True): """Plays a single complete episode with the agent. params: agent: An instance of Agent, which will be used to interact in the environment max_steps: An integer, which is the max steps an episode can take before terminating the episode teach: A boolean, which determines if the agent should be taught by a human key_action_map: A dictionary, which contains a key/char mapping to action values for teaching the agent random: A booelan, which determines if the agent should not be used, but instead pick random actions random_bounds: A tuple of two bounds (lower and upper), which are used for random actions that are not onehots render: A boolean, which determines if the environment should be rendered each step verbose: A boolean, which determines if information should be printed to the screen return: A tuple of an integer (last step) and a float (total reward) """ if not isinstance(agent, Agent): raise TypeError('The instance agent is not a child of Agent.') if not isinstance(agent.playing_data, PlayingData): raise ValueError('Invalid playing_data value. ' '(Forgot to set playing_data?)') if teach: if key_action_map is None: key_action_map = {str(i + 1): i for i in range(self.action_shape[0])} key_action_map = key_action_map.items() key_action_msg = ('Press a key: ' + ', '.join([f'{key}: {action}' for key, action in key_action_map])) total_reward = 0 state = self.reset() if render: self.render() for step in range(1, max_steps + 1): if teach: sleep(.5) print(key_action_msg) loop = True while loop: for key, action in key_action_map: if keyboard.is_pressed(key): loop = False print(f'Pressed: {key}') break elif random: if random_bounds is None: action = np.random.randint(0, self.action_shape[0]) else: action = np.random.uniform(*random_bounds, size=self.action_shape) else: action = agent.select_action( state, training=agent.playing_data.training ) new_state, reward, terminal = self.step(action) total_reward += reward if agent.playing_data.memorizing: agent.add_memory(state, action, new_state, reward, terminal) state = new_state if verbose: print(f'Step: {step} - Reward: {reward} ' f'- Action: {action}') if render: self.render() if (agent.playing_data.training and agent.playing_data.learns_in_episode and agent.playing_data.epochs > 0): agent.learn(**agent.playing_data.learning_params) if terminal: break agent.end_episode() if (agent.playing_data.training and not agent.playing_data.learns_in_episode and agent.playing_data.epochs > 0): agent.learn(**agent.playing_data.learning_params) return step, total_reward def play_episodes(self, agent, num_episodes, max_steps, teach=False, key_action_map=None, random=False, random_bounds=None, render=False, verbose=True, episode_verbose=None): """Plays atleast 1 complete episode with the agent. params: agent: An instance of Agent, which will be used to interact in the environment num_episodes: An integer, which is the number of episodes to play max_steps: An integer, which is the max steps an episode can take before terminating the episode teach: A boolean, which determines if the agent should be taught by a human key_action_map: A dictionary, which contains a key/char mapping to action values for teaching the agent random: A booelan, which determines if the agent should not be used, but instead pick random actions random_bounds: A tuple of two bounds (lower and upper), which are used for random actions that are not onehots render: A boolean, which determines if the environment should be rendered each step verbose: A boolean, which determines if information should be printed to the screen episode_verbose: A boolean, which determines if single episode information should be printed to the screen return: A float, which is the average total reward of all episodes """ if episode_verbose is None: episode_verbose = verbose total_rewards = 0 best_reward = 'Unknown' for episode in range(1, num_episodes + 1): step, total_reward = self.play_episode( agent, max_steps, random=random, random_bounds=random_bounds, teach=teach, key_action_map=key_action_map, render=render, verbose=episode_verbose, ) total_rewards += total_reward if best_reward == 'Unknown' or total_reward > best_reward: best_reward = total_reward if verbose: str_time = datetime.now().strftime(r'%H:%M:%S') print(f'Time: {str_time} - Episode: {episode} - ' f'Steps: {step} - ' f'Total Reward: {total_reward} - ' f'Best Total Reward: {best_reward} - ' f'Average Total Reward: {total_rewards / episode}') return total_rewards / episode def close(self): """Closes any threads or loose ends of the environment. """ pass def render(self): """Renders the environment. """ pass class GymWrapper(Environment): """This class is a environment wrapper for OpenAI Gyms.""" def __init__(self, gym, state_shape, action_shape): """Initalizes state and action shapes and sets the state. params: gym: A OpenAI Gym state_shape: A tuple of integers, which is the expected state shape for the agent, or an integer of the discrete state space action_shape: A tuple of integers, which is the expected action shape """ self.gym = gym if isinstance(state_shape, int): self.discrete_state_space = state_shape state_shape = 1 else: self.discrete_state_space = None self.state_shape = state_shape self.action_shape = action_shape self.reset() def reset(self): """Resets the environment to its initialized state. return: A numpy ndarray, which is the state """ self.state = self.gym.reset() if self.discrete_state_space is None: return self.state else: return [self.state] def step(self, action): """Moves the current state one step forward with regard to the action. params: action: An integer or value that determines an action return: A tuple of a ndarray (state), a float/integer (reward), and a boolean (terminal state) """ state, reward, terminal, _ = self.gym.step(action) self.state = state if self.discrete_state_space is None: return self.state, reward, terminal else: return [self.state], reward, terminal def close(self): """Closes any threads or loose ends of the environment. """ self.gym.close() def render(self): """Renders the environment. """ self.gym.render() class MultiSeqAgentEnvironment(Environment): """This class handles the environment in which multiple agents can perform actions against eachother in a sequential manner. """ def __init__(self, state_shape, action_shape): """Initalizes state and action shapes and sets the state. params: state_shape: A tuple of integers, which is the expected state shape for the agent action_shape: A tuple of integers, which is the expected action shape """ if isinstance(state_shape, int): self.discrete_state_space = state_shape state_shape = 1 else: self.discrete_state_space = None self.state_shape = state_shape self.action_shape = action_shape self.reset() def reset(self): """Resets the environment to its initialized state. return: A numpy ndarray, which is the state """ self.state = None return self.state def step(self, agent_ndx, action): """Moves the current state one step forward with regard to the agent's action. params: agent_ndx: An integer, which is the index of the agent taking a step action: An integer or value that determines an action return: A tuple of a ndarray (state), a float/integer (reward), and a boolean (terminal state) """ self.state = None return self.state, 0, self.terminal def play_episode(self, agents, max_steps, shuffle=True, teach=False, key_action_map=None, random=False, random_bounds=None, render=False, verbose=True): """Plays a single complete episode with the agents. params: agents: A list of Agent instances, which will be used to interact in the environment max_steps: An integer, which is the max steps an episode can take before terminating the episode shuffle: A boolean, which determines if the agents' positions should be shuffled teach: A boolean, which determines if the agents should be taught by a human key_action_map: A dictionary, which contains a key/char mapping to action values for teaching the agents random: A booelan, which determines if the agent should not be used, but instead pick random actions random_bounds: A tuple of two bounds (lower and upper), which are used for random actions that are not onehots render: A boolean, which determines if the environment should be rendered each step verbose: A boolean, which determines if information should be printed to the screen return: A tuple of a list of integers (last steps) and a list of floats (total rewards) """ num_agents = len(agents) ndxs = np.arange(num_agents) if shuffle: np.random.shuffle(ndxs) for ndx in ndxs: assert isinstance(agents[ndx], Agent), ( 'The instance agent is not a child of Agent.' ) assert isinstance(agents[ndx].playing_data, PlayingData), ( 'Invalid playing_data value.' ) if teach: if key_action_map is None: key_action_map = {str(i + 1): i for i in range(self.action_shape[0])} key_action_map = key_action_map.items() key_action_msg = ('Press a key: ' + ', '.join([f'{key}: {action}' for key, action in key_action_map])) total_rewards = [0] * num_agents state = self.reset() if render: self.render() break_loop = [False] * num_agents for step in range(1, max_steps + 1): for ndx in ndxs: if teach: print(key_action_msg) loop = True while loop: for key, action in key_action_map: if keyboard.is_pressed(key): loop = False print(f'Pressed: {key}') break elif random: if random_bounds is None: action = np.random.randint(0, self.action_shape[0]) else: action = np.random.uniform(*random_bounds, size=self.action_shape) else: action = agents[ndx].select_action( state, training=agents[ndx].playing_data.training ) new_state, reward, terminal = self.step(ndx, action) total_rewards[ndx] += reward if agents[ndx].playing_data.memorizing: agents[ndx].add_memory(state, action, new_state, reward, terminal) state = new_state if verbose: print(f'Step: {step} - Agent: {ndx} - ' f'Reward: {reward} - Action: {action}') if render: self.render() if (agents[ndx].playing_data.training and agents[ndx].playing_data.learns_in_episode and agents[ndx].playing_data.epochs > 0): agents[ndx].learn( **agents[ndx].playing_data.learning_params ) if terminal: break_loop[ndx] = True if False not in break_loop: break if False not in break_loop: break for ndx in ndxs: agents[ndx].end_episode() if (agents[ndx].playing_data.training and not agents[ndx].playing_data.learns_in_episode and agents[ndx].playing_data.epochs > 0): agents[ndx].learn(**agents[ndx].playing_data.learning_params) return step, total_rewards def play_episodes(self, agents, num_episodes, max_steps, shuffle=True, teach=False, key_action_map=None, random=False, random_bounds=None, render=False, verbose=True, episode_verbose=None): """Plays at least 1 complete episode with the agents. params: agents: A list of Agent instances, which will be used to interact in the environment num_episodes: An integer, which is the number of episodes to play max_steps: An integer, which is the max steps an episode can take before terminating the episode shuffle: A boolean, which determines if the agents' positions should be shuffled teach: A boolean, which determines if the agents should be taught by a human key_action_map: A dictionary, which contains a key/char mapping to action values for teaching the agents random: A booelan, which determines if the agent should not be used, but instead pick random actions random_bounds: A tuple of two bounds (lower and upper), which are used for random actions that are not onehots render: A boolean, which determines if the environment should be rendered each step verbose: A boolean, which determines if information should be printed to the screen episode_verbose: A boolean, which determines if single episode information should be printed to the screen return: A list of floats, which are the average total reward of all episodes for each agent """ if episode_verbose is None: episode_verbose = verbose num_agents = len(agents) total_rewards = [0] * num_agents best_rewards = ['Unknown'] * num_agents for episode in range(1, num_episodes + 1): step, total_reward = self.play_episode( agents, max_steps, shuffle=shuffle, random=random, random_bounds=random_bounds, teach=teach, key_action_map=key_action_map, render=render, verbose=episode_verbose, ) for ndx in range(num_agents): total_rewards[ndx] += total_reward[ndx] if (best_rewards[ndx] == 'Unknown' or total_reward[ndx] > best_rewards[ndx]): best_rewards[ndx] = total_reward[ndx] if verbose: str_time = datetime.now().strftime(r'%H:%M:%S') print(f'Time: {str_time} - Episode: {episode} - ' f'Steps: {step}') for ndx in range(num_agents): avg_total_reward = total_rewards[ndx] / episode print(f'Agent {ndx}. ' f'Total Reward: {total_reward[ndx]} - ' f'Best Total Reward: {best_rewards[ndx]} - ' f'Average Total Reward: {avg_total_reward}') return [tr / episode for tr in total_rewards] class Policy: """This class is used for calling an Agent's action function.""" def __init__(self): """Initalizes the Policy.""" pass def select_action(self, action_func, training): """Returns the action the Agent should take. params: action_func: A function that returns a value training: A boolean, which determines if the Agent is in a training states """ return action_func() def reset(self): """Resets any states.""" pass class GreedyPolicy(Policy): """This class is used for calling an Agent's action function and selecting the greediest action. """ def __init__(self): super().__init__() def select_action(self, action_func, training): """Returns the action the Agent should take. params: action_func: A function that returns a list of values training: A boolean, which determines if the Agent is in a training states """ action = np.argmax(action_func()) return action class AsceticPolicy(Policy): """This class is used for calling an Agent's action function and selecting the most ascetic action. """ def __init__(self): """Initalizes the Policy.""" super().__init__() def select_action(self, action_func, training): """Returns the action the Agent should take. params: action_func: A function that returns a list of values training: A boolean, which determines if the Agent is in a training states """ action = np.argmin(action_func()) return action class StochasticPolicy(Policy): def __init__(self, policy, stochasticity_decay_training, stochasticity_testing, action_size): """Initalizes the Policy's states. params: policy: A policy instance stochasticity_decay_training: A decay instance which decays the stochasticity of the policy stochasticity_testing: A float, which is the stochasticity of the policy when the agent is not training action_size: An integer, which is the size of the action ndarray """ super().__init__() self.policy = policy self.stochasticity_decay_training = stochasticity_decay_training self.stochasticity_testing = stochasticity_testing self.action_size = action_size def select_action(self, action_func, training): """Returns the action the Agent should take. params: action_func: A function that returns a list of values training: A boolean, which determines if the Agent is in a training states """ if training: stochasticity = self.stochasticity_decay_training() else: stochasticity = self.stochasticity_testing if np.random.uniform() < stochasticity: return np.random.randint(0, self.action_size) else: return self.policy.select_action(action_func, training) def reset(self): """Resets state of the stochasticity decay instance.""" self.stochasticity_decay_training.reset() class NoisePolicy(Policy): """This class is used for adding normal noise to an Agent's action.""" def __init__(self, noise_scale_decay_training, noise_scale_testing, action_bounds): """Initalizes the Noise Policy. params: noise_scale_decay_training: A decay instance, which decays the noise scale (a fraction of action range) for the policy noise_scale_testing: A float, which is the noise scale of the policy when the agent is not training action_bounds: A tuple of two floats/integers, which are the lower and upper bounds of the action range """ self.noise_scale_decay_training = noise_scale_decay_training self.noise_scale_testing = noise_scale_testing self.action_bounds = action_bounds def select_action(self, action_func, training): """Returns the action the Agent should take. params: action_func: A function that returns a value training: A boolean, which determines if the Agent is in a training states """ actions = action_func() if training: noise_scale = self.noise_scale_decay_training() else: noise_scale = self.noise_scale_testing noise = np.random.normal(scale=noise_scale, size=actions.shape) return np.clip(actions + noise, *self.action_bounds) def reset(self): """Resets decay state.""" self.noise_scale_decay_training.reset() class UniformNoisePolicy(NoisePolicy): """This class is used for adding noise to an Agent's action.""" def __init__(self, noise_scale_decay_training, noise_scale_testing, action_bounds, additive=False): """Initalizes the Uniform Noise Policy. params: noise_scale_decay_training: A decay instance, which decays the noise scale (a fraction of action range) for the policy noise_scale_testing: A float, which is the noise scale of the policy when the agent is not training action_bounds: A tuple of two floats/integers, which are the lower and upper bounds of the action range additive: A boolean, which determines if the noise should be added or replace the action value completely """ super().__init__(noise_scale_decay_training, noise_scale_testing, action_bounds) self.additive = additive def select_action(self, action_func, training): """Returns the action the Agent should take. params: action_func: A function that returns a value training: A boolean, which determines if the Agent is in a training states """ actions = action_func() noise = np.random.uniform(*self.action_bounds, size=actions.shape) if training: noise_scale = self.noise_scale_decay_training() else: noise_scale = self.noise_scale_testing if self.additive: return np.clip(actions + noise * noise_scale, *self.action_bounds) else: if np.random.uniform() < noise_scale: return noise else: return actions class TemporalNoisePolicy(NoisePolicy): """This class is used for adding temporal noise to an Agent's action.""" def __init__(self, noise_scale_decay_training, noise_scale_testing, action_bounds, sigma=.3, theta=.15, dt=.01, init_noise=None): """Initalizes the Temporal Noise Policy. params: noise_scale_decay_training: A decay instance, which decays the noise scale (a fraction of action range) for the policy noise_scale_testing: A float, which is the noise scale of the policy when the agent is not training action_bounds: A tuple of two floats/integers, which are the lower and upper bounds of the action range """ super().__init__(noise_scale_decay_training, noise_scale_testing, action_bounds) self.sigma = sigma self.theta = theta self.dt = dt self.sqrt_dt = np.sqrt(self.dt) if init_noise is None: self.init_noise = None else: self.init_noise = init_noise self.last_noise = None def select_action(self, action_func, training): """Returns the action the Agent should take. params: action_func: A function that returns a value training: A boolean, which determines if the Agent is in a training states """ actions = action_func() if self.init_noise is None: self.init_noise = np.full(actions.shape, np.mean(self.action_bounds)) self.last_noise = self.init_noise if training: noise_scale = self.noise_scale_decay_training() else: noise_scale = self.noise_scale_testing noise = np.random.normal(scale=noise_scale, size=actions.shape) noise = (self.last_noise + self.theta * -self.last_noise * self.dt + self.sigma * self.sqrt_dt * noise) self.last_noise = noise return np.clip(actions + noise, *self.action_bounds) def reset(self): """Resets decay state and initial actions.""" super().reset() self.last_noise = self.init_noise class Decay: """This class decays a initial value to a minimum value through a given number of steps. (formula: max(initial_value - constant * steps, 0)) """ def __init__(self, initial_value, constant, min_value=0): """Initalizes the state of the decay object. params: initial_value: A float, which is the starting value to decay constant: A float, which is the slope/rate that the decay occurs min_value: A float, which is the minimum value the decay can reach """ assert initial_value >= min_value, ( 'initial_value must be greater or equal to min_value' ) self.initial_value = initial_value self.steps = 0 self.constant = constant self.min_value = min_value def reset(self): """Resets the steps""" self.steps = 0 def __call__(self): """Returns the current value with regard to the state of decay. return: A float """ self.steps += 1 value = self.initial_value - self.constant * self.steps return np.max([value, self.min_value]) class ExponentialDecay(Decay): """This class decays a initial value to a minimum value exponentially through a given number of steps. (formula: inital_value * (1 - rate)^steps + min_value) """ def __init__(self, initial_value, rate, min_value=0): """Initalizes the state of the decay object. params: initial_value: A float, which is the starting value to decay rate: A float, which is the slope/rate that the decay occurs min_value: A float, which is the minimum value the decay can reach """ assert initial_value >= min_value, ( 'initial_value must be greater or equal to min_value' ) self.initial_value = initial_value self.rate = rate self.min_value = min_value self.steps = 0 def __call__(self): """Returns the current value with regard to the state of decay. return: A float """ self.steps += 1 return np.maximum(self.initial_value * (1 - self.rate)**self.steps, self.min_value) class LinearDecay(Decay): """This class decays a initial value to a minimum value linearly through a given number of steps. (formula: max(initial_value - (inital_value - min_value) / total_steps * steps, min_value)) """ def __init__(self, initial_value, total_steps, min_value=0): """Initalizes the state of the decay object. params: initial_value: A float, which is the starting value to decay total_steps: An integer, which is the number of steps until min_value would be reach min_value: A float, which is the minimum value the decay can reach """ assert initial_value >= min_value, ( 'initial_value must be greater or equal to min_value' ) self.initial_value = initial_value self.total_steps = total_steps self.min_value = min_value self.a = (-1 * (self.initial_value - self.min_value) / self.total_steps) self.steps = 0 def __call__(self): """Returns the current value with regard to the state of decay. return: A float """ self.steps += 1 value = self.a * self.steps + self.initial_value return np.max([value, self.min_value]) class Memory: """This class is used by agents to store episode information. (uses a normal python list) """ def __init__(self, max_len=None): """Initalizes the memory. params: max_len: An integer, which is the max length of memory (if reached, the oldest memory will be removed) """ self.max_len = max_len self.buffer = [] def __len__(self): """Returns the number of entries in the memory. return: An integer """ return len(self.buffer) def add(self, x): """Adds a entry to memory. params: x: A entry similar to other entries """ self.buffer.append(x) if (self.max_len is not None and len(self.buffer) > self.max_len): del self.buffer[0] def __getitem__(self, key): """Returns an item given a key. params: key: A valid key or index for a memory entry """ return self.buffer[key] def __setitem__(self, key, value): """Sets a entry to a given key. params: key: A valid key or index for a memory entry value: A entry similar to other entries """ self.buffer[key] = value def array(self): """Returns a copy of the memory. return: A numpy ndarray """ return np.array(self.buffer) def reset(self): """Resets or clears the memory. """ self.buffer.clear() class RingMemory(Memory): """This class is used by agents to store episode information. (uses a deque) """ def __init__(self, max_len): """Initalizes the memory. params: max_len: An integer, which is the max length of memory (if reached, the oldest memory will be removed) """ self.buffer = deque(maxlen=max_len) def add(self, x): """Adds a entry to memory. params: x: A entry similar to other entries """ self.buffer.append(x) class PlayingData: """This class is used for containing data that the environment needs to know, but the agent has. """ def __init__(self, training, memorizing, epochs, learns_in_episode, learning_params): """Initalizes the data. params: training: A boolean, which determines if the agent should be treated as in a training mode memorizing: A boolean, which determines if the agent should be adding the information obtained through playing an episode to memory epochs: An integer, which is the number of epochs to train in one training instance learns_in_episode: A boolean, which determines if the agent learns during a episode or at the end learning_params: A dictionary of parameters for the agent's learn method """ assert training is True or training is False, ( 'Invalid training value. Must be True or False.' ) assert memorizing is True or memorizing is False, ( 'Invalid memorizing value. Must be True or False.' ) assert epochs >= 0, ( 'Invalid epoch value. Must be greater or equal to zero.' ) assert learns_in_episode is True or learns_in_episode is False, ( 'Invalid learns_in_episode value. Must be True or False.' ) assert isinstance(learning_params, dict), ( 'Invalid learning_params value. Must be a dictionary.' ) self.training = training self.memorizing = memorizing self.epochs = epochs self.learns_in_episode = learns_in_episode self.learning_params = learning_params class Agent: """This class is the base class for all agent classes, and essentially is a random agent. """ def __init__(self, action_shape, policy): """Initalizes the agent. params: action_shape: A tuple of integers, which is the action shape of the environment policy: A policy instance """ self.action_shape = action_shape self.policy = policy self.playing_data = None def select_action(self, state, training=False): """Returns the action the Agent "believes" to be suited for the given state. params: state: A value or list of values, which is the state to get the action for training: A boolean, which determines if the agent is training return: A value, which is the selected action """ def _select_action(): return np.random.random(self.action_shape) return self.policy.select_action(_select_action, training=training) def set_playing_data(self): """Sets the episode data.""" self.playing_data = PlayingData(False, False, 0, False, {}) def add_memory(self, state, action, new_state, reward, terminal): """Adds information from one step in the environment to the agent. (For this agent all memory is discarded) params: state: A value or list of values, which is the state of the environment before the action was performed action: A value, which is the action the agent took new_state: A value or list of values, which is the state of the environment after performing the action reward: A float/integer, which is the evaluation of the action performed terminal: A boolean, which determines if this call to add memory is the last for the episode """ pass def forget(self): """Forgets or clears all memory.""" pass def end_episode(self): """Ends the episode for the agent.""" pass def learn(self, verbose=True): """Trains the agent on a batch of its experiences. (For this agent no learning is needed) params: verbose: A boolean, which determines if information should be printed to the screen """ pass def load(self, path): """Loads a save from a folder. params: path: A string, which is the path to a folder to load """ with open(os.path.join(path, 'note.txt'), 'r') as file: print(file.read(), end='') def save(self, path, note): """Saves a note to a new folder. params: path: A string, which is the path to a folder to save within note: A string, which is the note to save in the folder return: A string, which is the complete path of the save """ time = datetime.now() path = os.path.join(path, time.strftime(r'%Y%m%d_%H%M%S_%f')) os.mkdir(path) with open(os.path.join(path, 'note.txt'), 'w') as file: file.write(note) return path def encrypt(string): """Encrpts a string with a XOR cipher. (assumes security is not necessarily required) params: string: A string to encrypt return: A bytes object """ key = 175 string = map(ord, string) result = [] for plain in string: key ^= plain result.append(key) return bytes(result) class QAgent(Agent): """This class is a Q-learning Agent. It does not uses a neural network, but instead uses a table. """ def __init__(self, discrete_state_space, action_size, policy, discounted_rate): """Initalizes the Q-learning agent. params: discrete_state_space: An integer, which action_size: An integers, which is the action size of the environment policy: A policy instance discounted_rate: A float within 0.0-1.0, which is the rate that future rewards should be counted for the current reward """ Agent.__init__(self, action_size, policy) self.discrete_state_space = discrete_state_space self.discounted_rate = discounted_rate self.qtable = np.zeros((self.discrete_state_space, self.action_shape)) self.state = None self.action = None self.new_state = None self.reward = None self.terminal = None def select_action(self, state, training=False): """Returns the action the Agent "believes" to be suited for the given state. params: state: A value or list of values, which is the state to look up the action for in the table training: A boolean, which determines if the agent is training return: A value, which is the selected action """ def _select_action(): nonlocal state if isinstance(state, list) and len(state) == 1: state = state[0] return self.qtable[state] return self.policy.select_action(_select_action, training=training) def set_playing_data(self, training=False, learning_rate=None, verbose=False): """Sets the playing data. params: training: A boolean, which determines if the agent should be treated as in a training mode learning_rate: A float, which is the rate that the table is updated with the currect Q reward (Must be provided if training is True) verbose: A boolean, which determines if training should be verbose (print information to the screen) """ self.playing_data = PlayingData(training, training, 1, True, {'learning_rate': learning_rate, 'verbose': verbose}) def add_memory(self, state, action, new_state, reward, terminal): """Adds information from one step in the environment to the agent. params: state: A value or list of values, which is the state of the environment before the action was performed action: A value, which is the action the agent took new_state: A value or list of values, which is the state of the environment after performing the action reward: A float/integer, which is the evaluation of the action performed terminal: A boolean, which determines if this call to add memory is the last for the episode """ if isinstance(state, list) and len(state) == 1: state = state[0] if isinstance(new_state, list) and len(new_state) == 1: new_state = new_state[0] self.state = state self.action = action self.new_state = new_state self.reward = reward self.terminal = terminal def forget(self): """Forgets or clears all memory.""" self.state = None self.action = None self.new_state = None self.reward = None self.terminal = None def learn(self, learning_rate, verbose=True): """Trains the agent on its last experience. params: learning_rate: A float, which is the rate that the table is updated with the currect Q reward verbose: A boolean, which determines if information should be printed to the screen """ assert self.state is not None, ( 'Memory is empty.' ) discounted_reward = 0 if not self.terminal: discounted_reward = (self.discounted_rate * np.amax(self.qtable[self.new_state])) self.qtable[self.state, self.action] = ( (1 - learning_rate) * self.qtable[self.state, self.action] + learning_rate * (self.reward + discounted_reward) ) if verbose: pass def load(self, path): """Loads a save from a folder. params: path: A string, which is the path to a folder to load """ Agent.load(self, path) self.qtable = np.load(os.path.join(path, 'qtable.npy')) def save(self, path, note='QAgent Save'): """Saves a note and qtable to a new folder. params: path: A string, which is the path to a folder to save within note: A string, which is the note to save in the folder return: A string, which is the complete path of the save """ path = Agent.save(self, path, note) np.save(os.path.join(path, 'qtable.npy'), self.qtable) return path class PQAgent(QAgent): """This class is like QAgent, but it uses multiple variables at once, hince Parallel Q Agent. """ def __init__(self, discrete_state_space, action_size, policy, discounted_rates, learning_rates): """Initalizes the Q-learning agent. params: discrete_state_space: An integer, which action_size: An integers, which is the action size of the environment policy: A policy instance discounted_rates: A list of floats within 0.0-1.0, which are the rates that future rewards should be counted for the current reward learning_rate: A list of floats, which are the rates that the table is updated with the currect Q reward """ Agent.__init__(self, action_size, policy) self.discrete_state_space = discrete_state_space self.discounted_rates = np.array(discounted_rates) self.learning_rates = np.array(learning_rates) self.inv_learning_rates = 1 - self.learning_rates self.qtables = np.zeros((len(self.learning_rates), len(self.discounted_rates), self.discrete_state_space, self.action_shape)) self.selected_qtable = None self.state = None self.action = None self.new_state = None self.reward = None self.terminal = None def select_action(self, state, training=False): """Returns the action the Agent "believes" to be suited for the given state. params: state: A value or list of values, which is the state to look up the action for in the table training: A boolean, which determines if the agent is training return: A value, which is the selected action """ def _select_action(): nonlocal state if isinstance(state, list) and len(state) == 1: state = state[0] return self.selected_qtable()[state] return self.policy.select_action(_select_action, training=training) def set_playing_data(self, training=False, learning_rate_ndx=None, discounted_rate_ndx=None, verbose=False): """Sets the playing data. params: training: A boolean, which determines if the agent should be treated as in a training mode learning_rate_ndx: An integer, which is a ndx for the learning rates discounted_rate_ndx: An integer, which is a ndx for the discounted rate verbose: A boolean, which determines if training should be verbose (print information to the screen) """ lrn = 0 drn = 0 if learning_rate_ndx is not None: self.learning_rates[learning_rate_ndx] lrn = learning_rate_ndx if discounted_rate_ndx is not None: self.discounted_rates[discounted_rate_ndx] drn = discounted_rate_ndx self.selected_qtable = lambda: self.qtables[lrn, drn] self.playing_data = PlayingData( training, training, 1, True, {'learning_rate_ndx': learning_rate_ndx, 'discounted_rate_ndx': discounted_rate_ndx, 'verbose': verbose} ) def learn(self, learning_rate_ndx=None, discounted_rate_ndx=None, verbose=True): """Trains the agent on its last experience. params: learning_rate_ndx: An integer, which is a ndx for the learning rates discounted_rate_ndx: An integer, which is a ndx for the discounted rate verbose: A boolean, which determines if information should be printed to the screen """ assert self.state is not None, ( 'Memory is empty.' ) lrn = learning_rate_ndx drn = discounted_rate_ndx if lrn is None and drn is None: discounted_reward = 0 if not self.terminal: discounted_reward = ( self.discounted_rates * np.amax(self.qtables[:, :, self.new_state], axis=-1) ) self.qtables[:, :, self.state, self.action] = ( self.inv_learning_rates[:, np.newaxis] * self.qtables[:, :, self.state, self.action] + self.learning_rates[:, np.newaxis] * (self.reward + discounted_reward) ) elif drn is None: discounted_reward = 0 if not self.terminal: discounted_reward = ( self.discounted_rates * np.amax(self.qtables[lrn, :, self.new_state], axis=-1) ) self.qtables[lrn, :, self.state, self.action] = ( self.inv_learning_rates[lrn, np.newaxis] * self.qtables[lrn, :, self.state, self.action] + self.learning_rates[lrn, np.newaxis] * (self.reward + discounted_reward) ) elif lrn is None: discounted_reward = 0 if not self.terminal: discounted_reward = ( self.discounted_rates[drn] * np.amax(self.qtables[:, drn, self.new_state], axis=-1) ) self.qtables[:, drn, self.state, self.action] = ( self.inv_learning_rates[:, np.newaxis] * self.qtables[:, drn, self.state, self.action] + self.learning_rates[:, np.newaxis] * (self.reward + discounted_reward) ) else: discounted_reward = 0 if not self.terminal: discounted_reward = ( self.discounted_rates[drn] * np.amax(self.qtables[lrn, drn, self.new_state], axis=-1) ) self.qtables[lrn, drn, self.state, self.action] = ( self.inv_learning_rates[lrn] * self.qtables[lrn, drn, self.state, self.action] + self.learning_rates[lrn] * (self.reward + discounted_reward) ) if verbose: pass def load(self, path): """Loads a save from a folder. params: path: A string, which is the path to a folder to load from """ Agent.load(self, path) self.qtables = np.load(os.path.join(path, 'qtables.npy')) def save(self, path, note='PQAgent Save'): """Saves a note and qtables to a new folder. params: path: A string, which is the path to a folder to save within note: A string, which is the note to save in the folder return: A string, which is the complete path of the save """ path = Agent.save(self, path, note) np.save(os.path.join(path, 'qtables.npy'), self.qtables) return path class DQNAgent(Agent): """This class is an Agent that uses a Deep Q Network instead of a table like the QAgent. This allows for generalizations and large environment states. """ @staticmethod def get_dueling_output_layer(action_shape, dueling_type='avg'): assert dueling_type in ['avg', 'max', 'naive'], ( "Dueling type must be 'avg', 'max', or 'naive'" ) def layer(x1, x2): x1 = keras.layers.Dense(1)(x1) x2 = keras.layers.Dense(action_shape[0])(x2) x = keras.layers.Concatenate()([x1, x2]) if dueling_type == 'avg': def dueling(a): return (K.expand_dims(a[:, 0], -1) + a[:, 1:] - K.mean(a[:, 1:], axis=1, keepdims=True)) elif dueling_type == 'max': def dueling(a): return (K.expand_dims(a[:, 0], -1) + a[:, 1:] - K.max(a[:, 1:], axis=1, keepdims=True)) else: def dueling(a): return K.expand_dims(a[:, 0], -1) + a[:, 1:] return keras.layers.Lambda(dueling, output_shape=action_shape, name='q_output')(x) return layer def __init__(self, policy, qmodel, discounted_rate, create_memory=lambda: Memory(), enable_target=True, enable_double=False, enable_PER=False): """Initalizes the Deep Q Network Agent. params: policy: A policy instance qmodel: A keras model, which takes the state as input and outputs Q Values discounted_rate: A float within 0.0-1.0, which is the rate that future rewards should be counted for the current reward create_memory: A function, which returns a Memory instance enable_target: A boolean, which determines if a target model should be used enable_double: A boolean, which determiens if the Double Deep Q Network should be used enable_PER: A boolean, which determines if prioritized experience replay should be used (The implementation for this is not the normal tree implementation, and only weights the probabilily of being choosen and not also the gradient) """ Agent.__init__(self, qmodel.output_shape[1:], policy) self.qmodel = qmodel self.target_qmodel = None self.enable_target = enable_target or enable_double self.enable_double = enable_double if self.enable_target: self.target_qmodel = keras.models.clone_model(qmodel) self.target_qmodel.compile(optimizer='sgd', loss='mse') else: self.target_qmodel = self.qmodel self.discounted_rate = discounted_rate self.states = create_memory() self.next_states = create_memory() self.actions = create_memory() self.rewards = create_memory() self.terminals = create_memory() if enable_PER: self.PER_losses = create_memory() # assuming the true max loss will be less than 100 # at least at the begining self.max_loss = 100.0 else: self.PER_losses = None self.action_identity = np.identity(self.action_shape[0]) self.total_steps = 0 self.metric = tf.keras.metrics.Mean(name='loss') self._tf_train_step = tf.function( self._train_step, input_signature=(tf.TensorSpec(shape=self.qmodel.input_shape, dtype=tf.keras.backend.floatx()), tf.TensorSpec(shape=self.qmodel.input_shape, dtype=tf.keras.backend.floatx()), tf.TensorSpec(shape=(None, None), dtype=tf.keras.backend.floatx()), tf.TensorSpec(shape=(None,), dtype=tf.keras.backend.floatx()), tf.TensorSpec(shape=(None,), dtype=tf.keras.backend.floatx())) ) def select_action(self, state, training=False): """Returns the action the Agent "believes" to be suited for the given state. params: state: A value, which is the state to predict the Q values for training: A boolean, which determines if the agent is training return: A value, which is the selected action """ def _select_action(): qvalues = self.qmodel(np.expand_dims(state, axis=0), training=False)[0].numpy() return qvalues return self.policy.select_action(_select_action, training=training) def set_playing_data(self, training=False, memorizing=False, learns_in_episode=False, batch_size=None, mini_batch=0, epochs=1, repeat=1, target_update_interval=1, tau=1.0, verbose=True): """Sets the playing data. params: training: A boolean, which determines if the agent should be treated as in a training mode memorizing: A boolean, which determines if the agent should be adding the information obtained through playing an episode to memory learns_in_episode: A boolean, which determines if the agent learns during a episode or at the end batch_size: An integer, which is the size of each batch within the mini-batch during one training instance mini_batch: An integer, which is the entire batch size for one training instance epochs: An integer, which is the number of epochs to train in one training instance repeat: An integer, which is the times to repeat a training instance in one training instance (similar to epochs, but mini_batch is resampled and qvalues repredicted) target_update_interval: An integer, which is the number of complete training instances (repeats do not count) until the target model weights are updated tau: A float, which is the strength of the copy from the qmodel to the target qmodel (1.0 is a hard copy and less is softer) verbose: A boolean, which determines if training should be verbose (print information to the screen) """ learning_params = {'batch_size': batch_size, 'mini_batch': mini_batch, 'epochs': epochs, 'repeat': repeat, 'target_update_interval': target_update_interval, 'tau': tau, 'verbose': verbose} self.playing_data = PlayingData(training, memorizing, epochs, learns_in_episode, learning_params) def add_memory(self, state, action, new_state, reward, terminal): """Adds information from one step in the environment to the agent. params: state: A value or list of values, which is the state of the environment before the action was performed action: A value, which is the action the agent took new_state: A value or list of values, which is the state of the environment after performing the action reward: A float/integer, which is the evaluation of the action performed terminal: A boolean, which determines if this call to add memory is the last for the episode """ self.states.add(np.array(state)) self.next_states.add(np.array(new_state)) self.actions.add(action) self.rewards.add(reward) self.terminals.add(0 if terminal else 1) if self.PER_losses is not None: self.PER_losses.add(self.max_loss) def forget(self): """Forgets or clears all memory.""" self.states.reset() self.next_states.reset() self.actions.reset() self.rewards.reset() self.terminals.reset() if self.PER_losses is not None: self.PER_losses.reset() def update_target(self, tau): """Updates the target Q Model weights. params: tau: A float, which is the strength of the copy from the qmodel to the target qmodel (1.0 is a hard copy and less is softer) """ if tau == 1.0: self.target_qmodel.set_weights(self.qmodel.get_weights()) else: tws = self.target_qmodel.trainable_variables ws = self.qmodel.trainable_variables for ndx in range(len(tws)): tws[ndx] = ws[ndx] * tau + tws[ndx] * (1 - tau) def _train_step(self, states, next_states, action_onehots, terminals, rewards): """Performs one gradient step with a batch of data. params: states: A tensor that contains environment states next_states: A tensor that contains the states of the environment after an action was performed action_onehots: A tensor that contains onehot encodings of the action performed terminals: A tensor that contains ones for nonterminal states and zeros for terminal states rewards: A tensor that contains the reward for the action performed in the environment return: A loss for this batch of data """ if self.enable_double: qvalues = self.qmodel(next_states, training=False) actions = tf.argmax(qvalues, axis=-1) qvalues = self.target_qmodel(next_states, training=False) qvalues = tf.squeeze(tf.gather(qvalues, actions[:, tf.newaxis], axis=-1, batch_dims=1)) else: qvalues = self.target_qmodel(next_states, training=False) qvalues = tf.reduce_max(qvalues, axis=-1) qvalues = (rewards + self.discounted_rate * qvalues * terminals) with tf.GradientTape() as tape: y_pred = self.qmodel(states, training=True) if len(self.qmodel.losses) > 0: reg_loss = tf.math.add_n(self.qmodel.losses) else: reg_loss = 0 y_true = (y_pred * (1 - action_onehots) + qvalues[:, tf.newaxis] * action_onehots) loss = self.qmodel.loss_functions[0](y_true, y_pred) + reg_loss grads = tape.gradient(loss, self.qmodel.trainable_variables) self.qmodel.optimizer.apply_gradients( zip(grads, self.qmodel.trainable_variables) ) self.metric(loss) return tf.reduce_sum(tf.abs(y_true - y_pred), axis=-1) def _train(self, states, next_states, action_onehots, terminals, rewards, epochs, batch_size, verbose=True): """Performs multiple gradient steps of all the data. params: states: A numpy array that contains environment states next_states: A numpy array that contains the states of the environment after an action was performed action_onehots: A numpy array that contains onehot encodings of the action performed terminals: A numpy array that contains ones for nonterminal states and zeros for terminal states rewards: A numpy array that contains the reward for the action performed in the environment epochs: An integer, which is the number of complete gradient steps to perform batch_size: An integer, which is the size of the batch for each partial gradient step verbose: A boolean, which determines if information should be printed to the screen return: A list of floats, which are the absolute losses for all the data """ length = states.shape[0] float_type = tf.keras.backend.floatx() batches = tf.data.Dataset.from_tensor_slices( (states.astype(float_type), next_states.astype(float_type), action_onehots.astype(float_type), terminals.astype(float_type), rewards.astype(float_type)) ).batch(batch_size) losses = [] for epoch in range(1, epochs + 1): if verbose: print(f'Epoch {epoch}/{epochs}') count = 0 for batch in batches: if epoch == epochs: losses.append(self._tf_train_step(*batch).numpy()) else: self._tf_train_step(*batch) count += np.minimum(batch_size, length - count) if verbose: print(f'{count}/{length}', end='\r') loss_results = self.metric.result() self.metric.reset_states() if verbose: print(f'{count}/{length} - ' f'loss: {loss_results}') return np.hstack(losses) def learn(self, batch_size=None, mini_batch=0, epochs=1, repeat=1, target_update_interval=1, tau=1.0, verbose=True): """Trains the agent on a sample of its experiences. params: batch_size: An integer, which is the size of each batch within the mini-batch during one training instance mini_batch: An integer, which is the entire batch size for one training instance epochs: An integer, which is the number of epochs to train in one training instance repeat: An integer, which is the times to repeat a training instance in one training instance (similar to epochs, but mini_batch is resampled and qvalues repredicted) target_update_interval: An integer, which is the number of complete training instances (repeats do not count) until the target model weights are updated tau: A float, which is the strength of the copy from the qmodel to the target qmodel (1.0 is a hard copy and less is softer) verbose: A boolean, which determines if training should be verbose (print information to the screen) """ self.total_steps += 1 if mini_batch > 0 and len(self.states) > mini_batch: length = mini_batch else: length = len(self.states) for count in range(1, repeat+1): if verbose: print(f'Repeat {count}/{repeat}') indexes = None if self.PER_losses is None: indexes = np.random.choice(np.arange(len(self.states)), size=length, replace=False) else: PER_losses_arr = self.PER_losses.array() self.max_loss = PER_losses_arr.max() PER_losses_arr = PER_losses_arr / PER_losses_arr.sum() indexes = np.random.choice(np.arange(len(self.states)), size=length, replace=False, p=PER_losses_arr) if length >= 10000: # depends on cpu and other factors next_states_arr = self.next_states.array()[indexes] states_arr = self.states.array()[indexes] action_onehots = self.action_identity[ self.actions.array()[indexes] ] rewards_arr = self.rewards.array()[indexes] terminals_arr = self.terminals.array()[indexes] else: next_states_arr = np.empty((length, *self.states[0].shape)) states_arr = np.empty((length, *self.states[0].shape)) action_onehots = np.empty((length, self.action_shape[0])) rewards_arr = np.empty(length) terminals_arr = np.empty(length) for ndx, rndx in enumerate(indexes): states_arr[ndx] = self.states[rndx] next_states_arr[ndx] = self.next_states[rndx] action_onehots[ndx] = self.action_identity[ self.actions[rndx] ] rewards_arr[ndx] = self.rewards[rndx] terminals_arr[ndx] = self.terminals[rndx] losses = self._train(states_arr, next_states_arr, action_onehots, terminals_arr, rewards_arr, epochs, batch_size, verbose=verbose) if self.PER_losses is not None: for ndx, loss in zip(indexes, losses): self.PER_losses[ndx] = loss if (self.enable_target and self.total_steps % target_update_interval == 0): self.update_target(tau) def load(self, path, load_model=True, load_data=True): """Loads a save from a folder. params: path: A string, which is the path to a folder to load load_model: A boolean, which determines if the model architecture and weights should be loaded load_data: A boolean, which determines if the memory from a folder should be loaded """ Agent.load(self, path) if load_model: with open(os.path.join(path, 'qmodel.json'), 'r') as file: self.qmodel = model_from_json(file.read()) self.qmodel.load_weights(os.path.join(path, 'qweights.h5')) if self.enable_target: self.target_qmodel = keras.models.clone_model(self.qmodel) self.target_qmodel.compile(optimizer='sgd', loss='mse') else: self.target_qmodel = self.qmodel if load_data: with h5py.File(os.path.join(path, 'data.h5'), 'r') as file: for state in file['states']: self.states.add(state) for new_state in file['next_states']: self.next_states.add(new_state) for action in file['actions']: self.actions.add(action) for reward in file['rewards']: self.rewards.add(reward) for terminal in file['terminals']: self.terminals.add(terminal) if self.PER_losses is not None: if 'PER_losses' in file: for loss in file['PER_losses']: self.PER_losses.add(loss) else: for _ in range(len(self.states)): self.PER_losses.add(self.max_loss) def save(self, path, save_model=True, save_data=True, note='DQNAgent Save'): """Saves a note, model weights, and memory to a new folder. params: path: A string, which is the path to a folder to save within save_model: A boolean, which determines if the model architecture and weights should be saved save_data: A boolean, which determines if the memory should be saved note: A string, which is a note to save in the folder return: A string, which is the complete path of the save """ path = Agent.save(self, path, note) if save_model: with open(os.path.join(path, 'qmodel.json'), 'w') as file: file.write(self.qmodel.to_json()) self.qmodel.save_weights(os.path.join(path, 'qweights.h5')) if save_data: with h5py.File(os.path.join(path, 'data.h5'), 'w') as file: file.create_dataset('states', data=self.states.array()) file.create_dataset( 'next_states', data=self.next_states.array() ) file.create_dataset('actions', data=self.actions.array()) file.create_dataset('rewards', data=self.rewards.array()) file.create_dataset('terminals', data=self.terminals.array()) if self.PER_losses is not None: file.create_dataset( 'PER_losses', data=self.PER_losses.array() ) return path class PGAgent(Agent): """This class is an Agent that uses a Neural Network like the DQN Agent, but instead of learning to predict Q values, it predicts actions. It learns to predict these actions through Policy Gradients (PG). """ def __init__(self, amodel, discounted_rate, create_memory=lambda: Memory(), policy=None): """Initalizes the Policy Gradient Agent. params: amodel: A keras model, which takes the state as input and outputs actions (regularization losses are not applied, and compiled loss are not used) discounted_rate: A float within 0.0-1.0, which is the rate that future rewards should be counted for the current reward create_memory: A function, which returns a Memory instance policy: A policy instance """ Agent.__init__(self, amodel.output_shape[1:], policy) self.amodel = amodel self.discounted_rate = discounted_rate self.states = create_memory() self.actions = create_memory() self.rewards = create_memory() self.drewards = create_memory() self.action_identity = np.identity(self.action_shape[0]) self.metric = tf.keras.metrics.Mean(name='loss') self._tf_train_step = tf.function( self._train_step, input_signature=(tf.TensorSpec(shape=self.amodel.input_shape, dtype=tf.keras.backend.floatx()), tf.TensorSpec(shape=(None,), dtype=tf.keras.backend.floatx()), tf.TensorSpec(shape=(None, None), dtype=tf.keras.backend.floatx()), tf.TensorSpec(shape=(), dtype=tf.keras.backend.floatx())) ) def select_action(self, state, training=False): """Returns the action the Agent "believes" to be suited for the given state. params: state: A value, which is the state to predict the action for training: A boolean, which determines if the agent is training return: A value, which is the selected action """ def _select_action(): actions = self.amodel(np.expand_dims(state, axis=0), training=False)[0].numpy() return np.random.choice(np.arange(self.action_shape[0]), p=actions) if self.policy is None: return _select_action() return self.policy.select_action(_select_action, training=training) def set_playing_data(self, training=False, memorizing=False, batch_size=None, mini_batch=0, epochs=1, repeat=1, entropy_coef=0, verbose=True): """Sets the playing data. params: training: A boolean, which determines if the agent should be treated as in a training mode memorizing: A boolean, which determines if the agent should be adding the information obtained through playing an episode to memory batch_size: An integer, which is the size of each batch within the mini-batch during one training instance mini_batch: An integer, which is the entire batch size for one training instance epochs: An integer, which is the number of epochs to train in one training instance repeat: An integer, which is the times to repeat a training instance in one training instance (similar to epochs, but mini_batch is resampled and qvalues repredicted) entropy_coef: A float, which is the coefficent of entropy to add to the actor loss verbose: A boolean, which determines if training should be verbose (print information to the screen) """ learning_params = {'batch_size': batch_size, 'mini_batch': mini_batch, 'epochs': epochs, 'repeat': repeat, 'entropy_coef': entropy_coef, 'verbose': verbose} self.playing_data = PlayingData(training, memorizing, epochs, False, learning_params) def add_memory(self, state, action, new_state, reward, terminal): """Adds information from one step in the environment to the agent. params: state: A value or list of values, which is the state of the environment before the action was performed action: A value, which is the action the agent took new_state: A value or list of values, which is the state of the environment after performing the action (discarded) reward: A float/integer, which is the evaluation of the action performed terminal: A boolean, which determines if this call to add memory is the last for the episode (discarded) """ self.states.add(np.array(state)) self.actions.add(action) self.rewards.add(reward) def forget(self): """Forgets or clears all memory.""" self.states.reset() self.actions.reset() self.rewards.reset() self.drewards.reset() def end_episode(self): """Ends the episode, and creates drewards based on the episodes rewards. """ if len(self.rewards) > 0: dreward = 0 dreward_list = [] # hacky, assuming memory works with reversed for reward in reversed(self.rewards.buffer): dreward *= self.discounted_rate dreward += reward dreward_list.append(dreward) self.rewards.reset() for dreward in reversed(dreward_list): self.drewards.add(dreward) def _train_step(self, states, drewards, action_onehots, entropy_coef): """Performs one gradient step with a batch of data. params: states: A tensor that contains environment states drewards: A tensor that contains the discounted reward for the action performed in the environment action_onehots: A tensor that contains onehot encodings of the action performed entropy_coef: A tensor constant float, which is the coefficent of entropy to add to the actor loss """ with tf.GradientTape() as tape: y_pred = self.amodel(states, training=True) # log_softmax may be mathematically correct, but in practice # seems to give worse results log_probs = tf.reduce_sum( action_onehots * tf.math.log(y_pred + tf.keras.backend.epsilon()), axis=1 ) loss = -tf.reduce_mean(drewards * log_probs) entropy = tf.reduce_sum( y_pred * tf.math.log(y_pred + tf.keras.backend.epsilon()), axis=1 ) loss += tf.reduce_mean(entropy) * entropy_coef grads = tape.gradient(loss, self.amodel.trainable_variables) self.amodel.optimizer.apply_gradients( zip(grads, self.amodel.trainable_variables) ) self.metric(loss) def _train(self, states, drewards, action_onehots, epochs, batch_size, entropy_coef, verbose=True): """Performs multiple gradient steps of all the data. params: states: A numpy array that contains environment states drewards: A numpy array that contains the discounted reward for the action performed in the environment action_onehots: A numpy array that contains onehot encodings of the action performed epochs: An integer, which is the number of complete gradient steps to perform batch_size: An integer, which is the size of the batch for each partial gradient step entropy_coef: A float, which is the coefficent of entropy to add to the actor loss verbose: A boolean, which determines if information should be printed to the screen return: A float, which is the mean loss of batches (not exactly a loss) """ length = states.shape[0] float_type = tf.keras.backend.floatx() batches = tf.data.Dataset.from_tensor_slices( (states.astype(float_type), drewards.astype(float_type), action_onehots.astype(float_type)) ).batch(batch_size) entropy_coef = tf.constant(entropy_coef, dtype=float_type) for epoch in range(1, epochs + 1): if verbose: print(f'Epoch {epoch}/{epochs}') count = 0 for batch in batches: self._tf_train_step(*batch, entropy_coef) count += np.minimum(batch_size, length - count) print(f'{count}/{length}', end='\r') loss_results = self.metric.result() self.metric.reset_states() if verbose: print(f'{count}/{length} - ' f'loss: {loss_results}') return loss_results def learn(self, batch_size=None, mini_batch=0, epochs=1, repeat=1, entropy_coef=0, verbose=True): """Trains the agent on a sample of its experiences. params: batch_size: An integer, which is the size of each batch within the mini_batch during one training instance mini_batch: An integer, which is the entire batch size for one training instance epochs: An integer, which is the number of epochs to train in one training instance repeat: An integer, which is the times to repeat a training instance in one training instance (similar to epochs, but mini_batch is resampled) entropy_coef: A float, which is the coefficent of entropy to add to the actor loss verbose: A boolean, which determines if training should be verbose (print information to the screen) """ if mini_batch > 0 and len(self.states) > mini_batch: length = mini_batch else: length = len(self.states) for count in range(1, repeat+1): if verbose: print(f'Repeat {count}/{repeat}') indexes = np.random.choice(np.arange(len(self.states)), size=length, replace=False) if length >= 20000: # depends on cpu and other factors states_arr = self.states.array()[indexes] action_onehots = self.action_identity[ self.actions.array()[indexes] ] drewards_arr = self.drewards.array()[indexes] else: states_arr = np.empty((length, *self.states[0].shape)) action_onehots = np.empty((length, self.action_shape[0])) drewards_arr = np.empty(length) for ndx in range(length): states_arr[ndx] = self.states[indexes[ndx]] action_onehots[ndx] = self.action_identity[ self.actions[indexes[ndx]] ] drewards_arr[ndx] = self.drewards[indexes[ndx]] std = drewards_arr.std() if std == 0: return False drewards_arr = (drewards_arr - drewards_arr.mean()) / std self._train(states_arr, drewards_arr, action_onehots, epochs, batch_size, entropy_coef, verbose=verbose) def load(self, path, load_model=True, load_data=True): """Loads a save from a folder. params: path: A string, which is the path to a folder to load load_model: A boolean, which determines if the model architecture and weights should be loaded load_data: A boolean, which determines if the memory from a folder should be loaded """ Agent.load(self, path) if load_model: with open(os.path.join(path, 'amodel.json'), 'r') as file: self.amodel = model_from_json(file.read()) self.amodel.load_weights(os.path.join(path, 'aweights.h5')) if load_data: with h5py.File(os.path.join(path, 'data.h5'), 'r') as file: for state in file['states']: self.states.add(state) for action in file['actions']: self.actions.add(action) for dreward in file['drewards']: self.drewards.add(dreward) def save(self, path, save_model=True, save_data=True, note='PGAgent Save'): """Saves a note, model weights, and memory to a new folder. params: path: A string, which is the path to a folder to save within save_model: A boolean, which determines if the model architecture and weights should be saved save_data: A boolean, which determines if the memory should be saved note: A string, which is a note to save in the folder return: A string, which is the complete path of the save """ path = Agent.save(self, path, note) if save_model: with open(os.path.join(path, 'amodel.json'), 'w') as file: file.write(self.amodel.to_json()) self.amodel.save_weights(os.path.join(path, 'aweights.h5')) if save_data: with h5py.File(os.path.join(path, 'data.h5'), 'w') as file: file.create_dataset('states', data=self.states.array()) file.create_dataset('actions', data=self.actions.array()) file.create_dataset('drewards', data=self.drewards.array()) return path class DDPGAgent(Agent): """This class (Deep Deterministic Policy Gradient Agent) is an Agent that uses two Neural Networks. An Actor network, which is like a PGAgent Network and a Critic Network like the DQNAgent Network. The critic rates the actions of the actor. """ def __init__(self, policy, amodel, cmodel, discounted_rate, create_memory=lambda: Memory(), enable_target=False): """Initalizes the DDPG Agent. params: policy: A policy instance amodel: A keras model, which takes the state as input and outputs actions (regularization losses are not applied, and compiled loss are not used) cmodel: A keras model, which takes the state and a action as input and outputs Q Values (a judgement) discounted_rate: A float within 0.0-1.0, which is the rate that future rewards should be counted for the current reward create_memory: A function, which returns a Memory instance enable_target: A boolean, which determines if a target model should be used for the critic """ print('WARNING: This implementation may be incorrect.') Agent.__init__(self, amodel.output_shape[1:], policy) self.amodel = amodel self.cmodel = cmodel self.target_cmodel = None self.enable_target = enable_target self.discounted_rate = discounted_rate if self.enable_target: self.target_amodel = keras.models.clone_model(amodel) self.target_amodel.compile(optimizer='sgd', loss='mse') self.target_cmodel = keras.models.clone_model(cmodel) self.target_cmodel.compile(optimizer='sgd', loss='mse') else: self.target_amodel = self.amodel self.target_cmodel = self.cmodel self.states = create_memory() self.next_states = create_memory() self.actions = create_memory() self.rewards = create_memory() self.terminals = create_memory() self.total_steps = 0 self.metric_c = tf.keras.metrics.Mean(name='critic_loss') self.metric_a = tf.keras.metrics.Mean(name='actor_loss') self._tf_train_step = tf.function( self._train_step, input_signature=(tf.TensorSpec(shape=self.amodel.input_shape, dtype=tf.keras.backend.floatx()), tf.TensorSpec(shape=self.amodel.input_shape, dtype=tf.keras.backend.floatx()), tf.TensorSpec(shape=self.amodel.output_shape, dtype=tf.keras.backend.floatx()), tf.TensorSpec(shape=(None,), dtype=tf.keras.backend.floatx()), tf.TensorSpec(shape=(None,), dtype=tf.keras.backend.floatx())) ) def select_action(self, state, training=False): """Returns the action the Agent "believes" to be suited for the given state. params: state: A value or list of values, which is the state to predict the actions for training: A boolean, which determines if the agent is training return: A value or list of values, which is the selected action """ def _select_action(): actions = self.amodel(np.expand_dims(state, axis=0), training=False)[0].numpy() return actions actions = self.policy.select_action(_select_action, training=training) return actions def set_playing_data(self, training=False, memorizing=False, learns_in_episode=False, batch_size=None, mini_batch=0, epochs=1, repeat=1, target_update_interval=1, tau=1.0, verbose=True): """Sets the playing data. params: training: A boolean, which determines if the agent should be treated as in a training mode memorizing: A boolean, which determines if the agent should be adding the information obtained through playing an episode to memory learns_in_episode: A boolean, which determines if the agent learns during a episode or at the end batch_size: An integer, which is the size of each batch within the mini-batch during one training instance mini_batch: An integer, which is the entire batch size for one training instance epochs: An integer, which is the number of epochs to train in one training instance repeat: An integer, which is the times to repeat a training instance in one training instance (similar to epochs, but mini_batch is resampled and qvalues repredicted) target_update_interval: An integer, which is the number of complete training instances (repeats do not count) until the target critic model weights are updated tau: A float, which is the strength of the copy from the Actor or Critic model to the target models (1.0 is a hard copy and less is softer) verbose: A boolean, which determines if training should be verbose (print information to the screen) """ learning_params = {'batch_size': batch_size, 'mini_batch': mini_batch, 'epochs': epochs, 'repeat': repeat, 'target_update_interval': target_update_interval, 'tau': tau, 'verbose': verbose} self.playing_data = PlayingData(training, memorizing, epochs, learns_in_episode, learning_params) def add_memory(self, state, action, new_state, reward, terminal): """Adds information from one step in the environment to the agent. params: state: A value or list of values, which is the state of the environment before the action was performed action: A value or list of values, which is the action the agent took new_state: A value or list of values, which is the state of the environment after performing the action reward: A float/integer, which is the evaluation of the action performed terminal: A boolean, which determines if this call to add memory is the last for the episode """ self.states.add(np.array(state)) self.next_states.add(np.array(new_state)) self.actions.add(action) self.rewards.add(reward) self.terminals.add(0 if terminal else 1) def forget(self): """Forgets or clears all memory.""" self.states.reset() self.next_states.reset() self.actions.reset() self.rewards.reset() self.terminals.reset() def update_target(self, tau): """Updates the target Actor and Critic Model weights. params: tau: A float, which is the strength of the copy from the Actor or Critic model to the target models (1.0 is a hard copy and less is softer) """ if tau == 1.0: self.target_amodel.set_weights(self.amodel.get_weights()) self.target_cmodel.set_weights(self.cmodel.get_weights()) else: tws = self.target_amodel.trainable_variables ws = self.amodel.trainable_variables for ndx in range(len(tws)): tws[ndx] = ws[ndx] * tau + tws[ndx] * (1 - tau) tws = self.target_cmodel.trainable_variables ws = self.cmodel.trainable_variables for ndx in range(len(tws)): tws[ndx] = ws[ndx] * tau + tws[ndx] * (1 - tau) def _train_step(self, states, next_states, actions, terminals, rewards): """Performs one gradient step with a batch of data. params: states: A tensor that contains environment states next_states: A tensor that contains the states of the environment after an action was performed actions: A tensor that contains the actions performed terminals: A tensor that contains ones for nonterminal states and zeros for terminal states rewards: A tensor that contains the reward for the action performed in the environment """ next_actions = self.target_amodel(next_states, training=False) next_qvalues = self.target_cmodel([next_states, next_actions], training=False) qvalues_true = (rewards + self.discounted_rate * next_qvalues * terminals) # Critic with tf.GradientTape() as tape: qvalues_pred = self.cmodel([states, actions], training=True) if len(self.cmodel.losses) > 0: reg_loss = tf.math.add_n(self.cmodel.losses) else: reg_loss = 0 loss = self.cmodel.loss_functions[0](qvalues_true, qvalues_pred) loss = tf.reduce_mean(loss) + reg_loss grads = tape.gradient(loss, self.cmodel.trainable_variables) self.cmodel.optimizer.apply_gradients( zip(grads, self.cmodel.trainable_variables) ) self.metric_c(loss) # Actor with tf.GradientTape() as tape: action_preds = self.amodel(states, training=True) loss = -tf.reduce_mean( self.cmodel([states, action_preds], training=False) ) grads = tape.gradient(loss, self.amodel.trainable_variables) self.amodel.optimizer.apply_gradients( zip(grads, self.amodel.trainable_variables) ) self.metric_a(loss) def _train(self, states, next_states, actions, terminals, rewards, epochs, batch_size, verbose=True): """Performs multiple gradient steps of all the data. params: states: A numpy array that contains environment states next_states: A numpy array that contains the states of the environment after an action was performed actions: A numpy array that contains the actions performed terminals: A numpy array that contains ones for nonterminal states and zeros for terminal states rewards: A numpy array that contains the reward for the action performed in the environment epochs: An integer, which is the number of complete gradient steps to perform batch_size: An integer, which is the size of the batch for each partial gradient step verbose: A boolean, which determines if information should be printed to the screen return: A float, which is the mean critic loss of the batches """ length = states.shape[0] float_type = tf.keras.backend.floatx() batches = tf.data.Dataset.from_tensor_slices( (states.astype(float_type), next_states.astype(float_type), actions.astype(float_type), terminals.astype(float_type), rewards.astype(float_type)) ).batch(batch_size) for epoch in range(1, epochs + 1): if verbose: print(f'Epoch {epoch}/{epochs}') count = 0 for batch in batches: self._tf_train_step(*batch) count += np.minimum(batch_size, length - count) print(f'{count}/{length}', end='\r') critic_loss_results = self.metric_c.result() actor_loss_results = self.metric_a.result() self.metric_c.reset_states() self.metric_a.reset_states() if verbose: print(f'{count}/{length} - ' f'critic_loss: {critic_loss_results} - ' f'actor_loss: {actor_loss_results}') return critic_loss_results def learn(self, batch_size=None, mini_batch=0, epochs=1, repeat=1, target_update_interval=1, tau=1.0, verbose=True): """Trains the agent on a sample of its experiences. params: batch_size: An integer, which is the size of each batch within the mini_batch during one training instance mini_batch: An integer, which is the entire batch size for one training instance epochs: An integer, which is the number of epochs to train in one training instance repeat: An integer, which is the times to repeat a training instance in one training instance (similar to epochs, but mini_batch is resampled and predictions are repredicted) target_update_interval: An integer, which is the number of complete training instances (repeats do not count) until the target critic model weights are updated tau: A float, which is the strength of the copy from the Actor or Critic model to the target models (1.0 is a hard copy and less is softer) verbose: A boolean, which determines if training should be verbose (print information to the screen) """ self.total_steps += 1 if mini_batch > 0 and len(self.states) > mini_batch: length = mini_batch else: length = len(self.states) for count in range(1, repeat+1): if verbose: print(f'Repeat {count}/{repeat}') indexes = np.random.choice(np.arange(len(self.states)), size=length, replace=False) if length >= 10000: # depends on cpu and other factors next_states_arr = self.next_states.array()[indexes] states_arr = self.states.array()[indexes] actions_arr = self.actions.array()[indexes] rewards_arr = self.rewards.array()[indexes] terminals_arr = self.terminals.array()[indexes] else: next_states_arr = np.empty((length, *self.states[0].shape)) states_arr = np.empty((length, *self.states[0].shape)) actions_arr = np.empty((length, *self.actions[0].shape)) rewards_arr = np.empty(length) terminals_arr = np.empty(length) for ndx, rndx in enumerate(indexes): states_arr[ndx] = self.states[rndx] next_states_arr[ndx] = self.next_states[rndx] actions_arr[ndx] = self.actions[rndx] rewards_arr[ndx] = self.rewards[rndx] terminals_arr[ndx] = self.terminals[rndx] self._train(states_arr, next_states_arr, actions_arr, terminals_arr, rewards_arr, epochs, batch_size, verbose=verbose) if (self.enable_target and self.total_steps % target_update_interval == 0): self.update_target(tau) def load(self, path, load_model=True, load_data=True): """Loads a save from a folder. params: path: A string, which is the path to a folder to load load_model: A boolean, which determines if the model architectures and weights should be loaded load_data: A boolean, which determines if the memory from a folder should be loaded """ Agent.load(self, path) if load_model: with open(os.path.join(path, 'amodel.json'), 'r') as file: self.amodel = model_from_json(file.read()) with open(os.path.join(path, 'cmodel.json'), 'r') as file: self.cmodel = model_from_json(file.read()) self.amodel.load_weights(os.path.join(path, 'aweights.h5')) self.cmodel.load_weights(os.path.join(path, 'cweights.h5')) if load_data: with h5py.File(os.path.join(path, 'data.h5'), 'r') as file: for state in file['states']: self.states.add(state) for new_state in file['next_states']: self.next_states.add(new_state) for action in file['actions']: self.actions.add(action) for reward in file['rewards']: self.rewards.add(reward) for terminal in file['terminals']: self.terminals.add(terminal) def save(self, path, save_model=True, save_data=True, note='DDPGAgent Save'): """Saves a note, weights of the models, and memory to a new folder. params: path: A string, which is the path to a folder to save within save_model: A boolean, which determines if the model architectures and weights should be saved save_data: A boolean, which determines if the memory should be saved note: A string, which is a note to save in the folder return: A string, which is the complete path of the save """ path = Agent.save(self, path, note) if save_model: with open(os.path.join(path, 'amodel.json'), 'w') as file: file.write(self.amodel.to_json()) with open(os.path.join(path, 'cmodel.json'), 'w') as file: file.write(self.cmodel.to_json()) self.amodel.save_weights(os.path.join(path, 'aweights.h5')) self.cmodel.save_weights(os.path.join(path, 'cweights.h5')) if save_data: with h5py.File(os.path.join(path, 'data.h5'), 'w') as file: file.create_dataset('states', data=self.states.array()) file.create_dataset('next_states', data=self.next_states.array()) file.create_dataset('actions', data=self.actions.array()) file.create_dataset('rewards', data=self.rewards.array()) file.create_dataset('terminals', data=self.terminals.array()) return path
43.687129
79
0.5548
12,792
110,310
4.663149
0.048077
0.017602
0.023805
0.029689
0.813264
0.78686
0.762401
0.740759
0.714422
0.698865
0
0.004231
0.374427
110,310
2,524
80
43.704437
0.860188
0.372088
0
0.57578
0
0
0.042716
0.001052
0
0
0
0
0.009658
1
0.089153
false
0.007429
0.008172
0.002972
0.156761
0.017831
0
0
0
null
0
0
0
1
1
1
1
1
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
6
485c4df839b7a73db4114cb5e6e096d7902d8ff4
693
py
Python
scripts/fundamentals/scrp_Logical_if_statement.py
duttashi/learnpy
c08b76b173b06d66187e51a6939d55d5dd12cb5a
[ "MIT" ]
null
null
null
scripts/fundamentals/scrp_Logical_if_statement.py
duttashi/learnpy
c08b76b173b06d66187e51a6939d55d5dd12cb5a
[ "MIT" ]
77
2019-04-20T06:54:19.000Z
2022-01-16T08:15:20.000Z
scripts/fundamentals/scrp_Logical_if_statement.py
duttashi/learnpy
c08b76b173b06d66187e51a6939d55d5dd12cb5a
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Tue Jul 14 16:15:05 2020 Logical condition: If statement @author: Ashish """ day_of_week = input("What day of the week is it today? ") if day_of_week == "Monday": print("Have a great start to your week!") elif day_of_week == "Friday": print("It's ok to finish a bit early!") else: print("Full speed ahead!") # -- Problem: user not entering what we expect -- day_of_week = input("What day of the week is it today? ").lower() if day_of_week == "monday": print("Have a great start to your week!") elif day_of_week == "friday": print("It's ok to finish a bit early!") else: print("Full speed ahead!")
24.75
66
0.630592
114
693
3.72807
0.464912
0.094118
0.127059
0.065882
0.729412
0.729412
0.729412
0.729412
0.729412
0.729412
0
0.024436
0.232323
693
27
67
25.666667
0.774436
0.222222
0
0.571429
0
0
0.499002
0
0
0
0
0
0
1
0
false
0
0
0
0
0.428571
0
0
0
null
0
0
0
0
1
1
1
1
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
1
0
6
485cff93f4c5897bca0e48491c18d6fb6067db95
300
py
Python
0733 Peekable Iterator.py
ansabgillani/binarysearchcomproblems
12fe8632f8cbb5058c91a55bae53afa813a3247e
[ "MIT" ]
1
2020-12-29T21:17:26.000Z
2020-12-29T21:17:26.000Z
0733 Peekable Iterator.py
ansabgillani/binarysearchcomproblems
12fe8632f8cbb5058c91a55bae53afa813a3247e
[ "MIT" ]
null
null
null
0733 Peekable Iterator.py
ansabgillani/binarysearchcomproblems
12fe8632f8cbb5058c91a55bae53afa813a3247e
[ "MIT" ]
4
2021-09-09T17:42:43.000Z
2022-03-18T04:54:03.000Z
class PeekableIterator: def __init__(self, nums): self.nums = nums self.i = 0 def peek(self): return self.nums[self.i] def next(self): self.i += 1 return self.nums[self.i-1] def hasnext(self): return self.i < len(self.nums)
18.75
38
0.536667
41
300
3.829268
0.341463
0.254777
0.229299
0.229299
0.242038
0
0
0
0
0
0
0.015306
0.346667
300
15
39
20
0.785714
0
0
0
0
0
0
0
0
0
0
0
0
1
0.363636
false
0
0
0.181818
0.727273
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
1
0
0
0
1
1
0
0
6
487cc069c7d320759fd2272e555c78e9fb43f58f
57
py
Python
CAAPR/CAAPR_Photom/__init__.py
wdobbels/CAAPR
50d0b32642a61af614c22f1c6dc3c4a00a1e71a3
[ "MIT" ]
7
2016-05-20T21:56:39.000Z
2022-02-07T21:09:48.000Z
CAAPR/CAAPR_Photom/__init__.py
wdobbels/CAAPR
50d0b32642a61af614c22f1c6dc3c4a00a1e71a3
[ "MIT" ]
1
2019-03-21T16:10:04.000Z
2019-03-22T17:21:56.000Z
CAAPR/CAAPR_Photom/__init__.py
wdobbels/CAAPR
50d0b32642a61af614c22f1c6dc3c4a00a1e71a3
[ "MIT" ]
1
2020-05-19T16:17:17.000Z
2020-05-19T16:17:17.000Z
from . import CAAPR_Photom from .CAAPR_Photom import *
19
28
0.77193
8
57
5.25
0.5
0.52381
0
0
0
0
0
0
0
0
0
0
0.175439
57
2
29
28.5
0.893617
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
6f9c6aec874d67394922d584a31cf415da12cc40
49
py
Python
src/image/video/__init__.py
fronovics/AI_playground
ac302c0694fa2182af343c257b28a033bc4cf5b9
[ "Apache-2.0" ]
null
null
null
src/image/video/__init__.py
fronovics/AI_playground
ac302c0694fa2182af343c257b28a033bc4cf5b9
[ "Apache-2.0" ]
null
null
null
src/image/video/__init__.py
fronovics/AI_playground
ac302c0694fa2182af343c257b28a033bc4cf5b9
[ "Apache-2.0" ]
null
null
null
from src.image.video.video_loop import VideoLoop
24.5
48
0.857143
8
49
5.125
0.875
0
0
0
0
0
0
0
0
0
0
0
0.081633
49
1
49
49
0.911111
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
1
0
0
6
6f9f4a5b6c8223f54d05fab7db84f79b8957394c
10,423
py
Python
src/pds_doi_service/core/db/test/doi_database_test.py
NASA-PDS/pds-doi-service
b994381a5757700229865e8fe905553559684e0d
[ "Apache-2.0" ]
2
2020-11-03T19:29:11.000Z
2021-09-26T01:42:41.000Z
src/pds_doi_service/core/db/test/doi_database_test.py
NASA-PDS/pds-doi-service
b994381a5757700229865e8fe905553559684e0d
[ "Apache-2.0" ]
222
2020-05-07T21:05:23.000Z
2021-12-16T22:14:54.000Z
src/pds_doi_service/core/db/test/doi_database_test.py
NASA-PDS/pds-doi-service
b994381a5757700229865e8fe905553559684e0d
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python import datetime import os import unittest from datetime import timedelta from datetime import timezone from os.path import exists from pds_doi_service.core.db.doi_database import DOIDataBase from pds_doi_service.core.entities.doi import DoiStatus from pds_doi_service.core.entities.doi import ProductType from pds_doi_service.core.util.general_util import get_logger from pkg_resources import resource_filename logger = get_logger(__name__) class DOIDatabaseTest(unittest.TestCase): """Unit tests for the doi_database.py module""" def setUp(self): self._db_name = resource_filename(__name__, "doi_temp.db") # Delete temporary db if it already exists, this can occur when tests # are terminated before completion (during debugging for example) if exists(self._db_name): os.remove(self._db_name) self._doi_database = DOIDataBase(self._db_name) def tearDown(self): if exists(self._db_name): os.remove(self._db_name) def test_select_latest_rows(self): """Test selecting of latest rows from the transaction database""" # Set up a sample db entry identifier = "urn:nasa:pds:lab_shocked_feldspars::1.0" transaction_key = "img/2020-06-15T18:42:45.653317" doi = "10.17189/21729" date_added = datetime.datetime.now() date_updated = datetime.datetime.now() status = DoiStatus.Unknown title = "Laboratory Shocked Feldspars Bundle" product_type = ProductType.Collection product_type_specific = "PDS4 Collection" submitter = "img-submitter@jpl.nasa.gov" discipline_node = "img" # Insert a row in the 'doi' table self._doi_database.write_doi_info_to_database( identifier, transaction_key, doi, date_added, date_updated, status, title, product_type, product_type_specific, submitter, discipline_node, ) # Select the row we just added # The type of o_query_result should be JSON and a list of 1 o_query_result = self._doi_database.select_latest_rows(query_criterias={"doi": [doi]}) # Reformat results to a dictionary to test with query_result = dict(zip(o_query_result[0], o_query_result[1][0])) # Ensure we got back everything we just put in self.assertEqual(query_result["status"], status) self.assertEqual( int(query_result["date_added"].timestamp()), int(date_added.replace(tzinfo=timezone(timedelta(hours=--8.0))).timestamp()), ) self.assertEqual( int(query_result["date_updated"].timestamp()), int(date_updated.replace(tzinfo=timezone(timedelta(hours=--8.0))).timestamp()), ) self.assertEqual(query_result["submitter"], submitter) self.assertEqual(query_result["title"], title) self.assertEqual(query_result["type"], product_type) self.assertEqual(query_result["subtype"], product_type_specific) self.assertEqual(query_result["node_id"], discipline_node) self.assertEqual(query_result["identifier"], identifier) self.assertEqual(query_result["doi"], doi) self.assertEqual(query_result["transaction_key"], transaction_key) self.assertTrue(query_result["is_latest"]) # Update some fields and write a new "latest" entry status = DoiStatus.Draft submitter = "eng-submitter@jpl.nasa.gov" discipline_node = "eng" self._doi_database.write_doi_info_to_database( identifier, transaction_key, doi, date_added, date_updated, status, title, product_type, product_type_specific, submitter, discipline_node, ) # Query again and ensure we only get latest back o_query_result = self._doi_database.select_latest_rows(query_criterias={"doi": [doi]}) # Should only get the one row back self.assertEqual(len(o_query_result[-1]), 1) query_result = dict(zip(o_query_result[0], o_query_result[-1][0])) self.assertEqual(query_result["status"], status) self.assertEqual(query_result["submitter"], submitter) self.assertEqual(query_result["node_id"], discipline_node) self.assertTrue(query_result["is_latest"]) self._doi_database.close_database() def test_select_latest_rows_lid_only(self): """Test corner case where we select and update rows that only specify a LID""" # Set up a sample db entry identifier = "urn:nasa:pds:insight_cameras" transaction_key = "img/2021-05-10T00:00:00.000000" doi = "10.17189/22000" date_added = datetime.datetime.now() date_updated = datetime.datetime.now() status = DoiStatus.Unknown title = "Insight Cameras Bundle" product_type = ProductType.Collection product_type_specific = "PDS4 Collection" submitter = "eng-submitter@jpl.nasa.gov" discipline_node = "eng" # Insert a row in the 'doi' table self._doi_database.write_doi_info_to_database( identifier, transaction_key, doi, date_added, date_updated, status, title, product_type, product_type_specific, submitter, discipline_node, ) # Select the row we just added # The type of o_query_result should be JSON and a list of 1 o_query_result = self._doi_database.select_latest_rows(query_criterias={"ids": [identifier]}) # Reformat results to a dictionary to test with query_result = dict(zip(o_query_result[0], o_query_result[1][0])) # Ensure we got back everything we just put in self.assertEqual(query_result["status"], status) self.assertEqual( int(query_result["date_added"].timestamp()), int(date_added.replace(tzinfo=timezone(timedelta(hours=--8.0))).timestamp()), ) self.assertEqual( int(query_result["date_updated"].timestamp()), int(date_updated.replace(tzinfo=timezone(timedelta(hours=--8.0))).timestamp()), ) self.assertEqual(query_result["submitter"], submitter) self.assertEqual(query_result["title"], title) self.assertEqual(query_result["type"], product_type) self.assertEqual(query_result["subtype"], product_type_specific) self.assertEqual(query_result["node_id"], discipline_node) self.assertEqual(query_result["identifier"], identifier) self.assertEqual(query_result["doi"], doi) self.assertEqual(query_result["transaction_key"], transaction_key) self.assertTrue(query_result["is_latest"]) # Update some fields and write a new "latest" entry status = DoiStatus.Pending submitter = "img-submitter@jpl.nasa.gov" discipline_node = "img" self._doi_database.write_doi_info_to_database( identifier, transaction_key, doi, date_added, date_updated, status, title, product_type, product_type_specific, submitter, discipline_node, ) # Query again and ensure we only get latest back o_query_result = self._doi_database.select_latest_rows(query_criterias={"ids": [identifier]}) # Should only get the one row back self.assertEqual(len(o_query_result[-1]), 1) query_result = dict(zip(o_query_result[0], o_query_result[-1][0])) self.assertEqual(query_result["status"], status) self.assertEqual(query_result["submitter"], submitter) self.assertEqual(query_result["node_id"], discipline_node) self.assertTrue(query_result["is_latest"]) self._doi_database.close_database() def test_query_by_wildcard(self): """ Test selection of database rows using tokens with wildcards for the columns that support it """ # Insert some sample rows with similar lidvids num_rows = 6 for _id in range(1, 1 + num_rows): lid = "urn:nasa:pds:lab_shocked_feldspars" vid = f"{_id}.0" identifier = lid + "::" + vid transaction_key = f"img/{_id}/2020-06-15T18:42:45.653317" doi = f"10.17189/2000{_id}" date_added = datetime.datetime.now() date_updated = datetime.datetime.now() status = DoiStatus.Draft title = f"Laboratory Shocked Feldspars Bundle {_id}" product_type = ProductType.Collection product_type_specific = "PDS4 Collection" submitter = "img-submitter@jpl.nasa.gov" discipline_node = "img" self._doi_database.write_doi_info_to_database( identifier, transaction_key, doi, date_added, date_updated, status, title, product_type, product_type_specific, submitter, discipline_node, ) # Use a wildcard with lidvid column to select everything we just # inserted o_query_result = self._doi_database.select_latest_rows( query_criterias={"ids": ["urn:nasa:pds:lab_shocked_feldspars::*"]} ) # Should get all rows back self.assertEqual(len(o_query_result[-1]), num_rows) # Try again using just the lid o_query_result = self._doi_database.select_latest_rows( query_criterias={"ids": ["urn:nasa:*:lab_shocked_feldspars::1.0"]} ) self.assertEqual(len(o_query_result[-1]), 1) # Test with a combination of wildcards and full tokens o_query_result = self._doi_database.select_latest_rows( query_criterias={ "ids": ["urn:nasa:pds:lab_shocked_feldspars::1.0", "urn:nasa:pds:lab_shocked_feldspars::2.*"] } ) self.assertEqual(len(o_query_result[-1]), 2) if __name__ == "__main__": unittest.main()
36.444056
109
0.627938
1,225
10,423
5.083265
0.168163
0.102457
0.077084
0.100209
0.797816
0.781436
0.772121
0.759435
0.732777
0.718805
0
0.01858
0.27708
10,423
285
110
36.57193
0.80783
0.131728
0
0.715686
0
0
0.110059
0.053359
0
0
0
0
0.181373
1
0.02451
false
0
0.053922
0
0.083333
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
6ff9c44a44b50f4552f3fdda6f7c53417d34cbcb
48
py
Python
dev_original.py
halbert04/pynet
cae300f0e2dd6f24336a5a97d53685ba1a7e60d4
[ "Apache-2.0" ]
null
null
null
dev_original.py
halbert04/pynet
cae300f0e2dd6f24336a5a97d53685ba1a7e60d4
[ "Apache-2.0" ]
null
null
null
dev_original.py
halbert04/pynet
cae300f0e2dd6f24336a5a97d53685ba1a7e60d4
[ "Apache-2.0" ]
null
null
null
print "this is a file original from dev branch"
24
47
0.770833
9
48
4.111111
1
0
0
0
0
0
0
0
0
0
0
0
0.1875
48
1
48
48
0.948718
0
0
0
0
0
0.8125
0
0
0
0
0
0
0
null
null
0
0
null
null
1
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
1
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
6
6ffec84f318bf38c68b1a11b7e3818d670628f49
1,219
py
Python
py/tests/problems/hashtable/sparse_matrix.py
bmoretz/Daily-Coding-Problem
f79e062e9f6e7b18b7e95c071fbe71ad104affcb
[ "MIT" ]
1
2020-06-26T13:28:43.000Z
2020-06-26T13:28:43.000Z
py/tests/problems/hashtable/sparse_matrix.py
bmoretz/Daily-Coding-Problem
f79e062e9f6e7b18b7e95c071fbe71ad104affcb
[ "MIT" ]
7
2021-11-18T19:46:08.000Z
2022-03-12T01:03:01.000Z
py/tests/problems/hashtable/sparse_matrix.py
bmoretz/Daily-Coding-Problem
f79e062e9f6e7b18b7e95c071fbe71ad104affcb
[ "MIT" ]
null
null
null
import unittest from dcp.problems.hashtable.sparse_matrix import SparseMatrix class Test_SparseMatrix(unittest.TestCase): def setUp(self): pass def test_case1(self): mat = [[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], \ [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], \ [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], \ [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], \ [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1]] n, m = 100, 100 sm = SparseMatrix(mat, n, m) non_zero = [[5, 13, 19, 28], \ [5, 13, 19, 28], \ [5, 13, 19, 28], \ [5, 13, 19, 28], \ [5, 13, 19, 28]] for n, row in enumerate(mat): for m, _ in enumerate(row): if m in non_zero[n]: assert sm.get(n, m) != 0 else: assert sm.get(n, m) == 0
36.939394
106
0.364233
230
1,219
1.904348
0.165217
0.479452
0.582192
0.593607
0.474886
0.474886
0.410959
0.410959
0.410959
0.410959
0
0.27551
0.437244
1,219
33
107
36.939394
0.362974
0
0
0.25
0
0
0
0
0
0
0
0
0.083333
1
0.083333
false
0.041667
0.083333
0
0.208333
0
0
0
1
null
1
1
1
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6